On chain Data Structure

ERC20: Order structure

{
    "maker": "0x05182E579FDfCf69E4390c3411D8FeA1fb6467cf",
    "taker": "0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57",
    "nonceAndMeta": "7433034152904838547212883274543254857465784035140417181410394112",
    "expiry": 0,
    "makerAsset": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
    "takerAsset": "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",
    "makerAmount": "10000000000000000",
    "takerAmount": "7775870000000000",
    "signature": "0x43de8dbc8228594171d0ed3e623ca0ab5c24f46bf0575800624ae56723712f807ecaf7dc8edfcf0d4517f80f11bf016bde0a9a20e243eea2bb32e55eadbb6b0d1b" 
}
  • maker: address of owner of the order. (The user or contract who want to swap makerAsset to takerAsset).

  • taker: address that can fulfilled this order on chain.

    • taker == 0: anybody can fill the order

    • taker != 0: during the execution we will verify that msg.sender == taker. (taker needs to be the contract or user who fill an order).

  • nonceAndMeta: This field combine nonce value (guarantee uniqueness of the order) and some meta data

  • expiry: expiry timestamp in seconds. Can also be set 0 for an order that never expires

  • makerAsset: address of ERC20 token that maker want to sell to the taker.

  • takerAsset: address of ERC20 token that maker want to buy from the taker.

  • makerAmount: amount of makerAsset that maker want to swap to taker.

  • takerAmount: amount of makerAsset that maker want to swap to taker.

  • signature: EIP712 Signature of a JSON Object with all above fields signed with the private key of maker.

ERC 20/721/1155: Order structure

Token type encoding

  • maker: address of owner of the order. (The user or contract who want to swap makerAsset to takerAsset).

  • taker: address that can fulfilled this order on chain.

    • taker == 0: anybody can fill the order

    • taker != 0: during the execution we will verify that msg.sender == taker. (taker needs to be the contract or user who fill an order).

  • nonceAndMeta: This field combine nonce value (guarantee uniqueness of the order) and some meta data

  • expiry: expiry timestamp in seconds. Can also be set 0 for an order that never expires

  • makerAsset: Packed field containing address of an ERC20/721/1155 token that maker want to sell to the taker (between 0-19 bits). Token type encoded as show above on 20-21 bits.

  • makerAssetId: ignored for ERC20. For ERC/721/1155 the maker token.

  • takerAsset: Packed field containing address of an ERC20/721/1155 token that maker want to sell to the taker (between 0-19 bits). Token type encoded as show above on 20-21 bits.

  • makerAssetId: ignored for ERC20. For ERC/721/1155 the taker token.

  • makerAmount: amount of makerAsset (at id makerAssetId for ERC/721/1155) that maker want to swap to taker.

  • takerAmount: amount of takerAsset (at id takerAssetId for ERC/721/1155) that maker want to swap to taker.

  • signature: EIP712 Signature of a JSON Object with all above fields signed with the private key of maker.

Last updated