Assign an NFT for your provenance claim
Users can assign an NFT to one of their existing provenance claims, by issuing a transaction to ProvenanceGateway
, under these conditions:
- The provenance claim must exist and not have an NFT assigned to it yet.
- The NFT must exist.
- The NFT must be owned by the originatorโs custody address.
- The NFT must not be attached to any other provenance claim.
- The NFT must be on the same blockchain as the Royal Protocol (Base ๐).
This is the process:
-
The user creates the NFT with the appropriate metadata, on any NFT contract on Base.
-
The user gets the provenanceClaimId. You can use the indexer ๐ to get this value if you forgot it.
-
The user sends a transaction to the
assignNft
function ๐. -
The
assignNft
function ๐ runs some checks and then calls theProvenanceRegistry
assignNft
function ๐ -
That
assignNft
function ๐ runs more checks and then assigns the provenance claim to the NFT.
Step by step directions
-
Set up environment variables.
Variable Meaning How to get it PRIVATE_KEY Your private key You can usually get it from the wallet CLAIM_ID The ID for your provenance claim Use the indexer ๐ NFT_ADDR The address of your NFT contract TOKEN_ID The token ID of your NFT within that contract -
If necessary, install Foundry ๐.
-
Run these commands to use the
cast
command ๐. -
When you get the transaction hash, you can use a block explorer ๐ to see the log entry with your assigned NFT.