-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement EIP-4906 (MetadataUpdated event)
- Loading branch information
Showing
7 changed files
with
72 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import { IERC721Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; | ||
import { IERC165Upgradeable } from "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol"; | ||
|
||
/// @title EIP-721 Metadata Update Extension | ||
interface IERC4906 is IERC165Upgradeable, IERC721Upgradeable { | ||
/// @dev This event emits when the metadata of a token is changed. | ||
/// So that the third-party platforms such as NFT market could | ||
/// timely update the images and related attributes of the NFT. | ||
event MetadataUpdate(uint256 _tokenId); | ||
|
||
/// @dev This event emits when the metadata of a range of tokens is changed. | ||
/// So that the third-party platforms such as NFT market could | ||
/// timely update the images and related attributes of the NFTs. | ||
event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# IERC4906 | ||
|
||
EIP-721 Metadata Update Extension | ||
|
||
## Events | ||
|
||
### MetadataUpdate | ||
|
||
```solidity | ||
event MetadataUpdate( | ||
uint256 _tokenId | ||
) | ||
``` | ||
|
||
This event emits when the metadata of a token is changed. | ||
So that the third-party platforms such as NFT market could | ||
timely update the images and related attributes of the NFT. | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| :--- | :--- | :---------- | | ||
| `_tokenId` | uint256 | | | ||
### BatchMetadataUpdate | ||
|
||
```solidity | ||
event BatchMetadataUpdate( | ||
uint256 _fromTokenId, | ||
uint256 _toTokenId | ||
) | ||
``` | ||
|
||
This event emits when the metadata of a range of tokens is changed. | ||
So that the third-party platforms such as NFT market could | ||
timely update the images and related attributes of the NFTs. | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| :--- | :--- | :---------- | | ||
| `_fromTokenId` | uint256 | | | ||
| `_toTokenId` | uint256 | | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters