Mint an ERC-721 token to represent your digital asset on the Oasis Ethereum ParaTime, and send this newly minted unique token to friends and family! Could worth millions one day, who knows?
:warning: Warning: Pasting the private key of an account with a lot of value (i.e. a holding account) is not recommended whatsoever. Instead, please only transfer a tiny amount of value to a new one-off development account address and only use this new development account when writing and deploying your contracts. After all, you only need enough value to pay for gas; nothing else. Keep your holding account safe by never sharing its private keys.
contract MyNFT
is to mint the ERC-721 tokens. Here, you can specify a symbol for your ERC-721 tokens.totalSupply
function in BUIDL, and see that it returns 0. There is no token in this contract yet. The next step is to mint ERC-721 tokens with digital assets.mintToken
function. Enter an address in to
to assign the owner of the new ERC721 token. Enter an integer number in tokenId
to set the unique id of the ERC721 token. Enter the URL of your digital asset, such as an image or a video, in uri
to associate the digital asset with the ERC721 token.to, tokenId, uri
parameters in the mintToken
function. Please note, every token id can only correspond to one digital asset URL. If you want to mint a new ERC-721 token for a new URL, you need to use a different token id.totalSupply
function again, and it returns 1 this time.ownerOf
function. It returns the address we just entered in the mintToken
function.tokenURI
function, it returns the URL we just entered in the mintToken
function.approve
function gives permission to to
to transfer tokenId
token to another account. The function caller must own the tokenId
token. So we need to import the private key of the owner account of tokenId
token into BUIDL.Please ignore this step if you use the same account to deploy the ERC-721 smart contract and receive the minted ERC 721 Token. Just call theapprove
function.
approve
function. Enter an address in to
to assign the receiver of the given ERC721. Enter the id in tokenId
to transfer the unique NFT Token. Different tokenId
means different NFT Tokens.safeTransferFrom
function transfers tokenId
token from from
to to
.from
. Enter the receiver address in to
. Enter the id in tokenId
. The three parameters will make sure you are transferring the correct NFT Token.ownerOf
and balanceOf
functions to see the status of the given token. The owner of the given token has been transferred to 0xbf9a58574aab193f0c442f6f7dea22ec413db648
.token address
and tokenId
, which need to be submitted to the hackathon organizer through this form.