Tokens
Since their use is so ubiquitous, we’ve provided ERC20
, ERC721
, and ERC1155
wrappers of the Contract
class with pre-defined ABIs for your convenience. When interacting with tokens, it is recommended to use these.
Any of these contract wrappers can be created via a standard constructor requiring only the contract address. For example:
You may also provide your own ABI should you need to rewrite our default; however, doing so may require you to modify or rewrite the contract wrappers.
An example of querying:
An example of sending a transaction:
As a wrapper of Contract
, you also have the option to not create the EthTransaction
and send later on.
Bonus: Ownable
Similar to with tokens, we have also provided an Ownable
wrapper for your convenience as well which has a pre-defined ABI for methods implementing the Ownable interface.
ERC20
, ERC721
, and ERC1155
all inherit from this, but we encourage you to use Ownable
whenever you wish to interact with the Ownable methods on any arbitrary contract for convenience and safety.
Was this page helpful?