Comment on page
Acala EVM Playgroundis useful to test various functionalities of Acala EVM. It’s a fork from parity
To deploy your smart contract you can use our testnet or you can run your local dev node.
Once your development network is operational, you can connect your EVM wallet to it by using the following parameters:
Note: For the remainder of this page we will assume you are using a local development network. If you are deploying to the test network.
In case you want to use the same smart contract as it is used in this example, you can follow these short instructions on how to create it.
First clone the Acala Hardhat tutorials example:
Move into the examples repository and into the
Within the example directory, install all of the dependencies and compile the smart contracts:
yarn && yarn build
This will compile the
Tokensmart contract and create an ABI bundle to the directory
artifacts/contracts/Token.sol/the bundle file is called
Go to the
EVM playground => Upload
Nameof your smart contract. You will be able to identify the smart contract in the
Deploytab with it, once it gets uploaded.
To upload the ABI bundle itself, you can either drag and drop it into the upload section, or click on the section and select the file.
EVM playgrounds => Upload => Add file
Once you have selected the correct ABI bundle, the methods of the smart contract should be displayed. You can verify that the correct methods are listed and press
Uploadto upload the ABI bundle.
The ABI bundles that you uploaded in the
Uploadtab can be seen here:
EVM playgrounds => Deploy
The methods available for an ABI bundle can be seen by expanding the
ABImenu. This can be helpful if you have multiple bundles uploaded and you want to be sure that you will be interacting with the right one.
EVM playgrounds => Deploy => Expand ABI section
When you have verified that you are interacting with the ABI bundle that has the correct methods available, you can click
Deploy, which should open a deployment interface:
EVM playgrounds => Deploy => Deploy selected ABI bundle
The interface consists of the following components:
- Button to connect to your EVM wallet (this is why connecting MetaMask to the EVM+ is a prerequisite for this entry)
- Smart contract name, that can be changed, so you can deploy the same ABI bundle multiple times and easily differentiate between them
- ABI bundle identifications
- Fields to input the smart contract constructor parameters
- Value field to determine wether to send some of the native currency with the deploy transaction
Deploybutton to deploy the smart contract once you are satisfied with the deployment parameters
button will prompt your EVM wallet to connect to the site. You can select the account that you want to use with the EVM playgrounds and connect it.
The selected account should be displayed at the top of the page now:
Displayed deployment account
Depending on the requirements, you can modify the deployment parameters of your smart contract. It is required to fill out the constructor parameters, but modifying other values is optional.
Filled out deployment values
Once the values are filled out and double checked, the smart contract is ready to be deployed.
validUntilfield value has to be higher than the current block number, or the deployment transaction will fail, due to the validator treating it as outdated. You can verify the current block number in a block explorer.
Once the parameters of deployment are ready, you can deploy the smart contract by pressing the
Deploybutton. This should prompt your EVM wallet to confirm your deployment transaction:
Confirming the deployment transaction
Once the transaction is included in a block, the deployed smart contract can be found under
Navigate to the
Executetab. Find the deployed
ExampleTokencontract and Click the
Executebutton on the bottom of the "ExampleToken" box.
To perform a query on an account's balance, do the following steps:
- 1.Make sure that the account you used to deploy the smart contract is connected to the
Message to Senddropdown.
- 3.Copy and paste the address of the account that you used to deploy the smart contract to the
Filled out balance query
Note: Solidity smart contracts have two types of methods:
Viewsare used to query information from the blockchain without writing data to it.
Viewstransactions are free. The Playground uses the
Callbutton to indicate this.
Executablemethods can write data onto the blockchain, and these transactions aren’t free. Click the
Executebutton to execute it.
Callat the bottom, and
Call resultsshould show the ExampleToken balance of
Completed balance query
Now let's try transferring ExampleTokens to another account.
- 1.Make sure that the deployer account is connected to the EVM playgrounds.
Message to Senddropdown.
- 3.Fill out the
recipient addressinput box with another EVM address to which to send the tokens.
- 4.Enter transfer amount in the
amount: unit256argument box, note the token has a standard 18 decimals.
Filled out token transaction
A notification will pop-up to confirm that the transaction is successfully executed.
Now you can check the balances of both of the accounts, and confirm that they have changed. deployer's account:
Other account's balance