├── .gitbook
└── assets
│ ├── 13
│ ├── 14
│ ├── 15
│ ├── 16
│ ├── 17
│ ├── 13 (1)
│ ├── 14 (1)
│ ├── 15 (1)
│ ├── 16 (1)
│ ├── 17 (1)
│ ├── 3da362544c4f85e191a804a9899a555885c784fa
│ ├── 8f3c3066739239d2656e5e546536f2c567ad5a6e
│ ├── 9ffe2874935bfacd4166be1356849fab893b4146
│ ├── HelloWorld
│ ├── HelloWorld (1)
│ ├── README.md
│ ├── Screenshot 2022-03-03 at 21.25.37.png
│ ├── Screenshot 2022-03-03 at 21.28.20.png
│ ├── Screenshot 2022-03-03 at 21.35.04.png
│ ├── Screenshot 2022-07-07 at 11.48.11.png
│ ├── Screenshot from 2022-01-27 12-23-19.png
│ ├── Screenshot from 2022-01-27 18-14-42.png
│ ├── Screenshot from 2022-01-27 18-18-12.png
│ ├── Screenshot from 2022-01-27 18-24-59.png
│ ├── Screenshot from 2022-01-27 18-28-37.png
│ ├── Screenshot from 2022-01-29 00-08-33.png
│ ├── Screenshot from 2022-01-29 00-19-48.png
│ ├── Screenshot from 2022-01-29 00-21-43.png
│ ├── Screenshot from 2022-01-30 23-04-41.png
│ ├── Screenshot from 2022-01-30 23-05-33.png
│ ├── Screenshot from 2022-01-30 23-06-16.png
│ ├── Screenshot from 2022-01-30 23-08-00.png
│ ├── Screenshot from 2022-01-31 00-01-34.png
│ ├── a53c7e4aea7a1a7e326f42e1487a9176309c8822
│ ├── a53c7e4aea7a1a7e326f42e1487a9176309c8822 (1)
│ ├── advisories
│ ├── advisories (1)
│ ├── b15a612d67bca960cd83633c7622e6e2785f4d5e
│ ├── b15a612d67bca960cd83633c7622e6e2785f4d5e (1)
│ ├── compare
│ ├── compare (1)
│ ├── d570dd4942f28ef169584fec82a3d4d9dc6a2617
│ ├── d570dd4942f28ef169584fec82a3d4d9dc6a2617 (1)
│ ├── daily
│ ├── daily (1)
│ ├── f475070ced12c81ed2e83dd675f70e33f87ea35a
│ ├── ffd362e0b5ff8086846b23be5cfd9e1098da50b9
│ ├── ffd362e0b5ff8086846b23be5cfd9e1098da50b9 (1)
│ ├── halfweekly
│ ├── halfweekly (1)
│ ├── image (1).png
│ ├── image (10).png
│ ├── image (11) (1).png
│ ├── image (11) (2) (1).png
│ ├── image (11) (2) (2).png
│ ├── image (11) (2) (3).png
│ ├── image (11) (2) (4).png
│ ├── image (11) (2).png
│ ├── image (11).png
│ ├── image (12).png
│ ├── image (13).png
│ ├── image (14) (1).png
│ ├── image (14) (2).png
│ ├── image (14).png
│ ├── image (15).png
│ ├── image (16).png
│ ├── image (17).png
│ ├── image (18).png
│ ├── image (19).png
│ ├── image (2) (1).png
│ ├── image (2).png
│ ├── image (20).png
│ ├── image (21).png
│ ├── image (22).png
│ ├── image (23).png
│ ├── image (24).png
│ ├── image (25).png
│ ├── image (26).png
│ ├── image (27).png
│ ├── image (28).png
│ ├── image (29).png
│ ├── image (3) (1).png
│ ├── image (3).png
│ ├── image (30).png
│ ├── image (31).png
│ ├── image (32).png
│ ├── image (33).png
│ ├── image (34).png
│ ├── image (35).png
│ ├── image (36).png
│ ├── image (37).png
│ ├── image (38).png
│ ├── image (39).png
│ ├── image (4) (1).png
│ ├── image (4).png
│ ├── image (40).png
│ ├── image (41).png
│ ├── image (42).png
│ ├── image (43).png
│ ├── image (44).png
│ ├── image (45).png
│ ├── image (46).png
│ ├── image (47).png
│ ├── image (48).png
│ ├── image (49).png
│ ├── image (5).png
│ ├── image (50).png
│ ├── image (51).png
│ ├── image (52).png
│ ├── image (53).png
│ ├── image (54).png
│ ├── image (55).png
│ ├── image (56).png
│ ├── image (57).png
│ ├── image (6) (1).png
│ ├── image (6).png
│ ├── image (7).png
│ ├── image (8).png
│ ├── image (9).png
│ ├── image.png
│ ├── labels
│ ├── labels (1)
│ ├── milestones
│ ├── milestones (1)
│ ├── monthly
│ ├── monthly (1)
│ ├── package
│ ├── package (1)
│ ├── policy
│ ├── policy (1)
│ ├── subscan.png
│ └── wiki.png
├── LICENSE
├── README.md
├── SUMMARY.md
├── applications
├── applications.md
└── asset-router.md
├── examples
└── examples.md
├── general
├── about-acala-evm+.md
└── security-considerations-of-developing-in-acala-evm+.md
├── miscellaneous
├── FAQs.md
├── common-errors.md
├── ethdenver.md
├── feedback.md
└── request-support.md
├── network
├── aca-token.md
├── gas-parameters.md
├── network-configuration.md
├── network-setup
│ ├── README.md
│ ├── connecting-to-a-public-network-with-local-rpc-node.md
│ └── local-development-network.md
└── predeployed-smart-contracts
│ ├── README.md
│ └── details.md
├── special-features
├── batch-evm-transactions.md
├── special-features.md
└── using-bodhi.js-to-deploy-smart-contract-and-interact-with-it.md
└── tooling
├── chain-explorer.md
├── evm-playground
├── README.md
├── deploy-smart-contracts.md
└── interacting-with-smart-contracts.md
├── faucet.md
├── metamask
├── README.md
├── connect-to-the-network.md
└── simple-transactions.md
├── remix-ide
├── README.md
├── deploying-a-smart-contract.md
└── interacting-with-the-deployed-smart-contracts.md
├── rpc-adapter
└── README.md
└── tooling.md
/.gitbook/assets/README.md:
--------------------------------------------------------------------------------
1 | # Waffle Acala EVM+ development tutorial
2 |
3 | **If you are searching for [Truffle](https://github.com/AcalaNetwork/truffle-tutorials) or
4 | [Hardhat](https://github.com/AcalaNetwork/hardhat-tutorials) tutorial, please follow the links.**
5 |
6 | ## Prerequisites
7 |
8 | To be able to run the tutorial steps that require an operational development network (like deploying
9 | and testing), please refer to the [guide](https://github.com/AcalaNetwork/Acala#5-development) on
10 | how to setup a local development network.
11 |
12 | ## Current tutorials
13 |
14 | 1. [hello-world](./hello-world/README.md): This tutorial contains instructions on how to setup a
15 | simple Waffle project that is compatible, deployable and testable with Acala EVM+.
16 |
17 | 2. [echo](./echo/README.md): This tutorial builds upon the previous one and adds return values to
18 | the function calls, events and changes of storage variables.
19 |
20 | 3. [token](./token/README.md): This tutorial builds upon the previous ones and adds the ERC20 token
21 | using OpenZeppelin dependency.
22 |
23 | 4. [NFT](./NFT/README.md): This tutorial demonstrates how to build a NFT contract in Acala EVM+.
24 |
25 | ---
26 |
27 | This section of tutorials uses Acala EVM+ specific mechanics and is incompatible with the legacy EVM.
28 | It introduces the use of our precompiled smart contracts that are accessible to anyone using the
29 | Acala EVM+
30 |
31 | 5. [precompiled-token](./precompiled-token/README.md): This tutorial utilizes the precompiled and
32 | predeployed ERC20 tokens present in the Acala EVM+. It uses the `ADDRESS` utility, which serves
33 | as an automatic getter of the precompiled smart contract addresses, so we don't have to seach
34 | for them in the documentation and hardcode them into our project.
--------------------------------------------------------------------------------
/.gitbook/assets/Screenshot 2022-03-03 at 21.25.37.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/Screenshot 2022-03-03 at 21.25.37.png
--------------------------------------------------------------------------------
/.gitbook/assets/Screenshot 2022-03-03 at 21.28.20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/Screenshot 2022-03-03 at 21.28.20.png
--------------------------------------------------------------------------------
/.gitbook/assets/Screenshot 2022-03-03 at 21.35.04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/Screenshot 2022-03-03 at 21.35.04.png
--------------------------------------------------------------------------------
/.gitbook/assets/Screenshot 2022-07-07 at 11.48.11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/Screenshot 2022-07-07 at 11.48.11.png
--------------------------------------------------------------------------------
/.gitbook/assets/Screenshot from 2022-01-27 12-23-19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/Screenshot from 2022-01-27 12-23-19.png
--------------------------------------------------------------------------------
/.gitbook/assets/Screenshot from 2022-01-27 18-14-42.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/Screenshot from 2022-01-27 18-14-42.png
--------------------------------------------------------------------------------
/.gitbook/assets/Screenshot from 2022-01-27 18-18-12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/Screenshot from 2022-01-27 18-18-12.png
--------------------------------------------------------------------------------
/.gitbook/assets/Screenshot from 2022-01-27 18-24-59.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/Screenshot from 2022-01-27 18-24-59.png
--------------------------------------------------------------------------------
/.gitbook/assets/Screenshot from 2022-01-27 18-28-37.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/Screenshot from 2022-01-27 18-28-37.png
--------------------------------------------------------------------------------
/.gitbook/assets/Screenshot from 2022-01-29 00-08-33.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/Screenshot from 2022-01-29 00-08-33.png
--------------------------------------------------------------------------------
/.gitbook/assets/Screenshot from 2022-01-29 00-19-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/Screenshot from 2022-01-29 00-19-48.png
--------------------------------------------------------------------------------
/.gitbook/assets/Screenshot from 2022-01-29 00-21-43.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/Screenshot from 2022-01-29 00-21-43.png
--------------------------------------------------------------------------------
/.gitbook/assets/Screenshot from 2022-01-30 23-04-41.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/Screenshot from 2022-01-30 23-04-41.png
--------------------------------------------------------------------------------
/.gitbook/assets/Screenshot from 2022-01-30 23-05-33.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/Screenshot from 2022-01-30 23-05-33.png
--------------------------------------------------------------------------------
/.gitbook/assets/Screenshot from 2022-01-30 23-06-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/Screenshot from 2022-01-30 23-06-16.png
--------------------------------------------------------------------------------
/.gitbook/assets/Screenshot from 2022-01-30 23-08-00.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/Screenshot from 2022-01-30 23-08-00.png
--------------------------------------------------------------------------------
/.gitbook/assets/Screenshot from 2022-01-31 00-01-34.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/Screenshot from 2022-01-31 00-01-34.png
--------------------------------------------------------------------------------
/.gitbook/assets/image (1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (1).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (10).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (10).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (11) (1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (11) (1).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (11) (2) (1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (11) (2) (1).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (11) (2) (2).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (11) (2) (2).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (11) (2) (3).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (11) (2) (3).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (11) (2) (4).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (11) (2) (4).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (11) (2).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (11) (2).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (11).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (11).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (12).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (12).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (13).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (13).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (14) (1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (14) (1).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (14) (2).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (14) (2).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (14).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (14).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (15).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (15).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (16).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (16).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (17).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (17).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (18).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (18).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (19).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (19).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (2) (1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (2) (1).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (2).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (2).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (20).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (20).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (21).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (21).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (22).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (22).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (23).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (23).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (24).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (24).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (25).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (25).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (26).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (26).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (27).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (27).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (28).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (28).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (29).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (29).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (3) (1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (3) (1).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (3).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (3).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (30).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (30).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (31).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (31).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (32).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (32).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (33).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (33).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (34).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (34).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (35).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (35).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (36).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (36).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (37).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (37).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (38).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (38).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (39).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (39).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (4) (1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (4) (1).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (4).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (4).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (40).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (40).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (41).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (41).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (42).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (42).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (43).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (43).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (44).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (44).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (45).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (45).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (46).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (46).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (47).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (47).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (48).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (48).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (49).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (49).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (5).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (5).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (50).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (50).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (51).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (51).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (52).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (52).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (53).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (53).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (54).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (54).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (55).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (55).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (56).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (56).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (57).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (57).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (6) (1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (6) (1).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (6).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (6).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (7).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (7).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (8).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (8).png
--------------------------------------------------------------------------------
/.gitbook/assets/image (9).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image (9).png
--------------------------------------------------------------------------------
/.gitbook/assets/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/image.png
--------------------------------------------------------------------------------
/.gitbook/assets/subscan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/subscan.png
--------------------------------------------------------------------------------
/.gitbook/assets/wiki.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AcalaNetwork/acala-evm-dev-docs/f479e995f668d1f2c3c50cb92a3d8b5c6fab0729/.gitbook/assets/wiki.png
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Getting started
2 |
3 | Welcome to the Acala EVM+ development documentation. Here you can find all of the information needed in order to develop, test and deploy your smart contracts to the Acala EVM+.
4 |
5 | If you are unable to find an answer to your question or need further explanation, please contact us on [Discord](https://discord.gg/5JJgXKSznc) in our #evm channel and we will be happy to provide the answers.
6 |
--------------------------------------------------------------------------------
/SUMMARY.md:
--------------------------------------------------------------------------------
1 | # Table of contents
2 |
3 | * [Getting started](README.md)
4 |
5 | ## 💡 General
6 |
7 | * [About Acala EVM+](general/about-acala-evm+.md)
8 | * [Security considerations of developing in Acala EVM+](general/security-considerations-of-developing-in-acala-evm+.md)
9 |
10 | ## 🌐 Network
11 |
12 | * [Network configuration](network/network-configuration.md)
13 | * [Network setup](network/network-setup/README.md)
14 | * [Local development network](network/network-setup/local-development-network.md)
15 | * [Connecting to a public network with local RPC node](network/network-setup/connecting-to-a-public-network-with-local-rpc-node.md)
16 | * [Predeployed smart contracts](network/predeployed-smart-contracts/README.md)
17 | * [Details](network/predeployed-smart-contracts/details.md)
18 | * [ACA token](network/aca-token.md)
19 | * [Gas parameters](network/gas-parameters.md)
20 |
21 | ## 🛠 Tooling
22 |
23 | * [Tooling](tooling/tooling.md)
24 | * [Faucet](tooling/faucet.md)
25 | * [RPC adapter](tooling/rpc-adapter/README.md)
26 | * [Chain explorer](tooling/chain-explorer.md)
27 | * [MetaMask](tooling/metamask/README.md)
28 | * [Connect to the network](tooling/metamask/connect-to-the-network.md)
29 | * [Simple transactions](tooling/metamask/simple-transactions.md)
30 | * [EVM playground](tooling/evm-playground/README.md)
31 | * [Deploy smart contracts](tooling/evm-playground/deploy-smart-contracts.md)
32 | * [Interacting with smart contracts](tooling/evm-playground/interacting-with-smart-contracts.md)
33 | * [Remix IDE](tooling/remix-ide/README.md)
34 | * [Deploying a smart contract](tooling/remix-ide/deploying-a-smart-contract.md)
35 | * [Interacting with the deployed smart contracts](tooling/remix-ide/interacting-with-the-deployed-smart-contracts.md)
36 |
37 | ## 🎓 Examples
38 |
39 | * [Examples](examples/examples.md)
40 |
41 | ## ✨ Special features
42 |
43 | * [Special features](special-features/special-features.md)
44 | * [Using polkadot wallet to interact with EVM+](special-features/using-bodhi.js-to-deploy-smart-contract-and-interact-with-it.md)
45 | * [Batch EVM transactions](special-features/batch-evm-transactions.md)
46 |
47 | ## 💻 Applications
48 |
49 | * [Acala Multichain Asset Router](applications/asset-router.md)
50 |
51 | ## 🔎 Miscellaneous
52 |
53 | * [FAQs](miscellaneous/FAQs.md)
54 | * [Common errors](miscellaneous/common-errors.md)
55 | * [ETHDenver](miscellaneous/ethdenver.md)
56 | * [Request support](miscellaneous/request-support.md)
57 | * [Feedback or suggestions?](miscellaneous/feedback.md)
58 |
--------------------------------------------------------------------------------
/applications/applications.md:
--------------------------------------------------------------------------------
1 | # Applications
2 |
3 | Current applications on EVM+
4 |
--------------------------------------------------------------------------------
/applications/asset-router.md:
--------------------------------------------------------------------------------
1 | # Acala Multichain Asset Router
2 |
3 | ## What is the Acala Multichain Asset Router?
4 |
5 | Acala Multichain Asset Router is a cross-chain asset transfer protocol built on Acala EVM+. It links the Wormhole Bridge and Cross-Consensus Message (XCM), enabling users to seamlessly transfer assets between any EVM chain and parachains in the Polkadot ecosystem.
6 |
7 |
8 |
9 | **Benefits for users:** use one application rather than multiple, better efficiency in transactions and fees.\
10 | **Benefits for applications/networks:** integrate with Asset Router and expose to liquidity on networks supported by Wormhole, and Polkadot/Kusama networks supported by Acala/Karura.
11 |
12 | ## Routing User Experience (UX)
13 |
14 | Users can navigate to the Acala DApps UI, select the source and target chains, and choose the token to transfer. If the token is from EVM chains, the user will sign a transaction on MetaMask to approve the transfer. Conversely, if the token is from parachains, the user will sign a transaction with polkadot wallet. After the transaction confirmation, the user can click the "route" button on the UI to automatically transfer the asset to the target chain.
15 |
16 | ## Technical Details
17 |
18 | ### Components
19 |
20 | The routing process involves several components:
21 |
22 | * **Wormhole protocol**: This allows users to transfer assets between EVM chains and Acala/Karura.
23 | * **Relayer**: This service automates wormhole token transfers, so users do not need to send extra redeem transactions on the target chain. It also encapsulates all interactions with the wormhole and asset router contracts, so the UI only needs to call its endpoints to complete the routing process, without worrying about low level details.
24 | * **Asset router contracts**:
25 | * A router address on Acala/Karura, which is computed by the factory contract.
26 | * A factory contract, which calculates the router address based on the XCM or wormhole instructions. After the asset arrives at the router address, it deploys the router contract to the router address, and calls it to execute the routing.
27 | * **Xtokens contracts**: A pre-deployed contract on Acala/Karura, which empowers EVM+ to call XCM that transfers tokens among parachains.
28 |
29 | ### Routing Process
30 |
31 | The endpoints mentioned below are all associated with the relayer's endpoints.
32 |
33 | #### EVM => Parachain
34 |
35 | 1. The user selects the source and target chains, as well as the token to transfer.
36 | 2. UI calls [/shouldRouteXcm](asset-router.md#shouldroutexcm) with the encoded config to get the router address on Acala/Karura.
37 | 3. UI prompts the user to sign a transaction with MetaMask that bridges through the wormhole from the EVM chain to the Acala/Karura router address.
38 | 4. UI fetches the Wormhole VAA.
39 | 5. UI calls [/relayAndRoute](asset-router.md#relayandroute) with the VAA. This performs two actions behind the scenes:
40 | * Relays (redeems) the token from the wormhole to the Acala/Karura router address.
41 | * Performs routing, which involves calling the Xtokens contract to XCM the token to the target parachain.
42 |
43 | #### Parachain => EVM
44 |
45 | 1. The user selects the source and target chains, as well as the token to transfer.
46 | 2. UI calls [/shouldRouteWormhole](asset-router.md#shouldroutewormhole) with the encoded config to get the router address on Acala/Karura.
47 | 3. UI prompts the user to sign a transaction with the Polkadot wallet that XCMs the token from the source parachain to the router address on Acala/Karura.
48 | 4. UI calls [/routewormhole](asset-router.md#routewormhole). This sends the tokens to the wormhole from the router address.
49 | 5. UI fetches the Wormhole VAA.
50 | 6. UI prompts the user to sign a transaction with MetaMask that redeems the token on the target EVM chain.
51 |
52 | ## More References
53 |
54 | * [asset router contracts](https://github.com/AcalaNetwork/asset-router/tree/master/src)
55 | * [relayer source code](https://github.com/AcalaNetwork/wormhole-relayer)
56 | * [wormhole docs](https://docs.wormhole.com/wormhole/)
57 | * [wormhole development book](https://book.wormhole.com/)
58 | * [Cross-Consensus Message (XCM)](https://wiki.polkadot.network/docs/learn-xcm)
59 | * [xtokens pre-deployed contracts](https://github.com/AcalaNetwork/predeploy-contracts/blob/master/contracts/docs/xtokens/Xtokens.md)
60 |
--------------------------------------------------------------------------------
/examples/examples.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Start using your preferred development framework and toolings with Acala EVM+.
3 | ---
4 |
5 | # Examples
6 |
7 | Acala EVM+ is built in a way that is developer-friendly, this means that you can use any development framework that you prefer and develop, test and deploy onto our network.
8 |
9 | Depending on which framework/tooling you prefer, there are slight modifications you need to implement in order to get access to the full power of the Acala EVM+. To understand them, check out the following guides and start your development journey on Acala EVM+.
10 |
11 | - Framework Examples
12 | - [hardhat](https://github.com/AcalaNetwork/hardhat-tutorials)
13 | - [truffle](https://github.com/AcalaNetwork/truffle-tutorials)
14 | - [foundry](https://github.com/AcalaNetwork/bodhi.js/tree/master/examples/foundry/counter)
15 | - Tooling Examples
16 | - [subquery](https://github.com/AcalaNetwork/acala-evm-indexer-examples/tree/master/subquery)
17 | - [chopsticks](https://github.com/AcalaNetwork/bodhi.js/tree/master/examples/chopsticks)
18 | - [the graph](https://github.com/AcalaNetwork/acala-evm-indexer-examples/tree/master/the-graph) (deprecated)
19 | - [subsquid](https://github.com/AcalaNetwork/acala-evm-indexer-examples/tree/master/subsquid) (WIP)
20 |
--------------------------------------------------------------------------------
/general/about-acala-evm+.md:
--------------------------------------------------------------------------------
1 | # About Acala EVM+
2 |
3 | ## Introduction
4 |
5 | The vision of Acala is to build a decentralized permissionless DeFi platform. Ethereum is currently the largest DeFi platform. We would like to integrate with it by bridging the assets and liquidity of it. Our goal is to be compatible with Ethereum’s toolchains and tap into its large developer community. By building Acala EVM+, Ethereum developers will be able to deploy their solutions to Acala without friction.
6 |
7 | Many blockchains also aims to be the better Ethereum. Aiming to providing full Ethereum compatibility to allow developers to reuse their existing toolchains and deploy existing contracts with no or minimal changes to deploy on their network. However, Ethereum is not yet perfect and it wouldn’t make sense for us to just ignore all of the issues that Ethereum users are experiencing currently and just build another, faster, Ethereum.
8 |
9 | It is clear to us that just building a faster Ethereum is not what we want. With all the powerful and advanced features from Substrate, we aim to do better. All the while being friendly to existing Ethereum and Solidity developer community. EVM compatibility on Acala will be a stepping stone for the Solidity developers to tap into Polkadot ecosystem and have a taste of the new features that are simply not possible on Ethereum, such as bring your own gas (pay transaction fee with any supported token, powered by Acala Swap), powerful governance tools (no more locked funds) and full interoperability with the Polkadot ecosystem (no more centralized bridges).
10 |
11 | > _Learn once, write anywhere._
12 |
13 | Note that _“write once, run anywhere”_ is not our goal. Instead, we are inspired by the React Native approach _“learn once, write anywhere”_. Acala, and all Substrate based chains, are fundamentally different from Ethereum. We have our own trade-offs and therefore restrictions (in exchange for some other benefits). If we are trying to emulate an Ethereum node, we will be suffering from the worst of both worlds. It will be a step backwards for us to inherit all the restrictions from a legacy blockchain platform. Therefore it makes more sense to make some necessary compatibility sacrifices, to not be limited by decisions made by Ethereum developers many years ago. As a result, developers can take advantage of all of the advanced features that we are offering, while still using a familiar language (Solidity or another compile-to-evm languages). This means changes are likely required to port over existing projects. However with many new advanced features added to EVM via precompiles from Acala runtime, we hope the contracts can be significantly simplified and offer improved features and better usability to users.
14 |
15 | ## Challenges
16 |
17 | There were two categories of challenges we were facing when design & building Acala EVM+. The first area stemed from the things we do not want to inherit from the legacy decisions of Ethereum. The second area originated from the inherent conflicts between Substrate and Ethereum.
18 |
19 | ### Issues
20 |
21 | #### **Storage**
22 |
23 | One of the main issues preventing people from running their own Ethereum nodes is that it requires a very large storage. This is partially due to the cost of on-chain storage being uneconomic.
24 |
25 | On-chain storage is always expensive because it has to be replicated by every node and stored for many years, potentially forever. This is an ongoing cost and therefore the token economics should factor it in to avoid state explosion problem.
26 |
27 | On Ethereum, the cost of inserting data into on-chain state is a one-off payment based on the gas price at the time when the transaction is processed. It doesn’t consider future costs and has a poor incentive to remove unused stored data. As a result, very little smart contracts actively purge unused states and no one actively removes unused contracts. The poorly designed storage gas refund makes [Gas Token](https://cointelegraph.com/news/a-new-token-lets-you-save-on-ethereum-fees-by-storing-gas) possible, which encourages people to store useless data when gas prices are low and to remove them when gas prices are high. This benefits individuals and miners, but raises the transaction cost for everyone else and increases the cost of operating Ethereum nodes at the same time. There are also a lot of dust accounts containing too little funds to send a transaction, and therefore no one is willing to reclaim those dust funds and these accounts just waste the on-chain storage.
28 |
29 | #### **Gas price**
30 |
31 | Another usability issue of Ethereum is that it is hard estimate how much gas price to pay. There are multiple services available ([\[1\]](https://ethgas.watch/), [\[2\]](https://gitcoin.co/gas/intro), [\[3\]](https://ethgasstation.info/), [\[4\]](https://www.gasnow.org/), [\[5\]](https://etherscan.io/gastracker)), but it is still not easy for people to balance between high gas prices and long confirmation times. Most of the people are just using the whatever value is provided by their wallet and wallets usually overestimate the gas price to ensure a fast confirmation time. However the throughput of the network is limited and this means everyone is overpaying and no one is getting faster confirmation times.
32 |
33 | [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) is one of the solution that addresses this issue. It proposes an algorithm to calculate a base fee for transaction, using the gas usage of previous blocks, instead of requiring users to estimate and supply the gas price. This is very similar to the [Fee Adjustment](https://wiki.polkadot.network/docs/en/learn-transaction-fees#fee-adjustment) mechanism implemented by Polkadot. Acala will adapt the slow-adjusting fee mechanism with tips from Polkadot to provide a better UX. This mechanism will be incorporated into the Acala EVM+ so the smart contract developers and users will not need to worry about gas price anymore.
34 |
35 | ### Conflicts
36 |
37 | #### **Dust accounts**
38 |
39 | While Substrate is indeed very customisable, it still comes with constraints and technical limitations. Some of those constraints are due to lessons learnt from building Ethereum and it is not something we would like to revert. For example, Polkadot implements [Existential Deposit](https://wiki.polkadot.network/docs/build-protocol-info#existential-deposit) which aims to solve the dust account issue. However, this also comes with a trade-off that when a dust account is wiped, the storage and dust fund are reclaimed. It means nonce can be reset and introduce a possibility of a replay attack. To prevent replay attacks, Polkadot supports mortal transactions (expiring transactions), so that it is no longer possible to replay old transactions. This fundamentally conflicts with Ethereum’s account model and transaction format.
40 |
41 | #### **Compatible extensions**
42 |
43 | There are few multi-chain wallets that support both Ethereum and Polkadot, but the most commonly used wallets, for both Ethereum and Polkadot, are still a single network wallets, namely MetaMask and Polkadot.js extension. This creates an issue where Polkadot.js extension cannot handle Ethereum transaction format and MetaMask cannot handle Substrate transaction format. As the result, user may need to use two browser extensions at same time, one for the Substrate runtime and one for EVM interactions. This is not something that is acceptable.
44 |
45 | #### **Forkless upgrades**
46 |
47 | One of the most advanced features offered by Substrate is forkless upgrades, that allow blockchain to evolve without forks. This reduces amount of coordination required and risk of network instability when performing upgrades. We also have an experimental Karura network that holds real value, on which we can try out new features. This means we are actually able to quickly (yet securely) iterate features, to improve the user’s and developer’s experiences of the network. We can try a lot of new things that are simply not feasible on Ethereum, which means we are no longer limited by what Ethereum is able to offer. This requires a change of mindset (why copy what Ethereum did, if we can do it better?) and opens a lot of possibilities and increases potential of the Acala EVM+.
48 |
49 | ## Solutions & Enhancements
50 |
51 | We would like to implement a smart contract platform that takes the best of both worlds, while avoiding all of the pitfalls. This is actually very hard because we need to carefully balance all of the decisions and incompatibilities. Remember, most of the issues are not due to incompetent developers, but instead of people balancing trade-offs due to technical limitations. A solution of one problem usually leads to another set of problems. The art of Engineering is balancing trade-offs and building something best suited for the target audiences. Therefore we do not aim to build a perfect solution, but instead trying to make the right trade-offs to avoid all the pitfalls while keeping as much of the compatibility as possible.
52 |
53 | ### bodhi.js
54 |
55 | One key component to be Ethereum compatible is RPC compatibility. i.e. Support Ethereum RPC. This is not easy to achieve due to many low level decisions made by Substrate. e.g. Ethereum RPC supports to get transaction by hash, which is not supported by Substrate RPC. This is because Substrate aims to be as lightweight as possible, and decided to not store those extra information by default. It is possible to customize Substrate to support all those extra requirements by using [Frontier](http://github.com/paritytech/frontier), but it does add a lot of extra complexity to the node and undos a lot of work to make the node lightweight. Therefore, we decided to go with an alternative approach.
56 |
57 | Instead of emulating the full Ethereuem RPC on node side and to solve the problem of requiring multiple extensions, we have developed [bodhi.js](http://github.com/AcalaNetwork/bodhi.js), a JS SDK that offers an implementation of [Web3Provider](https://docs.ethers.io/v5/api/providers/) using polkadot.js and Substrate RPC. This means existing dApps that can use the Web3Provider offered by bodhi.js just like any other providers, such as the one provided by MetaMask. This will allow dApps to use bodhi.js to sign transactions using Polkadot.js extension as well as querying data from Acala nodes. As a result, a minimal change is required to port an existing Ethereum-based dApp to support Acala EVM+.
58 |
59 | ### Weight system
60 |
61 | Substrate offers a weight system which is somewhat similar to gas fee system. We decided to use the weight system for charging gas fees by defining a gas-to-weight conversion ratio. As the result, we can completely ignore the gas price and use the weight system to handle the fees. The priority fee from EIP-1559 can be directly translated to the tip of the Substrate transaction. This allows the blockchain to handle EVM transactions like any other standard transactions. Some changes will be required on the dApp side to handle the transaction fee estimation and display, but it should be very straightforward.
62 |
63 | ### Renting storage
64 |
65 | There are many researches on how to solve the state explosion problem and some of the possible solutions are [storage rent](https://wiki.polkadot.network/docs/build-smart-contracts#storage-rent) (which is deprecated) and [state expiry](https://notes.ethereum.org/@vbuterin/verkle\_and\_state\_expiry\_proposal). Both of them are complicated and not battle tested yet so we are not comfortable with using them in Acala EVM+ at this stage. Therefore we decided to use a much simpler model that charges a storage deposit for every byte used by the smart contract and refund the deposit upon clearing the storage used. This is able to create an incentive to free up unused storage while keeping compatibility with existing EVM smart contracts. The storage deposit in some sense can be viewed as the gas use/refund for storage operations, but the cost is a fixed amount of tokens per byte, instead of depending on the gas price, which depends on the block fullness utilisation. Similarly, the state deposit is also required for the code of new contracts, and encourage developers to remove any unused contracts from the on-chain storage.
66 |
67 | ### Storage meter
68 |
69 | In order to accurately handle the storage deposit, we have implemented a storage meter in Acala EVM+. Similar to gas meter, which measures the gas usage, storage meter measures the storage usage and handles the storage deposit. This also adds a new input to transaction: storage limit. Gas limit is used to limit how much gas can be consumed by a transaction and storage limit is used to ensure the contract does not incur more than specified storage deposit.
70 |
71 | ### Developer mode
72 |
73 | Being a DeFi chain, Acala always considers the security of our user’s funds the top priority. In Ethereum network, deploying a fraudulent contract is rather cheap. There is only an upfront development cost and even if the contract is banned or shunned by the users, the malicious developer can always deploy a new smart contract.
74 |
75 | We feel that censorship is the wrong approach, so we developed a different approach to solving this issue. Our solution is to raise the bar of deploying new publicly accessible contracts, so that it becomes expensive to deploy malicious token contracts and useless forks. Contracts will initially only be accessible by the contract developers, a special role that anyone can opt-in to. Once the contracts have been deployed and tested, they can be made public by paying a relatively large amount of ACA (the exact value still has to be determined) in order for them to become publicly accessible. Genuine teams that want to deploy contracts but cannot pay the upfront cost, can request a grant from the Acala Treasury. This means that there is no additional cost of deploying contracts for internal testing and personal usage, but iteratively deploying fraudulent contracts to be publicly used will be expensive. Our hope is that this approach achieves the right balance between permissionlessness and security of network user’s funds.
76 |
77 | In the future we expect to be able to work with Identity parachains in order to give identity to the contracts. This should greatly improve the trustworthiness of verified contracts, because users will know they are interacting with a canonical contract instead of a malicious fork.
78 |
79 | ### Custom precompiles and predeploys
80 |
81 | One of the things differentiating Acala EVM+ from the EVM is custom precompiles. Custom precompiles are smart contracts that are already compiled and deployed to the Acala EVM+ and available to the developers to incorporate within their own smart contracts. Additionally we are able to update these contracts via governance, which means that they will always be up to date with the latest security features and fixes. These predeploy contracts include [ERC-20 contracts](https://wiki.acala.network/build/development-guide/smart-contracts/advanced/use-native-tokens), like ACA, AUSD, DOT, LDOT and many more, as well as systemic contracts, like [State Rent](https://wiki.acala.network/build/development-guide/smart-contracts/advanced/use-flexi-fee#state-rent), [Oracle Price Feed](https/wiki.acala.network/build/development-guide/smart-contracts/advanced/use-oracle-feeds), [Scheduler](https://wiki.acala.network/build/development-guide/smart-contracts/advanced/use-on-chain-scheduler), [DEX](https://wiki.acala.network/learn/basics/dex). We expect DeFi contracts to join the list shortly.
82 |
83 | Usage of these precompiled contracts opens a whole new area of possibilities for smart contract developers. The built-in Scheduler allows for automation of the smart contract business logic execution (no more external scripts to call smart contract functions periodically) and the Oracle can be used to set a stable price for services which are in turn paid with unstable tokens. The possibilities are truly endless.
84 |
85 | Differences between EVM and Acala EVM+ mean that not every aspect of a transaction is compatible. If we wish for the users to be able to use Metamask, we have to provide a mechanic for it to work with the storage limit and expiration information. To do that we aim to use an [ERC-712](https://eips.ethereum.org/EIPS/eip-712) standard to sign the transactions and provide these kinds of information using it. This introduces another step when sending a transaction, compared to EVM, but allows us to support the existing extensions and browsers that are used on the Ethereum network rather than forcing the end user to migrate to another extension and/or wallet.
86 |
87 | ## Decisions
88 |
89 | We had to make some decisions that are not fully compatible with EVM to make the step forward. These have been carefully considered and we want to share why we did them.
90 |
91 | ### Disable native token
92 |
93 | Native token in Ethereum has 18 decimal spaces and Karura’s native token has 12 decimal spaces. This means that the two are incompatible. We could have used a conversion logic where we would multiply or divide the value by 1,000,000, depending on the way in which we are converting the tokens, but that could cause some serious errors. Imagine having to handle a value of 1 wei (the lowest possible value of Ethereum’s native token). Converting this to Karura’s we would divide this by 1,000,000 and get the value of 10^(-6). Since we are operating in a space where we don’t deal with floating point, the value would be rounded down, so the value would be 0. This could potentially break the flow of the operation that is running. Instead of accepting such a risk, we decided to disable native token in the Acala EVM+. This way we don’t compromise robustness of our virtual machine for support of an inherited trait.
94 |
95 | Additionally we have taken into account that many of the DeFi contracts don’t operate using the native token, but all of them use ERC-20 tokens. Which means we are not disabling any of their functionality, while improving the operation of the EVM+.
96 |
97 | ### Dust accounts clearing
98 |
99 | Clearing the dust accounts opens these addresses to a possibility of a replay attack, since the nonce is reset alongside the assets. To prevent that, each transaction has an expiration time. It would be easy to implement it as an additional parameter that has to be passed when calling a function, but that would put additional stress to the developers. We can’t add an additional field to Metamask and we can not force it to have a default value for the transaction expiration. Thus we devised a solution that uses the existing and supported operation by Metamask. Using ERC-712 typed signing standard will allow people to sign Acala EVM+ transaction with Metamask in a user friendly way. This allow us to provide the mechanics that we need, to provide as much security to user’s funds as possible, while serving users with an operation they already know when using Metamask.
100 |
101 | ### ERC-712 transactions
102 |
103 | Using ERC-712 format of the transaction allows us to store storage limit within it as well. Since the user is paying a per-byte fee for the data they are storing, it is important to support a mechanic where the user has control over the maximum amount they are willing to deposit to rent the storage, much like the maximum amount of gas they are prepared to pay for in Ethereum network.
104 |
105 | #### Embedding storage limit and transaction expiry into gas params
106 |
107 | In addition to the ERC-712 transactions we foresee a method that both, storage limit and transaction expiry information, within the gas params of the transaction. This would allow for smoother network usage for bots and servers, as the transaction would be streamlined for programmatic usage.
108 |
109 | Additionally we are able to use gas params to set the storage limit, since we’ve adopted the slow-adjusting fee mechanism with tips from Polkadot to provide a better UX for users. This mechanism will be incorporated into Acala EVM+, so the contract developers and users won’t have to worry about the gas price. This in turn sets the stage for using the gas params for something else, like the before-mentioned passing of the storage limit in the gas params field of the transaction. What is known as a priority fee value in Ethereum transactions, directly corresponds to Acala EVM+ tips, providing an additional familiarity for users and developers coming over from the Ethereum network.
110 |
--------------------------------------------------------------------------------
/general/security-considerations-of-developing-in-acala-evm+.md:
--------------------------------------------------------------------------------
1 | # Security considerations of developing in Acala EVM+
2 |
3 | ## Introduction
4 |
5 | As Acala EVM+ is not a simple copy-paste clone of the Ethereum's EVM, there are additional security considerations to the ones from Ethereum's EVM. The SWCs still apply and you should familiarise yourself with them if you haven't already. The directory can be found [here](https://swcregistry.io/).
6 |
7 | Acala EVM+ interacts with Substrate layer of the chain, so this introduces some of the considerations that we have to be aware of. We also refined some of the settings and mechanics of the chain, so some of these differences may impact your smart contracts. You also need to be aware how storage rent and storage deposit work when building, deploying and maintaining your smart contracts. There is more and we will analyse as much as we can in this article.
8 |
9 | This article assumes you have familiarised yourself with the Acala EVM+ and its functions.
10 |
11 | ## Considerations
12 |
13 | While we will to outline as much of the security considerations as we can, there is still a possibility that additional ones exist. We will expand the list if that is the case.
14 |
15 | ### 1. Double entry consideration
16 |
17 | Our native tokens ACA and KAR have a mirrored [predeployed smart contract](../network/predeployed-smart-contracts/details.md), which means that a change in balance of the native currency is also reflected in the mirrored ERC20 predeployed smart contract and vice versa. A DeFi protocol that supports operation of the native currency as well as the predeployed ERC20 smart contracts may encounter unexpected or unreliable behaviour because of this.
18 |
19 | We suggest to disable operations with native currency and only support the mirrored ERC20 version.
20 |
21 | ### 2. Dust balance consideration
22 |
23 | All of our mirror tokens and native tokens, have [existential deposit](https://wiki.acala.network/get-started/acala-network/acala-account#existential-deposit). This means that the balance of an account that falls below the threshold will be 'dusted'. This preserves space of chaindata and ensures that there are no accounts with balances lower than the cost of transferring these balances; if an account has balance lower than the transaction cost needed to clear the balance, the record of this balance can never be cleared.
24 |
25 | Not accounting for existential deposit can lead to mismatched numbers in your own protocol records or to transactions failing unexpectedly.
26 |
27 | We suggest implementing a mechanic for verification of these tokens being successfully received and not dusted or to enforce a minimum value of tokens being transferred to ensure that the tokens are not dusted upon receipt when transferring the mirror tokens.
28 |
29 | ### 3. Storage deposit consideration
30 |
31 | [Storage deposit](about-acala-evm+.md#renting-storage) is used to protect against chain bloat. It represents a staked amount of tokens that are returned upon clearing of storage. Having unbounded storage write ability could potentially allow for users causing a state of smart contact to require a change so big, that the interaction with the smart contract is too expensive.
32 |
33 | We suggest ensuring that the users are unable to put the smart contract in a state that could lead to so many states having to be changed at once, that the smart contract becomes unusable.
34 |
35 | On top of that, removing storage entries or destructing smart contracts will refund storage deposits. Smart contracts that allow potentially large storage removals, may also need to be gated, to ensure the storage deposit refund can be handled appropriately.
36 |
37 | Additionally we suggest that you design your smart contracts to change as little states as possible as this will reduce the cost of storage deposit incurred on users.
38 |
39 | ### 4. Unexpected upgrades consideration
40 |
41 | Acala EVM+ supports [publication](../tooling/development-account/publishing-a-smart-contract.md#mark-a-given-contract-as-published-in-the-developer-section-of-the-polkadot-app) of smart contracts. This allows the team deploying the smart contract to verify, test and configure the smart contract before the non-developer users are able to interact with it. This also means that the unpublished smart contract can be upgraded even if it is not upgradeable in a smart contract upgradeable sense (e.g. written in a proxy-upgrade or diamond pattern).
42 |
43 | We suggest [verifying](../tooling/development-account/publishing-a-smart-contract.md#verify-that-the-smart-contract-has-been-published-successfully) that the smart contract, your smart contract is interacting with, is published before interacting with it.
44 |
45 | ### 5. Decimals consideration
46 |
47 | Both ACA and KAR have 12 decimal points natively, however the native token decimals in EVM is always 18. This means that if you transfer `1000000 wei` in your smart contract, you are transferring the lowest denomination of ACA or KAR. Transfer of `1 ether` will result transfer of 1 ACA or KAR. Additionally, in order to avoid unexpected transfer amounts, any transfer with value that cannot be exactly represented with 12 decimals will fail. This means any transfer of value that is not a multiple of `10^6 wei` will be reverted. If you rely on such calls for transferring the native currency in your smart contract, your calls might potentially fail.
48 |
49 | We suggest reviewing your code for the `transfer()` calls and making sure you are transferring the expected amounts. The contracts needs to gracefully handle transfer amounts that are either result of user input or arithmetic operations, because the value may not be a valid transferable amount.
50 |
51 | ### 6. Two management accounts consideration
52 |
53 | EVM and the Substrate accounts [bound](../tooling/development-account/#bind-accounts) to each other in more that just sharing the balances of the native tokens. They are used to manage the deployed smart contracts. The EVM account can manage a smart contract using the owned smart contract development pattern while the Substrate account can [publish](../tooling/development-account/publishing-a-smart-contract.md) or [delete](../tooling/development-account/deleting-a-smart-contract.md) the smart contract.
54 |
55 | We suggest that, in case you are transfer the ownership of your smart contract in the EVM to another account, you transfer the management of the smart contract to the corresponding substrate account as well.
56 |
57 | {% hint style="info" %}
58 | **NOTE: This only applies to unpublished contracts.**
59 | {% endhint %}
60 |
61 | ### 7. Duplicated transaction hashes consideration
62 |
63 | There is no possibility for two or more transactions to share a same transaction hash. In Substrate based chains this is possible due to non-zero existential deposit. Once the account is [_dusted_](security-considerations-of-developing-in-acala-evm+.md#2.-dust-balance-consideration), its nonce is reset to 0. This means that people can craft replayable transactions, which could have the same transaction hash.
64 |
65 | We suggest that, if your dApp processes the transaction hashes, make sure that it can handle the replayed transactions gracefully.
66 |
67 | ### 8. Unintended address binding consideration
68 |
69 | The intertwining of the Substrate level and the EVM level means that, for users to access the full functionality of Acala's networks, their Substrate and EVM accounts need to be bound. Some of the Substrate assets might return an EVM asset to the account. When this happens the EVM assets are allocated to the EVM account associated to the Substrate account. If no such binding exists, the default EVM account will be bound to it.
70 |
71 | {% hint style="info" %}
72 | The default EVM account can only be used to [interact with the EVM through Substrate calls](../special-features/using-bodhi.js-to-deploy-smart-contract-and-interact-with-it.md) and cannot be imported into an EVM wallet as no private key nor mnemonic are available.
73 | {% endhint %}
74 |
75 | The assets associated with the default EVM address are fully interactable with, but can't be managed by the EVM wallet. This means that unlocking their full functionality might require user to transfer them, to a wallet they are able to restore, one by one.
76 |
77 | We suggest you implement a check in your dApp to verify that the user has bound their own EVM address and if they didn't, direct them to instructions on how to do that. As any smart contract interaction from a Substrate account binds the default EVM account, make sure to implement this check even if no EVM assets are allocated and the user is just interacting with a smart contract.
78 |
79 | ## Conclusion
80 |
81 | While the preexisting security considerations of developing in the EVM still apply, Acala EVM+'s improvements also introduce new ones. The list of security considerations in this article should give you a good overview on what to expect.
82 |
--------------------------------------------------------------------------------
/miscellaneous/FAQs.md:
--------------------------------------------------------------------------------
1 | # Frequently Asked Questions
2 |
3 | ## when do I need to provide subquery url for `eth-rpc-adpater` or `EvmRpcProvider`?
4 | **short answer**
5 |
6 | you need it when you ...
7 | - need to query for historical logs or tx receipts that exist **before** you start the provider or rpc adapter
8 | - OR need to query for logs or tx receipts that's older than [MAX_CACHE_SIZE](../tooling/rpc-adapter/running-the-rpc-adapter.md#list-of-options), which defaults to 200.
9 |
10 | **explanation**
11 |
12 | Transactions and logs from unfinalized blocks only live in cache, so new transactions will usually be in the cache first (for a couple blocks), then live in both the cache and the subquery, later, after the cache expires, they only live in subquery.
13 |
14 | Developers who run a mandala node and eth-rpc-adaptor locally, usually won’t need to start any subquery or database services for testing, since new transaction receipts and logs will be in cache and findable without subquery.
15 |
16 | For simple local testing setup, we can set a large `MAX_CACHE_SIZE` for rpc adapter, such as 10000 blocks. So even without subquery, we should be able to query for receipts and logs for as many as 10000 blocks.
17 |
18 | 
19 |
20 | ## why tx failed after I manually changed gas params in metamask?
21 | Acala EVM+ uses encoded `gasPrice` and `gasLimit`, so manually inputting random gas parameters might fail to decode. Please refer to [gas parameter](../network/gas-parameters.md) section for detailed explanations.
22 |
23 | ## why metamask tx doesn't confirm with local mandala?
24 | Metamask will sometimes cache the nonce locally, which is used to infer next tx nonce. For example, if we send a tx with nonce 3, metamask will set nonce 4 for next tx. However, after we restart the local mandala node, all accounts are reset and the nonce is back to 0, but metamaks doesn't know it!
25 |
26 | As a result, the account with nonce 0 send a tx with nonce 4, which won't be mined and got stuck!
27 |
28 | To solve this, we need to reset metamask after restarting local Mandala, so the nonce and cache will be cleared: `settings => advanced => reset account`. Or we can simply manually override the nonce to `0` for the first metamask tx after restarting the network.
29 |
30 | ## I have balance in metamask, but transfer failed
31 | Metamask shows **total balance**, which might include non-transferable balances. For example, if some of your ACA is staking, they will still show in metamask, but can't be transfered.
32 |
33 | We can check the transferable balance in the `Accounts` section in [polkadot.js app](../tooling/chain-explorer.md#polkadotjs-app)
34 |
35 | ## tx failing reason not showing in blockscout
36 | Every EVM+ transaction is essentially a substrate transaction, so we can find more details about it in [substrate chain explorer](../tooling/chain-explorer.md#substrate-chain-explorer).
37 |
38 | For example, for [this failing tx](https://blockscout.acala.network/tx/0xec304c62a61c56680522c09a80c7280fe4d985038203df70435cc925a7fe877f/internal-transactions), we can copy and paste the tx hash into the [Acala Subscan](https://acala.subscan.io/), which takes us to the [tx details page](https://acala.subscan.io/extrinsic/0xec304c62a61c56680522c09a80c7280fe4d985038203df70435cc925a7fe877f), the exact error should show up in the bottom `Events` section.
39 |
40 | In this case `ReserveStorageFailed` means account balance not enough.
41 |
42 | 
43 |
44 | ## how to check if a transaction is finalized?
45 | there are 2 ways:
46 | - use `eth_getBlockByNumber` with `finalized` block tag to get the latest finalized block number, and compare the tx block number with it.
47 | - use EVM+ specific RPC calls: [eth_isTransactionFinalized](../tooling/rpc-adapter/rpc-calls.md#custom-rpcs) or [eth_isBlockFinalized](../tooling/rpc-adapter/rpc-calls.md#custom-rpcs).
48 |
--------------------------------------------------------------------------------
/miscellaneous/common-errors.md:
--------------------------------------------------------------------------------
1 | # Common Errors
2 | This page summarises common errors that you might encounter while developing on Acala EVM+. If an error occurs that is not listed here, please reach out, so we might lend a hand and include it on this page.
3 |
4 | ## ProviderError: Error: -32603: execution fatal
5 | ### `{ index: 180, error: 0, message: None }`
6 |
7 | **Error name:** AddressNotMapped
8 |
9 | **Error explanation:** This means that maintenance features are called on a smart contract, that doesn't have an EVM address bound to it
10 |
11 | **Common causes:**
12 |
13 | * Should not happen, because even if no user account is associated with the smart contract, it should bind to the `0x0` address
14 |
15 | **Suggested actions:**
16 |
17 | * We suggest reaching out to us, so we can help you investigate the issue
18 |
19 | ### `{ index: 180, error: 1, message: None }`
20 |
21 | **Error name:** ContractNotFound
22 |
23 | **Error explanation:** This means that maintenance actions are being preformed on an address that is not a smart contract
24 |
25 | **Common causes:**
26 |
27 | * Usually happens when trying to maintain a non-existent or already deleted smart contract
28 |
29 | **Suggested actions:**
30 |
31 | * We suggest reviewing the address you are trying to maintain
32 |
33 |
34 |
35 | ### `{ index: 180, error: 2, message: None }`
36 |
37 | **Error name:** NoPermission
38 |
39 | **Error explanation:** This means that the account is not allowed to interact with the smart contract
40 |
41 | **Common causes:**
42 |
43 | * This means that the account is not allowed to interact with the smart contract
44 |
45 | **Suggested actions:**
46 |
47 | * If the user wants to interact with the smart contract before it is published, they can turn on the development mode
48 | * It the smart contract maintainer wishes to enable non-developer users to interact with the smart contract, they can publish the smart contract
49 |
50 |
51 |
52 | ### `{ index: 180, error: 3, message: None }`
53 |
54 | **Error name:** ContractDevelopmentNotEnabled
55 |
56 | **Error explanation:** This means that the account doesn't have the development mode enabled
57 |
58 | **Common causes:**
59 |
60 | * Usually happens when account doesn't have development mode enabled and the user tries to disable the development mode
61 |
62 | **Suggested actions:**
63 |
64 | * If you wish for the development mode to be disabled, you don't need to do anything
65 | * If you wish to enable the development mode, you can enable it by following the documentation
66 |
67 |
68 |
69 | ### `{ index: 180, error: 4, message: None }`
70 |
71 | **Error name:** ContractDevelopmentAlreadyEnabled
72 |
73 | **Error explanation:** This means that the account already has the development mode enabled
74 |
75 | **Common causes:**
76 |
77 | * Usually happens when account has development mode enabled and the user tries to enable the development mode
78 |
79 | **Suggested actions:**
80 |
81 | * If you wish for the development mode to be enabled, you don't need to do anything
82 | * If you wish to disable the development mode, you can enable it by following the documentation
83 |
84 |
85 |
86 | ### `{ index: 180, error: 5, message: None }`
87 |
88 | **Error name:** ContractAlreadyPublished
89 |
90 | **Error explanation:** This means that the smart contract is already published
91 |
92 | **Common causes:**
93 |
94 | * Usually happens when trying to publish an already published smart contract
95 |
96 | **Suggested actions:**
97 |
98 | * If you wish for the smart contract to be published, you don't need to do anything
99 | * If you wish that the smart contract wouldn't be reachable by users that don't have development mode enabled, you can delete it and redeploy it
100 |
101 |
102 |
103 | ### `{ index: 180, error: 6, message: None }) `
104 |
105 | **Error name:** ContractExceedsMaxCodeSize
106 |
107 | **Error explanation:** This means that the smart contract file size is too big
108 |
109 | **Common causes:**
110 |
111 | * Usually happens when trying to deploy a smart contract that is too big
112 |
113 | **Suggested actions:**
114 |
115 | * We suggest refactoring your smart contract, so that the file size is decreased
116 |
117 |
118 |
119 | ### `{ index: 180, error: 7, message: None }`
120 |
121 | **Error name:** ContractAlreadyExisted
122 |
123 | **Error explanation:** This means that the same address has already been used and can't be used again
124 |
125 | **Common causes:**
126 |
127 | * Usually happens when the substrate account, to which the EVM+ account has been bound, has been reaped, which resulted in the EVM+ account nonce being reset. This in turn can cause the EVM+ to try and create a smart contract at an address that has already been used
128 |
129 | **Suggested actions:**
130 |
131 | * We suggest using another EVM+ account
132 |
133 | {% hint style="warning" %}
134 | **NOTE: This behaviour should be made obsolete. If you encounter this error, please reach out to us, so we can investigate.**
135 | {% endhint %}
136 |
137 |
138 |
139 | ### `{ index: 180, error: 8, message: None }`
140 |
141 | **Error name:** OutOfStorage
142 |
143 | **Error explanation:** This means that the storage usage of the transaction is greater than the storage limit
144 |
145 | **Common causes:**
146 |
147 | * Usually happens when transaction changes a number of states and the storage limit value is too low
148 |
149 | **Suggested actions:**
150 |
151 | * We suggest increasing the storage limit value of the transaction
152 | * If the storage limit exceeds the maximum storage limit we suggest reviewing the call initiated by the transaction and adapting it to change less states
153 |
154 |
155 |
156 | ### `{ index: 180, error: 9, message: None }`
157 |
158 | **Error name:** ChargeFeeFailed
159 |
160 | **Error explanation:** This means that the smart contract, that is trying to use Schedule predeployed smart contract, doesn't have enough funds to pay for the Schedule transaction fees
161 |
162 | **Common causes:**
163 |
164 | * Usually happens when either the smart contract has too low of a balance or the scheduled call is too complex
165 |
166 | **Suggested actions:**
167 |
168 | * We suggest additionally funding the smart contract or reviewing the scheduled call in order to make it more efficient
169 |
170 |
171 |
172 | ### `{ index: 180, error: 10, message: None }`
173 |
174 | **Error name:** CannotKillContract
175 |
176 | **Error explanation:** This means that killing the smart contract has failed
177 |
178 | **Common causes:**
179 |
180 | * Usually happens when trying to kill a non-existent function
181 |
182 | **Suggested actions:**
183 |
184 | * We suggest reviewing the address you are using to kill the smart contract and checking for typos or missed characters
185 |
186 |
187 |
188 | ### `{ index: 180, error: 11, message: None }`
189 |
190 | **Error name:** ReserveStorageFailed
191 |
192 | **Error explanation:** This means that the account doesn't have enough funds to put data into storage
193 |
194 | **Common causes:**
195 |
196 | * Usually happens when trying to change a lot of states in a single transaction
197 |
198 | **Suggested actions:**
199 |
200 | * We suggest reviewing the call and reducing the number of states that are changed within it
201 | * If the number of states changed by the call can't be reduced, we suggest adding funds to the account
202 |
203 |
204 |
205 | ### `{ index: 180, error: 12, message: None }`
206 |
207 | **Error name:** UnreserveStorageFailed
208 |
209 | **Error explanation:** This means that releasing the storage has failed
210 |
211 | **Common causes:**
212 |
213 | * Usually happens when the storage rent is increased after the storage has been rented, but not before it has been released
214 |
215 | **Suggested actions:**
216 |
217 | * We suggest reaching out to the team as this shouldn't happen under normal circumstances
218 |
219 |
220 |
221 | ### `{ index: 180, error: 13, message: None }`
222 |
223 | **Error name:** ChargeStorageFailed
224 |
225 | **Error explanation:** This means that charging the storage rent has failed
226 |
227 | **Common causes:**
228 |
229 | * None
230 |
231 | **Suggested actions:**
232 |
233 | * We suggest reaching out to the team if you encounter this error
234 |
235 |
236 |
237 | ### `{ index: 180, error: 14, message: None }`
238 |
239 | **Error name:** InvalidDecimals
240 |
241 | **Error explanation:** This means that the value provided was too low
242 |
243 | **Common causes:**
244 |
245 | * Usually happens when trying to convert wei to ACA or KAR. As ACA and KAR have 12 decimal spaces and the EVM+ expects the native currency to have 18, this error might occur during the conversion.
246 |
247 | **Suggested actions:**
248 |
249 | * We suggest only using the values greater than `1_000_000` when referring to a native currency in wei
250 |
251 | ## Named Errors
252 | ### `Error: 1010: Invalid transaction: Transaction is outdated`
253 |
254 | **Error name:** Transaction is outdated
255 |
256 | **Error explanation:** This means that the transaction's `validUntil` value is too low or that there is already a transaction with the same nonce in the chain.
257 |
258 | **Common causes:**
259 |
260 | * `validUntil` value of the transaction is lower than current block number
261 | * Transaction nonce is the same as one of the preexisting transactions had
262 |
263 | **Suggested actions:**
264 |
265 | * Verify that the transaction has a valid `validUntil` value and update it if the block number of the chain is higher
266 | * Reset the account nonce, to make sure it corresponds to the one associated with the account nonce on chain
267 |
268 | ### `Error: 1012: Invalid transaction: Transaction is temporary banned`
269 |
270 | **Error name:** Transaction is temporary banned
271 |
272 | **Error explanation:** This means that an identic transaction to this one has already failed, so mining this transaction won't be attempted. This behaviour is narrated by Substrate and has to be supported.
273 |
274 | **Common causes:**
275 |
276 | * Transaction identic to this one has recently failed
277 |
278 | **Suggested actions:**
279 |
280 | * Review logs and identify the original error to address it
281 | * If the previous error can't be found, wait for 15 minutes and re-attempt sending the transaction. The original error message should be returned
282 |
283 | ## Other Errors
284 | ### `invalid ETH gasLimit/gasPrice combination provided`
285 | We don't support inputting random gasLimit/gasPrice combination. Please read through the [gas params](../network/gas-parameters.md) section, which has detailed explanation of how to provide valid gas params.
286 |
287 | ### `Transaction hash mismatch from Provider.sendTransaction`
288 | **Common causes:**
289 |
290 | This is usually cause by using `ethers.JsonRpcProvider` as provider when sending a transaction. `JsonRpcProvider` expects a pre-calculated ETH style tx hash. However, the algorithm we use to derive the result tx hash is different than traditional EVM world, causing the mismatch.
291 |
292 | **Suggested actions:**
293 |
294 | Use [AcalaJsonRpcProvider](https://github.com/AcalaNetwork/bodhi.js/tree/master/packages/eth-providers#acala-networketh-providers) as a drop-in replacement.
295 |
296 | For example:
297 |
298 | ```ts
299 | import { AcalaJsonRpcProvider } from "@acala-network/eth-providers";
300 |
301 | // https://evmdocs.acala.network/network/network-configuration#karura-mainnet
302 | const KARURA_ETH_RPC= 'https://eth-rpc-karura.aca-api.network';
303 | const provider = new AcalaJsonRpcProvider(KARURA_ETH_RPC);
304 |
305 | // send transaction
306 | const wallet = new Wallet(PRIVATE_KEY, provider);
307 | const contractInstance = new Contract(CONTRACT_ADDR, CONTRACT_ABI, wallet);
308 | await contractInstance.someMethod();
309 | ```
310 |
311 | Note that `JsonRpcProvider` should still work in most cases, such as getting account balance, etc... The only senario that this error occur is when sending a transaction with `Provider.sendTransaction`.
312 |
313 | Also, such error only occurs with `ethers.JsonRpcProvider`, and using other providers (such as metamask's provider) should be fine.
314 |
315 | ### `Account cannot exist with the funds that would be given`
316 | **Common causes:**
317 |
318 | Each address needs a minimum balance of 0.1 ACA/KAR, this is called [Existential Deposit](https://wiki.acala.network/get-started/acala-network/acala-account#existential-deposit). Sending a transaction with value lower than ED to a **new address** will result in this error.
319 |
320 | **Suggested actions:**
321 | - when sending native token to a new EOA, make sure the value is greater than ED, which is 0.1 ACA/KAR.
322 | - if target address is a contract that handles payments, we can send 0.1 ACA/KAR to the contract right after the it is deployed, so this error won't occur for any following transactions.
--------------------------------------------------------------------------------
/miscellaneous/ethdenver.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: 'Acala at ETHDenver 2022 #BUIDLWeek'
3 | ---
4 |
5 | # ETHDenver
6 |
7 | #### Join the EVM+ Workshop in-person & online during ETHDenver’s #BUIDLWeek
8 |
9 | \
10 | Project Submission: [https://share.hsforms.com/1woaQxNlJSA-EYJKe2cYJZA4h8qc](https://share.hsforms.com/1woaQxNlJSA-EYJKe2cYJZA4h8qc)\
11 | \
12 | Tutorial: [https://aca.la/BUIDLWeek](https://aca.la/BUIDLWeek)\
13 | \
14 | Tutorial Video: [https://youtu.be/GI6OBZvRPGc](https://youtu.be/GI6OBZvRPGc)\
15 | \
16 | Link Metamask to Mandala: [https://acala-evm.netlify.app/](https://acala-evm.netlify.app/)\
17 |
18 |
19 | **Beyond EVM: Building Sustainable dApps & L1 Networks With Acala**\
20 | **Date/Time**: Tuesday, Feb 15, 2022, 3:00pm — 5:00pm MST (10pm UTC)\
21 | **Location**: 1134 Broadway (2nd Floor), Denver CO, 80203\
22 | \
23 | In this workshop, you'll utilize familiar toolsets to deploy leading Ethereum DEX contracts while leveraging programmable DOT assets and cost-effective calls to Acala's native DEX, Acala Swap. Meet the team, pick up some Acala swag, and try for bounty rewards with our hands-on tutorial:\
24 | \
25 | **Bounty 1**
26 |
27 | * **Objective**: Deploy a DApp on Polkadot using Acala EVM+
28 | * **Reward:** $1000
29 |
30 | **Bounty 2**
31 |
32 | * **Objective**: Deploy a DApp on Acala EVM+ that integrates with Acala's decentralized stablecoin, aUSD
33 | * **Reward:** $4000
34 |
35 | **Judging Criteria**
36 |
37 | * **Strength of aUSD stablecoin use case (25%)** — Includes how much utility and demand the DApp creates for aUSD.
38 | * **Originality, Creativity, and Innovation (25%)** — Includes how new and novel the submission is versus existing technologies.
39 | * **Technical Difficulty (25%)** — Includes the level of skill or knowledge required to build the DApp.
40 | * **User Experience (25%)** — Includes how intuitive and understandable the submission is for potential users.
41 |
42 | \
43 | \
44 |
--------------------------------------------------------------------------------
/miscellaneous/feedback.md:
--------------------------------------------------------------------------------
1 | # Feedback or suggestions
2 |
3 | If you have any feedback or suggestions about the EVM+ documentations, feel free to open an issue or PR [here](https://github.com/AcalaNetwork/acala-evm-dev-docs/issues).
--------------------------------------------------------------------------------
/miscellaneous/request-support.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: >-
3 | Instructions how to request support for your project in a format that will
4 | allow for the most efficient support.
5 | ---
6 |
7 | # Request support
8 |
9 | In order for us to be able to lend a hand when you hit a snag, we want to share a simple checklist of what to include in your support request.
10 |
11 | ## Brief description
12 |
13 | A brief description of your issue that illustrates what issues you have encountered and how it impacts you. For example:
14 |
15 | We have tried deploying a smart contract using Truffle framework, but the transaction has failed with `Error: 1010: Invalid Transaction: Transaction is outdated` error.
16 |
17 | ## Source
18 |
19 | Providing us with the source code will allow for an easier debugging by our engineers. Being able to look at the code and manipulate it in order to provide a solution will eliminate the guesswork.
20 |
21 | Source can be a link to a branch in your repository that encountered the issue or a mock of it (in case you don't feel comfortable sharing your source code with us). If you are sharing a mock branch it is important that you preserve the dependencies you are using and the configuration as well as the flow of the script that encounters the issue (you may change the contract and variable names and values, but keep the statements as close to the original as possible).
22 |
23 | ## Reproduction instructions
24 |
25 | Step by step instructions on how to reproduce the issue. Be as detailed as possible. Reproduction instructions should start with cloning the source and end with reproducing the issue. For example:
26 |
27 | 1. `git clone REPOSITORY`
28 | 2. `yarn`
29 | 3. `yarn build`
30 | 4. `yarn reproduce-issue`
31 |
32 | ## Additional details
33 |
34 | Details about your environment that could be specific to you are important. Make sure you have bound your Substrate and EVM accounts and enabled the development mode. Do you have sufficient balance? Hash of the transaction that failed (not screenshot, as the hash can be copy-pasted) can greatly increase the chances of resolving your issue.
35 |
36 | ## How to request support?
37 |
38 | Remember to gather all of the information above and have it ready.
39 |
40 | We encourage you to first post your question to [Substrate stack exchange](https://substrate.stackexchange.com/) or to check it out whether or not your question has already been answered. Please use `acala`, `karura` or `mandala` tags (depending on the network you are using) and the `evm+` tag, to make sure one of our engineers sees your question.
41 |
42 | If you are unable to get sufficient support, reach out to us in one of our many channels of communication and we will assist you.
43 |
--------------------------------------------------------------------------------
/network/aca-token.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Explanation on how ACA ERC20 ties into Acala native token.
3 | ---
4 |
5 | # ACA token
6 |
7 | ACA token is synced in 3 places:
8 | - acala native token
9 | - evm native token
10 | - evm predeployed ACA ERC20 token
11 |
12 | Any change in the balance of any of the above, is reflected in all.
13 |
14 | The predeployed ACA ERC20 smart contract is tied directly into the native ACA token of the Acala network. This means that you can transfer the ACA as you would the native currency, but you can also transfer it as an ERC20 token.
15 |
16 |
17 | {% hint style="info" %}
18 | Balances of the EVM accounts bound to the Polkadot.js accounts can differ from reasons other than existential deposit. One of such instances is staking.
19 | {% endhint %}
20 |
--------------------------------------------------------------------------------
/network/gas-parameters.md:
--------------------------------------------------------------------------------
1 | # Gas Parameters
2 |
3 | The primary distinction between Acala EVM+ and the legacy EVM lies in the usage of encoded `gasPrice` and `gasLimit`, together referred to as "gas parameters".
4 |
5 | ## Context
6 |
7 | Acala EVM+ operates on a substrate chain. Consequently, the gas parameters must encode four substrate parameters: `gasLimit`, `storageLimit`, `validUntil`, and `tip`. It's crucial to supply precise `gasPrice` to `gasLimit` values to ensure accurate decoding into substrate parameters. Arbitrary changes to these parameters could lead to incorrect decoding.
8 |
9 | For instance, when a user sends a transaction with the following gas parameters:
10 | ```
11 | {
12 | gasPrice: 100.004623375 gwei,
13 | gasLimit: 100106,
14 | }
15 | ```
16 |
17 | These parameters are decoded into substrate parameters as follows:
18 | ```
19 | {
20 | validUntil: 4623375,
21 | gasLimit: 30000,
22 | storageLimit: 64,
23 | tip: 0,
24 | }
25 | ```
26 |
27 | Despite being inconsistent with the legacy EVM, this aspect is advantageous for Acala EVM+. It utilizes features unavailable in the legacy EVM. For example, the `validUntil` parameter prevents transactions from indefinitely lingering in the transaction pool. Additionally, the `storageLimit` encourages developers to remove redundant data from the chain, thereby reducing chain bloat.
28 |
29 | ## Retrieving Gas Parameters
30 | ### for users
31 |
32 | Users are not required to calculate gas parameters:
33 |
34 | - When sending tokens, MetaMask automatically retrieves the correct gas parameters by calling ETH RPC endpoints.
35 | - During transaction signing, dApps provide the correct gas parameters to MetaMask, enabling users to sign a valid transaction.
36 |
37 | However, users should avoid arbitrary modification of transaction parameters within MetaMask, as it could lead to transaction failure due to incorrect decoding. We recommend highlighting this warning within your dApp's user interface.
38 |
39 | ### for developers
40 |
41 | Most tools and libraries (like `ethers`, `hardhat`, `truffle`) automatically calculate the correct gas parameters when sending a transaction. Developers typically do not need to intervene.
42 |
43 | If gas parameters are not auto-computed, developers can calculate them as follows:
44 |
45 | ```ts
46 | const gasPrice = await provider.getGasPrice();
47 | const gasLimit = await contractInstance.estimateGas.functionName(...args);
48 | ```
49 |
50 | ## Gas Decoding Details
51 | ### without tip (default case)
52 | Assume the Ethereum gasLimit is encoded as `aaaabbbcc` and gasPrice is encoded as `100yyyyyyyyy`. They can be decoded into substrate gas parameters as follows:
53 | - `validUntil = yyyyyyyyy`
54 | - `gasLimit = 30000 * bbb`
55 | - `storageLimit = 2^min(21, cc)`
56 |
57 | for example:
58 | ```
59 | {
60 | gasPrice: 100004623375, // 100yyyyyyyyy, where yyyyyyyyy = 004623375
61 | gasLimit: 100106, // aaaabbbcc, where bbb = 001 and cc = 06
62 | }
63 | ```
64 | will be decoded as
65 | ```
66 | {
67 | validUntil: 4623375, // yyyyyyyyy
68 | gasLimit: 30000, // 30000 * bbb = 30000 * 1 = 30000
69 | storageLimit: 64, // 2 ^ min(21, cc) = 2 ^ 6 = 64
70 | tip: 0,
71 | }
72 | ```
73 |
74 | ### with tip
75 | The `gasLimit` remains unaffected by the tip, as the tip is encoded into `gasPrice` as `ab0yyyyyyyyy`.
76 | - `tip = (ab0 / 100 - 1)% of the original cost`
77 |
78 | for example:
79 | ```
80 | {
81 | gasPrice: 120004623375, // ab0yyyyyyyyy, where ab0 = 120
82 | gasLimit: 100106, // same as above
83 | }
84 | ```
85 | will be decoded as
86 | ```
87 | {
88 | validUntil: 4623375, // same as above
89 | gasLimit: 30000, // same as above
90 | storageLimit: 64, // same as above
91 | tip: 20%, // ab0 / 100 - 1 = 120 / 100 - 1 = 20%
92 | }
93 | ```
94 |
95 | ## Modifying Gas Parameters
96 | ### for users
97 | Users generally should avoid manually modifying gas parameters to prevent incorrect decoding. dApps should initiate signature requests with valid gas parameters, relieving users of any concern about gas calculation. Nonetheless, knowledgeable users can manually modify the `ab0` part of the gasPrice to increase the tip, which can expedite the transaction when the network is busy.
98 |
99 | ### for developers
100 | Developers can offer different priority options to users and compute the corresponding `gasPrice`, eliminating the need for users to manually modify gas parameters. For instance:
101 | - default priority: `ab0 = 100`, in which case gasPrice is calculated automatically by the toolings
102 | - high priority: `ab0 = 120`, in which case tip = 20% of the original cost
103 | - super high priority: `ab0 = 200`, in which case tip = 100% of the original cost
104 |
105 | If developers choose not to offer such options, they can use the default gasPrice directly.
106 |
107 | When prompting user signatures, developers should also calculate a valid gasLimit. Most often, the tools should auto-calculate the gasLimit. If not, developers can hardcode a valid gasLimit (a rare occurrence, but if it happens, please report to the Acala team). For example, if an auto-calculated `gasLimit = 100106` fails the transaction with an error like `storage limit not enough`, it implies the transaction requires more storage than the auto-computed storageLimit = `2 ^ 6 = 64`. If the actual storage cost is `100`, developers can use `cc = 7`, making `gasLimit = 100107`.
108 |
--------------------------------------------------------------------------------
/network/network-configuration.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Addressing and identification information of Acala networks.
3 | ---
4 |
5 | # Network configuration
6 |
7 | The following tables contain the information necessary to connect to Acala networks.
8 |
9 | ## Acala Mainnet
10 |
11 | | **Name** | Acala |
12 | | -------------------- | -------------------------------------------------------------------- |
13 | | **Node Endpoint** | `wss://acala-rpc.aca-api.network` |
14 | | **ETH RPC Endpoint** | `https://eth-rpc-acala.aca-api.network` |
15 | | **WS Endpoint** | `wss://eth-rpc-acala.aca-api.network` |
16 | | **Subquery** | `https://subql-query-acala.aca-api.network` |
17 | | **Explorer** | [https://blockscout.acala.network](https://blockscout.acala.network) |
18 | | **Chan ID** | 787 |
19 | | **Symbol** | ACA |
20 |
21 | There is also a developer-facing beta version that usually contains some latest features, but might be unstable.
22 |
23 | | **Name** | Acala Beta |
24 | | -------------------- | ------------------------------------------- |
25 | | **ETH RPC Endpoint** | `https://eth-rpc-acala.aca-staging.network` |
26 | | **WS Endpoint** | `wss://eth-rpc-acala.aca-staging.network` |
27 |
28 | ## Karura Mainnet
29 |
30 | | **Name** | Karura |
31 | | -------------------- | ---------------------------------------------------------------------- |
32 | | **Node Endpoint** | `wss://karura-rpc.aca-api.network` |
33 | | **ETH RPC Endpoint** | `https://eth-rpc-karura.aca-api.network` |
34 | | **WS Endpoint** | `wss://eth-rpc-karura.aca-api.network` |
35 | | **Subquery** | `https://subql-query-karura.aca-api.network` |
36 | | **Explorer** | [https://blockscout.karura.network](https://blockscout.karura.network) |
37 | | **Chan ID** | 686 |
38 | | **Symbol** | KAR |
39 |
40 | There is also a developer-facing beta version that usually contains some latest features, but might be unstable.
41 |
42 | | **Name** | Karura Beta |
43 | | -------------------- | -------------------------------------------- |
44 | | **ETH RPC Endpoint** | `https://eth-rpc-karura.aca-staging.network` |
45 | | **WS Endpoint** | `wss://eth-rpc-karura.aca-staging.network` |
46 |
47 |
48 | ## Local Development Network
49 |
50 | This section assumes you are using the dockerized local development network described in the [node setup](network-setup/local-development-network.md) section.
51 |
52 | | **Name** | Mandala Local |
53 | | ------------------- | ----------------------- |
54 | | **Node Endpoint** | `ws://127.0.0.1:9944` |
55 | | **ETH RPC Endpoint** | `http://127.0.0.1:8545` |
56 | | **WS Endpoint** | `ws://127.0.0.1:8545` |
57 | | **Chain ID** | 595 |
58 | | **Symbol** | mACA |
59 |
60 | ## Mandala Testnet TC9
61 |
62 | | **Name** | Mandala TC9 |
63 | | ------------------- | ------------------------------------------------- |
64 | | **Node Endpoint** | `wss://mandala-tc9-rpc.aca-staging.network` |
65 | | **ETH RPC Endpoint** | `https://eth-rpc-tc9.aca-staging.network` |
66 | | **WS Endpoint** | `wss://eth-rpc-tc9.aca-staging.network` |
67 | | **Subquery** | `https://subql-query-tc9.aca-staging.network` |
68 | | **Explorer** | [https://blockscout.mandala.aca-staging.network](https://blockscout.mandala.aca-staging.network) |
69 | | **Chan ID** | 595 |
70 | | **Symbol** | mACA |
71 |
72 | ## Karura Testnet
73 |
74 | | **Name** | Karura Testnet |
75 | | ------------------- | ------------------------------------------ |
76 | | **Node Endpoint** | `wss://karura-testnet.aca-staging.network/rpc/karura/ws` |
77 | | **ETH RPC Endpoint** | `https://eth-rpc-karura-testnet.aca-staging.network` |
78 | | **WS Endpoint** | `wss://eth-rpc-karura-testnet.aca-staging.network` |
79 | | **Subquery** | `https://subql-query-karura-testnet.aca-staging.network` |
80 | | **Explorer** | [https://blockscout.karura-testnet.aca-staging.network](https://blockscout.karura-testnet.aca-staging.network) |
81 | | **Chan ID** | 596 |
82 | | **Symbol** | KAR |
83 |
84 | ## Acala Testnet
85 |
86 | | **Name** | Acala Testnet |
87 | | ------------------- | ------------------------------------------ |
88 | | **Node Endpoint** | `wss://acala-dev.aca-dev.network/rpc/ws` |
89 | | **ETH RPC Endpoint** | `https://eth-rpc-acala-testnet.aca-staging.network` |
90 | | **WS Endpoint** | `wss://eth-rpc-acala-testnet.aca-staging.network` |
91 | | **Subquery** | `https://subql-query-acala-testnet.aca-staging.network` |
92 | | **Explorer** | [https://blockscout.acala-dev.aca-dev.network](https://blockscout.acala-dev.aca-dev.network) |
93 | | **Chan ID** | 597 |
94 | | **Symbol** | ACA |
95 |
--------------------------------------------------------------------------------
/network/network-setup/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Instructions on how to run a node in each of the networks
3 | ---
4 |
5 | # Network setup
6 |
7 | As we have public production networks, public test networks as well as local development network for developers to interact with, this section contains instructions on how to use them:
8 |
9 | {% content-ref url="local-development-network.md" %}
10 | [local-development-network.md](local-development-network.md)
11 | {% endcontent-ref %}
12 |
13 | {% content-ref url="connecting-to-a-public-network-with-local-rpc-node.md" %}
14 | [connecting-to-a-public-network-with-local-rpc-node.md](connecting-to-a-public-network-with-local-rpc-node.md)
15 | {% endcontent-ref %}
16 |
--------------------------------------------------------------------------------
/network/network-setup/connecting-to-a-public-network-with-local-rpc-node.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Instructions on how to setup local RPC node that connects to a public network
3 | ---
4 |
5 | # Connecting to a public network with local RPC node
6 |
7 | Except from connecting to local development network, we can also run a local RPC node connecting to public networks.
8 |
9 | ```
10 | npx @acala-network/eth-rpc-adapter@latest \
11 | --endpoint \
12 | --subql
13 | ```
14 |
15 | Node endpoints and subquery urls can be found in [network configuration](../network-configuration.md).
16 |
17 | For example to connect to acala mainnet:
18 | ```
19 | npx @acala-network/eth-rpc-adapter@latest \
20 | --endpoint wss://acala-rpc.aca-api.network \
21 | --subql https://subql-query-acala.aca-api.network
22 | ```
23 |
24 | Also checkout the help command for more details
25 | ```
26 | npx @acala-network/eth-rpc-adapter@latest --help
27 | ```
28 |
29 | {% hint style="info" %}
30 | **If you wish to learn more about the RPC adapter, you can find more info in the** [**RPC adapter documentation**](../../tooling/rpc-adapter/running-the-rpc-adapter.md)**.**
31 | {% endhint %}
32 |
--------------------------------------------------------------------------------
/network/network-setup/local-development-network.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Instructions on how to run a full local development network
3 | ---
4 |
5 | # Local development network
6 |
7 | The local development network consists of following services:
8 |
9 | * Local Acala Fork
10 | * Eth Rpc Adapter
11 | * \*Subquery Services
12 | * Postgres database
13 | * Subquery node
14 | * GraphQL engine
15 |
16 | ## Starting the stack
17 | You can download or copy + paste this [docker compose file](https://github.com/AcalaNetwork/bodhi.js/blob/master/docker-compose.yml), and then
18 |
19 | ```
20 | docker compose up
21 | ```
22 |
23 | Once you see logs like this, the local development stack is ready.
24 |
25 | ```
26 | --------------------------------------------
27 | 🚀 SERVER STARTED 🚀
28 | --------------------------------------------
29 | version : bodhi.js/eth-rpc-adapter/2.9.4
30 | endpoint url : ws://node:9944
31 | subquery url : undefined
32 | server host : localhost
33 | server port : 8545
34 | max blockCache : 200
35 | max batchSize : 50
36 | max storageSize : 5000
37 | cache capacity : 1000
38 | safe mode : false
39 | local mode : false
40 | http only : false
41 | verbose : true
42 | --------------------------------------------
43 | ```
44 |
45 | This stack contains a local Acala fork, and an eth rpc adapter.
46 |
47 | It does not contain a subquery services, since for local testing purpose, we usually do not need subquery services, and if you would like to setup a local subquery service, you can refer to the [subquery docs](https://github.com/AcalaNetwork/bodhi.js/tree/master/packages/evm-subql#run-with-docker).
48 |
49 | {% hint style="info" %}
50 | **In order to have a clean start after every shutdown of the node, run the following command after the node was shut down:**
51 |
52 | **`docker compose down -v`**
53 | {% endhint %}
54 |
55 | ## The local development network services
56 | Once the local development network is up and running, the following services are available:
57 |
58 | * A local mandala node: [ws://localhost:9944](ws://localhost:9944)
59 | * \*A subquery service: [http://localhost:3001](http://localhost:3001)
60 | * An ETH JSON-RPC service:
61 | * [http://localhost:8545](http://localhost:8545)
62 | * [ws://localhost:8545](ws://localhost:8545)
63 | * Local network substrate chain explorer: [Polkadot.js App](https://polkadot.js.org/apps/?rpc=ws%3A%2F%2Flocalhost%3A9944%2Fws#/explorer)
64 |
65 | You can now setup [Metamask on localhost](../../tooling/metamask/#localhost) and interact with your local setup, or try to deploy or interact with a smart contract.
66 |
--------------------------------------------------------------------------------
/network/predeployed-smart-contracts/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: >-
3 | Section detailing the precompiled and predeployed smart contracts of the Acala
4 | EVM+.
5 | ---
6 |
7 | # Predeployed smart contracts
8 |
9 | One of the great features of Acala EVM+ is the precompiled and the predeployed smart contracts.
10 |
11 | ## Precompiled smart contracts
12 |
13 | The precompiled smart contracts allow for the use of the predeployed smart contracts within your project's smart contracts and scripts. Just import the `@acala-network/contracts` package and import them into your project. The package includes the smart contracts to import into the smart contracts of your project as well as their compiled versions in order to import them into the deploy, test and interaction scripts.
14 |
15 | To add them to your project simply use:
16 |
17 | ```
18 | yarn add --dev @acala-network/contracts
19 | ```
20 |
21 | Once you add the dependency to the project you can simply import the contracts included in it like this:
22 |
23 | ```solidity
24 | import "@acala-network/contracts/token/Token.sol";
25 | ```
26 |
27 | And to use the precompiled smart contract within your script use the:
28 |
29 | ```javascript
30 | const TokenContract = require("@acala-network/contracts/build/contracts/Token.json");
31 | ```
32 |
33 | ## Predeployed smart contracts
34 |
35 | Predeployed smart contracts in Acala EVM+ allow for the reliable use of the smart contracts that are always deployed at the same address no matter the chain. The predeployed smart contracts include Tokens smart contracts, the native on chain scheduler called Schedule, Oracle, DEX and StateRent.
36 |
37 | ### ADDRESS utility
38 |
39 | The `@acala-network/contracts` dependency contains the [`ADDRESS`](https://github.com/AcalaNetwork/predeploy-contracts/blob/master/contracts/utils/MandalaAddress.sol) utility which can be used in your smart contracts as well as scripts to access the predeployed smart contracts. It allows for using the addresses of the predeployed smart contracts without the need to copy-paste and hardcode these addresses into your project. There is an `ADDRESS` utility for each of the networks. The local development network and Mandala public test network use `MandalaAddress`, the Acala network uses the `AcalaAddress` and the Karura network uses the `KaruraAddress` to provide the correct addresses.
40 |
41 | To use the utility within your smart contract simply import it using (for Mandala):
42 |
43 | ```solidity
44 | import "@acala-network/contracts/utils/MandalaAddress.sol";
45 | ```
46 |
47 | Make sure to set the inheritance of your contract to be able to interact with the `ADDRESS` utility:
48 |
49 | ```solidity
50 | contract YourContract is ADDRESS {
51 |
52 | }
53 | ```
54 |
55 | To get the address of the DEX predeployed smart contract you can now simply use:
56 |
57 | ```solidity
58 | ADDRESS.DEX
59 | ```
60 |
61 | If you want to refer to the addresses of the predeployed smart contracts, take a look at the following page.
62 |
--------------------------------------------------------------------------------
/network/predeployed-smart-contracts/details.md:
--------------------------------------------------------------------------------
1 | # Details
2 |
3 | This section contains details about each of predeployed contracts, including their addresses, explanation, and deployment status.
4 |
5 | deployment status:
6 |
7 | * the predeployed smart contract is enabled and interactable with in the given network.
8 | * the predeployed smart contract has not been enabled in the given network yet.
9 |
10 | ## ERC20
11 |
12 | The predeployed ERC20 smart contracts allow you to interact with these token contract reliably on all of the Acala EVM+ chain. You can also use these addresses to add the tokens to your MetaMask or any other EVM wallet you might use with the Acala EVM+.
13 |
14 | The most up to date list of ERC20 addresses can be found in the [predeploy-contracts repository](https://github.com/AcalaNetwork/predeploy-contracts/tree/master/contracts/utils)
15 |
16 | | Acala | Karura | Mandala |
17 | | :------------------------------------------------------------------------------: | :------------------------------------------------------------------------------: | :------------------------------------------------------------------------------: |
18 | | | | |
19 |
20 | {% tabs %}
21 | {% tab title="Acala" %}
22 | | Token | Address |
23 | | ------------------ | ------------------------------------------ |
24 | | ACA | 0x0000000000000000000100000000000000000000 |
25 | | aSEED | 0x0000000000000000000100000000000000000001 |
26 | | DOT | 0x0000000000000000000100000000000000000002 |
27 | | LDOT | 0x0000000000000000000100000000000000000003 |
28 | | LCDOT | 0x000000000000000000040000000000000000000d |
29 | | SA_DOT | 0x0000000000000000000300000000000000000000 |
30 | | FA_GLMR | 0x0000000000000000000500000000000000000000 |
31 | | FA_PARA | 0x0000000000000000000500000000000000000001 |
32 | | FA_ASTR | 0x0000000000000000000500000000000000000002 |
33 | | FA_IBTC | 0x0000000000000000000500000000000000000003 |
34 | | FA_INTR | 0x0000000000000000000500000000000000000004 |
35 | | FA_WBTC | 0x0000000000000000000500000000000000000005 |
36 | | FA_WETH | 0x0000000000000000000500000000000000000006 |
37 | | FA_EQ | 0x0000000000000000000500000000000000000007 |
38 | | FA_EQD | 0x0000000000000000000500000000000000000008 |
39 | | LP_ACA_aSEED | 0x0000000000000000000200000000000000000001 |
40 | | LP_LDOT_aSEED | 0x0000000000000000000200000000010000000003 |
41 | | LP_LCDOT_aSEED | 0x000000000000000000020000000001020000000D |
42 | | LP_LCDOT_DOT | 0x000000000000000000020000000002020000000d |
43 | {% endtab %}
44 |
45 | {% tab title="Karura" %}
46 | | Token | Address |
47 | | -------------- | ------------------------------------------ |
48 | | KAR | 0x0000000000000000000100000000000000000080 |
49 | | aSEED | 0x0000000000000000000100000000000000000081 |
50 | | KSM | 0x0000000000000000000100000000000000000082 |
51 | | LKSM | 0x0000000000000000000100000000000000000083 |
52 | | TAI | 0x0000000000000000000100000000000000000084 |
53 | | BNC | 0x00000000000000000001000000000000000000a8 |
54 | | VSKSM | 0x00000000000000000001000000000000000000A9 |
55 | | PHA | 0x00000000000000000001000000000000000000Aa |
56 | | KINT | 0x00000000000000000001000000000000000000AB |
57 | | KBTC | 0x00000000000000000001000000000000000000aC |
58 | | FA_USDT | 0x0000000000000000000500000000000000000007 |
59 | | SA_KSM | 0x0000000000000000000300000000000000000000 |
60 | | SA_3USD | 0x0000000000000000000300000000000000000001 |
61 | | FA_RMRK | 0x0000000000000000000500000000000000000000 |
62 | | FA_ARIS | 0x0000000000000000000500000000000000000001 |
63 | | FA_QTZ | 0x0000000000000000000500000000000000000002 |
64 | | FA_MOVR | 0x0000000000000000000500000000000000000003 |
65 | | FA_HKO | 0x0000000000000000000500000000000000000004 |
66 | | FA_CSM | 0x0000000000000000000500000000000000000005 |
67 | | FA_KICO | 0x0000000000000000000500000000000000000006 |
68 | | FA_USDT | 0x0000000000000000000500000000000000000007 |
69 | | FA_TEER | 0x0000000000000000000500000000000000000008 |
70 | | FA_NEER | 0x0000000000000000000500000000000000000009 |
71 | | FA_KMA | 0x000000000000000000050000000000000000000a |
72 | | FA_BSX | 0x000000000000000000050000000000000000000b |
73 | | FA_AIR | 0x000000000000000000050000000000000000000c |
74 | | FA_CRAB | 0x000000000000000000050000000000000000000d |
75 | | FA_GENS | 0x000000000000000000050000000000000000000E |
76 | | FA_EQD | 0x000000000000000000050000000000000000000f |
77 | | FA_TUR | 0x0000000000000000000500000000000000000010 |
78 | | FA_PCHU | 0x0000000000000000000500000000000000000011 |
79 | | FA_SDN | 0x0000000000000000000500000000000000000012 |
80 | | FA_LT | 0x0000000000000000000500000000000000000013 |
81 | | LP_KAR_aSEED | 0x0000000000000000000200000000800000000081 |
82 | | LP_KSM_aSEED | 0x0000000000000000000200000000810000000082 |
83 | | LP_LKSM_aSEED | 0x0000000000000000000200000000810000000083 |
84 | | LP_BNC_aSEED | 0x00000000000000000002000000008100000000a8 |
85 | | LP_PHA_aSEED | 0x00000000000000000002000000008100000000aa |
86 | | LP_KINT_aSEED | 0x00000000000000000002000000008100000000Ab |
87 | | LP_KBTC_aSEED | 0x00000000000000000002000000008100000000aC |
88 | | LP_RMRK_aSEED | 0x0000000000000000000200000000810300000000 |
89 | | LP_QTZ_aSEED | 0x0000000000000000000200000000810300000002 |
90 | | LP_CSM_aSEED | 0x0000000000000000000200000000810300000005 |
91 | | LP_AIR_aSEED | 0x000000000000000000020000000081030000000c |
92 | | LP_LKSM_KAR | 0x0000000000000000000200000000800000000083 |
93 | | LP_QTZ_KAR | 0x0000000000000000000200000000800300000002 |
94 | | LP_KAR_KSM | 0x0000000000000000000200000000800000000082 |
95 | | LP_LKSM_KSM | 0x0000000000000000000200000000820000000083 |
96 | | LP_RMRK_KSM | 0x0000000000000000000200000000820300000000 |
97 | | LP_ARIS_KSM | 0x0000000000000000000200000000820300000001 |
98 | | LP_RMRK_TAI | 0x0000000000000000000200000000840300000000 |
99 | {% endtab %}
100 |
101 | {% tab title="Mandala" %}
102 | | Token | Address |
103 | | ------------------ | ------------------------------------------ |
104 | | ACA | 0x0000000000000000000100000000000000000000 |
105 | | DOT | 0x0000000000000000000100000000000000000002 |
106 | | LDOT | 0x0000000000000000000100000000000000000003 |
107 | | LCDOT | 0x000000000000000000040000000000000000000d |
108 | {% endtab %}
109 | {% endtabs %}
110 |
111 | ## DEX
112 |
113 | The DEX smart contract allows you to interact with the built in DEX of the Acala EVM+. You can take a look at [DEX tutorial](../../examples/truffle-tutorials/dex-tutorial.md) in order to see it in action.
114 |
115 | | Acala | Karura | Mandala |
116 | | :------------------------------------------------------------------------------: | :------------------------------------------------------------------------------: | :------------------------------------------------------------------------------: |
117 | | | | |
118 |
119 | | Smart contract | Address |
120 | | -------------- | ------------------------------------------ |
121 | | DEX | 0x0000000000000000000000000000000000000803 |
122 |
123 | ## EVM
124 |
125 | The EVM smart contract allows you to manage the development aspect of you account and the smart contracts that you deployed or are in control of. If you wish to see more about how the EVM predeployed smart contract works, you can take a look at the [EVM tutorial](../../examples/hardhat-tutorials/evm-tutorial.md).
126 |
127 | | Acala | Karura | Mandala |
128 | | :------------------------------------------------------------------------------: | :--------------------------------------------------------------------------: | :------------------------------------------------------------------------------: |
129 | | | | |
130 |
131 | | Smart contract | Address |
132 | | -------------- | ------------------------------------------ |
133 | | EVM | 0x0000000000000000000000000000000000000800 |
134 |
135 | ## Oracle
136 |
137 | The Oracle predeployed smart contract allows you to get the prices of the supported tokens.
138 |
139 | | Acala | Karura | Mandala |
140 | | :------------------------------------------------------------------------------: | :--------------------------------------------------------------------------: | :------------------------------------------------------------------------------: |
141 | | | | |
142 |
143 | | Smart contract | Address |
144 | | -------------- | ------------------------------------------ |
145 | | ORACLE | 0x0000000000000000000000000000000000000801 |
146 |
147 | ## Schedule
148 |
149 | The Schedule smart contract allows you to schedule the on-chain calls without the need for the off-chain interaction. To see the Schedule in action, you can take a look at the [Advanced escrow](../../examples/hardhat-tutorials/advancedescrow-tutorial.md) tutorial.
150 |
151 | | Acala | Karura | Mandala |
152 | | :----------------------------------------------------------------------: | :----------------------------------------------------------------------: | :------------------------------------------------------------------------------: |
153 | | | | |
154 |
155 | | Smart contract | Address |
156 | | -------------- | ------------------------------------------ |
157 | | SCHEDULE | 0x0000000000000000000000000000000000000802 |
158 |
159 | ## Stable asset
160 |
161 | The Stable asset smart contract can be found at the address available above and you can take a look at it [here](https://github.com/AcalaNetwork/predeploy-contracts/blob/master/contracts/stable-asset/StableAsset.sol).
162 |
163 | | Acala | Karura | Mandala |
164 | | :------------------------------------------------------------------------------: | :----------------------------------------------------------------------: | :----------------------------------------------------------------------: |
165 | | | | |
166 |
167 | | Smart contract | Address |
168 | | -------------- | ------------------------------------------ |
169 | | STABLE_ASSET | 0x0000000000000000000000000000000000000804 |
170 |
171 | ## Homa
172 |
173 | The Homa smart contract can be found at the address available above and you can take a look at it [here](https://github.com/AcalaNetwork/predeploy-contracts/blob/master/contracts/homa/Homa.sol).
174 |
175 | | Acala | Karura | Mandala |
176 | | :----------------------------------------------------------------------: | :----------------------------------------------------------------------: | :----------------------------------------------------------------------: |
177 | | | | |
178 |
179 | | Smart contract | Address |
180 | | -------------- | ------------------------------------------ |
181 | | HOMA | 0x0000000000000000000000000000000000000805 |
182 |
183 | ## EVM Accounts
184 |
185 | The EVM Accounts smart contract is used for simple account management and its source code can be found [here](https://github.com/AcalaNetwork/predeploy-contracts/blob/master/contracts/evm-accounts/EVMAccounts.sol).
186 |
187 | | Acala | Karura | Mandala |
188 | | :------------------------------------------------------------------------------: | :------------------------------------------------------------------------------: | :------------------------------------------------------------------------------: |
189 | | | | |
190 |
191 | | Smart contract | Address |
192 | | -------------- | ------------------------------------------ |
193 | | EVM_ACCOUNTS | 0x0000000000000000000000000000000000000806 |
194 |
195 | ## Honzon
196 |
197 | The Honzon bridge smart contract can be reached at the address above and its source code is available [here](https://github.com/AcalaNetwork/predeploy-contracts/blob/master/contracts/honzon/Honzon.sol).
198 |
199 | | Acala | Karura | Mandala |
200 | | :----------------------------------------------------------------------: | :----------------------------------------------------------------------: | :----------------------------------------------------------------------: |
201 | | | | |
202 |
203 | | Smart contract | Address |
204 | | -------------- | ------------------------------------------ |
205 | | HONZON | 0x0000000000000000000000000000000000000807 |
206 |
207 | ## Incentives
208 |
209 | The Incentives smart contract can be reached at the address above and its source code is available [here](https://github.com/AcalaNetwork/predeploy-contracts/blob/master/contracts/incentives/Incentives.sol).
210 |
211 | | Acala | Karura | Mandala |
212 | | :----------------------------------------------------------------------: | :----------------------------------------------------------------------: | :----------------------------------------------------------------------: |
213 | | | | |
214 |
215 | | Smart contract | Address |
216 | | -------------- | ------------------------------------------ |
217 | | INCENTIVES | 0x0000000000000000000000000000000000000808 |
218 |
219 | ## XTokens
220 |
221 | The XTokens smart contract allows you to use XCM to transfer tokens between parachains.
222 |
223 | | Acala | Karura | Mandala |
224 | | :------------------------------------------------------------------------------: | :------------------------------------------------------------------------------: | :------------------------------------------------------------------------------: |
225 | | | | |
226 |
227 | | Smart contract | Address |
228 | | -------------- | ------------------------------------------ |
229 | | XTokens | 0x0000000000000000000000000000000000000809 |
230 |
--------------------------------------------------------------------------------
/special-features/batch-evm-transactions.md:
--------------------------------------------------------------------------------
1 | # Batch EVM Transactions
2 |
3 | One of the advanced feature of EVM+, compared to traditional EVM, is the ability to do batch transaction.
4 |
5 | This example will show how to batch transactions with polkadot wallet and [bodhi.js](https://github.com/AcalaNetwork/bodhi.js/tree/master/packages/bodhi#create-a-wallet) SDK,so users can deploy multiple contracts at once, and perform approve token and add liquidity transactions within a single transaction.
6 |
7 | {% hint style="info" %}
8 | Before diving into this advanced example, we suggest going over the [basic example](./using-bodhi.js-to-deploy-smart-contract-and-interact-with-it.md) first
9 | {% endhint %}
10 |
11 | The example is [here](https://github.com/AcalaNetwork/bodhi-examples/tree/master/batch-transactions).
--------------------------------------------------------------------------------
/special-features/special-features.md:
--------------------------------------------------------------------------------
1 | # Special features
2 |
3 | The following section showcases the special features available in the Acala EVM+, such as using a Polkadot wallet to interact with the EVM+ and much more.
4 |
--------------------------------------------------------------------------------
/special-features/using-bodhi.js-to-deploy-smart-contract-and-interact-with-it.md:
--------------------------------------------------------------------------------
1 | # Using polkadot wallet to interact with EVM+
2 |
3 | In traditional EVM world, usually the only way to interact with DApps is through Metamask. One cool feature that EVM+ provides is that users can also use polkadot wallets.
4 |
5 | Check out the [basic example](https://github.com/AcalaNetwork/bodhi-examples/tree/master/deploy-contract) on how to sign Acala EVM+ transactions with a Polkadot wallet with the [bodhi.js](https://github.com/AcalaNetwork/bodhi.js/tree/master/packages/bodhi#create-a-wallet) SDK.
6 |
--------------------------------------------------------------------------------
/tooling/chain-explorer.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Instructions on how to use the chain explorers of Acala EVM+
3 | ---
4 |
5 | # Chain explorer
6 | ## Polkadot.js app
7 |
8 | - [Acala](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Facala-rpc-0.aca-api.network#/explorer)
9 | - [Karura](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkarura-rpc-0.aca-api.network#/explorer)
10 | - [Local](https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/explorer)
11 | - [Mandala](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fmandala-tc9-rpc.aca-staging.network%2Fws#/explorer)
12 | - [Karura Testnet](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkarura-testnet.aca-staging.network%2Frpc%2Fkarura%2Fws#/explorer)
13 | - [Acala Testnet](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Facala-dev.aca-dev.network%2Frpc%2Fws#/explorer)
14 |
15 | Alternatively you can go to [https://polkadot.js.org/apps/#/explorer](https://polkadot.js.org/apps/#/explorer), and select the desired network from the top left corner's menu
16 |
17 | ## EVM chain explorer
18 |
19 | Blockscout is our first official EVM chain block explorer.
20 |
21 | - [Acala](https://blockscout.acala.network)
22 | - [Karura](https://blockscout.karura.network)
23 | - [Mandala](https://blockscout.mandala.aca-staging.network/)
24 | - [Karura Testnet](https://blockscout.karura-testnet.aca-staging.network/)
25 | - [Acala Testnet](https://blockscout.acala-dev.aca-dev.network/)
26 |
27 | ## Substrate chain explorer
28 |
29 | You can put your EVM transaction hash at the end of these link to get the details:
30 |
31 | - [Acala](https://acala.subscan.io)
32 | - [Karura](https://karura.subscan.io)
33 | - [Mandala](https://acala-testnet.subscan.io)
34 |
--------------------------------------------------------------------------------
/tooling/evm-playground/README.md:
--------------------------------------------------------------------------------
1 | # EVM playground
2 |
3 | {% hint style="warning" %}
4 | evm playground is a legacy UI to interact with EVM+, and is no longer under maintainance. Using toolings such as hardhat or remix is recommended. ([examples](../../examples/examples.md))
5 | {% endhint %}
6 |
7 | The EVM playground can be found here: [https://evm.acala.network/](https://evm.acala.network/)
8 |
9 |
--------------------------------------------------------------------------------
/tooling/evm-playground/deploy-smart-contracts.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Instructions on how to deploy a smart contract using EVM playgrounds
3 | ---
4 |
5 | # Deploy smart contracts
6 |
7 | {% hint style="info" %}
8 | This entry assumes that you have already [configured your Metamask](../metamask/connect-to-the-network.md) to connect to Acala EVM+.
9 | {% endhint %}
10 |
11 | To deploy a smart contract using [EVM playgrounds](https://evm.acala.network/), you need to compile your smart contract in your preferred development framework so that you have the ABI bundle available to upload.
12 |
13 | ## Upload the ABI bundle
14 |
15 | Open the [Upload tab](https://evm.acala.network/#/upload) in the EVM playgrounds. Here you can upload an ABI bundle of the smart contract that you want to deploy. This will allow you to use it to deploy the smart contract:
16 |
17 | .png>)
18 |
19 | 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.
20 |
21 | 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.
22 |
23 | .png>)
24 |
25 | 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.
26 |
27 | ## Deploy the smart contract
28 |
29 | Smart contracts can be deployed under the [Deploy tab](https://evm.acala.network/#/deploy) of the EVM playgrounds.
30 |
31 | The ABI bundles that you uploaded in the `Upload` tab can be seen here:
32 |
33 | .png>)
34 |
35 | 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.
36 |
37 | .png>)
38 |
39 | 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:
40 |
41 | .png>)
42 |
43 | The interface consists of the following components:
44 |
45 | * Button to connect to your EVM wallet (this is why connecting MetaMask to the EVM+ is a prerequisite for this entry)
46 | * Smart contract name, that can be changed, so you can deploy the same ABI bundle multiple times and easily differentiate between them
47 | * ABI bundle identifications
48 | * Fields to input the smart contract constructor parameters
49 | * Value field to determine wether to send some of the native currency with the deploy transaction
50 | * Fields to override the [`gas parameters`](../../network/gas-parameters.md)
51 | * `Deploy` button to deploy the smart contract once you are satisfied with the deployment parameters
52 |
53 | ### 1. Connect your EVM wallet
54 |
55 | 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.
56 |
57 | .png>)
58 |
59 | The selected account should be displayed at the top of the page now:
60 |
61 | .png>)
62 |
63 | ### 2. Update the required deployment parameters
64 |
65 | 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.
66 |
67 | .png>)
68 |
69 | Once the values are filled out and double checked, the smart contract is ready to be deployed.
70 |
71 | {% hint style="warning" %}
72 | 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 [block explorer](../chain-explorer.md).
73 | {% endhint %}
74 |
75 | ### 3. Deploy the smart contract
76 |
77 | 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:
78 |
79 | .png>)
80 |
81 | The deployed smart contract can now be seen in the `Execute` tab, which is [further explained](interacting-with-smart-contracts.md) in the next entry.
82 |
--------------------------------------------------------------------------------
/tooling/evm-playground/interacting-with-smart-contracts.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: >-
3 | Instructions on how to use EVM playgrounds to interact with smart contracts
4 | deployed on Acala EVM+.
5 | ---
6 |
7 | # Interacting with smart contracts
8 |
9 | You can use the [EVM playground](https://evm.acala.network/) in order to interact with smart contracts that have been deployed to the Acala EVM+.
10 |
11 | To do that, open [https://evm.acala.network/#/execute](https://evm.acala.network/#/execute):
12 |
13 | .png>)
14 |
15 | Select the **Add and Existing Contract** option, which will open the form to add an existing smart contract to the collection of the executable smart contracts. For the sake of the documentation, aUSD ERC20 smart contract will be added. You can get its address from the [ADDRESS utility](https://github.com/AcalaNetwork/predeploy-contracts/blob/master/contracts/utils/Address.sol) and the precompiled ABI of the smart contract within the [AcalaNetwork/predeploy-contracts](https://github.com/AcalaNetwork/predeploy-contracts) repository. Once you fill out the form you can click **Save** and the smart contract will be added to your collection.
16 |
17 |  (1).png>)
18 |
19 | {% hint style="info" %}
20 | In some rare cases, the collection page won't load after you save a new smart contract, so you need to refresh the page.
21 | {% endhint %}
22 |
23 | Once you locate your newly saved smart contracts to the executable smart contracts collection, you can interact with it by pressing the **Execute** button below its address.
24 |
25 | 
26 |
27 | If you are using the EVM Playground for the first time you will need to connect your MetaMask to it in order to be able to use it. To connect your MetaMask, click the **Connect to MetaMask** button, which will prompt the MetaMask to open and you can select the desired account that you want to connect with the EVM Playgrounds.
28 |
29 | 
30 |
31 | Once your MetaMask is connected to the EVM Playgrounds, you can interact with the smart contract, by selecting the function that you would like to call from the **Message to Send** dropdown menu and filling out the required parameters (if there are any). Once you are satisfied with the call and the values passed to it, you can press the **Call** button, which will initiate the transaction.
32 |
33 | 
34 |
--------------------------------------------------------------------------------
/tooling/faucet.md:
--------------------------------------------------------------------------------
1 | # Faucet
2 |
3 | The Mandala faucet is located in the [#acala-testnet-faucet channel on Discord](https://discord.gg/5JJgXKSznc). Send a `!drip` command with your Mandala address to receive testnet ACA, DOT, KSM and LKSM.
4 |
--------------------------------------------------------------------------------
/tooling/metamask/README.md:
--------------------------------------------------------------------------------
1 | # MetaMask
2 |
3 | MetaMask or any similar EVM wallet can be used to interact with the Acala EVM+. The next pages illustrate how you can connect to a network that has Acala EVM+ and how you can initiate transactions with it as well as how you can interact with the smart contracts deployed on it.
4 |
--------------------------------------------------------------------------------
/tooling/metamask/connect-to-the-network.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: >-
3 | Instructions on how to connect MetaMask to Mandala EVM+ in order to interact
4 | with the smart contracts deployed on it.
5 | ---
6 |
7 | # Connect to the network
8 |
9 | You can add the network to the MetaMask using the [Chainlist service](https://chainlist.org/?search=acala) or follow the instructions on how to add the network manually.
10 |
11 | ## Automated process
12 |
13 | Follow the link to the network you are trying to add, connect your wallet and the network will be added to your wallet.
14 |
15 | {% embed url="https://chainlist.org/chain/595" %}
16 | Automated process of adding the Mandala EVM+ network to your wallet
17 | {% endembed %}
18 |
19 | {% embed url="https://chainlist.org/chain/686" %}
20 | Automated process of adding the Karura EVM+ network to your wallet
21 | {% endembed %}
22 |
23 | {% embed url="https://chainlist.org/chain/787" %}
24 | Automated process of adding the Acala EVM+ network to your wallet
25 | {% endembed %}
26 |
27 | ## Manual process
28 |
29 | {% hint style="info" %}
30 | NOTE: The manual process example connects to the Mandala EVM+. For other networks can substitute the values with any of the values provided at the [network configuration](../../network/network-configuration.md) section.
31 | {% endhint %}
32 |
33 | In order to be able to interact with the Acala EVM+ in Mandala TC9, you first need to navigate to the **Add network** section of the MetaMask. You can find it at the bottom of the list of available networks after clicking on the currently active network.
34 |
35 | 
36 |
37 | This should open up a form to add a new network to your MetaMask (you might have to unlock MetaMask before it opens). Once the form is opened, use the following information to add the Mandala TC9 network.
38 |
--------------------------------------------------------------------------------
/tooling/metamask/simple-transactions.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Example on how to transfer ACA using MetaMask.
3 | ---
4 |
5 | # Simple transactions
6 |
7 | MetaMask can be used to transfer ACA in the same manner, you would transfer Ether in Ethereum network:
8 |
9 | 1. Open and unlock the MetaMask
10 | 2. Click on **Send** option
11 | 3. Paste the EVM account address that you want to send the ACA to and input the amount of ACA you want to send and click **Next**
12 | 4. Verify that the transaction data is correct and click **Confirm**
13 | 5. You are done! The ACA has been sent to the desired address
14 |
15 | .png>)
16 |
17 |
18 | {% hint style="info" %}
19 | before sending any transaction, please don't change the default `gasPrice` or `GasLimit`, otherwise transaction will fail. ([why?](../../miscellaneous/FAQs.md#why-tx-failed-after-i-manually-changed-gas-params-in-metamask))
20 | {% endhint %}
21 |
22 | {% hint style="info" %}
23 | if we are using local mandala, everytime we restart the local mandala node, we need to reset metamask for local network, so the nonce and cache will be cleared: `settings => advanced => reset account`. ([why?](../../miscellaneous/FAQs.md#why-metamask-tx-doesnt-confirm-with-local-mandala))
24 | {% endhint %}
25 |
--------------------------------------------------------------------------------
/tooling/remix-ide/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Introduction into using Remix IDE with Acala EVM+.
3 | ---
4 |
5 | # Remix IDE
6 |
7 | You can use the [Remix IDE](https://remix.ethereum.org/), online smart contract development IDE, to deploy and interact with your smart contracts on Acala EVM+. Prerequisite for using Remix with Acala EVM+ is that you have your MetaMask wallet connected to the network. If you haven't done it yet, you can follow the [MetaMask setup guide](../metamask/).
8 |
9 | ## Connecting Remix IDE to MetaMask
10 |
11 | To connect the Remix IDE to your MetaMask, and subsequently to the Acala EVM+, you have to first go to [Remix IDE](https://remix.ethereum.org/) and open the `Deploy & run transactions` tab.
12 |
13 | {% hint style="info" %}
14 | The `Deploy & run transactions` tab is represented by  icon.
15 | {% endhint %}
16 |
17 | Once the tab opens, locate the `Environment menu` and select the `Injected Web3` option.
18 |
19 | 
20 |
21 | As you select the `Injected Web3` option, MetaMask window should pop up and prompt you to select accounts that you want to connect to Remix IDE.
22 |
23 | 
24 |
25 | The second screen should provide which information is received by Remix and you can finally connect the two. Once you do, the account should appear in the side `Deploy & run transactions` menu, as well as it's balance.
26 |
27 | 
28 |
29 | Now that we are ready to use the Remix IDE, we can take a look on how to interact with the smart contracts that are already deployed on the network and how to deploy our own.
30 |
--------------------------------------------------------------------------------
/tooling/remix-ide/deploying-a-smart-contract.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Walk through on deploying a smart contract to Acala EVM+ using Remix IDE.
3 | ---
4 |
5 | # Deploying a smart contract
6 |
7 | Assuming you have already connected Remix IDE to MetaMask and added the `Echo` smart contract from the [`Interacting with the deployed smart contracts`](interacting-with-the-deployed-smart-contracts.md) walk through, we can take a look at how to deploy the `Echo` smart contract using Remix IDE.
8 |
9 | {% hint style="info" %}
10 | This walk through focuses on specifics of deploying a smart contract to Acala EVM+ using Remix IDE. If you wish to learn more about deploying smart contracts using Remix IDE, please refer to the [official documentation](https://remix-ide.readthedocs.io/en/latest/create\_deploy.html#deploy-the-contract).
11 | {% endhint %}
12 |
13 | You should see a `scripts` folder under your `File explorers` section. We will be modifying the `deploy_ethers.js` in this walk through.
14 |
15 |
16 |
17 | As the example smart contract is called `Echo`, we have to modify the 6th line in the file, so that the value of `contractName` variable is `'Echo'`.
18 |
19 | ```javascript
20 | const contractName = 'Echo'
21 | ```
22 |
23 | This finishes up the modifications we need to do to the `deploy_ethers.js` file. We are now able to run the script, by option-clicking on it in the `File explorers` menu and selecting the `Run` option. This will open a MetaMask prompt, where we have to confirm the deploy transaction.
24 |
25 | 
26 |
27 | After the deployment transaction is included in a block, we can start interacting with our newly deployed smart contract, just like we did in the `Interacting with the deployed smart contracts` walk through.
28 |
--------------------------------------------------------------------------------
/tooling/remix-ide/interacting-with-the-deployed-smart-contracts.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Walk through on how to interact with an already deployed smart contract.
3 | ---
4 |
5 | # Interacting with the deployed smart contracts
6 |
7 | Now that Remix IDE is connected to the Mandala test network, we can interact with the smart contracts deployed on it. As you complete the setting up, you can take a look at the `File explorers` section. It should already include folders named `contracts`, `scripts` and `tests`, as well as `REAMDE.txt`.
8 |
9 | {% hint style="info" %}
10 | File explorers section is represented by the icon.
11 | {% endhint %}
12 |
13 | We can use a very simple smart contract that is further explained in the tutorials section and is already deployed on the Mandala TC9 network. The smart contract is called Echo and it has one function that stores a value passed to it in a public variable, which we are able to get using it's getter function. In order to use Remix IDE to interact with it, we need to add it into the `contracts` folder. We do this by option-clicking onto the folder and selecting `New file` option. the file should be named `Echo.sol`. You can now copy-paste the following code into the file:
14 |
15 | {% code title="Echo.sol" %}
16 | ```solidity
17 | pragma solidity =0.8.9;
18 |
19 | contract Echo{
20 | string public echo;
21 | uint echoCount;
22 |
23 | event NewEcho(string message, uint count);
24 |
25 | constructor() {
26 | echo = "Deployed successfully!";
27 | }
28 |
29 | function scream(string memory message) public returns(string memory){
30 | echo = message;
31 | echoCount += 1;
32 | emit NewEcho(message, echoCount);
33 | return message;
34 | }
35 | }
36 | ```
37 | {% endcode %}
38 |
39 | Once you save the file, the Remix IDE built-in compiler will run and compile the smart contract. If the compilation fails (you can see that by a red error indicator appearing over the Solidity compiler section ), you might have to manually set the compiler version to `0.8.9.`
40 |
41 | 
42 |
43 | As the smart contract compiles as expected, we need to point to the address to which it is deployed to. There is an instance deployed at `0x87c8Dc09548195A3B1222ab5c3905c01595D5516`, so you can use this one. To use it, navigate to `Deploy & run transactions` tab and paste the address into the `At Address` section.
44 |
45 | {% hint style="info" %}
46 | The Deploy & run transactions is represented by icon.
47 | {% endhint %}
48 |
49 | 
50 |
51 | Once you click on the `At Address` button, you should see `ECHO` in the `Deployed contracts` section.
52 |
53 | 
54 |
55 | Once you expand the view, you can interact with the smart contract. If you select the `echo` getter, there will be no MetaMask confirmation needed, as no transaction is executed. If you select scream, then you should pass a string to it within the `""` and confirm the transaction in MetaMask as the prompt appears.
56 |
--------------------------------------------------------------------------------
/tooling/rpc-adapter/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: What is it and how to use it to debug your project
3 | ---
4 |
5 | # RPC adapter
6 |
7 | Many of the EVM tools rely on [JSON-RPC](https://ethereum.github.io/execution-apis/api-documentation/) to communicate with the chain. Acala chain node doesn't provide these RPCs out of the box, so we implemented the EVM+ RPC Adapter, which is a service that wrap substrate RPC calls to provide these ETH JSON-RPCs. As a result, existing Ethereum dApp and tools can interact with EVM+ with minumum changes.
8 |
9 | For more information, checkout [eth rpc adapter docs](https://github.com/AcalaNetwork/bodhi.js/tree/master/packages/eth-rpc-adapter#acala-networketh-rpc-adapter).
--------------------------------------------------------------------------------
/tooling/tooling.md:
--------------------------------------------------------------------------------
1 | # Tooling
2 |
3 | The following pages require information about tooling available to the developers developing on Acala EVM+.
4 |
--------------------------------------------------------------------------------