Acala Wiki
LearnBuildMaintain
  • Acala & Karura Wiki
  • Acala 2.0
    • Overview
    • Execution Roadmap
    • aUSD SEED (aSEED)
      • aSEED Integration Guide
    • ACA
      • ACA/KAR Staking
    • Universal Asset Hub (UAH)
    • Euphrates DApp
  • Learn
    • Acala Introduction
      • Acala Dollar
      • AcalaSwap
      • Homa Liquid Staking
      • Redenomination of ACA
    • Trilogy Networks
    • Flexible Fees
      • How to change default fee token
    • Governance Overivew
      • Participate in Democracy
      • How to Verify a Runtime Upgrade
      • How to Verify Referendum Proposal
    • Treasury
    • Acala EVM+
      • Why Acala EVM+
      • Existing Solutions
      • Acala EVM+
        • Composable DeFi Stack
        • Flexible Fees
        • EVM Account
        • On-chain Scheduler
        • Queryable & Lightweight
        • Upgradable Contracts
        • Compatible Toolings
        • No Dust Account
      • How does it work?
  • Get started
    • Acala Network
      • Acala Launch Phases
      • Wallet & Account
        • Account Generation
          • Polkadot{.js} Browser Extension
          • Polkawallet Mobile App
          • Ledger Hardware Wallet
        • Exchange Withdraw/Deposit
        • Balance Type and Vesting
        • Check Address for Different Chains
      • Acala's DOT Bridge
      • Acala Assets
      • Governance
      • Acala Web Apps
      • Acala Mobile
    • Karura Network
      • Karura Launch Phases
      • Check Distribution
      • Wallets & Account
        • Account Generation
          • Polkadot{.js} Browser Extension
          • Polkawallet Mobile App
          • Ledger Hardware Wallet
        • Exchange Withdraw/Deposit
        • Balance Type & Vesting
        • Check Address for Different Chains
      • Inter Kusama Transfer
      • Karura Assets
      • Karura Web Apps
      • Governance
      • Transaction Fees
    • Mandala Testnet
  • Integrate
    • Acala Network
      • Protocol Info
      • Token Transfer
      • Node Interaction
      • Full Node
      • Collator
    • Karura Network
      • Protocol Info
      • Token Transfer
      • Node Interaction
      • Full Node
      • Collator
  • Build
    • EVM+ documentation
    • SDKs
      • Acala Stablecoin
      • Homa Liquid Staking
      • AcalaSwap
      • Homa Staking
    • Guides
      • Node Interaction
      • Transaction Construction
    • Build DApps
      • Deploy Ecosystem Modules
      • Composable Chains
        • Open HRMP Channel
        • Bridge Tokens
        • Cross-chain Listing
      • Open-Web3-Stack & ORML
      • Smart Contracts
        • Acala EVM Overview
        • Get Started
          • Connect to a Node
            • Use MetaMask with EVM+
          • Setup EVM Account
          • Polkadot Explorer
          • EVM Playground
          • Use Remix
          • Use Waffle
          • Use Hardhat
          • Deploy Contracts
        • Advanced
          • Use Native & Cross-chain Tokens
          • Use On-chain Scheduler
            • Tutorial
          • Use Oracle Feeds
          • Upcoming Features
        • Acala EVM Hacker Guide
          • Try Acala DApp
    • Tools
    • Indexers
      • SubQuery
    • Miscellaneous
      • Runtime Events
      • Modules
    • Cross Chain DeFi
  • Ecosystem
    • General Info
    • Alliance
    • Community
    • Contribution & Rewards
      • Acala Old Friend NFT
    • Ecosystem
    • Media Kits
    • Ledger Generic App Migration
  • Crowdloans
    • What are crowdloans
    • Acala Crowdloan
      • Crowdloan Event
      • Crowdloan Rewards
      • Claim ACA
      • How to Crowdloan
      • FAQ
      • Acala Quests
        • Attaching Polkawallet to Polkadot.js Extension
      • DOT Address
        • Creating a New DOT Account
        • Becoming a DOT Holder
        • Unstaking Your DOT
          • Unstaking Your DOT Tokens on Polkadot.{js} Extension
          • Unstaking Your DOT Tokens on Polkawallet
    • Karura Crowdloan
      • Crowdloan Event
      • Crowdloan Rewards
      • Claim KAR
      • How to Crowdloan
      • FAQ
      • KSM Address
        • Creating a New KSM Account
        • Check KSM Address
        • Unstaking Your KSM
          • Unstaking Your KSM Tokens on Polkawallet
          • Unstaking Your KSM Tokens on Polkadot.{js} Extension
      • Finding Tokens and NFTs
  • Misc
    • aUSD Incident
    • Contributing
    • Glossary
