Skip to content

Commit

Permalink
Merge pull request ethereum#8 from xDeSAT/gabriel/sam-fixes
Browse files Browse the repository at this point in the history
docs(ERC7578): remove 'setProperties' method
  • Loading branch information
V1d0r authored Jul 1, 2024
2 parents d4503e8 + b8c96c5 commit c919031
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions ERCS/erc-7578.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,27 +103,19 @@ interface IERC7578 {
* @param tokenId The token ID of the minted token
*/
function getProperties(uint256 tokenId) external view returns (Properties memory properties);
/**
* @notice Sets the properties of the `tokenId` token
* @param tokenId The ID of the token
* @param properties The properties of the token
*/
function setProperties(uint256 tokenId, Properties calldata properties) external;
}
```

The `setProperties(uint256 tokenId, Properties calldata properties)` method SHOULD be called before minting a token. By not calling this method before minting a ERC-721 token, one risks that the asset's provenance represented by the token cannot be established.

The `getProperties(uint256 tokenId)` function MUST return the unique `properties` of a token. If the ERC-721 token is burned or has no properties set, it SHOULD return an empty `Properties` struct.

When `properties` are set, the `PropertiesSet(uint256 indexed tokenId, Properties properties)` event is emitted.

When `properties` are removed, the `PropertiesRemoved(uint256 indexed tokenId)` event is emitted.

The `getProperties(uint256 tokenId)` function MUST return the unique `properties` of a token. If the ERC-721 token is burned or has no properties set, it SHOULD return an empty `Properties` struct.

## Rationale

When a token is minted, its properties SHOULD be initialized beforehand. Consequently, when a token has valid properties and is to be burned, the properties MUST be removed.
When a token is minted, its properties SHOULD be initialized beforehand. By not initializing a token's properties before minting, one risks that the asset's provenance represented by the token cannot be established.

When a token with valid properties is to be burned, the properties MUST be removed.

Contract level validation is not used on the properties as we believe the accuracy of the data declared is the responsibility of the token issuer. This builds trust on the token issuer and the token itself.

Expand Down Expand Up @@ -163,7 +155,7 @@ contract ERC7578 is ERC721, IERC7578 {
constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {}
/**
* @inheritdoc IERC7578
* @notice Initializes the ERC-7578 properties of the `tokenId` token
*/
function setProperties(uint256 tokenId, Properties calldata properties) public {
_properties[tokenId] = Properties({
Expand Down

0 comments on commit c919031

Please sign in to comment.