Skip to main content

IERC721P

Git Source

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

NameTypeDescription
_chronicleChronicleThe 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

NameTypeDescription
tokenIduint256The tokenId to identify the owner of.
bridgeDatabytesThe bridgeData to use to identify the owner.

Returns

NameTypeDescription
<none>addressowner 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

NameTypeDescription
tokenIduint256The tokenId for which to return the metadata URI.
bridgeDatabytesThe bridgeData to use to construct the metadata URI.

Returns

NameTypeDescription
<none>stringtokenURI 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

NameTypeDescription
tokenIduint256The index of the leaf to be verified in the tree.
bridgeDatabytesThe data of the NFT, to be converted to a leaf.
leftProofbytes32[]The left range of the proof.
rightProofbytes32[]The right range of the proof.
targetRootbytes32The root of the tree the proof is being verified against.