Powered by GitBook
On this page
  • 1. Setup
  • Run your own development network
  • Deploy to our test network
  • 2. Upload Contract ABI & bytecode
  • 3. Deploy the Contract
  • 1. Connect your EVM wallet
  • 2. Update the required deployment parameters
  • 3. Deploy the smart contract
  • 4. Interact with the Contract
  • 5. Query Balances
  • 6. Transfer

Was this helpful?

Edit on GitHub
  1. Build
  2. Build DApps
  3. Smart Contracts
  4. Get Started

Deploy Contracts

PreviousUse HardhatNextAdvanced

Last updated 2 years ago

Was this helpful?

The Acala EVM Playground is useful to test various functionalities of Acala EVM. It’s a fork from parity canvas-ui.

1. Setup

To deploy your smart contract you can use our testnet or you can run your local dev node.

Run your own development network

To run your own development network, you can follow the on setting up your own development network in the official EVM+ documentation.

Once your development network is operational, you can connect your EVM wallet to it by using the following parameters:

Name

Mandala

URL

http://127.0.0.1:8545

Chain ID

595

WS endpoint URL

ws://127.0.0.1:9944

Symbol

ACA

You can reference the on how to connect MetaMask to the EVM+ and substitute the values from instructions with the values from above.

After your EVM wallet is connected to the Acala EVM+, you can continue to the .

Deploy to our test network

To deploy to our test network you need to have the wallet extension installed in your browser.

Once you have the extension installed, you can with an EVM address and get test network funds from the Discord faucet.

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.

2. Upload Contract ABI & bytecode

How to create an ExampleToken ABI bundle

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:

git clone git@github.com:AcalaNetwork/hardhat-tutorials.git

Move into the examples repository and into the token example:

cd hardhat-tutorials/token

Within the example directory, install all of the dependencies and compile the smart contracts:

yarn && yarn build

This will compile the Token smart contract and create an ABI bundle to the directory artifacts/contracts/Token.sol/ the bundle file is called Token.json.

Go to the Upload tab.

Assign the Name of your smart contract. You will be able to identify the smart contract in the Deploy tab 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.

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 Upload to upload the ABI bundle.

3. Deploy the Contract

The ABI bundles that you uploaded in the Upload tab can be seen here:

The methods available for an ABI bundle can be seen by expanding the ABI menu. 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.

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:

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

  • Deploy button to deploy the smart contract once you are satisfied with the deployment parameters

1. Connect your EVM wallet

The selected account should be displayed at the top of the page now:

2. Update the required deployment parameters

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.

Once the values are filled out and double checked, the smart contract is ready to be deployed.

3. Deploy the smart contract

Once the parameters of deployment are ready, you can deploy the smart contract by pressing the Deploy button. This should prompt your EVM wallet to confirm your deployment transaction:

Once the transaction is included in a block, the deployed smart contract can be found under Execute tab.

4. Interact with the Contract

Navigate to the Execute tab. Find the deployed ExampleToken contract and Click the Execute button on the bottom of the "ExampleToken" box.

5. Query Balances

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 EVM playgrounds.

  2. Pick balanceOf from the Message to Send dropdown.

  3. Copy and paste the address of the account that you used to deploy the smart contract to the account: address input.

Note: Solidity smart contracts have two types of methods: views and executable methods.

  • Views are used to query information from the blockchain without writing data to it. Views transactions are free. The Playground uses the Call button to indicate this.

  • Executable methods can write data onto the blockchain, and these transactions aren’t free. Click the Execute button to execute it.

Finally, click Call at the bottom, and Call results should show the ExampleToken balance of 123456789.

6. Transfer

Now let's try transferring ExampleTokens to another account.

  1. Make sure that the deployer account is connected to the EVM playgrounds.

  2. Select transfer from the Message to Send dropdown.

  3. Fill out the recipient address input box with another EVM address to which to send the tokens.

  4. Enter transfer amount in the amount: unit256 argument box, note the token has a standard 18 decimals.

  5. Click Execute.

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:

To deploy a smart contract using , you need to compile your smart contract in your preferred development framework so that you have the ABI bundle available to upload.

Upload ExampleToken ABI & bytecode file by navigating to .

Smart contracts can be deployed under the of the EVM playgrounds.

Fields to override the

Pressing the 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.

Filled out deployment values

The validUntil field 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 .

Confirming the deployment transaction
EVM playgrounds
https://evm.acala.network/
Deploy tab
gas parameters
block explorer
instructions
instructions
EVM playground
polkadot{.js}
EVM playground => Upload
EVM playgrounds => Upload => Add file
EVM playgrounds => Deploy
EVM playgrounds => Deploy => Expand ABI section
EVM playgrounds => Deploy => Deploy selected ABI bundle
Displayed deployment account
Filled out balance query
Completed balance query
Filled out token transaction
Deployer's balance
Other account's balance
bind your accounts