Using extensions
Extensions are the most convenient way to interact with contracts and protocols.
They are precompiled, type-safe and highly optimized implementations of common standards such as ERC20, ERC721, ERC1155, etc. They can be handwritten to provide an easier API, sometimes combining multiple contract calls into one convenient function. They can also be generated from any deployed contract using a simple CLI command.
To use an extension, you just need to import it and call it with the necessary parameters.
Example: getOwned()
extension for ERC1155 tokens
This read extension handles fetching all the tokens owned by an address. Under the hood, this combines multiple contract calls.
Example: mintTo()
extension for ERC721 tokens
This extension handles uploading metadata to IPFS before minting an ERC721 token.
Example: transfer()
extension for ERC20 tokens
This extension conveniently handles unit conversion when transfering ERC20 tokens. You can pass the amount in tokens, the extension will convert it to the right unit before calling the contract.