logoDeveloper Hub

Interacting with Precompiles

Interact with native Subnet-EVM precompiles

Available Subnet-EVM Precompiles

Below are listed out the default Subnet-EVM precompile interfaces.

Interacting with Precompiles

If a precompile is enabled within the genesis.json using the respective ConfigKey we can interact with the precompile using Foundry or other tools such as Remix. Below are listed out the addresses and ConfigKey of default precompiles we can enable in Subnet-EVM. The address and ConfigKey are defined in the module.go of each precompile contract.

PrecompileConfigKeyAddress
Deployer Allow ListcontractDeployerAllowListConfig0x0200000000000000000000000000000000000000
Native MintercontractNativeMinterConfig0x0200000000000000000000000000000000000001
Transaction Allow ListtxAllowListConfig0x0200000000000000000000000000000000000002
Fee ManagerfeeManagerConfig0x0200000000000000000000000000000000000003
Reward ManagerrewardManagerConfig0x0200000000000000000000000000000000000004
Warp MessengerwarpConfig0x0200000000000000000000000000000000000005

For example, if contractDeployerAllowListConfig is enabled in the genesis.json:

genesis.json
 "contractDeployerAllowListConfig": {
      "adminAddresses": [ // Addresses that can manage (add/remove) enabled addresses. They are also enabled themselves for contract deployment.
        "0x4f9e12d407b18ad1e96e4f139ef1c144f4058a4e",
        "0x4b9e5977a46307dd93674762f9ddbe94fb054def"
      ],
      "blockTimestamp": 0,
      "enabledAddresses": [
        "0x09c6fa19dd5d41ec6d0f4ca6f923ec3d941cc569" // Addresses that can only deploy contracts 
      ]
    },

We can then add an Enabled address to the Deployer Allow List by interacting with the IAllowList interface at 0x0200000000000000000000000000000000000000

cast send 0x0200000000000000000000000000000000000000 setEnabled(address addr) <ADDRESS_TO_ENABLE> --rpc-url $MY_L1_RPC --private-key $ADMIN_PRIVATE_KEY

Last updated on

On this page

Edit on Github