logo

Builtin Precompiles

Darwinia Network

0x0000000000000000000000000000000000000001
ECRecover
0x0000000000000000000000000000000000000002
Sha256
0x0000000000000000000000000000000000000003
Ripemd160
0x0000000000000000000000000000000000000004
Identity
0x0000000000000000000000000000000000000005
Modexp
0x0000000000000000000000000000000000000006
Bn128Add
0x0000000000000000000000000000000000000007
Bn128Mul
0x0000000000000000000000000000000000000008
Bn128Pairing
0x0000000000000000000000000000000000000009
Blake2F
0x0000000000000000000000000000000000000400
StateStorage
0x0000000000000000000000000000000000000401
Dispatch
0x0000000000000000000000000000000000000402
KTON Asset
0x0000000000000000000000000000000000000600
Deposit
0x0000000000000000000000000000000000000601
Stake
0x0000000000000000000000000000000000000800
BLS12-381

Crab Network

0x0000000000000000000000000000000000000001
ECRecover
0x0000000000000000000000000000000000000002
Sha256
0x0000000000000000000000000000000000000003
Ripemd160
0x0000000000000000000000000000000000000004
Identity
0x0000000000000000000000000000000000000005
Modexp
0x0000000000000000000000000000000000000006
Bn128Add
0x0000000000000000000000000000000000000007
Bn128Mul
0x0000000000000000000000000000000000000008
Bn128Pairing
0x0000000000000000000000000000000000000009
Blake2F
0x0000000000000000000000000000000000000400
StateStorage
0x0000000000000000000000000000000000000401
Dispatch
0x0000000000000000000000000000000000000402
KTON Asset
0x0000000000000000000000000000000000000600
Deposit
0x0000000000000000000000000000000000000601
Stake
0x0000000000000000000000000000000000000800
BLS12-381

Pangoro Network

0x0000000000000000000000000000000000000001
ECRecover
0x0000000000000000000000000000000000000002
Sha256
0x0000000000000000000000000000000000000003
Ripemd160
0x0000000000000000000000000000000000000004
Identity
0x0000000000000000000000000000000000000005
Modexp
0x0000000000000000000000000000000000000006
Bn128Add
0x0000000000000000000000000000000000000007
Bn128Mul
0x0000000000000000000000000000000000000008
Bn128Pairing
0x0000000000000000000000000000000000000009
Blake2F
0x0000000000000000000000000000000000000400
StateStorage
0x0000000000000000000000000000000000000401
Dispatch
0x0000000000000000000000000000000000000402
KTON Asset
0x0000000000000000000000000000000000000600
Deposit
0x0000000000000000000000000000000000000601
Stake
0x0000000000000000000000000000000000000800
BLS12-381

Pangolin Network

0x0000000000000000000000000000000000000001
ECRecover
0x0000000000000000000000000000000000000002
Sha256
0x0000000000000000000000000000000000000003
Ripemd160
0x0000000000000000000000000000000000000004
Identity
0x0000000000000000000000000000000000000005
Modexp
0x0000000000000000000000000000000000000006
Bn128Add
0x0000000000000000000000000000000000000007
Bn128Mul
0x0000000000000000000000000000000000000008
Bn128Pairing
0x0000000000000000000000000000000000000009
Blake2F
0x0000000000000000000000000000000000000400
StateStorage
0x0000000000000000000000000000000000000401
Dispatch
0x0000000000000000000000000000000000000402
KTON Asset
0x0000000000000000000000000000000000000600
Deposit
0x0000000000000000000000000000000000000601
Stake
0x0000000000000000000000000000000000000800
BLS12-381

Precompiles

Ethereum Compatible

  • 0x0000000000000000000000000000000000000001: ECRecover
  • 0x0000000000000000000000000000000000000002: Sha256
  • 0x0000000000000000000000000000000000000003: Ripemd160
  • 0x0000000000000000000000000000000000000004: Identity
  • 0x0000000000000000000000000000000000000005: Modexp
  • 0x0000000000000000000000000000000000000006: Bn128Add
  • 0x0000000000000000000000000000000000000007: Bn128Mul
  • 0x0000000000000000000000000000000000000008: Bn128Pairing
  • 0x0000000000000000000000000000000000000009: Blake2F

Darwinia Dedicated

  • 0x0000000000000000000000000000000000000400: StateStorage
    • Retrieve the raw storage value from Substrate modules using the raw storage key.
    • Function Signature: state_storage(bytes)
    • Input:
      • bytes: The raw storage key
    • Output:
      • Returns the raw storage value under the given storage key, empty if there is no storage.
  • 0x0000000000000000000000000000000000000401: Dispatch
    • Dispatch the substrate dispatch calls via the solidity interface.
    • Function Signature: (bytes)
    • Input:
      • bytes: The scale encoded substrate dispatch call
    • Output:
      • Returns an empty array on success, otherwise, an error.
  • 0x0000000000000000000000000000000000000402: KTON Asset
    • This is fully compatible with the Ethereum ERC20 protocol interfaces.
  • 0x0000000000000000000000000000000000000600: Deposit
    • Interact with the Darwinia deposit module via the solidity interface.
    • Functions:
      • Lock native token
        • Function Signature: lock(uint256,uint8)
        • Input:
          • amount, the locked RING amount
          • month, 1 ~ 36
        • Output:
          • bool, return true if success, otherwise false.
      • Claim locked native token
        • Function Signature:claim()
        • Output:
          • bool, return true if success, otherwise false.
      • Claim locked deposit items early.
        • Function Signature: claim_with_penalty(uint8)
        • Input:
          • id, the deposit id
        • Output:
          • bool, return true if success, otherwise false.
  • 0x0000000000000000000000000000000000000601 Stake
    • Interact with the Darwinia stake module via the solidity interface.
    • Functions:
      • Stake tokens and deposit item
        • Function Signature: stake(uint256,uint256,uint8[])
        • Input:
          • ring_amount, the stake RING amount
          • kton_amount, the stake KTON amount
          • Vec<DepositId>, the deposit id list
        • Output:
          • bool, return true if success, otherwise false.
      • Restake the unstaking assets
        • Function Signature: restake(uint256,uint256,uint8[])
        • Input:
          • ring_amount, the stake RING amount
          • kton_amount, the stake KTON amount
          • Vec<DepositId>, the deposit ids list
        • Output:
          • bool, return true if success, otherwise false.
      • Withdraw the locked assets
        • Function Signature:unstake(uint256,uint256,uint8[])
        • Input:
          • ring_amount, the unstake RING amount
          • kton_amountthe unstake KTON amount
          • Vec<DepositId>, the deposit id list
        • Output:
          • bool, return true if success, otherwise false
      • Claim the stakes assets
        • Function Signature: claim()
        • Output:
          • bool, return true if success, otherwise false.
      • Declare the desire to collect
        • Function Signature:collect(uint32)
        • Input:
          • commission, collator commission, 0 ~ 100
        • Output:
          • bool, return true if success, otherwise false.
      • Declare the desire to nominate a collator.
        • Function Signature:nominate(address)
        • Input:
          • target, the target collator address.
        • Output:
          • bool, return true if success, otherwise false.
      • Declare no desire to either collect or nominate.
        • Function Signature: chill()
        • Output:
          • bool, return true if success, otherwise false.
  • 0x0000000000000000000000000000000000000800 BLS12-381
    • Verifies an AggregateSignature against an AggregatePublicKey.
    • Function Signature: fast_aggregate_verify(bytes[],bytes,bytes)
    • Input
      • bytes[], the pubkeys
      • bytes, the message
      • bytes, the signature
    • Output
      • bool, return true if success, otherwise false.