Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanio committed Oct 18, 2023
1 parent ab22c09 commit 4ceb226
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions EIPS/eip-7496.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Contracts implementing this EIP MUST include the events, getters, and setters as
```solidity
interface IERC7496 {
/* Events */
event TraitUpdated(bytes32 indexed traitKey, uint256 indexed tokenId, bytes32 value);
event TraitUpdatedBulkRange(bytes32 indexed traitKey, uint256 fromTokenId, uint256 toTokenId);
event TraitUpdatedBulkList(bytes32 indexed traitKey, uint256[] tokenIds);
event TraitUpdated(bytes32 indexed traitKey, uint256 tokenId, bytes32 traitValue);
event TraitUpdatedBulkRange(bytes32 indexed traitKey, uint256 fromTokenId, uint256 toTokenId, bytes32 traitValue);
event TraitUpdatedBulkList(bytes32 indexed traitKey, uint256[] tokenIds, bytes32 traitValue);
event TraitMetadataURIUpdated();
/* Getters */
Expand Down Expand Up @@ -163,7 +163,13 @@ The `dataType` object MAY have a `valueMappings` object defined. If the `valueMa

### Events

Updating traits MUST either emit the `TraitUpdated`, `TraitUpdatedBulkRange` or `TraitUpdatedBulkList` event. For the event `TraitUpdatedBulkRange`, the `fromTokenId` and `toTokenId` MUST be a consecutive range of tokens IDs and MUST be treated as an inclusive range. For the event `TraitUpdatedBulkList`, the `tokenIds` MAY be in any order.
Updating traits MUST either emit the `TraitUpdated`, `TraitUpdatedBulkRange` or `TraitUpdatedBulkList` event.

For the event `TraitUpdatedBulkRange`, the `fromTokenId` and `toTokenId` MUST be a consecutive range of tokens IDs and MUST be treated as an inclusive range.

For the event `TraitUpdatedBulkList`, the `tokenIds` MAY be in any order.

For `TraitUpdatedBulkRange` and `TraitUpdatedBulkList`, if the `traitValue` is the same for all updated tokens, it is RECOMMENDED to provide the `traitValue` so offchain indexers don't have to fetch each token ID and can more quickly process bulk updates. If the magic value `keccak256("FETCH_EACH_TRAIT_VALUE")` is provided then the indexers will fetch each token's value individually.

Updating the trait metadata URI MUST emit the event `TraitMetadataURIUpdated` so offchain indexers can be notified to query the contract for the latest changes via `getTraitMetadataURI()`.

Expand Down
2 changes: 1 addition & 1 deletion assets/eip-7496/DynamicTraits.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.19;

import {EnumerableSet} from "openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol";
Expand Down
2 changes: 1 addition & 1 deletion assets/eip-7496/ERC721DynamicTraits.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.19;

import {ERC721} from "openzeppelin-contracts/contracts/token/ERC721/ERC721.sol";
Expand Down

0 comments on commit 4ceb226

Please sign in to comment.