What are Precompiles?
Precompiles or Precompiled contracts are a unique category of smart contracts who functionariy incorporated directly into the EVM instead of executing as bytecode, each assigned a specific address. The gas fees for executing these contracts are predetermined. In Berachain, this is primarily used to enable deeper functionality on the chain that interacts directly with various Cosmos modules that otherwise would be inaccessible outside the EVM.
Examples
Ethereum Shanghai EVM Codes Precompiled
Address | Name | Minimum Gas | Input | Output | Description |
---|---|---|---|---|---|
0x02 | SHA2-256 | 60 | data | hash | Hash function |
Address | Name | Minimum Gas | Input | Output | Description |
---|---|---|---|---|---|
0x4381dC2aB14285160c808659aEe005D51255adD7 | Bank Contract | ~ | send(address , Cosmos.Coin[] ) | boolean | Transfers/balances to Cosmos SDK Bank Module. |
Berachain Precompiles
Berachain precompiles adopt some of Polaris' EVM precompile contracts while adding some additional ones for more functionality.
These precompiled contracts aid in the functionality of Proof-of-liquity and more, in the form of a native BEX, native oracle, governance, and more.
To see the full list of precomiled contracts, see Precompiles & Deployment Addresses.