How to use the contract to mint NFTS

Hey Guys! I am using the NFT contract at https://github.com/FuelLabs/sway-applications/blob/master/NFT/NFT-contract/src/main.sw in my dapp which is used to mint NFTs. I am not able to understand how I should call the mint functions and in what order to store the metadata as well as the asset. Can someone please help me with this

Hey @sho-shoaib, please have a look at the NFT example here. this is our most up-to-date example with the latest versions. Lmk if you need anything else

2 Likes

Do you mean sending requests from frontend by saying call the mint functions?


Hey Nazeeh I am getting permission denied what is the name of the file I should add in
chmod +x file_name

what you are trying to run? fuel node or the frontend server?

fuel node in order to deploy the contract, also I want to deploy it on the testnet
I just want the abi and address of the deployed contract so I can use it in my application
I had deployed the contract from sway-examples but while using the contract I got no response from contract

const contract = new FuelNFTContract(
    address,
    abi,
    signer
  )

and the error is simply {}

are you using fuels-cli? If thats the case, then you would need to use the fuels:dev command to start the node. Also, to interact with the contract, you don’t need an ABI of the contract. You can simply use the Factory contract (generated using the fuels cli) and call the contract like this

Looks like you’re on the right track with deploying the contract! If you’re using the fuels-cli, make sure to start the node with fuels:dev. Also, instead of using the ABI directly, you can interact with the contract through the Factory contract generated by fuels-cli. Let me know if you need more guidance!