Precompiles
A precompile is a common functionality used in smart contracts that has been compiled in advance, so Ethereum nodes can run it more efficiently. From a contract's perspective, this is a single command like an opcode.
The Frontier EVM used on Astar network provides several useful precompiled contracts. These contracts are implemented in our ecosystem as a native implementation. The precompiled contracts 0x01
through 0x08
are the same as those in Ethereum (see list below). Additionally, Astar implements precompiled contracts starting from 0x5001
, that support new Astar features.
Ethereum Native Precompiles
Precompile | Address |
---|---|
ECRecover | 0x0000000000000000000000000000000000000001 |
Sha256 | 0x0000000000000000000000000000000000000002 |
Ripemd160 | 0x0000000000000000000000000000000000000003 |
Identity | 0x0000000000000000000000000000000000000004 |
Modexp | 0x0000000000000000000000000000000000000005 |
Bn128Add | 0x0000000000000000000000000000000000000006 |
Bn128Mul | 0x0000000000000000000000000000000000000007 |
Bn128Pairing | 0x0000000000000000000000000000000000000008 |