Overview¶
Precompiles Contracts in Ethereum are built-in contracts that offer specific functionalities. They are implemented within the Ethereum Virtual Machine (EVM) and can be executed by sending a transaction to their unique addresses. Typically, precompiles are utilized for computationally expensive operations like cryptographic functions (e.g., SHA-256, elliptic curve operations) and modular exponentiation. These precompiles are optimized and often more efficient than implementing the same functionalities in Solidity or other smart contract languages.
Darwinia strives to achieve compatibility with Ethereum, which includes being RPC compatible. Additionally, compatibility with Ethereum precompiles is also important. All Darwinia networks have integrated the standard Ethereum precompiles, making it easier for existing Ethereum applications to transition to the Darwinia network without any modifications. In addition to the standard precompiles, Darwinia has also installed other precompiles such as StateStorage
, Dispatch
. considering the unique architecture of Darwinia chains. This chapter will guide you through the design and usage of precompile contracts in Darwinia.
Precompiles In Darwinia Networks¶
In the comprehensive Darwinia Ecosystem, each network serves a distinct purpose, resulting in the installation of different precompiles on each network. It is possible that a particular network requires a unique precompile to execute specific actions, while it is unnecessary and would introduce unnecessary overhead in other networks. To address this, it is crucial to provide a precompile list for each network. If you are unfamiliar with the relationship between these networks, please refer to this answer for more information.
Darwinia Network¶
Precompile Address | Name |
---|---|
0x0000000000000000000000000000000000000001 ~ 0x0000000000000000000000000000000000000009 |
Ethereum |
0x0000000000000000000000000000000000000400 |
StateStorage |
0x0000000000000000000000000000000000000401 |
Dispatch |
0x0000000000000000000000000000000000000402 |
Commitment Token |
0x0000000000000000000000000000000000000403 |
USDT |
0x0000000000000000000000000000000000000404 |
PINK |
Crab Network¶
Precompile Address | Name |
---|---|
0x0000000000000000000000000000000000000001 ~ 0x0000000000000000000000000000000000000009 |
Ethereum |
0x0000000000000000000000000000000000000400 |
StateStorage |
0x0000000000000000000000000000000000000401 |
Dispatch |
0x0000000000000000000000000000000000000402 |
Commitment Token |
0x0000000000000000000000000000000000000602 |
Conviction Voting |
Koi Testnet¶
Precompile Address | Name |
---|---|
0x0000000000000000000000000000000000000001 ~ 0x0000000000000000000000000000000000000009 |
Ethereum |
0x0000000000000000000000000000000000000400 |
StateStorage |
0x0000000000000000000000000000000000000401 |
Dispatch |
0x0000000000000000000000000000000000000402 |
Commitment Token |
0x0000000000000000000000000000000000000403 |
USDT |
0x0000000000000000000000000000000000000602 |
Conviction Voting |