2571 lines
212 KiB
JSON
2571 lines
212 KiB
JSON
{
|
|
"schemaVersion": "2.0.0",
|
|
"contractName": "INativeOrdersFeature",
|
|
"compilerOutput": {
|
|
"abi": [
|
|
{
|
|
"anonymous": false,
|
|
"inputs": [
|
|
{
|
|
"indexed": false,
|
|
"internalType": "bytes32",
|
|
"name": "orderHash",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address",
|
|
"name": "feeRecipient",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFilledAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "uint128",
|
|
"name": "makerTokenFilledAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFeeFilledAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "uint256",
|
|
"name": "protocolFeePaid",
|
|
"type": "uint256"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"name": "LimitOrderFilled",
|
|
"type": "event"
|
|
},
|
|
{
|
|
"anonymous": false,
|
|
"inputs": [
|
|
{
|
|
"indexed": false,
|
|
"internalType": "bytes32",
|
|
"name": "orderHash",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
}
|
|
],
|
|
"name": "OrderCancelled",
|
|
"type": "event"
|
|
},
|
|
{
|
|
"anonymous": false,
|
|
"inputs": [
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "uint256",
|
|
"name": "minValidSalt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"name": "PairCancelledLimitOrders",
|
|
"type": "event"
|
|
},
|
|
{
|
|
"anonymous": false,
|
|
"inputs": [
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "uint256",
|
|
"name": "minValidSalt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"name": "PairCancelledRfqOrders",
|
|
"type": "event"
|
|
},
|
|
{
|
|
"anonymous": false,
|
|
"inputs": [
|
|
{
|
|
"indexed": false,
|
|
"internalType": "bytes32",
|
|
"name": "orderHash",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFilledAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "uint128",
|
|
"name": "makerTokenFilledAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"name": "RfqOrderFilled",
|
|
"type": "event"
|
|
},
|
|
{
|
|
"anonymous": false,
|
|
"inputs": [
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address",
|
|
"name": "origin",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "address[]",
|
|
"name": "addrs",
|
|
"type": "address[]"
|
|
},
|
|
{
|
|
"indexed": false,
|
|
"internalType": "bool",
|
|
"name": "allowed",
|
|
"type": "bool"
|
|
}
|
|
],
|
|
"name": "RfqOrderOriginsAllowed",
|
|
"type": "event"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFeeAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "sender",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "feeRecipient",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.LimitOrder",
|
|
"name": "order",
|
|
"type": "tuple"
|
|
},
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "enum LibSignature.SignatureType",
|
|
"name": "signatureType",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "uint8",
|
|
"name": "v",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "r",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "s",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"internalType": "struct LibSignature.Signature",
|
|
"name": "signature",
|
|
"type": "tuple"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFillAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "sender",
|
|
"type": "address"
|
|
}
|
|
],
|
|
"name": "_fillLimitOrder",
|
|
"outputs": [
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFilledAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerTokenFilledAmount",
|
|
"type": "uint128"
|
|
}
|
|
],
|
|
"stateMutability": "payable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "txOrigin",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.RfqOrder",
|
|
"name": "order",
|
|
"type": "tuple"
|
|
},
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "enum LibSignature.SignatureType",
|
|
"name": "signatureType",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "uint8",
|
|
"name": "v",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "r",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "s",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"internalType": "struct LibSignature.Signature",
|
|
"name": "signature",
|
|
"type": "tuple"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFillAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
}
|
|
],
|
|
"name": "_fillRfqOrder",
|
|
"outputs": [
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFilledAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerTokenFilledAmount",
|
|
"type": "uint128"
|
|
}
|
|
],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFeeAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "sender",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "feeRecipient",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.LimitOrder[]",
|
|
"name": "orders",
|
|
"type": "tuple[]"
|
|
}
|
|
],
|
|
"name": "batchCancelLimitOrders",
|
|
"outputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06[]",
|
|
"name": "makerTokens",
|
|
"type": "address[]"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06[]",
|
|
"name": "takerTokens",
|
|
"type": "address[]"
|
|
},
|
|
{
|
|
"internalType": "uint256[]",
|
|
"name": "minValidSalts",
|
|
"type": "uint256[]"
|
|
}
|
|
],
|
|
"name": "batchCancelPairLimitOrders",
|
|
"outputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06[]",
|
|
"name": "makerTokens",
|
|
"type": "address[]"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06[]",
|
|
"name": "takerTokens",
|
|
"type": "address[]"
|
|
},
|
|
{
|
|
"internalType": "uint256[]",
|
|
"name": "minValidSalts",
|
|
"type": "uint256[]"
|
|
}
|
|
],
|
|
"name": "batchCancelPairRfqOrders",
|
|
"outputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "txOrigin",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.RfqOrder[]",
|
|
"name": "orders",
|
|
"type": "tuple[]"
|
|
}
|
|
],
|
|
"name": "batchCancelRfqOrders",
|
|
"outputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFeeAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "sender",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "feeRecipient",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.LimitOrder[]",
|
|
"name": "orders",
|
|
"type": "tuple[]"
|
|
},
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "enum LibSignature.SignatureType",
|
|
"name": "signatureType",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "uint8",
|
|
"name": "v",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "r",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "s",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"internalType": "struct LibSignature.Signature[]",
|
|
"name": "signatures",
|
|
"type": "tuple[]"
|
|
}
|
|
],
|
|
"name": "batchGetLimitOrderRelevantStates",
|
|
"outputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "orderHash",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "enum LibNativeOrder.OrderStatus",
|
|
"name": "status",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFilledAmount",
|
|
"type": "uint128"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.OrderInfo[]",
|
|
"name": "orderInfos",
|
|
"type": "tuple[]"
|
|
},
|
|
{
|
|
"internalType": "uint128[]",
|
|
"name": "actualFillableTakerTokenAmounts",
|
|
"type": "uint128[]"
|
|
},
|
|
{
|
|
"internalType": "bool[]",
|
|
"name": "isSignatureValids",
|
|
"type": "bool[]"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "txOrigin",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.RfqOrder[]",
|
|
"name": "orders",
|
|
"type": "tuple[]"
|
|
},
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "enum LibSignature.SignatureType",
|
|
"name": "signatureType",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "uint8",
|
|
"name": "v",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "r",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "s",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"internalType": "struct LibSignature.Signature[]",
|
|
"name": "signatures",
|
|
"type": "tuple[]"
|
|
}
|
|
],
|
|
"name": "batchGetRfqOrderRelevantStates",
|
|
"outputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "orderHash",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "enum LibNativeOrder.OrderStatus",
|
|
"name": "status",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFilledAmount",
|
|
"type": "uint128"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.OrderInfo[]",
|
|
"name": "orderInfos",
|
|
"type": "tuple[]"
|
|
},
|
|
{
|
|
"internalType": "uint128[]",
|
|
"name": "actualFillableTakerTokenAmounts",
|
|
"type": "uint128[]"
|
|
},
|
|
{
|
|
"internalType": "bool[]",
|
|
"name": "isSignatureValids",
|
|
"type": "bool[]"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFeeAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "sender",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "feeRecipient",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.LimitOrder",
|
|
"name": "order",
|
|
"type": "tuple"
|
|
}
|
|
],
|
|
"name": "cancelLimitOrder",
|
|
"outputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "minValidSalt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"name": "cancelPairLimitOrders",
|
|
"outputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "minValidSalt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"name": "cancelPairRfqOrders",
|
|
"outputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "txOrigin",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.RfqOrder",
|
|
"name": "order",
|
|
"type": "tuple"
|
|
}
|
|
],
|
|
"name": "cancelRfqOrder",
|
|
"outputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFeeAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "sender",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "feeRecipient",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.LimitOrder",
|
|
"name": "order",
|
|
"type": "tuple"
|
|
},
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "enum LibSignature.SignatureType",
|
|
"name": "signatureType",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "uint8",
|
|
"name": "v",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "r",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "s",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"internalType": "struct LibSignature.Signature",
|
|
"name": "signature",
|
|
"type": "tuple"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFillAmount",
|
|
"type": "uint128"
|
|
}
|
|
],
|
|
"name": "fillLimitOrder",
|
|
"outputs": [
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFilledAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerTokenFilledAmount",
|
|
"type": "uint128"
|
|
}
|
|
],
|
|
"stateMutability": "payable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFeeAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "sender",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "feeRecipient",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.LimitOrder",
|
|
"name": "order",
|
|
"type": "tuple"
|
|
},
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "enum LibSignature.SignatureType",
|
|
"name": "signatureType",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "uint8",
|
|
"name": "v",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "r",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "s",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"internalType": "struct LibSignature.Signature",
|
|
"name": "signature",
|
|
"type": "tuple"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFillAmount",
|
|
"type": "uint128"
|
|
}
|
|
],
|
|
"name": "fillOrKillLimitOrder",
|
|
"outputs": [
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerTokenFilledAmount",
|
|
"type": "uint128"
|
|
}
|
|
],
|
|
"stateMutability": "payable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "txOrigin",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.RfqOrder",
|
|
"name": "order",
|
|
"type": "tuple"
|
|
},
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "enum LibSignature.SignatureType",
|
|
"name": "signatureType",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "uint8",
|
|
"name": "v",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "r",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "s",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"internalType": "struct LibSignature.Signature",
|
|
"name": "signature",
|
|
"type": "tuple"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFillAmount",
|
|
"type": "uint128"
|
|
}
|
|
],
|
|
"name": "fillOrKillRfqOrder",
|
|
"outputs": [
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerTokenFilledAmount",
|
|
"type": "uint128"
|
|
}
|
|
],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "txOrigin",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.RfqOrder",
|
|
"name": "order",
|
|
"type": "tuple"
|
|
},
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "enum LibSignature.SignatureType",
|
|
"name": "signatureType",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "uint8",
|
|
"name": "v",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "r",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "s",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"internalType": "struct LibSignature.Signature",
|
|
"name": "signature",
|
|
"type": "tuple"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFillAmount",
|
|
"type": "uint128"
|
|
}
|
|
],
|
|
"name": "fillRfqOrder",
|
|
"outputs": [
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFilledAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerTokenFilledAmount",
|
|
"type": "uint128"
|
|
}
|
|
],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFeeAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "sender",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "feeRecipient",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.LimitOrder",
|
|
"name": "order",
|
|
"type": "tuple"
|
|
}
|
|
],
|
|
"name": "getLimitOrderHash",
|
|
"outputs": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "orderHash",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFeeAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "sender",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "feeRecipient",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.LimitOrder",
|
|
"name": "order",
|
|
"type": "tuple"
|
|
}
|
|
],
|
|
"name": "getLimitOrderInfo",
|
|
"outputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "orderHash",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "enum LibNativeOrder.OrderStatus",
|
|
"name": "status",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFilledAmount",
|
|
"type": "uint128"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.OrderInfo",
|
|
"name": "orderInfo",
|
|
"type": "tuple"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFeeAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "sender",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "feeRecipient",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.LimitOrder",
|
|
"name": "order",
|
|
"type": "tuple"
|
|
},
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "enum LibSignature.SignatureType",
|
|
"name": "signatureType",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "uint8",
|
|
"name": "v",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "r",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "s",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"internalType": "struct LibSignature.Signature",
|
|
"name": "signature",
|
|
"type": "tuple"
|
|
}
|
|
],
|
|
"name": "getLimitOrderRelevantState",
|
|
"outputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "orderHash",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "enum LibNativeOrder.OrderStatus",
|
|
"name": "status",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFilledAmount",
|
|
"type": "uint128"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.OrderInfo",
|
|
"name": "orderInfo",
|
|
"type": "tuple"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "actualFillableTakerTokenAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "bool",
|
|
"name": "isSignatureValid",
|
|
"type": "bool"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [],
|
|
"name": "getProtocolFeeMultiplier",
|
|
"outputs": [
|
|
{
|
|
"internalType": "uint32",
|
|
"name": "multiplier",
|
|
"type": "uint32"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "txOrigin",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.RfqOrder",
|
|
"name": "order",
|
|
"type": "tuple"
|
|
}
|
|
],
|
|
"name": "getRfqOrderHash",
|
|
"outputs": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "orderHash",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "txOrigin",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.RfqOrder",
|
|
"name": "order",
|
|
"type": "tuple"
|
|
}
|
|
],
|
|
"name": "getRfqOrderInfo",
|
|
"outputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "orderHash",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "enum LibNativeOrder.OrderStatus",
|
|
"name": "status",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFilledAmount",
|
|
"type": "uint128"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.OrderInfo",
|
|
"name": "orderInfo",
|
|
"type": "tuple"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "makerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "contract IERC20TokenV06",
|
|
"name": "takerToken",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "makerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "maker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "taker",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "address",
|
|
"name": "txOrigin",
|
|
"type": "address"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "pool",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "uint64",
|
|
"name": "expiry",
|
|
"type": "uint64"
|
|
},
|
|
{
|
|
"internalType": "uint256",
|
|
"name": "salt",
|
|
"type": "uint256"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.RfqOrder",
|
|
"name": "order",
|
|
"type": "tuple"
|
|
},
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "enum LibSignature.SignatureType",
|
|
"name": "signatureType",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "uint8",
|
|
"name": "v",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "r",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "s",
|
|
"type": "bytes32"
|
|
}
|
|
],
|
|
"internalType": "struct LibSignature.Signature",
|
|
"name": "signature",
|
|
"type": "tuple"
|
|
}
|
|
],
|
|
"name": "getRfqOrderRelevantState",
|
|
"outputs": [
|
|
{
|
|
"components": [
|
|
{
|
|
"internalType": "bytes32",
|
|
"name": "orderHash",
|
|
"type": "bytes32"
|
|
},
|
|
{
|
|
"internalType": "enum LibNativeOrder.OrderStatus",
|
|
"name": "status",
|
|
"type": "uint8"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "takerTokenFilledAmount",
|
|
"type": "uint128"
|
|
}
|
|
],
|
|
"internalType": "struct LibNativeOrder.OrderInfo",
|
|
"name": "orderInfo",
|
|
"type": "tuple"
|
|
},
|
|
{
|
|
"internalType": "uint128",
|
|
"name": "actualFillableTakerTokenAmount",
|
|
"type": "uint128"
|
|
},
|
|
{
|
|
"internalType": "bool",
|
|
"name": "isSignatureValid",
|
|
"type": "bool"
|
|
}
|
|
],
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "address[]",
|
|
"name": "origins",
|
|
"type": "address[]"
|
|
},
|
|
{
|
|
"internalType": "bool",
|
|
"name": "allowed",
|
|
"type": "bool"
|
|
}
|
|
],
|
|
"name": "registerAllowedRfqOrigins",
|
|
"outputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"inputs": [
|
|
{
|
|
"internalType": "bytes32[]",
|
|
"name": "poolIds",
|
|
"type": "bytes32[]"
|
|
}
|
|
],
|
|
"name": "transferProtocolFeesForPools",
|
|
"outputs": [],
|
|
"stateMutability": "nonpayable",
|
|
"type": "function"
|
|
}
|
|
],
|
|
"devdoc": {
|
|
"details": "Feature for interacting with limit orders.",
|
|
"kind": "dev",
|
|
"methods": {
|
|
"_fillLimitOrder((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128,address,address)": {
|
|
"details": "Fill a limit order. Internal variant. ETH protocol fees can be attached to this call. Any unspent ETH will be refunded to `msg.sender` (not `sender`).",
|
|
"params": {
|
|
"order": "The limit order.",
|
|
"sender": "The order sender.",
|
|
"signature": "The order signature.",
|
|
"taker": "The order taker.",
|
|
"takerTokenFillAmount": "Maximum taker token to fill this order with."
|
|
},
|
|
"returns": {
|
|
"makerTokenFilledAmount": "How much maker token was filled.",
|
|
"takerTokenFilledAmount": "How much maker token was filled."
|
|
}
|
|
},
|
|
"_fillRfqOrder((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128,address)": {
|
|
"details": "Fill an RFQ order. Internal variant.",
|
|
"params": {
|
|
"order": "The RFQ order.",
|
|
"signature": "The order signature.",
|
|
"taker": "The order taker.",
|
|
"takerTokenFillAmount": "Maximum taker token to fill this order with."
|
|
},
|
|
"returns": {
|
|
"makerTokenFilledAmount": "How much maker token was filled.",
|
|
"takerTokenFilledAmount": "How much maker token was filled."
|
|
}
|
|
},
|
|
"batchCancelLimitOrders((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256)[])": {
|
|
"details": "Cancel multiple limit orders. The caller must be the maker. Silently succeeds if the order has already been cancelled.",
|
|
"params": {
|
|
"orders": "The limit orders."
|
|
}
|
|
},
|
|
"batchCancelPairLimitOrders(address[],address[],uint256[])": {
|
|
"details": "Cancel all limit orders for a given maker and pair with a salt less than the value provided. The caller must be the maker. Subsequent calls to this function with the same caller and pair require the new salt to be >= the old salt.",
|
|
"params": {
|
|
"makerTokens": "The maker tokens.",
|
|
"minValidSalts": "The new minimum valid salts.",
|
|
"takerTokens": "The taker tokens."
|
|
}
|
|
},
|
|
"batchCancelPairRfqOrders(address[],address[],uint256[])": {
|
|
"details": "Cancel all RFQ orders for a given maker and pair with a salt less than the value provided. The caller must be the maker. Subsequent calls to this function with the same caller and pair require the new salt to be >= the old salt.",
|
|
"params": {
|
|
"makerTokens": "The maker tokens.",
|
|
"minValidSalts": "The new minimum valid salts.",
|
|
"takerTokens": "The taker tokens."
|
|
}
|
|
},
|
|
"batchCancelRfqOrders((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256)[])": {
|
|
"details": "Cancel multiple RFQ orders. The caller must be the maker. Silently succeeds if the order has already been cancelled.",
|
|
"params": {
|
|
"orders": "The RFQ orders."
|
|
}
|
|
},
|
|
"batchGetLimitOrderRelevantStates((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256)[],(uint8,uint8,bytes32,bytes32)[])": {
|
|
"details": "Batch version of `getLimitOrderRelevantState()`, without reverting. Orders that would normally cause `getLimitOrderRelevantState()` to revert will have empty results.",
|
|
"params": {
|
|
"orders": "The limit orders.",
|
|
"signatures": "The order signatures."
|
|
},
|
|
"returns": {
|
|
"actualFillableTakerTokenAmounts": "How much of each order is fillable based on maker funds, in taker tokens.",
|
|
"isSignatureValids": "Whether each signature is valid for the order.",
|
|
"orderInfos": "Info about the orders."
|
|
}
|
|
},
|
|
"batchGetRfqOrderRelevantStates((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256)[],(uint8,uint8,bytes32,bytes32)[])": {
|
|
"details": "Batch version of `getRfqOrderRelevantState()`, without reverting. Orders that would normally cause `getRfqOrderRelevantState()` to revert will have empty results.",
|
|
"params": {
|
|
"orders": "The RFQ orders.",
|
|
"signatures": "The order signatures."
|
|
},
|
|
"returns": {
|
|
"actualFillableTakerTokenAmounts": "How much of each order is fillable based on maker funds, in taker tokens.",
|
|
"isSignatureValids": "Whether each signature is valid for the order.",
|
|
"orderInfos": "Info about the orders."
|
|
}
|
|
},
|
|
"cancelLimitOrder((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256))": {
|
|
"details": "Cancel a single limit order. The caller must be the maker. Silently succeeds if the order has already been cancelled.",
|
|
"params": {
|
|
"order": "The limit order."
|
|
}
|
|
},
|
|
"cancelPairLimitOrders(address,address,uint256)": {
|
|
"details": "Cancel all limit orders for a given maker and pair with a salt less than the value provided. The caller must be the maker. Subsequent calls to this function with the same caller and pair require the new salt to be >= the old salt.",
|
|
"params": {
|
|
"makerToken": "The maker token.",
|
|
"minValidSalt": "The new minimum valid salt.",
|
|
"takerToken": "The taker token."
|
|
}
|
|
},
|
|
"cancelPairRfqOrders(address,address,uint256)": {
|
|
"details": "Cancel all RFQ orders for a given maker and pair with a salt less than the value provided. The caller must be the maker. Subsequent calls to this function with the same caller and pair require the new salt to be >= the old salt.",
|
|
"params": {
|
|
"makerToken": "The maker token.",
|
|
"minValidSalt": "The new minimum valid salt.",
|
|
"takerToken": "The taker token."
|
|
}
|
|
},
|
|
"cancelRfqOrder((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256))": {
|
|
"details": "Cancel a single RFQ order. The caller must be the maker. Silently succeeds if the order has already been cancelled.",
|
|
"params": {
|
|
"order": "The RFQ order."
|
|
}
|
|
},
|
|
"fillLimitOrder((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128)": {
|
|
"details": "Fill a limit order. The taker and sender will be the caller.",
|
|
"params": {
|
|
"order": "The limit order. ETH protocol fees can be attached to this call. Any unspent ETH will be refunded to the caller.",
|
|
"signature": "The order signature.",
|
|
"takerTokenFillAmount": "Maximum taker token amount to fill this order with."
|
|
},
|
|
"returns": {
|
|
"makerTokenFilledAmount": "How much maker token was filled.",
|
|
"takerTokenFilledAmount": "How much maker token was filled."
|
|
}
|
|
},
|
|
"fillOrKillLimitOrder((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128)": {
|
|
"details": "Fill an RFQ order for exactly `takerTokenFillAmount` taker tokens. The taker will be the caller. ETH protocol fees can be attached to this call. Any unspent ETH will be refunded to the caller.",
|
|
"params": {
|
|
"order": "The limit order.",
|
|
"signature": "The order signature.",
|
|
"takerTokenFillAmount": "How much taker token to fill this order with."
|
|
},
|
|
"returns": {
|
|
"makerTokenFilledAmount": "How much maker token was filled."
|
|
}
|
|
},
|
|
"fillOrKillRfqOrder((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128)": {
|
|
"details": "Fill an RFQ order for exactly `takerTokenFillAmount` taker tokens. The taker will be the caller.",
|
|
"params": {
|
|
"order": "The RFQ order.",
|
|
"signature": "The order signature.",
|
|
"takerTokenFillAmount": "How much taker token to fill this order with."
|
|
},
|
|
"returns": {
|
|
"makerTokenFilledAmount": "How much maker token was filled."
|
|
}
|
|
},
|
|
"fillRfqOrder((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128)": {
|
|
"details": "Fill an RFQ order for up to `takerTokenFillAmount` taker tokens. The taker will be the caller.",
|
|
"params": {
|
|
"order": "The RFQ order.",
|
|
"signature": "The order signature.",
|
|
"takerTokenFillAmount": "Maximum taker token amount to fill this order with."
|
|
},
|
|
"returns": {
|
|
"makerTokenFilledAmount": "How much maker token was filled.",
|
|
"takerTokenFilledAmount": "How much maker token was filled."
|
|
}
|
|
},
|
|
"getLimitOrderHash((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256))": {
|
|
"details": "Get the canonical hash of a limit order.",
|
|
"params": {
|
|
"order": "The limit order."
|
|
},
|
|
"returns": {
|
|
"orderHash": "The order hash."
|
|
}
|
|
},
|
|
"getLimitOrderInfo((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256))": {
|
|
"details": "Get the order info for a limit order.",
|
|
"params": {
|
|
"order": "The limit order."
|
|
},
|
|
"returns": {
|
|
"orderInfo": "Info about the order."
|
|
}
|
|
},
|
|
"getLimitOrderRelevantState((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32))": {
|
|
"details": "Get order info, fillable amount, and signature validity for a limit order. Fillable amount is determined using balances and allowances of the maker.",
|
|
"params": {
|
|
"order": "The limit order.",
|
|
"signature": "The order signature."
|
|
},
|
|
"returns": {
|
|
"actualFillableTakerTokenAmount": "How much of the order is fillable based on maker funds, in taker tokens.",
|
|
"isSignatureValid": "Whether the signature is valid.",
|
|
"orderInfo": "Info about the order."
|
|
}
|
|
},
|
|
"getProtocolFeeMultiplier()": {
|
|
"details": "Get the protocol fee multiplier. This should be multiplied by the gas price to arrive at the required protocol fee to fill a native order.",
|
|
"returns": {
|
|
"multiplier": "The protocol fee multiplier."
|
|
}
|
|
},
|
|
"getRfqOrderHash((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256))": {
|
|
"details": "Get the canonical hash of an RFQ order.",
|
|
"params": {
|
|
"order": "The RFQ order."
|
|
},
|
|
"returns": {
|
|
"orderHash": "The order hash."
|
|
}
|
|
},
|
|
"getRfqOrderInfo((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256))": {
|
|
"details": "Get the order info for an RFQ order.",
|
|
"params": {
|
|
"order": "The RFQ order."
|
|
},
|
|
"returns": {
|
|
"orderInfo": "Info about the order."
|
|
}
|
|
},
|
|
"getRfqOrderRelevantState((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32))": {
|
|
"details": "Get order info, fillable amount, and signature validity for an RFQ order. Fillable amount is determined using balances and allowances of the maker.",
|
|
"params": {
|
|
"order": "The RFQ order.",
|
|
"signature": "The order signature."
|
|
},
|
|
"returns": {
|
|
"actualFillableTakerTokenAmount": "How much of the order is fillable based on maker funds, in taker tokens.",
|
|
"isSignatureValid": "Whether the signature is valid.",
|
|
"orderInfo": "Info about the order."
|
|
}
|
|
},
|
|
"registerAllowedRfqOrigins(address[],bool)": {
|
|
"details": "Mark what tx.origin addresses are allowed to fill an order that specifies the message sender as its txOrigin.",
|
|
"params": {
|
|
"allowed": "True to register, false to unregister.",
|
|
"origins": "An array of origin addresses to update."
|
|
}
|
|
},
|
|
"transferProtocolFeesForPools(bytes32[])": {
|
|
"details": "Transfers protocol fees from the `FeeCollector` pools into the staking contract.",
|
|
"params": {
|
|
"poolIds": "Staking pool IDs"
|
|
}
|
|
}
|
|
},
|
|
"version": 1
|
|
},
|
|
"evm": {
|
|
"bytecode": {
|
|
"linkReferences": {},
|
|
"object": "0x",
|
|
"opcodes": "",
|
|
"sourceMap": ""
|
|
},
|
|
"deployedBytecode": {
|
|
"immutableReferences": {},
|
|
"linkReferences": {},
|
|
"object": "0x",
|
|
"opcodes": "",
|
|
"sourceMap": ""
|
|
},
|
|
"methodIdentifiers": {
|
|
"_fillLimitOrder((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128,address,address)": "414e4ccf",
|
|
"_fillRfqOrder((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128,address)": "a656186b",
|
|
"batchCancelLimitOrders((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256)[])": "9baa45a8",
|
|
"batchCancelPairLimitOrders(address[],address[],uint256[])": "86a0c8d7",
|
|
"batchCancelPairRfqOrders(address[],address[],uint256[])": "0f0e8cf7",
|
|
"batchCancelRfqOrders((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256)[])": "f6e0f6a5",
|
|
"batchGetLimitOrderRelevantStates((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256)[],(uint8,uint8,bytes32,bytes32)[])": "b4658bfb",
|
|
"batchGetRfqOrderRelevantStates((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256)[],(uint8,uint8,bytes32,bytes32)[])": "ad354eeb",
|
|
"cancelLimitOrder((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256))": "7d49ec1a",
|
|
"cancelPairLimitOrders(address,address,uint256)": "d0a55fb0",
|
|
"cancelPairRfqOrders(address,address,uint256)": "9a4f809c",
|
|
"cancelRfqOrder((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256))": "fe55a3ef",
|
|
"fillLimitOrder((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128)": "f6274f66",
|
|
"fillOrKillLimitOrder((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128)": "9240529c",
|
|
"fillOrKillRfqOrder((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128)": "438cdfc5",
|
|
"fillRfqOrder((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32),uint128)": "aa77476c",
|
|
"getLimitOrderHash((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256))": "dd11d225",
|
|
"getLimitOrderInfo((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256))": "95480889",
|
|
"getLimitOrderRelevantState((address,address,uint128,uint128,uint128,address,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32))": "1fb09795",
|
|
"getProtocolFeeMultiplier()": "487b5c20",
|
|
"getRfqOrderHash((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256))": "016a6d65",
|
|
"getRfqOrderInfo((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256))": "346693c5",
|
|
"getRfqOrderRelevantState((address,address,uint128,uint128,address,address,address,bytes32,uint64,uint256),(uint8,uint8,bytes32,bytes32))": "37f381d8",
|
|
"registerAllowedRfqOrigins(address[],bool)": "b09f1fb1",
|
|
"transferProtocolFeesForPools(bytes32[])": "3cd2f026"
|
|
}
|
|
}
|
|
},
|
|
"sourceTreeHashHex": "0x36cd1f7bc88fbc3b7b37566aba22678026e2cff9594dcf1de02430608ce7e2d6",
|
|
"sources": {
|
|
"./INativeOrdersFeature.sol": {
|
|
"id": 3,
|
|
"content": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\npragma experimental ABIEncoderV2;\n\nimport \"@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol\";\nimport \"../libs/LibSignature.sol\";\nimport \"../libs/LibNativeOrder.sol\";\nimport \"./INativeOrdersEvents.sol\";\n\n\n/// @dev Feature for interacting with limit orders.\ninterface INativeOrdersFeature is\n INativeOrdersEvents\n{\n\n /// @dev Transfers protocol fees from the `FeeCollector` pools into\n /// the staking contract.\n /// @param poolIds Staking pool IDs\n function transferProtocolFeesForPools(bytes32[] calldata poolIds)\n external;\n\n /// @dev Fill a limit order. The taker and sender will be the caller.\n /// @param order The limit order. ETH protocol fees can be\n /// attached to this call. Any unspent ETH will be refunded to\n /// the caller.\n /// @param signature The order signature.\n /// @param takerTokenFillAmount Maximum taker token amount to fill this order with.\n /// @return takerTokenFilledAmount How much maker token was filled.\n /// @return makerTokenFilledAmount How much maker token was filled.\n function fillLimitOrder(\n LibNativeOrder.LimitOrder calldata order,\n LibSignature.Signature calldata signature,\n uint128 takerTokenFillAmount\n )\n external\n payable\n returns (uint128 takerTokenFilledAmount, uint128 makerTokenFilledAmount);\n\n /// @dev Fill an RFQ order for up to `takerTokenFillAmount` taker tokens.\n /// The taker will be the caller.\n /// @param order The RFQ order.\n /// @param signature The order signature.\n /// @param takerTokenFillAmount Maximum taker token amount to fill this order with.\n /// @return takerTokenFilledAmount How much maker token was filled.\n /// @return makerTokenFilledAmount How much maker token was filled.\n function fillRfqOrder(\n LibNativeOrder.RfqOrder calldata order,\n LibSignature.Signature calldata signature,\n uint128 takerTokenFillAmount\n )\n external\n returns (uint128 takerTokenFilledAmount, uint128 makerTokenFilledAmount);\n\n /// @dev Fill an RFQ order for exactly `takerTokenFillAmount` taker tokens.\n /// The taker will be the caller. ETH protocol fees can be\n /// attached to this call. Any unspent ETH will be refunded to\n /// the caller.\n /// @param order The limit order.\n /// @param signature The order signature.\n /// @param takerTokenFillAmount How much taker token to fill this order with.\n /// @return makerTokenFilledAmount How much maker token was filled.\n function fillOrKillLimitOrder(\n LibNativeOrder.LimitOrder calldata order,\n LibSignature.Signature calldata signature,\n uint128 takerTokenFillAmount\n )\n external\n payable\n returns (uint128 makerTokenFilledAmount);\n\n /// @dev Fill an RFQ order for exactly `takerTokenFillAmount` taker tokens.\n /// The taker will be the caller.\n /// @param order The RFQ order.\n /// @param signature The order signature.\n /// @param takerTokenFillAmount How much taker token to fill this order with.\n /// @return makerTokenFilledAmount How much maker token was filled.\n function fillOrKillRfqOrder(\n LibNativeOrder.RfqOrder calldata order,\n LibSignature.Signature calldata signature,\n uint128 takerTokenFillAmount\n )\n external\n returns (uint128 makerTokenFilledAmount);\n\n /// @dev Fill a limit order. Internal variant. ETH protocol fees can be\n /// attached to this call. Any unspent ETH will be refunded to\n /// `msg.sender` (not `sender`).\n /// @param order The limit order.\n /// @param signature The order signature.\n /// @param takerTokenFillAmount Maximum taker token to fill this order with.\n /// @param taker The order taker.\n /// @param sender The order sender.\n /// @return takerTokenFilledAmount How much maker token was filled.\n /// @return makerTokenFilledAmount How much maker token was filled.\n function _fillLimitOrder(\n LibNativeOrder.LimitOrder calldata order,\n LibSignature.Signature calldata signature,\n uint128 takerTokenFillAmount,\n address taker,\n address sender\n )\n external\n payable\n returns (uint128 takerTokenFilledAmount, uint128 makerTokenFilledAmount);\n\n /// @dev Fill an RFQ order. Internal variant.\n /// @param order The RFQ order.\n /// @param signature The order signature.\n /// @param takerTokenFillAmount Maximum taker token to fill this order with.\n /// @param taker The order taker.\n /// @return takerTokenFilledAmount How much maker token was filled.\n /// @return makerTokenFilledAmount How much maker token was filled.\n function _fillRfqOrder(\n LibNativeOrder.RfqOrder calldata order,\n LibSignature.Signature calldata signature,\n uint128 takerTokenFillAmount,\n address taker\n )\n external\n returns (uint128 takerTokenFilledAmount, uint128 makerTokenFilledAmount);\n\n /// @dev Cancel a single limit order. The caller must be the maker.\n /// Silently succeeds if the order has already been cancelled.\n /// @param order The limit order.\n function cancelLimitOrder(LibNativeOrder.LimitOrder calldata order)\n external;\n\n /// @dev Cancel a single RFQ order. The caller must be the maker.\n /// Silently succeeds if the order has already been cancelled.\n /// @param order The RFQ order.\n function cancelRfqOrder(LibNativeOrder.RfqOrder calldata order)\n external;\n\n /// @dev Mark what tx.origin addresses are allowed to fill an order that\n /// specifies the message sender as its txOrigin.\n /// @param origins An array of origin addresses to update.\n /// @param allowed True to register, false to unregister.\n function registerAllowedRfqOrigins(address[] memory origins, bool allowed)\n external;\n\n /// @dev Cancel multiple limit orders. The caller must be the maker.\n /// Silently succeeds if the order has already been cancelled.\n /// @param orders The limit orders.\n function batchCancelLimitOrders(LibNativeOrder.LimitOrder[] calldata orders)\n external;\n\n /// @dev Cancel multiple RFQ orders. The caller must be the maker.\n /// Silently succeeds if the order has already been cancelled.\n /// @param orders The RFQ orders.\n function batchCancelRfqOrders(LibNativeOrder.RfqOrder[] calldata orders)\n external;\n\n /// @dev Cancel all limit orders for a given maker and pair with a salt less\n /// than the value provided. The caller must be the maker. Subsequent\n /// calls to this function with the same caller and pair require the\n /// new salt to be >= the old salt.\n /// @param makerToken The maker token.\n /// @param takerToken The taker token.\n /// @param minValidSalt The new minimum valid salt.\n function cancelPairLimitOrders(\n IERC20TokenV06 makerToken,\n IERC20TokenV06 takerToken,\n uint256 minValidSalt\n )\n external;\n\n /// @dev Cancel all limit orders for a given maker and pair with a salt less\n /// than the value provided. The caller must be the maker. Subsequent\n /// calls to this function with the same caller and pair require the\n /// new salt to be >= the old salt.\n /// @param makerTokens The maker tokens.\n /// @param takerTokens The taker tokens.\n /// @param minValidSalts The new minimum valid salts.\n function batchCancelPairLimitOrders(\n IERC20TokenV06[] calldata makerTokens,\n IERC20TokenV06[] calldata takerTokens,\n uint256[] calldata minValidSalts\n )\n external;\n\n /// @dev Cancel all RFQ orders for a given maker and pair with a salt less\n /// than the value provided. The caller must be the maker. Subsequent\n /// calls to this function with the same caller and pair require the\n /// new salt to be >= the old salt.\n /// @param makerToken The maker token.\n /// @param takerToken The taker token.\n /// @param minValidSalt The new minimum valid salt.\n function cancelPairRfqOrders(\n IERC20TokenV06 makerToken,\n IERC20TokenV06 takerToken,\n uint256 minValidSalt\n )\n external;\n\n /// @dev Cancel all RFQ orders for a given maker and pair with a salt less\n /// than the value provided. The caller must be the maker. Subsequent\n /// calls to this function with the same caller and pair require the\n /// new salt to be >= the old salt.\n /// @param makerTokens The maker tokens.\n /// @param takerTokens The taker tokens.\n /// @param minValidSalts The new minimum valid salts.\n function batchCancelPairRfqOrders(\n IERC20TokenV06[] calldata makerTokens,\n IERC20TokenV06[] calldata takerTokens,\n uint256[] calldata minValidSalts\n )\n external;\n\n /// @dev Get the order info for a limit order.\n /// @param order The limit order.\n /// @return orderInfo Info about the order.\n function getLimitOrderInfo(LibNativeOrder.LimitOrder calldata order)\n external\n view\n returns (LibNativeOrder.OrderInfo memory orderInfo);\n\n /// @dev Get the order info for an RFQ order.\n /// @param order The RFQ order.\n /// @return orderInfo Info about the order.\n function getRfqOrderInfo(LibNativeOrder.RfqOrder calldata order)\n external\n view\n returns (LibNativeOrder.OrderInfo memory orderInfo);\n\n /// @dev Get the canonical hash of a limit order.\n /// @param order The limit order.\n /// @return orderHash The order hash.\n function getLimitOrderHash(LibNativeOrder.LimitOrder calldata order)\n external\n view\n returns (bytes32 orderHash);\n\n /// @dev Get the canonical hash of an RFQ order.\n /// @param order The RFQ order.\n /// @return orderHash The order hash.\n function getRfqOrderHash(LibNativeOrder.RfqOrder calldata order)\n external\n view\n returns (bytes32 orderHash);\n\n /// @dev Get the protocol fee multiplier. This should be multiplied by the\n /// gas price to arrive at the required protocol fee to fill a native order.\n /// @return multiplier The protocol fee multiplier.\n function getProtocolFeeMultiplier()\n external\n view\n returns (uint32 multiplier);\n\n /// @dev Get order info, fillable amount, and signature validity for a limit order.\n /// Fillable amount is determined using balances and allowances of the maker.\n /// @param order The limit order.\n /// @param signature The order signature.\n /// @return orderInfo Info about the order.\n /// @return actualFillableTakerTokenAmount How much of the order is fillable\n /// based on maker funds, in taker tokens.\n /// @return isSignatureValid Whether the signature is valid.\n function getLimitOrderRelevantState(\n LibNativeOrder.LimitOrder calldata order,\n LibSignature.Signature calldata signature\n )\n external\n view\n returns (\n LibNativeOrder.OrderInfo memory orderInfo,\n uint128 actualFillableTakerTokenAmount,\n bool isSignatureValid\n );\n\n /// @dev Get order info, fillable amount, and signature validity for an RFQ order.\n /// Fillable amount is determined using balances and allowances of the maker.\n /// @param order The RFQ order.\n /// @param signature The order signature.\n /// @return orderInfo Info about the order.\n /// @return actualFillableTakerTokenAmount How much of the order is fillable\n /// based on maker funds, in taker tokens.\n /// @return isSignatureValid Whether the signature is valid.\n function getRfqOrderRelevantState(\n LibNativeOrder.RfqOrder calldata order,\n LibSignature.Signature calldata signature\n )\n external\n view\n returns (\n LibNativeOrder.OrderInfo memory orderInfo,\n uint128 actualFillableTakerTokenAmount,\n bool isSignatureValid\n );\n\n /// @dev Batch version of `getLimitOrderRelevantState()`, without reverting.\n /// Orders that would normally cause `getLimitOrderRelevantState()`\n /// to revert will have empty results.\n /// @param orders The limit orders.\n /// @param signatures The order signatures.\n /// @return orderInfos Info about the orders.\n /// @return actualFillableTakerTokenAmounts How much of each order is fillable\n /// based on maker funds, in taker tokens.\n /// @return isSignatureValids Whether each signature is valid for the order.\n function batchGetLimitOrderRelevantStates(\n LibNativeOrder.LimitOrder[] calldata orders,\n LibSignature.Signature[] calldata signatures\n )\n external\n view\n returns (\n LibNativeOrder.OrderInfo[] memory orderInfos,\n uint128[] memory actualFillableTakerTokenAmounts,\n bool[] memory isSignatureValids\n );\n\n /// @dev Batch version of `getRfqOrderRelevantState()`, without reverting.\n /// Orders that would normally cause `getRfqOrderRelevantState()`\n /// to revert will have empty results.\n /// @param orders The RFQ orders.\n /// @param signatures The order signatures.\n /// @return orderInfos Info about the orders.\n /// @return actualFillableTakerTokenAmounts How much of each order is fillable\n /// based on maker funds, in taker tokens.\n /// @return isSignatureValids Whether each signature is valid for the order.\n function batchGetRfqOrderRelevantStates(\n LibNativeOrder.RfqOrder[] calldata orders,\n LibSignature.Signature[] calldata signatures\n )\n external\n view\n returns (\n LibNativeOrder.OrderInfo[] memory orderInfos,\n uint128[] memory actualFillableTakerTokenAmounts,\n bool[] memory isSignatureValids\n );\n}\n"
|
|
},
|
|
"@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol": {
|
|
"id": 6,
|
|
"content": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\n\n\ninterface IERC20TokenV06 {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed from,\n address indexed to,\n uint256 value\n );\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param to The address of the recipient\n /// @param value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address to, uint256 value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param from The address of the sender\n /// @param to The address of the recipient\n /// @param value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address from,\n address to,\n uint256 value\n )\n external\n returns (bool);\n\n /// @dev `msg.sender` approves `spender` to spend `value` tokens\n /// @param spender The address of the account able to transfer the tokens\n /// @param value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address spender, uint256 value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n\n /// @dev Get the balance of `owner`.\n /// @param owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address owner)\n external\n view\n returns (uint256);\n\n /// @dev Get the allowance for `spender` to spend from `owner`.\n /// @param owner The address of the account owning tokens\n /// @param spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address owner, address spender)\n external\n view\n returns (uint256);\n\n /// @dev Get the number of decimals this token has.\n function decimals()\n external\n view\n returns (uint8);\n}\n"
|
|
},
|
|
"../libs/LibSignature.sol": {
|
|
"id": 5,
|
|
"content": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\npragma experimental ABIEncoderV2;\n\nimport \"@0x/contracts-utils/contracts/src/v06/errors/LibRichErrorsV06.sol\";\nimport \"../../errors/LibSignatureRichErrors.sol\";\n\n\n/// @dev A library for validating signatures.\nlibrary LibSignature {\n using LibRichErrorsV06 for bytes;\n\n // '\\x19Ethereum Signed Message:\\n32\\x00\\x00\\x00\\x00' in a word.\n uint256 private constant ETH_SIGN_HASH_PREFIX =\n 0x19457468657265756d205369676e6564204d6573736167653a0a333200000000;\n /// @dev Exclusive upper limit on ECDSA signatures 'R' values.\n /// The valid range is given by fig (282) of the yellow paper.\n uint256 private constant ECDSA_SIGNATURE_R_LIMIT =\n uint256(0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141);\n /// @dev Exclusive upper limit on ECDSA signatures 'S' values.\n /// The valid range is given by fig (283) of the yellow paper.\n uint256 private constant ECDSA_SIGNATURE_S_LIMIT = ECDSA_SIGNATURE_R_LIMIT / 2 + 1;\n\n /// @dev Allowed signature types.\n enum SignatureType {\n ILLEGAL,\n INVALID,\n EIP712,\n ETHSIGN\n }\n\n /// @dev Encoded EC signature.\n struct Signature {\n // How to validate the signature.\n SignatureType signatureType;\n // EC Signature data.\n uint8 v;\n // EC Signature data.\n bytes32 r;\n // EC Signature data.\n bytes32 s;\n }\n\n /// @dev Retrieve the signer of a signature.\n /// Throws if the signature can't be validated.\n /// @param hash The hash that was signed.\n /// @param signature The signature.\n /// @return recovered The recovered signer address.\n function getSignerOfHash(\n bytes32 hash,\n Signature memory signature\n )\n internal\n pure\n returns (address recovered)\n {\n // Ensure this is a signature type that can be validated against a hash.\n _validateHashCompatibleSignature(hash, signature);\n\n if (signature.signatureType == SignatureType.EIP712) {\n // Signed using EIP712\n recovered = ecrecover(\n hash,\n signature.v,\n signature.r,\n signature.s\n );\n } else if (signature.signatureType == SignatureType.ETHSIGN) {\n // Signed using `eth_sign`\n // Need to hash `hash` with \"\\x19Ethereum Signed Message:\\n32\" prefix\n // in packed encoding.\n bytes32 ethSignHash;\n assembly {\n // Use scratch space\n mstore(0, ETH_SIGN_HASH_PREFIX) // length of 28 bytes\n mstore(28, hash) // length of 32 bytes\n ethSignHash := keccak256(0, 60)\n }\n recovered = ecrecover(\n ethSignHash,\n signature.v,\n signature.r,\n signature.s\n );\n }\n // `recovered` can be null if the signature values are out of range.\n if (recovered == address(0)) {\n LibSignatureRichErrors.SignatureValidationError(\n LibSignatureRichErrors.SignatureValidationErrorCodes.BAD_SIGNATURE_DATA,\n hash\n ).rrevert();\n }\n }\n\n /// @dev Validates that a signature is compatible with a hash signee.\n /// @param hash The hash that was signed.\n /// @param signature The signature.\n function _validateHashCompatibleSignature(\n bytes32 hash,\n Signature memory signature\n )\n private\n pure\n {\n // Ensure the r and s are within malleability limits.\n if (uint256(signature.r) >= ECDSA_SIGNATURE_R_LIMIT ||\n uint256(signature.s) >= ECDSA_SIGNATURE_S_LIMIT)\n {\n LibSignatureRichErrors.SignatureValidationError(\n LibSignatureRichErrors.SignatureValidationErrorCodes.BAD_SIGNATURE_DATA,\n hash\n ).rrevert();\n }\n\n // Always illegal signature.\n if (signature.signatureType == SignatureType.ILLEGAL) {\n LibSignatureRichErrors.SignatureValidationError(\n LibSignatureRichErrors.SignatureValidationErrorCodes.ILLEGAL,\n hash\n ).rrevert();\n }\n\n // Always invalid.\n if (signature.signatureType == SignatureType.INVALID) {\n LibSignatureRichErrors.SignatureValidationError(\n LibSignatureRichErrors.SignatureValidationErrorCodes.ALWAYS_INVALID,\n hash\n ).rrevert();\n }\n\n // Solidity should check that the signature type is within enum range for us\n // when abi-decoding.\n }\n}\n"
|
|
},
|
|
"@0x/contracts-utils/contracts/src/v06/errors/LibRichErrorsV06.sol": {
|
|
"id": 8,
|
|
"content": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\n\n\nlibrary LibRichErrorsV06 {\n\n // bytes4(keccak256(\"Error(string)\"))\n bytes4 internal constant STANDARD_ERROR_SELECTOR = 0x08c379a0;\n\n // solhint-disable func-name-mixedcase\n /// @dev ABI encode a standard, string revert error payload.\n /// This is the same payload that would be included by a `revert(string)`\n /// solidity statement. It has the function signature `Error(string)`.\n /// @param message The error string.\n /// @return The ABI encoded error.\n function StandardError(string memory message)\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n STANDARD_ERROR_SELECTOR,\n bytes(message)\n );\n }\n // solhint-enable func-name-mixedcase\n\n /// @dev Reverts an encoded rich revert reason `errorData`.\n /// @param errorData ABI encoded error data.\n function rrevert(bytes memory errorData)\n internal\n pure\n {\n assembly {\n revert(add(errorData, 0x20), mload(errorData))\n }\n }\n}\n"
|
|
},
|
|
"../../errors/LibSignatureRichErrors.sol": {
|
|
"id": 1,
|
|
"content": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\n\n\nlibrary LibSignatureRichErrors {\n\n enum SignatureValidationErrorCodes {\n ALWAYS_INVALID,\n INVALID_LENGTH,\n UNSUPPORTED,\n ILLEGAL,\n WRONG_SIGNER,\n BAD_SIGNATURE_DATA\n }\n\n // solhint-disable func-name-mixedcase\n\n function SignatureValidationError(\n SignatureValidationErrorCodes code,\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"SignatureValidationError(uint8,bytes32,address,bytes)\")),\n code,\n hash,\n signerAddress,\n signature\n );\n }\n\n function SignatureValidationError(\n SignatureValidationErrorCodes code,\n bytes32 hash\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"SignatureValidationError(uint8,bytes32)\")),\n code,\n hash\n );\n }\n}\n"
|
|
},
|
|
"../libs/LibNativeOrder.sol": {
|
|
"id": 4,
|
|
"content": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\npragma experimental ABIEncoderV2;\n\nimport \"@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol\";\nimport \"@0x/contracts-utils/contracts/src/v06/errors/LibRichErrorsV06.sol\";\nimport \"@0x/contracts-utils/contracts/src/v06/LibSafeMathV06.sol\";\nimport \"../../errors/LibNativeOrdersRichErrors.sol\";\n\n\n/// @dev A library for common native order operations.\nlibrary LibNativeOrder {\n using LibSafeMathV06 for uint256;\n using LibRichErrorsV06 for bytes;\n\n enum OrderStatus {\n INVALID,\n FILLABLE,\n FILLED,\n CANCELLED,\n EXPIRED\n }\n\n /// @dev A standard OTC or OO limit order.\n struct LimitOrder {\n IERC20TokenV06 makerToken;\n IERC20TokenV06 takerToken;\n uint128 makerAmount;\n uint128 takerAmount;\n uint128 takerTokenFeeAmount;\n address maker;\n address taker;\n address sender;\n address feeRecipient;\n bytes32 pool;\n uint64 expiry;\n uint256 salt;\n }\n\n /// @dev An RFQ limit order.\n struct RfqOrder {\n IERC20TokenV06 makerToken;\n IERC20TokenV06 takerToken;\n uint128 makerAmount;\n uint128 takerAmount;\n address maker;\n address taker;\n address txOrigin;\n bytes32 pool;\n uint64 expiry;\n uint256 salt;\n }\n\n /// @dev Info on a limit or RFQ order.\n struct OrderInfo {\n bytes32 orderHash;\n OrderStatus status;\n uint128 takerTokenFilledAmount;\n }\n\n uint256 private constant UINT_128_MASK = (1 << 128) - 1;\n uint256 private constant UINT_64_MASK = (1 << 64) - 1;\n uint256 private constant ADDRESS_MASK = (1 << 160) - 1;\n\n // The type hash for limit orders, which is:\n // keccak256(abi.encodePacked(\n // \"LimitOrder(\",\n // \"address makerToken,\",\n // \"address takerToken,\",\n // \"uint128 makerAmount,\",\n // \"uint128 takerAmount,\",\n // \"uint128 takerTokenFeeAmount,\",\n // \"address maker,\",\n // \"address taker,\",\n // \"address sender,\",\n // \"address feeRecipient,\",\n // \"bytes32 pool,\",\n // \"uint64 expiry,\",\n // \"uint256 salt\"\n // \")\"\n // ))\n uint256 private constant _LIMIT_ORDER_TYPEHASH =\n 0xce918627cb55462ddbb85e73de69a8b322f2bc88f4507c52fcad6d4c33c29d49;\n\n // The type hash for RFQ orders, which is:\n // keccak256(abi.encodePacked(\n // \"RfqOrder(\",\n // \"address makerToken,\",\n // \"address takerToken,\",\n // \"uint128 makerAmount,\",\n // \"uint128 takerAmount,\",\n // \"address maker,\",\n // \"address taker,\",\n // \"address txOrigin,\",\n // \"bytes32 pool,\",\n // \"uint64 expiry,\",\n // \"uint256 salt\"\n // \")\"\n // ))\n uint256 private constant _RFQ_ORDER_TYPEHASH =\n 0xe593d3fdfa8b60e5e17a1b2204662ecbe15c23f2084b9ad5bae40359540a7da9;\n\n /// @dev Get the struct hash of a limit order.\n /// @param order The limit order.\n /// @return structHash The struct hash of the order.\n function getLimitOrderStructHash(LimitOrder memory order)\n internal\n pure\n returns (bytes32 structHash)\n {\n // The struct hash is:\n // keccak256(abi.encode(\n // TYPE_HASH,\n // order.makerToken,\n // order.takerToken,\n // order.makerAmount,\n // order.takerAmount,\n // order.takerTokenFeeAmount,\n // order.maker,\n // order.taker,\n // order.sender,\n // order.feeRecipient,\n // order.pool,\n // order.expiry,\n // order.salt,\n // ))\n assembly {\n let mem := mload(0x40)\n mstore(mem, _LIMIT_ORDER_TYPEHASH)\n // order.makerToken;\n mstore(add(mem, 0x20), and(ADDRESS_MASK, mload(order)))\n // order.takerToken;\n mstore(add(mem, 0x40), and(ADDRESS_MASK, mload(add(order, 0x20))))\n // order.makerAmount;\n mstore(add(mem, 0x60), and(UINT_128_MASK, mload(add(order, 0x40))))\n // order.takerAmount;\n mstore(add(mem, 0x80), and(UINT_128_MASK, mload(add(order, 0x60))))\n // order.takerTokenFeeAmount;\n mstore(add(mem, 0xA0), and(UINT_128_MASK, mload(add(order, 0x80))))\n // order.maker;\n mstore(add(mem, 0xC0), and(ADDRESS_MASK, mload(add(order, 0xA0))))\n // order.taker;\n mstore(add(mem, 0xE0), and(ADDRESS_MASK, mload(add(order, 0xC0))))\n // order.sender;\n mstore(add(mem, 0x100), and(ADDRESS_MASK, mload(add(order, 0xE0))))\n // order.feeRecipient;\n mstore(add(mem, 0x120), and(ADDRESS_MASK, mload(add(order, 0x100))))\n // order.pool;\n mstore(add(mem, 0x140), mload(add(order, 0x120)))\n // order.expiry;\n mstore(add(mem, 0x160), and(UINT_64_MASK, mload(add(order, 0x140))))\n // order.salt;\n mstore(add(mem, 0x180), mload(add(order, 0x160)))\n structHash := keccak256(mem, 0x1A0)\n }\n }\n\n /// @dev Get the struct hash of a RFQ order.\n /// @param order The RFQ order.\n /// @return structHash The struct hash of the order.\n function getRfqOrderStructHash(RfqOrder memory order)\n internal\n pure\n returns (bytes32 structHash)\n {\n // The struct hash is:\n // keccak256(abi.encode(\n // TYPE_HASH,\n // order.makerToken,\n // order.takerToken,\n // order.makerAmount,\n // order.takerAmount,\n // order.maker,\n // order.taker,\n // order.txOrigin,\n // order.pool,\n // order.expiry,\n // order.salt,\n // ))\n assembly {\n let mem := mload(0x40)\n mstore(mem, _RFQ_ORDER_TYPEHASH)\n // order.makerToken;\n mstore(add(mem, 0x20), and(ADDRESS_MASK, mload(order)))\n // order.takerToken;\n mstore(add(mem, 0x40), and(ADDRESS_MASK, mload(add(order, 0x20))))\n // order.makerAmount;\n mstore(add(mem, 0x60), and(UINT_128_MASK, mload(add(order, 0x40))))\n // order.takerAmount;\n mstore(add(mem, 0x80), and(UINT_128_MASK, mload(add(order, 0x60))))\n // order.maker;\n mstore(add(mem, 0xA0), and(ADDRESS_MASK, mload(add(order, 0x80))))\n // order.taker;\n mstore(add(mem, 0xC0), and(ADDRESS_MASK, mload(add(order, 0xA0))))\n // order.txOrigin;\n mstore(add(mem, 0xE0), and(ADDRESS_MASK, mload(add(order, 0xC0))))\n // order.pool;\n mstore(add(mem, 0x100), mload(add(order, 0xE0)))\n // order.expiry;\n mstore(add(mem, 0x120), and(UINT_64_MASK, mload(add(order, 0x100))))\n // order.salt;\n mstore(add(mem, 0x140), mload(add(order, 0x120)))\n structHash := keccak256(mem, 0x160)\n }\n }\n\n /// @dev Refund any leftover protocol fees in `msg.value` to `msg.sender`.\n /// @param ethProtocolFeePaid How much ETH was paid in protocol fees.\n function refundExcessProtocolFeeToSender(uint256 ethProtocolFeePaid)\n internal\n {\n if (msg.value > ethProtocolFeePaid && msg.sender != address(this)) {\n uint256 refundAmount = msg.value.safeSub(ethProtocolFeePaid);\n (bool success,) = msg\n .sender\n .call{value: refundAmount}(\"\");\n if (!success) {\n LibNativeOrdersRichErrors.ProtocolFeeRefundFailed(\n msg.sender,\n refundAmount\n ).rrevert();\n }\n }\n }\n}\n"
|
|
},
|
|
"@0x/contracts-utils/contracts/src/v06/LibSafeMathV06.sol": {
|
|
"id": 7,
|
|
"content": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\n\nimport \"./errors/LibRichErrorsV06.sol\";\nimport \"./errors/LibSafeMathRichErrorsV06.sol\";\n\n\nlibrary LibSafeMathV06 {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n if (c / a != b) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256BinOpError(\n LibSafeMathRichErrorsV06.BinOpErrorCodes.MULTIPLICATION_OVERFLOW,\n a,\n b\n ));\n }\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (b == 0) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256BinOpError(\n LibSafeMathRichErrorsV06.BinOpErrorCodes.DIVISION_BY_ZERO,\n a,\n b\n ));\n }\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (b > a) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256BinOpError(\n LibSafeMathRichErrorsV06.BinOpErrorCodes.SUBTRACTION_UNDERFLOW,\n a,\n b\n ));\n }\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n if (c < a) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256BinOpError(\n LibSafeMathRichErrorsV06.BinOpErrorCodes.ADDITION_OVERFLOW,\n a,\n b\n ));\n }\n return c;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function safeMul128(uint128 a, uint128 b)\n internal\n pure\n returns (uint128)\n {\n if (a == 0) {\n return 0;\n }\n uint128 c = a * b;\n if (c / a != b) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256BinOpError(\n LibSafeMathRichErrorsV06.BinOpErrorCodes.MULTIPLICATION_OVERFLOW,\n a,\n b\n ));\n }\n return c;\n }\n\n function safeDiv128(uint128 a, uint128 b)\n internal\n pure\n returns (uint128)\n {\n if (b == 0) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256BinOpError(\n LibSafeMathRichErrorsV06.BinOpErrorCodes.DIVISION_BY_ZERO,\n a,\n b\n ));\n }\n uint128 c = a / b;\n return c;\n }\n\n function safeSub128(uint128 a, uint128 b)\n internal\n pure\n returns (uint128)\n {\n if (b > a) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256BinOpError(\n LibSafeMathRichErrorsV06.BinOpErrorCodes.SUBTRACTION_UNDERFLOW,\n a,\n b\n ));\n }\n return a - b;\n }\n\n function safeAdd128(uint128 a, uint128 b)\n internal\n pure\n returns (uint128)\n {\n uint128 c = a + b;\n if (c < a) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256BinOpError(\n LibSafeMathRichErrorsV06.BinOpErrorCodes.ADDITION_OVERFLOW,\n a,\n b\n ));\n }\n return c;\n }\n\n function max128(uint128 a, uint128 b)\n internal\n pure\n returns (uint128)\n {\n return a >= b ? a : b;\n }\n\n function min128(uint128 a, uint128 b)\n internal\n pure\n returns (uint128)\n {\n return a < b ? a : b;\n }\n\n function safeDowncastToUint128(uint256 a)\n internal\n pure\n returns (uint128)\n {\n if (a > type(uint128).max) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256DowncastError(\n LibSafeMathRichErrorsV06.DowncastErrorCodes.VALUE_TOO_LARGE_TO_DOWNCAST_TO_UINT128,\n a\n ));\n }\n return uint128(a);\n }\n}\n"
|
|
},
|
|
"@0x/contracts-utils/contracts/src/v06/errors/LibSafeMathRichErrorsV06.sol": {
|
|
"id": 9,
|
|
"content": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\n\n\nlibrary LibSafeMathRichErrorsV06 {\n\n // bytes4(keccak256(\"Uint256BinOpError(uint8,uint256,uint256)\"))\n bytes4 internal constant UINT256_BINOP_ERROR_SELECTOR =\n 0xe946c1bb;\n\n // bytes4(keccak256(\"Uint256DowncastError(uint8,uint256)\"))\n bytes4 internal constant UINT256_DOWNCAST_ERROR_SELECTOR =\n 0xc996af7b;\n\n enum BinOpErrorCodes {\n ADDITION_OVERFLOW,\n MULTIPLICATION_OVERFLOW,\n SUBTRACTION_UNDERFLOW,\n DIVISION_BY_ZERO\n }\n\n enum DowncastErrorCodes {\n VALUE_TOO_LARGE_TO_DOWNCAST_TO_UINT32,\n VALUE_TOO_LARGE_TO_DOWNCAST_TO_UINT64,\n VALUE_TOO_LARGE_TO_DOWNCAST_TO_UINT96,\n VALUE_TOO_LARGE_TO_DOWNCAST_TO_UINT128\n }\n\n // solhint-disable func-name-mixedcase\n function Uint256BinOpError(\n BinOpErrorCodes errorCode,\n uint256 a,\n uint256 b\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n UINT256_BINOP_ERROR_SELECTOR,\n errorCode,\n a,\n b\n );\n }\n\n function Uint256DowncastError(\n DowncastErrorCodes errorCode,\n uint256 a\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n UINT256_DOWNCAST_ERROR_SELECTOR,\n errorCode,\n a\n );\n }\n}\n"
|
|
},
|
|
"../../errors/LibNativeOrdersRichErrors.sol": {
|
|
"id": 0,
|
|
"content": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\n\n\nlibrary LibNativeOrdersRichErrors {\n\n // solhint-disable func-name-mixedcase\n\n function ProtocolFeeRefundFailed(\n address receiver,\n uint256 refundAmount\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"ProtocolFeeRefundFailed(address,uint256)\")),\n receiver,\n refundAmount\n );\n }\n\n function OrderNotFillableByOriginError(\n bytes32 orderHash,\n address txOrigin,\n address orderTxOrigin\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"OrderNotFillableByOriginError(bytes32,address,address)\")),\n orderHash,\n txOrigin,\n orderTxOrigin\n );\n }\n\n function OrderNotFillableError(\n bytes32 orderHash,\n uint8 orderStatus\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"OrderNotFillableError(bytes32,uint8)\")),\n orderHash,\n orderStatus\n );\n }\n\n function OrderNotSignedByMakerError(\n bytes32 orderHash,\n address signer,\n address maker\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"OrderNotSignedByMakerError(bytes32,address,address)\")),\n orderHash,\n signer,\n maker\n );\n }\n\n function OrderNotFillableBySenderError(\n bytes32 orderHash,\n address sender,\n address orderSender\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"OrderNotFillableBySenderError(bytes32,address,address)\")),\n orderHash,\n sender,\n orderSender\n );\n }\n\n function OrderNotFillableByTakerError(\n bytes32 orderHash,\n address taker,\n address orderTaker\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"OrderNotFillableByTakerError(bytes32,address,address)\")),\n orderHash,\n taker,\n orderTaker\n );\n }\n\n function CancelSaltTooLowError(\n uint256 minValidSalt,\n uint256 oldMinValidSalt\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"CancelSaltTooLowError(uint256,uint256)\")),\n minValidSalt,\n oldMinValidSalt\n );\n }\n\n function FillOrKillFailedError(\n bytes32 orderHash,\n uint256 takerTokenFilledAmount,\n uint256 takerTokenFillAmount\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"FillOrKillFailedError(bytes32,uint256,uint256)\")),\n orderHash,\n takerTokenFilledAmount,\n takerTokenFillAmount\n );\n }\n\n function OnlyOrderMakerAllowed(\n bytes32 orderHash,\n address sender,\n address maker\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"OnlyOrderMakerAllowed(bytes32,address,address)\")),\n orderHash,\n sender,\n maker\n );\n }\n\n function BatchFillIncompleteError(\n bytes32 orderHash,\n uint256 takerTokenFilledAmount,\n uint256 takerTokenFillAmount\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"BatchFillIncompleteError(bytes32,uint256,uint256)\")),\n orderHash,\n takerTokenFilledAmount,\n takerTokenFillAmount\n );\n }\n}\n"
|
|
},
|
|
"./INativeOrdersEvents.sol": {
|
|
"id": 2,
|
|
"content": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2021 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\npragma experimental ABIEncoderV2;\n\nimport \"@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol\";\nimport \"../libs/LibSignature.sol\";\nimport \"../libs/LibNativeOrder.sol\";\n\n\n/// @dev Events emitted by NativeOrdersFeature.\ninterface INativeOrdersEvents {\n\n /// @dev Emitted whenever a `LimitOrder` is filled.\n /// @param orderHash The canonical hash of the order.\n /// @param maker The maker of the order.\n /// @param taker The taker of the order.\n /// @param feeRecipient Fee recipient of the order.\n /// @param takerTokenFilledAmount How much taker token was filled.\n /// @param makerTokenFilledAmount How much maker token was filled.\n /// @param protocolFeePaid How much protocol fee was paid.\n /// @param pool The fee pool associated with this order.\n event LimitOrderFilled(\n bytes32 orderHash,\n address maker,\n address taker,\n address feeRecipient,\n address makerToken,\n address takerToken,\n uint128 takerTokenFilledAmount,\n uint128 makerTokenFilledAmount,\n uint128 takerTokenFeeFilledAmount,\n uint256 protocolFeePaid,\n bytes32 pool\n );\n\n /// @dev Emitted whenever an `RfqOrder` is filled.\n /// @param orderHash The canonical hash of the order.\n /// @param maker The maker of the order.\n /// @param taker The taker of the order.\n /// @param takerTokenFilledAmount How much taker token was filled.\n /// @param makerTokenFilledAmount How much maker token was filled.\n /// @param pool The fee pool associated with this order.\n event RfqOrderFilled(\n bytes32 orderHash,\n address maker,\n address taker,\n address makerToken,\n address takerToken,\n uint128 takerTokenFilledAmount,\n uint128 makerTokenFilledAmount,\n bytes32 pool\n );\n\n /// @dev Emitted whenever a limit or RFQ order is cancelled.\n /// @param orderHash The canonical hash of the order.\n /// @param maker The order maker.\n event OrderCancelled(\n bytes32 orderHash,\n address maker\n );\n\n /// @dev Emitted whenever Limit orders are cancelled by pair by a maker.\n /// @param maker The maker of the order.\n /// @param makerToken The maker token in a pair for the orders cancelled.\n /// @param takerToken The taker token in a pair for the orders cancelled.\n /// @param minValidSalt The new minimum valid salt an order with this pair must\n /// have.\n event PairCancelledLimitOrders(\n address maker,\n address makerToken,\n address takerToken,\n uint256 minValidSalt\n );\n\n /// @dev Emitted whenever RFQ orders are cancelled by pair by a maker.\n /// @param maker The maker of the order.\n /// @param makerToken The maker token in a pair for the orders cancelled.\n /// @param takerToken The taker token in a pair for the orders cancelled.\n /// @param minValidSalt The new minimum valid salt an order with this pair must\n /// have.\n event PairCancelledRfqOrders(\n address maker,\n address makerToken,\n address takerToken,\n uint256 minValidSalt\n );\n\n /// @dev Emitted when new addresses are allowed or disallowed to fill\n /// orders with a given txOrigin.\n /// @param origin The address doing the allowing.\n /// @param addrs The address being allowed/disallowed.\n /// @param allowed Indicates whether the address should be allowed.\n event RfqOrderOriginsAllowed(\n address origin,\n address[] addrs,\n bool allowed\n );\n}\n"
|
|
}
|
|
},
|
|
"sourceCodes": {
|
|
"./INativeOrdersFeature.sol": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\npragma experimental ABIEncoderV2;\n\nimport \"@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol\";\nimport \"../libs/LibSignature.sol\";\nimport \"../libs/LibNativeOrder.sol\";\nimport \"./INativeOrdersEvents.sol\";\n\n\n/// @dev Feature for interacting with limit orders.\ninterface INativeOrdersFeature is\n INativeOrdersEvents\n{\n\n /// @dev Transfers protocol fees from the `FeeCollector` pools into\n /// the staking contract.\n /// @param poolIds Staking pool IDs\n function transferProtocolFeesForPools(bytes32[] calldata poolIds)\n external;\n\n /// @dev Fill a limit order. The taker and sender will be the caller.\n /// @param order The limit order. ETH protocol fees can be\n /// attached to this call. Any unspent ETH will be refunded to\n /// the caller.\n /// @param signature The order signature.\n /// @param takerTokenFillAmount Maximum taker token amount to fill this order with.\n /// @return takerTokenFilledAmount How much maker token was filled.\n /// @return makerTokenFilledAmount How much maker token was filled.\n function fillLimitOrder(\n LibNativeOrder.LimitOrder calldata order,\n LibSignature.Signature calldata signature,\n uint128 takerTokenFillAmount\n )\n external\n payable\n returns (uint128 takerTokenFilledAmount, uint128 makerTokenFilledAmount);\n\n /// @dev Fill an RFQ order for up to `takerTokenFillAmount` taker tokens.\n /// The taker will be the caller.\n /// @param order The RFQ order.\n /// @param signature The order signature.\n /// @param takerTokenFillAmount Maximum taker token amount to fill this order with.\n /// @return takerTokenFilledAmount How much maker token was filled.\n /// @return makerTokenFilledAmount How much maker token was filled.\n function fillRfqOrder(\n LibNativeOrder.RfqOrder calldata order,\n LibSignature.Signature calldata signature,\n uint128 takerTokenFillAmount\n )\n external\n returns (uint128 takerTokenFilledAmount, uint128 makerTokenFilledAmount);\n\n /// @dev Fill an RFQ order for exactly `takerTokenFillAmount` taker tokens.\n /// The taker will be the caller. ETH protocol fees can be\n /// attached to this call. Any unspent ETH will be refunded to\n /// the caller.\n /// @param order The limit order.\n /// @param signature The order signature.\n /// @param takerTokenFillAmount How much taker token to fill this order with.\n /// @return makerTokenFilledAmount How much maker token was filled.\n function fillOrKillLimitOrder(\n LibNativeOrder.LimitOrder calldata order,\n LibSignature.Signature calldata signature,\n uint128 takerTokenFillAmount\n )\n external\n payable\n returns (uint128 makerTokenFilledAmount);\n\n /// @dev Fill an RFQ order for exactly `takerTokenFillAmount` taker tokens.\n /// The taker will be the caller.\n /// @param order The RFQ order.\n /// @param signature The order signature.\n /// @param takerTokenFillAmount How much taker token to fill this order with.\n /// @return makerTokenFilledAmount How much maker token was filled.\n function fillOrKillRfqOrder(\n LibNativeOrder.RfqOrder calldata order,\n LibSignature.Signature calldata signature,\n uint128 takerTokenFillAmount\n )\n external\n returns (uint128 makerTokenFilledAmount);\n\n /// @dev Fill a limit order. Internal variant. ETH protocol fees can be\n /// attached to this call. Any unspent ETH will be refunded to\n /// `msg.sender` (not `sender`).\n /// @param order The limit order.\n /// @param signature The order signature.\n /// @param takerTokenFillAmount Maximum taker token to fill this order with.\n /// @param taker The order taker.\n /// @param sender The order sender.\n /// @return takerTokenFilledAmount How much maker token was filled.\n /// @return makerTokenFilledAmount How much maker token was filled.\n function _fillLimitOrder(\n LibNativeOrder.LimitOrder calldata order,\n LibSignature.Signature calldata signature,\n uint128 takerTokenFillAmount,\n address taker,\n address sender\n )\n external\n payable\n returns (uint128 takerTokenFilledAmount, uint128 makerTokenFilledAmount);\n\n /// @dev Fill an RFQ order. Internal variant.\n /// @param order The RFQ order.\n /// @param signature The order signature.\n /// @param takerTokenFillAmount Maximum taker token to fill this order with.\n /// @param taker The order taker.\n /// @return takerTokenFilledAmount How much maker token was filled.\n /// @return makerTokenFilledAmount How much maker token was filled.\n function _fillRfqOrder(\n LibNativeOrder.RfqOrder calldata order,\n LibSignature.Signature calldata signature,\n uint128 takerTokenFillAmount,\n address taker\n )\n external\n returns (uint128 takerTokenFilledAmount, uint128 makerTokenFilledAmount);\n\n /// @dev Cancel a single limit order. The caller must be the maker.\n /// Silently succeeds if the order has already been cancelled.\n /// @param order The limit order.\n function cancelLimitOrder(LibNativeOrder.LimitOrder calldata order)\n external;\n\n /// @dev Cancel a single RFQ order. The caller must be the maker.\n /// Silently succeeds if the order has already been cancelled.\n /// @param order The RFQ order.\n function cancelRfqOrder(LibNativeOrder.RfqOrder calldata order)\n external;\n\n /// @dev Mark what tx.origin addresses are allowed to fill an order that\n /// specifies the message sender as its txOrigin.\n /// @param origins An array of origin addresses to update.\n /// @param allowed True to register, false to unregister.\n function registerAllowedRfqOrigins(address[] memory origins, bool allowed)\n external;\n\n /// @dev Cancel multiple limit orders. The caller must be the maker.\n /// Silently succeeds if the order has already been cancelled.\n /// @param orders The limit orders.\n function batchCancelLimitOrders(LibNativeOrder.LimitOrder[] calldata orders)\n external;\n\n /// @dev Cancel multiple RFQ orders. The caller must be the maker.\n /// Silently succeeds if the order has already been cancelled.\n /// @param orders The RFQ orders.\n function batchCancelRfqOrders(LibNativeOrder.RfqOrder[] calldata orders)\n external;\n\n /// @dev Cancel all limit orders for a given maker and pair with a salt less\n /// than the value provided. The caller must be the maker. Subsequent\n /// calls to this function with the same caller and pair require the\n /// new salt to be >= the old salt.\n /// @param makerToken The maker token.\n /// @param takerToken The taker token.\n /// @param minValidSalt The new minimum valid salt.\n function cancelPairLimitOrders(\n IERC20TokenV06 makerToken,\n IERC20TokenV06 takerToken,\n uint256 minValidSalt\n )\n external;\n\n /// @dev Cancel all limit orders for a given maker and pair with a salt less\n /// than the value provided. The caller must be the maker. Subsequent\n /// calls to this function with the same caller and pair require the\n /// new salt to be >= the old salt.\n /// @param makerTokens The maker tokens.\n /// @param takerTokens The taker tokens.\n /// @param minValidSalts The new minimum valid salts.\n function batchCancelPairLimitOrders(\n IERC20TokenV06[] calldata makerTokens,\n IERC20TokenV06[] calldata takerTokens,\n uint256[] calldata minValidSalts\n )\n external;\n\n /// @dev Cancel all RFQ orders for a given maker and pair with a salt less\n /// than the value provided. The caller must be the maker. Subsequent\n /// calls to this function with the same caller and pair require the\n /// new salt to be >= the old salt.\n /// @param makerToken The maker token.\n /// @param takerToken The taker token.\n /// @param minValidSalt The new minimum valid salt.\n function cancelPairRfqOrders(\n IERC20TokenV06 makerToken,\n IERC20TokenV06 takerToken,\n uint256 minValidSalt\n )\n external;\n\n /// @dev Cancel all RFQ orders for a given maker and pair with a salt less\n /// than the value provided. The caller must be the maker. Subsequent\n /// calls to this function with the same caller and pair require the\n /// new salt to be >= the old salt.\n /// @param makerTokens The maker tokens.\n /// @param takerTokens The taker tokens.\n /// @param minValidSalts The new minimum valid salts.\n function batchCancelPairRfqOrders(\n IERC20TokenV06[] calldata makerTokens,\n IERC20TokenV06[] calldata takerTokens,\n uint256[] calldata minValidSalts\n )\n external;\n\n /// @dev Get the order info for a limit order.\n /// @param order The limit order.\n /// @return orderInfo Info about the order.\n function getLimitOrderInfo(LibNativeOrder.LimitOrder calldata order)\n external\n view\n returns (LibNativeOrder.OrderInfo memory orderInfo);\n\n /// @dev Get the order info for an RFQ order.\n /// @param order The RFQ order.\n /// @return orderInfo Info about the order.\n function getRfqOrderInfo(LibNativeOrder.RfqOrder calldata order)\n external\n view\n returns (LibNativeOrder.OrderInfo memory orderInfo);\n\n /// @dev Get the canonical hash of a limit order.\n /// @param order The limit order.\n /// @return orderHash The order hash.\n function getLimitOrderHash(LibNativeOrder.LimitOrder calldata order)\n external\n view\n returns (bytes32 orderHash);\n\n /// @dev Get the canonical hash of an RFQ order.\n /// @param order The RFQ order.\n /// @return orderHash The order hash.\n function getRfqOrderHash(LibNativeOrder.RfqOrder calldata order)\n external\n view\n returns (bytes32 orderHash);\n\n /// @dev Get the protocol fee multiplier. This should be multiplied by the\n /// gas price to arrive at the required protocol fee to fill a native order.\n /// @return multiplier The protocol fee multiplier.\n function getProtocolFeeMultiplier()\n external\n view\n returns (uint32 multiplier);\n\n /// @dev Get order info, fillable amount, and signature validity for a limit order.\n /// Fillable amount is determined using balances and allowances of the maker.\n /// @param order The limit order.\n /// @param signature The order signature.\n /// @return orderInfo Info about the order.\n /// @return actualFillableTakerTokenAmount How much of the order is fillable\n /// based on maker funds, in taker tokens.\n /// @return isSignatureValid Whether the signature is valid.\n function getLimitOrderRelevantState(\n LibNativeOrder.LimitOrder calldata order,\n LibSignature.Signature calldata signature\n )\n external\n view\n returns (\n LibNativeOrder.OrderInfo memory orderInfo,\n uint128 actualFillableTakerTokenAmount,\n bool isSignatureValid\n );\n\n /// @dev Get order info, fillable amount, and signature validity for an RFQ order.\n /// Fillable amount is determined using balances and allowances of the maker.\n /// @param order The RFQ order.\n /// @param signature The order signature.\n /// @return orderInfo Info about the order.\n /// @return actualFillableTakerTokenAmount How much of the order is fillable\n /// based on maker funds, in taker tokens.\n /// @return isSignatureValid Whether the signature is valid.\n function getRfqOrderRelevantState(\n LibNativeOrder.RfqOrder calldata order,\n LibSignature.Signature calldata signature\n )\n external\n view\n returns (\n LibNativeOrder.OrderInfo memory orderInfo,\n uint128 actualFillableTakerTokenAmount,\n bool isSignatureValid\n );\n\n /// @dev Batch version of `getLimitOrderRelevantState()`, without reverting.\n /// Orders that would normally cause `getLimitOrderRelevantState()`\n /// to revert will have empty results.\n /// @param orders The limit orders.\n /// @param signatures The order signatures.\n /// @return orderInfos Info about the orders.\n /// @return actualFillableTakerTokenAmounts How much of each order is fillable\n /// based on maker funds, in taker tokens.\n /// @return isSignatureValids Whether each signature is valid for the order.\n function batchGetLimitOrderRelevantStates(\n LibNativeOrder.LimitOrder[] calldata orders,\n LibSignature.Signature[] calldata signatures\n )\n external\n view\n returns (\n LibNativeOrder.OrderInfo[] memory orderInfos,\n uint128[] memory actualFillableTakerTokenAmounts,\n bool[] memory isSignatureValids\n );\n\n /// @dev Batch version of `getRfqOrderRelevantState()`, without reverting.\n /// Orders that would normally cause `getRfqOrderRelevantState()`\n /// to revert will have empty results.\n /// @param orders The RFQ orders.\n /// @param signatures The order signatures.\n /// @return orderInfos Info about the orders.\n /// @return actualFillableTakerTokenAmounts How much of each order is fillable\n /// based on maker funds, in taker tokens.\n /// @return isSignatureValids Whether each signature is valid for the order.\n function batchGetRfqOrderRelevantStates(\n LibNativeOrder.RfqOrder[] calldata orders,\n LibSignature.Signature[] calldata signatures\n )\n external\n view\n returns (\n LibNativeOrder.OrderInfo[] memory orderInfos,\n uint128[] memory actualFillableTakerTokenAmounts,\n bool[] memory isSignatureValids\n );\n}\n",
|
|
"@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\n\n\ninterface IERC20TokenV06 {\n\n // solhint-disable no-simple-event-func-name\n event Transfer(\n address indexed from,\n address indexed to,\n uint256 value\n );\n\n event Approval(\n address indexed owner,\n address indexed spender,\n uint256 value\n );\n\n /// @dev send `value` token to `to` from `msg.sender`\n /// @param to The address of the recipient\n /// @param value The amount of token to be transferred\n /// @return True if transfer was successful\n function transfer(address to, uint256 value)\n external\n returns (bool);\n\n /// @dev send `value` token to `to` from `from` on the condition it is approved by `from`\n /// @param from The address of the sender\n /// @param to The address of the recipient\n /// @param value The amount of token to be transferred\n /// @return True if transfer was successful\n function transferFrom(\n address from,\n address to,\n uint256 value\n )\n external\n returns (bool);\n\n /// @dev `msg.sender` approves `spender` to spend `value` tokens\n /// @param spender The address of the account able to transfer the tokens\n /// @param value The amount of wei to be approved for transfer\n /// @return Always true if the call has enough gas to complete execution\n function approve(address spender, uint256 value)\n external\n returns (bool);\n\n /// @dev Query total supply of token\n /// @return Total supply of token\n function totalSupply()\n external\n view\n returns (uint256);\n\n /// @dev Get the balance of `owner`.\n /// @param owner The address from which the balance will be retrieved\n /// @return Balance of owner\n function balanceOf(address owner)\n external\n view\n returns (uint256);\n\n /// @dev Get the allowance for `spender` to spend from `owner`.\n /// @param owner The address of the account owning tokens\n /// @param spender The address of the account able to transfer the tokens\n /// @return Amount of remaining tokens allowed to spent\n function allowance(address owner, address spender)\n external\n view\n returns (uint256);\n\n /// @dev Get the number of decimals this token has.\n function decimals()\n external\n view\n returns (uint8);\n}\n",
|
|
"../libs/LibSignature.sol": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\npragma experimental ABIEncoderV2;\n\nimport \"@0x/contracts-utils/contracts/src/v06/errors/LibRichErrorsV06.sol\";\nimport \"../../errors/LibSignatureRichErrors.sol\";\n\n\n/// @dev A library for validating signatures.\nlibrary LibSignature {\n using LibRichErrorsV06 for bytes;\n\n // '\\x19Ethereum Signed Message:\\n32\\x00\\x00\\x00\\x00' in a word.\n uint256 private constant ETH_SIGN_HASH_PREFIX =\n 0x19457468657265756d205369676e6564204d6573736167653a0a333200000000;\n /// @dev Exclusive upper limit on ECDSA signatures 'R' values.\n /// The valid range is given by fig (282) of the yellow paper.\n uint256 private constant ECDSA_SIGNATURE_R_LIMIT =\n uint256(0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141);\n /// @dev Exclusive upper limit on ECDSA signatures 'S' values.\n /// The valid range is given by fig (283) of the yellow paper.\n uint256 private constant ECDSA_SIGNATURE_S_LIMIT = ECDSA_SIGNATURE_R_LIMIT / 2 + 1;\n\n /// @dev Allowed signature types.\n enum SignatureType {\n ILLEGAL,\n INVALID,\n EIP712,\n ETHSIGN\n }\n\n /// @dev Encoded EC signature.\n struct Signature {\n // How to validate the signature.\n SignatureType signatureType;\n // EC Signature data.\n uint8 v;\n // EC Signature data.\n bytes32 r;\n // EC Signature data.\n bytes32 s;\n }\n\n /// @dev Retrieve the signer of a signature.\n /// Throws if the signature can't be validated.\n /// @param hash The hash that was signed.\n /// @param signature The signature.\n /// @return recovered The recovered signer address.\n function getSignerOfHash(\n bytes32 hash,\n Signature memory signature\n )\n internal\n pure\n returns (address recovered)\n {\n // Ensure this is a signature type that can be validated against a hash.\n _validateHashCompatibleSignature(hash, signature);\n\n if (signature.signatureType == SignatureType.EIP712) {\n // Signed using EIP712\n recovered = ecrecover(\n hash,\n signature.v,\n signature.r,\n signature.s\n );\n } else if (signature.signatureType == SignatureType.ETHSIGN) {\n // Signed using `eth_sign`\n // Need to hash `hash` with \"\\x19Ethereum Signed Message:\\n32\" prefix\n // in packed encoding.\n bytes32 ethSignHash;\n assembly {\n // Use scratch space\n mstore(0, ETH_SIGN_HASH_PREFIX) // length of 28 bytes\n mstore(28, hash) // length of 32 bytes\n ethSignHash := keccak256(0, 60)\n }\n recovered = ecrecover(\n ethSignHash,\n signature.v,\n signature.r,\n signature.s\n );\n }\n // `recovered` can be null if the signature values are out of range.\n if (recovered == address(0)) {\n LibSignatureRichErrors.SignatureValidationError(\n LibSignatureRichErrors.SignatureValidationErrorCodes.BAD_SIGNATURE_DATA,\n hash\n ).rrevert();\n }\n }\n\n /// @dev Validates that a signature is compatible with a hash signee.\n /// @param hash The hash that was signed.\n /// @param signature The signature.\n function _validateHashCompatibleSignature(\n bytes32 hash,\n Signature memory signature\n )\n private\n pure\n {\n // Ensure the r and s are within malleability limits.\n if (uint256(signature.r) >= ECDSA_SIGNATURE_R_LIMIT ||\n uint256(signature.s) >= ECDSA_SIGNATURE_S_LIMIT)\n {\n LibSignatureRichErrors.SignatureValidationError(\n LibSignatureRichErrors.SignatureValidationErrorCodes.BAD_SIGNATURE_DATA,\n hash\n ).rrevert();\n }\n\n // Always illegal signature.\n if (signature.signatureType == SignatureType.ILLEGAL) {\n LibSignatureRichErrors.SignatureValidationError(\n LibSignatureRichErrors.SignatureValidationErrorCodes.ILLEGAL,\n hash\n ).rrevert();\n }\n\n // Always invalid.\n if (signature.signatureType == SignatureType.INVALID) {\n LibSignatureRichErrors.SignatureValidationError(\n LibSignatureRichErrors.SignatureValidationErrorCodes.ALWAYS_INVALID,\n hash\n ).rrevert();\n }\n\n // Solidity should check that the signature type is within enum range for us\n // when abi-decoding.\n }\n}\n",
|
|
"@0x/contracts-utils/contracts/src/v06/errors/LibRichErrorsV06.sol": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\n\n\nlibrary LibRichErrorsV06 {\n\n // bytes4(keccak256(\"Error(string)\"))\n bytes4 internal constant STANDARD_ERROR_SELECTOR = 0x08c379a0;\n\n // solhint-disable func-name-mixedcase\n /// @dev ABI encode a standard, string revert error payload.\n /// This is the same payload that would be included by a `revert(string)`\n /// solidity statement. It has the function signature `Error(string)`.\n /// @param message The error string.\n /// @return The ABI encoded error.\n function StandardError(string memory message)\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n STANDARD_ERROR_SELECTOR,\n bytes(message)\n );\n }\n // solhint-enable func-name-mixedcase\n\n /// @dev Reverts an encoded rich revert reason `errorData`.\n /// @param errorData ABI encoded error data.\n function rrevert(bytes memory errorData)\n internal\n pure\n {\n assembly {\n revert(add(errorData, 0x20), mload(errorData))\n }\n }\n}\n",
|
|
"../../errors/LibSignatureRichErrors.sol": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\n\n\nlibrary LibSignatureRichErrors {\n\n enum SignatureValidationErrorCodes {\n ALWAYS_INVALID,\n INVALID_LENGTH,\n UNSUPPORTED,\n ILLEGAL,\n WRONG_SIGNER,\n BAD_SIGNATURE_DATA\n }\n\n // solhint-disable func-name-mixedcase\n\n function SignatureValidationError(\n SignatureValidationErrorCodes code,\n bytes32 hash,\n address signerAddress,\n bytes memory signature\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"SignatureValidationError(uint8,bytes32,address,bytes)\")),\n code,\n hash,\n signerAddress,\n signature\n );\n }\n\n function SignatureValidationError(\n SignatureValidationErrorCodes code,\n bytes32 hash\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"SignatureValidationError(uint8,bytes32)\")),\n code,\n hash\n );\n }\n}\n",
|
|
"../libs/LibNativeOrder.sol": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\npragma experimental ABIEncoderV2;\n\nimport \"@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol\";\nimport \"@0x/contracts-utils/contracts/src/v06/errors/LibRichErrorsV06.sol\";\nimport \"@0x/contracts-utils/contracts/src/v06/LibSafeMathV06.sol\";\nimport \"../../errors/LibNativeOrdersRichErrors.sol\";\n\n\n/// @dev A library for common native order operations.\nlibrary LibNativeOrder {\n using LibSafeMathV06 for uint256;\n using LibRichErrorsV06 for bytes;\n\n enum OrderStatus {\n INVALID,\n FILLABLE,\n FILLED,\n CANCELLED,\n EXPIRED\n }\n\n /// @dev A standard OTC or OO limit order.\n struct LimitOrder {\n IERC20TokenV06 makerToken;\n IERC20TokenV06 takerToken;\n uint128 makerAmount;\n uint128 takerAmount;\n uint128 takerTokenFeeAmount;\n address maker;\n address taker;\n address sender;\n address feeRecipient;\n bytes32 pool;\n uint64 expiry;\n uint256 salt;\n }\n\n /// @dev An RFQ limit order.\n struct RfqOrder {\n IERC20TokenV06 makerToken;\n IERC20TokenV06 takerToken;\n uint128 makerAmount;\n uint128 takerAmount;\n address maker;\n address taker;\n address txOrigin;\n bytes32 pool;\n uint64 expiry;\n uint256 salt;\n }\n\n /// @dev Info on a limit or RFQ order.\n struct OrderInfo {\n bytes32 orderHash;\n OrderStatus status;\n uint128 takerTokenFilledAmount;\n }\n\n uint256 private constant UINT_128_MASK = (1 << 128) - 1;\n uint256 private constant UINT_64_MASK = (1 << 64) - 1;\n uint256 private constant ADDRESS_MASK = (1 << 160) - 1;\n\n // The type hash for limit orders, which is:\n // keccak256(abi.encodePacked(\n // \"LimitOrder(\",\n // \"address makerToken,\",\n // \"address takerToken,\",\n // \"uint128 makerAmount,\",\n // \"uint128 takerAmount,\",\n // \"uint128 takerTokenFeeAmount,\",\n // \"address maker,\",\n // \"address taker,\",\n // \"address sender,\",\n // \"address feeRecipient,\",\n // \"bytes32 pool,\",\n // \"uint64 expiry,\",\n // \"uint256 salt\"\n // \")\"\n // ))\n uint256 private constant _LIMIT_ORDER_TYPEHASH =\n 0xce918627cb55462ddbb85e73de69a8b322f2bc88f4507c52fcad6d4c33c29d49;\n\n // The type hash for RFQ orders, which is:\n // keccak256(abi.encodePacked(\n // \"RfqOrder(\",\n // \"address makerToken,\",\n // \"address takerToken,\",\n // \"uint128 makerAmount,\",\n // \"uint128 takerAmount,\",\n // \"address maker,\",\n // \"address taker,\",\n // \"address txOrigin,\",\n // \"bytes32 pool,\",\n // \"uint64 expiry,\",\n // \"uint256 salt\"\n // \")\"\n // ))\n uint256 private constant _RFQ_ORDER_TYPEHASH =\n 0xe593d3fdfa8b60e5e17a1b2204662ecbe15c23f2084b9ad5bae40359540a7da9;\n\n /// @dev Get the struct hash of a limit order.\n /// @param order The limit order.\n /// @return structHash The struct hash of the order.\n function getLimitOrderStructHash(LimitOrder memory order)\n internal\n pure\n returns (bytes32 structHash)\n {\n // The struct hash is:\n // keccak256(abi.encode(\n // TYPE_HASH,\n // order.makerToken,\n // order.takerToken,\n // order.makerAmount,\n // order.takerAmount,\n // order.takerTokenFeeAmount,\n // order.maker,\n // order.taker,\n // order.sender,\n // order.feeRecipient,\n // order.pool,\n // order.expiry,\n // order.salt,\n // ))\n assembly {\n let mem := mload(0x40)\n mstore(mem, _LIMIT_ORDER_TYPEHASH)\n // order.makerToken;\n mstore(add(mem, 0x20), and(ADDRESS_MASK, mload(order)))\n // order.takerToken;\n mstore(add(mem, 0x40), and(ADDRESS_MASK, mload(add(order, 0x20))))\n // order.makerAmount;\n mstore(add(mem, 0x60), and(UINT_128_MASK, mload(add(order, 0x40))))\n // order.takerAmount;\n mstore(add(mem, 0x80), and(UINT_128_MASK, mload(add(order, 0x60))))\n // order.takerTokenFeeAmount;\n mstore(add(mem, 0xA0), and(UINT_128_MASK, mload(add(order, 0x80))))\n // order.maker;\n mstore(add(mem, 0xC0), and(ADDRESS_MASK, mload(add(order, 0xA0))))\n // order.taker;\n mstore(add(mem, 0xE0), and(ADDRESS_MASK, mload(add(order, 0xC0))))\n // order.sender;\n mstore(add(mem, 0x100), and(ADDRESS_MASK, mload(add(order, 0xE0))))\n // order.feeRecipient;\n mstore(add(mem, 0x120), and(ADDRESS_MASK, mload(add(order, 0x100))))\n // order.pool;\n mstore(add(mem, 0x140), mload(add(order, 0x120)))\n // order.expiry;\n mstore(add(mem, 0x160), and(UINT_64_MASK, mload(add(order, 0x140))))\n // order.salt;\n mstore(add(mem, 0x180), mload(add(order, 0x160)))\n structHash := keccak256(mem, 0x1A0)\n }\n }\n\n /// @dev Get the struct hash of a RFQ order.\n /// @param order The RFQ order.\n /// @return structHash The struct hash of the order.\n function getRfqOrderStructHash(RfqOrder memory order)\n internal\n pure\n returns (bytes32 structHash)\n {\n // The struct hash is:\n // keccak256(abi.encode(\n // TYPE_HASH,\n // order.makerToken,\n // order.takerToken,\n // order.makerAmount,\n // order.takerAmount,\n // order.maker,\n // order.taker,\n // order.txOrigin,\n // order.pool,\n // order.expiry,\n // order.salt,\n // ))\n assembly {\n let mem := mload(0x40)\n mstore(mem, _RFQ_ORDER_TYPEHASH)\n // order.makerToken;\n mstore(add(mem, 0x20), and(ADDRESS_MASK, mload(order)))\n // order.takerToken;\n mstore(add(mem, 0x40), and(ADDRESS_MASK, mload(add(order, 0x20))))\n // order.makerAmount;\n mstore(add(mem, 0x60), and(UINT_128_MASK, mload(add(order, 0x40))))\n // order.takerAmount;\n mstore(add(mem, 0x80), and(UINT_128_MASK, mload(add(order, 0x60))))\n // order.maker;\n mstore(add(mem, 0xA0), and(ADDRESS_MASK, mload(add(order, 0x80))))\n // order.taker;\n mstore(add(mem, 0xC0), and(ADDRESS_MASK, mload(add(order, 0xA0))))\n // order.txOrigin;\n mstore(add(mem, 0xE0), and(ADDRESS_MASK, mload(add(order, 0xC0))))\n // order.pool;\n mstore(add(mem, 0x100), mload(add(order, 0xE0)))\n // order.expiry;\n mstore(add(mem, 0x120), and(UINT_64_MASK, mload(add(order, 0x100))))\n // order.salt;\n mstore(add(mem, 0x140), mload(add(order, 0x120)))\n structHash := keccak256(mem, 0x160)\n }\n }\n\n /// @dev Refund any leftover protocol fees in `msg.value` to `msg.sender`.\n /// @param ethProtocolFeePaid How much ETH was paid in protocol fees.\n function refundExcessProtocolFeeToSender(uint256 ethProtocolFeePaid)\n internal\n {\n if (msg.value > ethProtocolFeePaid && msg.sender != address(this)) {\n uint256 refundAmount = msg.value.safeSub(ethProtocolFeePaid);\n (bool success,) = msg\n .sender\n .call{value: refundAmount}(\"\");\n if (!success) {\n LibNativeOrdersRichErrors.ProtocolFeeRefundFailed(\n msg.sender,\n refundAmount\n ).rrevert();\n }\n }\n }\n}\n",
|
|
"@0x/contracts-utils/contracts/src/v06/LibSafeMathV06.sol": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\n\nimport \"./errors/LibRichErrorsV06.sol\";\nimport \"./errors/LibSafeMathRichErrorsV06.sol\";\n\n\nlibrary LibSafeMathV06 {\n\n function safeMul(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n if (c / a != b) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256BinOpError(\n LibSafeMathRichErrorsV06.BinOpErrorCodes.MULTIPLICATION_OVERFLOW,\n a,\n b\n ));\n }\n return c;\n }\n\n function safeDiv(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (b == 0) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256BinOpError(\n LibSafeMathRichErrorsV06.BinOpErrorCodes.DIVISION_BY_ZERO,\n a,\n b\n ));\n }\n uint256 c = a / b;\n return c;\n }\n\n function safeSub(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n if (b > a) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256BinOpError(\n LibSafeMathRichErrorsV06.BinOpErrorCodes.SUBTRACTION_UNDERFLOW,\n a,\n b\n ));\n }\n return a - b;\n }\n\n function safeAdd(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n uint256 c = a + b;\n if (c < a) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256BinOpError(\n LibSafeMathRichErrorsV06.BinOpErrorCodes.ADDITION_OVERFLOW,\n a,\n b\n ));\n }\n return c;\n }\n\n function max256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a >= b ? a : b;\n }\n\n function min256(uint256 a, uint256 b)\n internal\n pure\n returns (uint256)\n {\n return a < b ? a : b;\n }\n\n function safeMul128(uint128 a, uint128 b)\n internal\n pure\n returns (uint128)\n {\n if (a == 0) {\n return 0;\n }\n uint128 c = a * b;\n if (c / a != b) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256BinOpError(\n LibSafeMathRichErrorsV06.BinOpErrorCodes.MULTIPLICATION_OVERFLOW,\n a,\n b\n ));\n }\n return c;\n }\n\n function safeDiv128(uint128 a, uint128 b)\n internal\n pure\n returns (uint128)\n {\n if (b == 0) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256BinOpError(\n LibSafeMathRichErrorsV06.BinOpErrorCodes.DIVISION_BY_ZERO,\n a,\n b\n ));\n }\n uint128 c = a / b;\n return c;\n }\n\n function safeSub128(uint128 a, uint128 b)\n internal\n pure\n returns (uint128)\n {\n if (b > a) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256BinOpError(\n LibSafeMathRichErrorsV06.BinOpErrorCodes.SUBTRACTION_UNDERFLOW,\n a,\n b\n ));\n }\n return a - b;\n }\n\n function safeAdd128(uint128 a, uint128 b)\n internal\n pure\n returns (uint128)\n {\n uint128 c = a + b;\n if (c < a) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256BinOpError(\n LibSafeMathRichErrorsV06.BinOpErrorCodes.ADDITION_OVERFLOW,\n a,\n b\n ));\n }\n return c;\n }\n\n function max128(uint128 a, uint128 b)\n internal\n pure\n returns (uint128)\n {\n return a >= b ? a : b;\n }\n\n function min128(uint128 a, uint128 b)\n internal\n pure\n returns (uint128)\n {\n return a < b ? a : b;\n }\n\n function safeDowncastToUint128(uint256 a)\n internal\n pure\n returns (uint128)\n {\n if (a > type(uint128).max) {\n LibRichErrorsV06.rrevert(LibSafeMathRichErrorsV06.Uint256DowncastError(\n LibSafeMathRichErrorsV06.DowncastErrorCodes.VALUE_TOO_LARGE_TO_DOWNCAST_TO_UINT128,\n a\n ));\n }\n return uint128(a);\n }\n}\n",
|
|
"@0x/contracts-utils/contracts/src/v06/errors/LibSafeMathRichErrorsV06.sol": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\n\n\nlibrary LibSafeMathRichErrorsV06 {\n\n // bytes4(keccak256(\"Uint256BinOpError(uint8,uint256,uint256)\"))\n bytes4 internal constant UINT256_BINOP_ERROR_SELECTOR =\n 0xe946c1bb;\n\n // bytes4(keccak256(\"Uint256DowncastError(uint8,uint256)\"))\n bytes4 internal constant UINT256_DOWNCAST_ERROR_SELECTOR =\n 0xc996af7b;\n\n enum BinOpErrorCodes {\n ADDITION_OVERFLOW,\n MULTIPLICATION_OVERFLOW,\n SUBTRACTION_UNDERFLOW,\n DIVISION_BY_ZERO\n }\n\n enum DowncastErrorCodes {\n VALUE_TOO_LARGE_TO_DOWNCAST_TO_UINT32,\n VALUE_TOO_LARGE_TO_DOWNCAST_TO_UINT64,\n VALUE_TOO_LARGE_TO_DOWNCAST_TO_UINT96,\n VALUE_TOO_LARGE_TO_DOWNCAST_TO_UINT128\n }\n\n // solhint-disable func-name-mixedcase\n function Uint256BinOpError(\n BinOpErrorCodes errorCode,\n uint256 a,\n uint256 b\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n UINT256_BINOP_ERROR_SELECTOR,\n errorCode,\n a,\n b\n );\n }\n\n function Uint256DowncastError(\n DowncastErrorCodes errorCode,\n uint256 a\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n UINT256_DOWNCAST_ERROR_SELECTOR,\n errorCode,\n a\n );\n }\n}\n",
|
|
"../../errors/LibNativeOrdersRichErrors.sol": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2020 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\n\n\nlibrary LibNativeOrdersRichErrors {\n\n // solhint-disable func-name-mixedcase\n\n function ProtocolFeeRefundFailed(\n address receiver,\n uint256 refundAmount\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"ProtocolFeeRefundFailed(address,uint256)\")),\n receiver,\n refundAmount\n );\n }\n\n function OrderNotFillableByOriginError(\n bytes32 orderHash,\n address txOrigin,\n address orderTxOrigin\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"OrderNotFillableByOriginError(bytes32,address,address)\")),\n orderHash,\n txOrigin,\n orderTxOrigin\n );\n }\n\n function OrderNotFillableError(\n bytes32 orderHash,\n uint8 orderStatus\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"OrderNotFillableError(bytes32,uint8)\")),\n orderHash,\n orderStatus\n );\n }\n\n function OrderNotSignedByMakerError(\n bytes32 orderHash,\n address signer,\n address maker\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"OrderNotSignedByMakerError(bytes32,address,address)\")),\n orderHash,\n signer,\n maker\n );\n }\n\n function OrderNotFillableBySenderError(\n bytes32 orderHash,\n address sender,\n address orderSender\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"OrderNotFillableBySenderError(bytes32,address,address)\")),\n orderHash,\n sender,\n orderSender\n );\n }\n\n function OrderNotFillableByTakerError(\n bytes32 orderHash,\n address taker,\n address orderTaker\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"OrderNotFillableByTakerError(bytes32,address,address)\")),\n orderHash,\n taker,\n orderTaker\n );\n }\n\n function CancelSaltTooLowError(\n uint256 minValidSalt,\n uint256 oldMinValidSalt\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"CancelSaltTooLowError(uint256,uint256)\")),\n minValidSalt,\n oldMinValidSalt\n );\n }\n\n function FillOrKillFailedError(\n bytes32 orderHash,\n uint256 takerTokenFilledAmount,\n uint256 takerTokenFillAmount\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"FillOrKillFailedError(bytes32,uint256,uint256)\")),\n orderHash,\n takerTokenFilledAmount,\n takerTokenFillAmount\n );\n }\n\n function OnlyOrderMakerAllowed(\n bytes32 orderHash,\n address sender,\n address maker\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"OnlyOrderMakerAllowed(bytes32,address,address)\")),\n orderHash,\n sender,\n maker\n );\n }\n\n function BatchFillIncompleteError(\n bytes32 orderHash,\n uint256 takerTokenFilledAmount,\n uint256 takerTokenFillAmount\n )\n internal\n pure\n returns (bytes memory)\n {\n return abi.encodeWithSelector(\n bytes4(keccak256(\"BatchFillIncompleteError(bytes32,uint256,uint256)\")),\n orderHash,\n takerTokenFilledAmount,\n takerTokenFillAmount\n );\n }\n}\n",
|
|
"./INativeOrdersEvents.sol": "// SPDX-License-Identifier: Apache-2.0\n/*\n\n Copyright 2021 ZeroEx Intl.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.6.5;\npragma experimental ABIEncoderV2;\n\nimport \"@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol\";\nimport \"../libs/LibSignature.sol\";\nimport \"../libs/LibNativeOrder.sol\";\n\n\n/// @dev Events emitted by NativeOrdersFeature.\ninterface INativeOrdersEvents {\n\n /// @dev Emitted whenever a `LimitOrder` is filled.\n /// @param orderHash The canonical hash of the order.\n /// @param maker The maker of the order.\n /// @param taker The taker of the order.\n /// @param feeRecipient Fee recipient of the order.\n /// @param takerTokenFilledAmount How much taker token was filled.\n /// @param makerTokenFilledAmount How much maker token was filled.\n /// @param protocolFeePaid How much protocol fee was paid.\n /// @param pool The fee pool associated with this order.\n event LimitOrderFilled(\n bytes32 orderHash,\n address maker,\n address taker,\n address feeRecipient,\n address makerToken,\n address takerToken,\n uint128 takerTokenFilledAmount,\n uint128 makerTokenFilledAmount,\n uint128 takerTokenFeeFilledAmount,\n uint256 protocolFeePaid,\n bytes32 pool\n );\n\n /// @dev Emitted whenever an `RfqOrder` is filled.\n /// @param orderHash The canonical hash of the order.\n /// @param maker The maker of the order.\n /// @param taker The taker of the order.\n /// @param takerTokenFilledAmount How much taker token was filled.\n /// @param makerTokenFilledAmount How much maker token was filled.\n /// @param pool The fee pool associated with this order.\n event RfqOrderFilled(\n bytes32 orderHash,\n address maker,\n address taker,\n address makerToken,\n address takerToken,\n uint128 takerTokenFilledAmount,\n uint128 makerTokenFilledAmount,\n bytes32 pool\n );\n\n /// @dev Emitted whenever a limit or RFQ order is cancelled.\n /// @param orderHash The canonical hash of the order.\n /// @param maker The order maker.\n event OrderCancelled(\n bytes32 orderHash,\n address maker\n );\n\n /// @dev Emitted whenever Limit orders are cancelled by pair by a maker.\n /// @param maker The maker of the order.\n /// @param makerToken The maker token in a pair for the orders cancelled.\n /// @param takerToken The taker token in a pair for the orders cancelled.\n /// @param minValidSalt The new minimum valid salt an order with this pair must\n /// have.\n event PairCancelledLimitOrders(\n address maker,\n address makerToken,\n address takerToken,\n uint256 minValidSalt\n );\n\n /// @dev Emitted whenever RFQ orders are cancelled by pair by a maker.\n /// @param maker The maker of the order.\n /// @param makerToken The maker token in a pair for the orders cancelled.\n /// @param takerToken The taker token in a pair for the orders cancelled.\n /// @param minValidSalt The new minimum valid salt an order with this pair must\n /// have.\n event PairCancelledRfqOrders(\n address maker,\n address makerToken,\n address takerToken,\n uint256 minValidSalt\n );\n\n /// @dev Emitted when new addresses are allowed or disallowed to fill\n /// orders with a given txOrigin.\n /// @param origin The address doing the allowing.\n /// @param addrs The address being allowed/disallowed.\n /// @param allowed Indicates whether the address should be allowed.\n event RfqOrderOriginsAllowed(\n address origin,\n address[] addrs,\n bool allowed\n );\n}\n"
|
|
},
|
|
"compiler": {
|
|
"name": "solc",
|
|
"version": "0.6.12+commit.27d51765",
|
|
"settings": {
|
|
"remappings": [
|
|
"@0x/contracts-utils=/Users/michaelzhu/protocol/node_modules/@0x/contracts-utils",
|
|
"@0x/contracts-erc20=/Users/michaelzhu/protocol/contracts/zero-ex/node_modules/@0x/contracts-erc20"
|
|
],
|
|
"optimizer": {
|
|
"enabled": true,
|
|
"runs": 1000000,
|
|
"details": {
|
|
"yul": true,
|
|
"deduplicate": true,
|
|
"cse": true,
|
|
"constantOptimizer": true
|
|
}
|
|
},
|
|
"outputSelection": {
|
|
"*": {
|
|
"*": [
|
|
"abi",
|
|
"devdoc",
|
|
"evm.bytecode.object",
|
|
"evm.bytecode.sourceMap",
|
|
"evm.deployedBytecode.object",
|
|
"evm.deployedBytecode.sourceMap",
|
|
"evm.methodIdentifiers"
|
|
]
|
|
}
|
|
},
|
|
"evmVersion": "istanbul"
|
|
}
|
|
},
|
|
"chains": {}
|
|
}
|