Skip to content

Commit

Permalink
Add documentation for 2981 implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
JulissaDantes committed Dec 10, 2021
1 parent 7fb8bfd commit e979b93
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

* `ERC2891`: add a new extension of `ERC721` to handle royalty information.([]())
* `GovernorTimelockControl`: improve the `state()` function to have it reflect cases where a proposal has been canceled directly on the timelock. ([#2977](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2977))
* `Math`: add a `abs(int256)` method that returns the unsigned absolute value of a signed value. ([#2984](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2984))
* Preset contracts are now deprecated in favor of [Contracts Wizard](https://wizard.openzeppelin.com). ([#2986](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2986))
Expand Down
13 changes: 10 additions & 3 deletions contracts/token/ERC721/extensions/draft-ERC721Royalty.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import "../../../utils/introspection/ERC165Storage.sol";
import "hardhat/console.sol";

/**
* @dev TBD
* @dev Implementation of the ERC721 Royalty extension allowing royalty information to be stored and retrieved, as defined in
* https://eips.ethereum.org/EIPS/eip-2981[EIP-2981].
*
* Adds the {_setTokenRoyalty} methods to set the token royalty information, and {_setRoyalty} method to set a global
* royalty information.
*
* _Available since v4.5._
*/
Expand All @@ -21,7 +25,8 @@ abstract contract ERC721Royalty is IERC721Royalty, ERC165Storage {
RoyaltyInfo private _royaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyalty;

/*@dev Sets tokens royalties
/*
* @dev Sets tokens royalties
*
* Requirements:
* - `tokenId` must be already mined.
Expand All @@ -39,7 +44,9 @@ abstract contract ERC721Royalty is IERC721Royalty, ERC165Storage {
_tokenRoyalty[tokenId] = RoyaltyInfo(recipient, value);
}

/*@dev Sets global royalty
/*
*
* @dev Sets global royalty
*
* Requirements:
* - `recipient` cannot be the zero address.
Expand Down

0 comments on commit e979b93

Please sign in to comment.