IERC721P
Inherits: ChronicleProvenanceConsumer
Author: sina.eth
Utility mixin for ERC721 adding provenance-related utility methods.
ERC721-P[rovenance] is a 721 token that supports "bridging" provenance of lazy mints via Chronicle.
Functions​
constructor​
Immutably sets the Chronicle address.
constructor(Chronicle _chronicle) ChronicleProvenanceConsumer(_chronicle);
Parameters
| Name | Type | Description |
|---|---|---|
_chronicle | Chronicle | The address that's used as the Chronicle to verify provenance against. |
getBridgedOwner​
Identifies the owner of the tokenId given its bridgeData.
May optionally throw when called for a token that already exists, but callers should not rely on this and instead cross-check with whether the token has already been bridged.
function getBridgedOwner(uint256 tokenId, bytes calldata bridgeData) public view virtual returns (address);
Parameters
| Name | Type | Description |
|---|---|---|
tokenId | uint256 | The tokenId to identify the owner of. |
bridgeData | bytes | The bridgeData to use to identify the owner. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | address | owner The owner of the token. |
bridgedTokenURI​
Returns the metadata URI for the tokenId given its bridgeData.
May optionally throw when called for a token that already exists, but callers should not rely on this and instead cross-check with whether the token has already been bridged.
function bridgedTokenURI(uint256 tokenId, bytes calldata bridgeData) public view virtual returns (string memory);
Parameters
| Name | Type | Description |
|---|---|---|
tokenId | uint256 | The tokenId for which to return the metadata URI. |
bridgeData | bytes | The bridgeData to use to construct the metadata URI. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | string | tokenURI The metadata URI for the token. |
bridge​
Bridge the provenance of and mint an NFT.
function bridge(
uint256 tokenId,
bytes calldata bridgeData,
bytes32[] calldata leftProof,
bytes32[] calldata rightProof,
bytes32 targetRoot
) public virtual;
Parameters
| Name | Type | Description |
|---|---|---|
tokenId | uint256 | The index of the leaf to be verified in the tree. |
bridgeData | bytes | The data of the NFT, to be converted to a leaf. |
leftProof | bytes32[] | The left range of the proof. |
rightProof | bytes32[] | The right range of the proof. |
targetRoot | bytes32 | The root of the tree the proof is being verified against. |