Precompiled and predeployed smart contracts
Section detailing the precompiled and predeployed smart contracts of the Acala EVM/.
One of the great features of Acala EVM+ is the precompiled and the predeployed smart contracts.

Precompiled smart contracts

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.
To add them to your project simply use:
1
yarn add --dev @acala-network/contracts
Copied!
Once you add the dependency to the project you can simply import the contracts included in it like this:
1
import "@acala-network/contracts/token/Token.sol";
Copied!
And to use the precompiled smart contract within your script use the:
1
const TokenContract = require("@acala-network/contracts/build/contracts/Token.json");
Copied!
For more information about how to use the precompiled smart contracts of the Acala EVM+ and how to interact with the predeployed smart contracts, please refer to Hardhat, Truffle or Waffle tutorials.

Predeployed smart contracts

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.

ADDRESS utility

The @acala-network/contracts dependency contains the ADDRESS 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.
To use the utility within your smart contract simply import it using:
1
import "@acala-network/contracts/utils/Address.sol";
Copied!
Make sure to set the inheritance of your contract to be able to interact with the ADDRESS utility:
1
contract YourContract is ADDRESS {
2
3
}
Copied!
To get the address of the DEX predeployed smart contract you can now simply use:
1
ADDRESS.DEX
Copied!
If you want to refer to the addresses of the predeployed smart contracts, take a look at the following pages.