Interacting with Contracts
The Unity SDK provides different ways for you to interact with smart contract functionality:
- Generic reading data from and writing transactions to smart contracts using the
Read
andWrite
methods. - Using special features that are available for each extension that your smart contract implements.
- Use our low-level
Transaction Builder
to prepare, build, and send transactions to your smart contract.
Extensions
Each extension (i.e. Solidity interface) that your smart contract implements unlocks new functionality for you to use in the SDK. For example, NFT collection smart contracts implements the ERC721 extension, allowing you can to use the ERC721 extension in the SDK when interacting with that contract.
These extension interfaces are available for the most common EIP standards, including support for ERC20, ERC721, ERC1155, permissions, metadata, and more. They handle the pre-processing of calling the smart contract functions for you, such as checking for token approval, uploading metadata to IPFS, formatting inputs, etc. Making your code safer and easier to write.
Example: the "mint" function above uploads and pins your NFT metadata to IPFS for you before minting.