Examples
Outlined on this page are some examples on how to use Ethers.js on the Aion network. These examples have been designed to be copy-and-pasteable into your existing code. If you have some suggestion for further examples to include here, click on the GitHub icon at the bottom left of the screen to be take to this page in the AionNetwork/Docs repository.
Base Contract
For the examples on this page, we’ll be using the following getter-setter contract.
Contract Call
Get data from the blockchain by performing a contract method call.
Contract Transaction
Send a transaction to a contract, and alter the state of the blockchain.
Sending a transaction to a contract is different from a call, because calls cannot change the state of a contract, only return a value. Contract transactions are able to change values within a contract, and thus require AION
to run.