Isa Hassan ⚡ pfp
Isa Hassan ⚡
@totheapex
Day 5: Deploying and Testing the Contract_ We'll deploy our contract on a local blockchain like Ganache or Hardhat, and then test its functionality using Truffle's `truffle console` or Remix. Here's an example of how to deploy and test the contract using Truffle: /base
4 replies
2 recasts
2 reactions

Isa Hassan ⚡ pfp
Isa Hassan ⚡
@totheapex
This is a basic example, but you can test all the contract's functionality using this approach. And that's it! We've completed our ERC721 contract development journey! Now, feel free to ask any questions you have, and I'll be happy to help! /base
0 reply
0 recast
1 reaction

Isa Hassan ⚡ pfp
Isa Hassan ⚡
@totheapex
Explanation: We're deploying the contract using `truffle deploy`, and then opening a console to interact with the contract using `truffle console`. We're creating a new instance of the contract, minting a new token, transferring it, and checking the token owner.
0 reply
0 recast
0 reaction

Isa Hassan ⚡ pfp
Isa Hassan ⚡
@totheapex
/ Transfer the token await myContract.transferFrom("0x...", "0x...", 1) // Check the token owner var owner = await myContract.ownerOf(1)
0 reply
0 recast
0 reaction

Isa Hassan ⚡ pfp
Isa Hassan ⚡
@totheapex
truffle deploy --network ganache truffle console --network ganache // Create a new instance of the contract var myContract = await MyERC721.deployed() // Mint a new token await myContract.mintToken("0x...", 1, "https://...")
0 reply
0 recast
0 reaction