0x を動かしてみた (その5)
0x を動かしてみた (その5)
0x Protocol の内部データなどを記載してみました
0x order format
address makerAddress; // Address that created the order.
address takerAddress; // Address that is allowed to fill the order. If set to 0, any address is allowed to fill the order.
address feeRecipientAddress; // Address that will recieve fees when order is filled.
address senderAddress; // Address that is allowed to call Exchange contract methods that affect this order. If set to 0, any address is allowed to call these methods.
uint256 makerAssetAmount; // Amount of makerAsset being offered by maker. Must be greater than 0.
uint256 takerAssetAmount; // Amount of takerAsset being bid on by maker. Must be greater than 0.
uint256 makerFee; // Amount of ZRX paid to feeRecipient by maker when order is filled. If set to 0, no transfer of ZRX from maker to feeRecipient will be attempted.
uint256 takerFee; // Amount of ZRX paid to feeRecipient by taker when order is filled. If set to 0, no transfer of ZRX from taker to feeRecipient will be attempted.
uint256 expirationTimeSeconds; // Timestamp in seconds at which order expires.
uint256 salt; // Arbitrary number to facilitate uniqueness of the order's hash.
bytes makerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring makerAsset. The last byte references the id of this proxy.
bytes takerAssetData; // Encoded data that can be decoded by a specified proxy contract when transferring takerAsset. The last byte references the id of this proxy.
0x Order Status
INVALID // Default value
INVALID_MAKER_ASSET_AMOUNT // Order does not have a valid maker asset amount
INVALID_TAKER_ASSET_AMOUNT // Order does not have a valid taker asset amount
FULLY_FILLED // Order is fully filled
EXPIRED // Order has already expired
CANCELLED // Order has been cancelled
FILLABLE // Order is fillable
0x Order Info
uint8 orderStatus; // Status that describes order's validity and fillability.
bytes32 orderHash; // EIP712 hash of the order
uint256 orderTakerAssetFilledAmount; // Amount of order that has already been filled.
0x Library
0x.js: A library for interacting with the 0x protocol.
@0x/connect: An http & websocket client.
@0x/contract-wrappers: Typescript/Javascript wrappers of the 0x protocol Ethereum smart contracts.
@0x/order-utils: A set of utils for working with 0x orders.
@0x/order-watcher: A daemon that watches a set of 0x orders and emits events when an order's fillability has changed.
@0x/contract-addresses A tiny utility library for getting known deployed contract addresses for a particular network.
@0x/contract-artifacts Smart contract compilation artifacts for the latest version of the 0x Protocol.
@0x/contracts 0x protocol solidity smart contracts & tests
@0x/subproviders: A collection of subproviders to use with web3-provider-engine.
@0x/web3-wrapper: A raw Ethereum JSON RPC client to simplify interfacing with Ethereum nodes.
@0x/abi-gen-wrappers Low-level 0x smart contract wrappers
0x Contract Address
mainnet(1)
erc20Proxy: '0x2240dab907db71e64d3e0dba4800c83b5c502d4e'
erc721Proxy: '0x208e41fb445f1bb1b6780d58356e81405f3e6127'
zrxToken: '0xe41d2489571d322189246dafa5ebde1f4699f498'
etherToken: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
exchange: '0x4f833a24e1f95d70f028921e27040ca56e09ab0b'
assetProxyOwner:'0x17992e4ffb22730138e4b62aaa6367fa9d3699a6'
forwarder: '0x7afc2d5107af94c462a194d2c21b5bdd238709d6'
orderValidator: '0x9463e518dea6810309563c81d5266c1b1d149138'
ropsten(3)
erc20Proxy: '0xb1408f4c245a23c31b98d2c626777d4c0d766caa'
erc721Proxy: '0xe654aac058bfbf9f83fcaee7793311dd82f6ddb4'
zrxToken: '0xff67881f8d12f372d91baae9752eb3631ff0ed00'
etherToken: '0xc778417e063141139fce010982780140aa0cd5ab'
exchange: '0x4530c0483a1633c7a1c97d2c53721caff2caaaaf'
assetProxyOwner:'0xf5fa5b5fed2727a0e44ac67f6772e97977aa358b'
forwarder: '0x3983e204b12b3c02fb0638caf2cd406a62e0ead3'
orderValidator: '0x90431a90516ab49af23a0530e04e8c7836e7122f'
kovan(42)
erc20Proxy: '0xf1ec01d6236d3cd881a0bf0130ea25fe4234003e'
erc721Proxy: '0x2a9127c745688a165106c11cd4d647d2220af821'
zrxToken: '0x2002d3812f58e35f0ea1ffbf80a75a38c32175fa'
etherToken: '0xd0a1e359811322d97991e03f863a0c30c2cf029c'
exchange: '0x35dd2932454449b14cee11a94d3674a936d5d7b2'
assetProxyOwner:'0x2c824d2882baa668e0d5202b1e7f2922278703f8'
forwarder: '0xd85e2fa7e7e252b27b01bf0d65c946959d2f45b8'
orderValidator: '0xb389da3d204b412df2f75c6afb3d0a7ce0bc283d'
Ganache(50) [0x-starter-project]
erc20Proxy: '0x1dc4c1cefef38a777b15aa20260a54e584b16c48'
erc721Proxy: '0x1d7022f5b17d2f8b695918fb48fa1089c9f85401'
zrxToken: '0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c'
etherToken: '0x0b1ba0af832d7c05fd64161e0db78e85978e8082'
exchange: '0x48bacb9266a570d521063ef5dd96e61686dbe788'
assetProxyOwner:'0x34d402f14d58e001d8efbe6585051bf9706aa064'
forwarder: '0xb69e673309512a9d726f87304c6984054f87a93b'
orderValidator: '0xe86bb98fcf9bff3512c74589b78fb168200cc546'
0x Standard Relayer API:
https://api.relayer.com/sra/v2
/asset_pairs
/orders
/order/[orderHash]
/orderbook
/order_config
/fee_recipients
/order
wss://api.relayer.com/sra/v2
本記事にて「0xを動かしてみた」シリーズは一旦おしまいとなります