├── .circleci └── config.yml ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── README.md ├── dist ├── ethereum-input-to-object.esm.js └── ethereum-input-to-object.js ├── package-lock.json ├── package.json ├── rollup.config.js ├── src └── index.js └── test ├── data ├── 0x_v3_abi.json ├── 0x_v3_batchFillOrders.txt ├── 1inch_exchange_v2_abi.json ├── 1inch_exchange_v2_assetEth_withWeth.txt ├── 1inch_exchange_v3_abi.json ├── 1inch_exchange_v3_unoswap.txt └── 1inch_v2_expectedSwap.json └── index.js /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | test: 4 | docker: 5 | - image: circleci/node:12.13 6 | steps: 7 | - checkout 8 | - restore_cache: 9 | keys: 10 | - v1-dependencies-{{ checksum "package.json" }} 11 | - run: npm ci 12 | - run: npm run test 13 | - save_cache: 14 | paths: 15 | - node_modules 16 | key: v1-dependencies-{{ checksum "package.json" }} 17 | lint: 18 | docker: 19 | - image: circleci/node:12.13 20 | steps: 21 | - checkout 22 | - restore_cache: 23 | keys: 24 | - v1-dependencies-{{ checksum "package.json" }} 25 | - run: npm ci 26 | - run: npm run lint 27 | - save_cache: 28 | paths: 29 | - node_modules 30 | key: v1-dependencies-{{ checksum "package.json" }} 31 | 32 | workflows: 33 | version: 2 34 | main: 35 | jobs: 36 | - lint 37 | - test -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | dist -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 'env': { 3 | 'node': true, 4 | 'jest': true, 5 | }, 6 | 'extends': 'airbnb-base', 7 | 'globals': { 8 | 'Atomics': 'readonly', 9 | 'SharedArrayBuffer': 'readonly' 10 | }, 11 | 'parserOptions': { 12 | 'ecmaVersion': 2018 13 | }, 14 | 'rules': { 15 | 'indent': [ 16 | 'error', 17 | 2 18 | ], 19 | 'linebreak-style': [ 20 | 'error', 21 | 'unix' 22 | ], 23 | 'quotes': [ 24 | 'error', 25 | 'single' 26 | ], 27 | 'semi': [ 28 | 'error', 29 | 'never' 30 | ], 31 | 'no-console': [ 32 | 'error', 33 | { 34 | allow: [ 35 | 'log', 36 | 'warn', 37 | 'error' 38 | ] 39 | } 40 | ], 41 | 'no-param-reassign': 'off', 42 | 'no-use-before-define': 'off', 43 | 'prefer-promise-reject-errors': 'off', 44 | 'no-underscore-dangle': 'off', 45 | 'object-curly-newline': ['error', { 46 | 'ObjectExpression': { 'multiline': true }, 47 | 'ObjectPattern': { 'multiline': true }, 48 | 'ImportDeclaration': { 'multiline': true, 'minProperties': 3 }, 49 | 'ExportDeclaration': { 'multiline': true, 'minProperties': 3 } 50 | }] 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | .DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ethereum-input-to-object 2 | 3 | Decodes an Ethereum input data hex string into a developer friendly JavaScript object. 4 | 5 | ## Warning 6 | 7 | This package is in alpha, use at your own risk! 8 | 9 | ## Aim 10 | 11 | The goal of ethereum-input-to-object is to facilitate dead-simple conversion of a transaction input into a JavaScript native, serializable object. 12 | 13 | ## Usage 14 | 15 | ### Simple example 16 | 17 | Pass an ABI and input to `inputToObject` 18 | 19 | ```javascript 20 | import inputToObject from 'ethereum-input-to-object'; 21 | const erc20Abi = [{ ... }]; 22 | const input = '0xa9059cbb0000000000000000000000005a1cb5a88988ca4fef229935db834a6781e873cb0000000000000000000000000000000000000000000000000de0b6b3a7640000'; 23 | const decoded = inputToObject(erc20Abi, input); 24 | console.log(decoded); 25 | ``` 26 | 27 | ```javascript 28 | { 29 | methodName: 'transfer', 30 | params: { 31 | _to: '0x5A1Cb5A88988cA4FEF229935db834A6781e873cB', 32 | _value: '1000000000000000000' 33 | } 34 | } 35 | ``` 36 | 37 | ### Unable to decode example 38 | 39 | If the input does not match the ABI, `inputToObject` returns `null` 40 | 41 | ```javascript 42 | import inputToObject from 'ethereum-input-to-object'; 43 | const erc20Abi = [{ ... }]; 44 | const input = '0xgarbage'; 45 | const decoded = inputToObject(erc20Abi, input); 46 | console.log(decoded); 47 | ``` 48 | 49 | ```javascript 50 | null 51 | ``` 52 | 53 | ### Complex example 54 | 55 | `inputToObject` also supports decoding and conversion of complex, nested Solidity data structures. 56 | 57 | ```javascript 58 | import inputToObject from 'ethereum-input-to-object'; 59 | const setProtocolRebalancingExchangeIssuanceV2Abi = [{ ... }]; 60 | const input = '0x16919b9...'; // Truncated for example 61 | const decoded = inputToObject(erc20Abi, input); 62 | console.log(decoded); 63 | ``` 64 | 65 | ```javascript 66 | { 67 | methodName: 'issueRebalancingSetWithEther', 68 | params: { 69 | _rebalancingSetAddress: '0x81c55017F7Ce6E72451cEd49FF7bAB1e3DF64d0C', 70 | _rebalancingSetQuantity: '2810697751873000000', 71 | _exchangeIssuanceParams: { 72 | setAddress: '0xA37dE6790861B5541b0dAa7d0C0e651F44c6f4D9', 73 | quantity: '16878240000000000', 74 | sendTokenExchangeIds: ['1'], 75 | sendTokens: ['0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'], 76 | sendTokenAmounts: ['1874799564199638103'], 77 | receiveTokens: ['0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359', '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'], 78 | receiveTokenAmounts: ['121675511211317568000', '1687824'], 79 | }, 80 | _orderData: '0x000000000000000000000000...', // Truncated for example 81 | _keepChangeInVault: true, 82 | } 83 | } 84 | ``` 85 | 86 | ### Decoder param example 87 | 88 | If you prefer, you may pass a `decoder` created using [ethereum-input-data-decoder](https://github.com/miguelmota/ethereum-input-data-decoder) instead of an ABI as the first parameter 89 | 90 | ```javascript 91 | import InputDataDecoder from 'ethereum-input-data-decoder'; 92 | import inputToObject from 'ethereum-input-to-object'; 93 | const erc20Abi = [{ ... }]; 94 | const erc20Decoder = new InputDataDecoder(erc20Abi); 95 | const input = '0xa9059cbb0000000000000000000000005a1cb5a88988ca4fef229935db834a6781e873cb0000000000000000000000000000000000000000000000000de0b6b3a7640000'; 96 | const decoded = inputToObject(erc20Decoder, input); 97 | ``` 98 | 99 | ### Usage in node.js 100 | 101 | When ES6 imports are not avaliable, you may use `require` 102 | 103 | ```javascript 104 | const inputToObject = require('ethereum-input-to-object') 105 | ``` 106 | 107 | ### Supported types 108 | 109 | | Solidity | JavaScript equivalent used 110 | |------|--------| 111 | | int (all variations) | String 112 | | address | String 113 | | string | String 114 | | bool | Boolean 115 | | bytes (all variations) | String (hex formatted) 116 | | tuple | Object (with contents also converted) 117 | | array | Array (with contents also converted) 118 | 119 | Using a type not supported? Open an issue. 120 | 121 | ## ethereum-input-data-decoder 122 | 123 | This library is built on the great work by Miguel on [ethereum-input-data-decoder](https://github.com/miguelmota/ethereum-input-data-decoder). 124 | 125 | If ethereum-input-to-object prioritises convenience over function too much for you, check out his project. 126 | -------------------------------------------------------------------------------- /dist/ethereum-input-to-object.esm.js: -------------------------------------------------------------------------------- 1 | import { bytesToHex } from 'web3-utils'; 2 | import { toChecksumAddress } from 'ethereumjs-util'; 3 | import InputDataDecoder from 'ethereum-input-data-decoder'; 4 | 5 | function decodeInput(decoderOrAbi, input) { 6 | const decoder = decoderOrAbi.constructor.name === 'Array' 7 | ? new InputDataDecoder(decoderOrAbi) // ABI was passed 8 | : decoderOrAbi; // Decoder was passed 9 | 10 | const data = safeDecode(decoder, input); 11 | if (!data || !data.method) return null 12 | 13 | const paramsObject = data.inputs.reduce((params, curVal, index) => { 14 | const type = data.types[index]; 15 | // Handle tuples 16 | if (type.startsWith('(')) { 17 | const tupleName = data.names[index][0]; 18 | const tupleParamNames = data.names[index][1]; 19 | // Handle tuple[] type 20 | if (type.endsWith(')[]')) { 21 | return { 22 | ...params, 23 | [tupleName]: [ 24 | ...curVal.map(tuple => handleTupleType( 25 | tupleParamNames, 26 | type.slice(0, type.length - 2), 27 | index, 28 | tuple, 29 | )), 30 | ], 31 | } 32 | } 33 | // Handle tuple type 34 | if (type.endsWith(')')) { 35 | return { 36 | ...params, 37 | [tupleName]: { ...handleTupleType(tupleParamNames, type, index, curVal) }, 38 | } 39 | } 40 | } 41 | const name = data.names[index]; 42 | const parsedValue = parseCallValue(curVal, type); 43 | return { ...params, [name]: parsedValue } 44 | }, {}); 45 | const methodName = data.method; 46 | 47 | return { 48 | methodName, 49 | params: paramsObject, 50 | } 51 | } 52 | 53 | function safeDecode(decoder, input) { 54 | let decodedInput = { method: null }; 55 | try { 56 | decodedInput = decoder.decodeData(input); 57 | } catch (error) { 58 | // Input was invalid, swallow error 59 | } 60 | return decodedInput 61 | } 62 | 63 | function handleTupleType(tupleParamNames, type, index, curVal) { 64 | const types = type 65 | .slice(1, type.length - 1) // strip parens 66 | .split(','); 67 | 68 | return curVal.reduce((acc, val, i) => { 69 | const name = tupleParamNames[i]; 70 | return { ...acc, [name]: parseCallValue(val, types[i]) } 71 | }, {}) 72 | } 73 | 74 | function parseCallValue(val, type) { 75 | try { 76 | if (type === 'address') return standardiseAddress(val) 77 | if (type.includes('address[')) return val.map(a => standardiseAddress(a)) 78 | if (type === 'string' || type.includes('string[')) return val 79 | if (type.includes('int[')) return val.map(v => v.toString()) 80 | if (type.includes('int256[')) return val.map(v => v.toString()) 81 | if (type.includes('int8[')) return val.map(v => v.toString()) 82 | if (type.includes('int')) return val.toString() 83 | if (type.includes('bool')) return val 84 | 85 | // Sometimes our decoder library does not decode bytes correctly and returns buffers 86 | // Here we safegaurd this as to not double decode them. 87 | if (type.includes('bytes32[')) { 88 | return val.map((b) => { 89 | if (typeof b === 'string') { 90 | return b 91 | } 92 | return bytesToHex(b) 93 | }) 94 | } 95 | if (type.includes('bytes[')) { 96 | return val.map((b) => { 97 | if (typeof b === 'string') { 98 | return b 99 | } 100 | return bytesToHex(b) 101 | }) 102 | } 103 | if (type.includes('bytes')) { 104 | if (typeof val === 'string') { 105 | return val 106 | } 107 | return bytesToHex(val) 108 | } 109 | throw Error(`Unknown type ${type}`) 110 | } catch (error) { 111 | throw Error( 112 | `Failed to decode { type: '${JSON.stringify( 113 | type, 114 | )}', val: '${val}', typeof val: '${typeof val}' }: ${error}`, 115 | ) 116 | } 117 | } 118 | 119 | function standardiseAddress(ad) { 120 | if (!ad.startsWith('0x')) return toChecksumAddress(`0x${ad}`) 121 | return toChecksumAddress(ad) 122 | } 123 | 124 | export default decodeInput; 125 | -------------------------------------------------------------------------------- /dist/ethereum-input-to-object.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } 4 | 5 | var web3Utils = require('web3-utils'); 6 | var ethereumjsUtil = require('ethereumjs-util'); 7 | var InputDataDecoder = _interopDefault(require('ethereum-input-data-decoder')); 8 | 9 | function decodeInput(decoderOrAbi, input) { 10 | const decoder = decoderOrAbi.constructor.name === 'Array' 11 | ? new InputDataDecoder(decoderOrAbi) // ABI was passed 12 | : decoderOrAbi; // Decoder was passed 13 | 14 | const data = safeDecode(decoder, input); 15 | if (!data || !data.method) return null 16 | 17 | const paramsObject = data.inputs.reduce((params, curVal, index) => { 18 | const type = data.types[index]; 19 | // Handle tuples 20 | if (type.startsWith('(')) { 21 | const tupleName = data.names[index][0]; 22 | const tupleParamNames = data.names[index][1]; 23 | // Handle tuple[] type 24 | if (type.endsWith(')[]')) { 25 | return { 26 | ...params, 27 | [tupleName]: [ 28 | ...curVal.map(tuple => handleTupleType( 29 | tupleParamNames, 30 | type.slice(0, type.length - 2), 31 | index, 32 | tuple, 33 | )), 34 | ], 35 | } 36 | } 37 | // Handle tuple type 38 | if (type.endsWith(')')) { 39 | return { 40 | ...params, 41 | [tupleName]: { ...handleTupleType(tupleParamNames, type, index, curVal) }, 42 | } 43 | } 44 | } 45 | const name = data.names[index]; 46 | const parsedValue = parseCallValue(curVal, type); 47 | return { ...params, [name]: parsedValue } 48 | }, {}); 49 | const methodName = data.method; 50 | 51 | return { 52 | methodName, 53 | params: paramsObject, 54 | } 55 | } 56 | 57 | function safeDecode(decoder, input) { 58 | let decodedInput = { method: null }; 59 | try { 60 | decodedInput = decoder.decodeData(input); 61 | } catch (error) { 62 | // Input was invalid, swallow error 63 | } 64 | return decodedInput 65 | } 66 | 67 | function handleTupleType(tupleParamNames, type, index, curVal) { 68 | const types = type 69 | .slice(1, type.length - 1) // strip parens 70 | .split(','); 71 | 72 | return curVal.reduce((acc, val, i) => { 73 | const name = tupleParamNames[i]; 74 | return { ...acc, [name]: parseCallValue(val, types[i]) } 75 | }, {}) 76 | } 77 | 78 | function parseCallValue(val, type) { 79 | try { 80 | if (type === 'address') return standardiseAddress(val) 81 | if (type.includes('address[')) return val.map(a => standardiseAddress(a)) 82 | if (type === 'string' || type.includes('string[')) return val 83 | if (type.includes('int[')) return val.map(v => v.toString()) 84 | if (type.includes('int256[')) return val.map(v => v.toString()) 85 | if (type.includes('int8[')) return val.map(v => v.toString()) 86 | if (type.includes('int')) return val.toString() 87 | if (type.includes('bool')) return val 88 | 89 | // Sometimes our decoder library does not decode bytes correctly and returns buffers 90 | // Here we safegaurd this as to not double decode them. 91 | if (type.includes('bytes32[')) { 92 | return val.map((b) => { 93 | if (typeof b === 'string') { 94 | return b 95 | } 96 | return web3Utils.bytesToHex(b) 97 | }) 98 | } 99 | if (type.includes('bytes[')) { 100 | return val.map((b) => { 101 | if (typeof b === 'string') { 102 | return b 103 | } 104 | return web3Utils.bytesToHex(b) 105 | }) 106 | } 107 | if (type.includes('bytes')) { 108 | if (typeof val === 'string') { 109 | return val 110 | } 111 | return web3Utils.bytesToHex(val) 112 | } 113 | throw Error(`Unknown type ${type}`) 114 | } catch (error) { 115 | throw Error( 116 | `Failed to decode { type: '${JSON.stringify( 117 | type, 118 | )}', val: '${val}', typeof val: '${typeof val}' }: ${error}`, 119 | ) 120 | } 121 | } 122 | 123 | function standardiseAddress(ad) { 124 | if (!ad.startsWith('0x')) return ethereumjsUtil.toChecksumAddress(`0x${ad}`) 125 | return ethereumjsUtil.toChecksumAddress(ad) 126 | } 127 | 128 | module.exports = decodeInput; 129 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ethereum-input-to-object", 3 | "version": "0.0.4", 4 | "description": "Decodes an Ethereum input data hex string into a developer friendly JavaScript object", 5 | "main": "dist/ethereum-input-to-object.js", 6 | "module": "dist/ethereum-input-to-object.esm.js", 7 | "scripts": { 8 | "test": "tape ./test/index.js", 9 | "build": "rollup -c", 10 | "lint": "eslint ." 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/blocknative/ethereum-input-to-object.git" 15 | }, 16 | "author": "Blocknative", 17 | "license": "ISC", 18 | "bugs": { 19 | "url": "https://github.com/blocknative/ethereum-input-to-object/issues" 20 | }, 21 | "homepage": "https://github.com/blocknative/ethereum-input-to-object#readme", 22 | "devDependencies": { 23 | "@rollup/plugin-commonjs": "^13.0.0", 24 | "eslint": "^5.3.0", 25 | "eslint-config-airbnb-base": "^13.1.0", 26 | "eslint-plugin-import": "^2.17.3", 27 | "jest": "^26.0.1", 28 | "rollup": "^2.19.0" 29 | }, 30 | "dependencies": { 31 | "ethereum-input-data-decoder": "git@github.com:alexcampbelling/ethereum-input-data-decoder.git", 32 | "ethereumjs-util": "^7.0.2", 33 | "web3-utils": "^1.2.9", 34 | "tape": "^4.6.3" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | import commonjs from '@rollup/plugin-commonjs' 2 | 3 | import pkg from './package.json' 4 | 5 | export default { 6 | input: 'src/index.js', 7 | output: [ 8 | { 9 | format: 'esm', 10 | file: pkg.module, 11 | }, 12 | { 13 | format: 'cjs', 14 | file: pkg.main, 15 | }, 16 | ], 17 | external: ['ethereum-input-data-decoder', 'ethereumjs-util', 'web3-utils'], 18 | plugins: [commonjs()], 19 | } 20 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import { bytesToHex } from 'web3-utils' 2 | import { toChecksumAddress } from 'ethereumjs-util' 3 | import InputDataDecoder from 'ethereum-input-data-decoder' 4 | 5 | export default function decodeInput(decoderOrAbi, input) { 6 | const decoder = decoderOrAbi.constructor.name === 'Array' 7 | ? new InputDataDecoder(decoderOrAbi) // ABI was passed 8 | : decoderOrAbi // Decoder was passed 9 | 10 | const data = safeDecode(decoder, input) 11 | if (!data || !data.method) return null 12 | 13 | const paramsObject = data.inputs.reduce((params, curVal, index) => { 14 | const type = data.types[index] 15 | // Handle tuples 16 | if (type.startsWith('(')) { 17 | const tupleName = data.names[index][0] 18 | const tupleParamNames = data.names[index][1] 19 | // Handle tuple[] type 20 | if (type.endsWith(')[]')) { 21 | return { 22 | ...params, 23 | [tupleName]: [ 24 | ...curVal.map(tuple => handleTupleType( 25 | tupleParamNames, 26 | type.slice(0, type.length - 2), 27 | index, 28 | tuple, 29 | )), 30 | ], 31 | } 32 | } 33 | // Handle tuple type 34 | if (type.endsWith(')')) { 35 | return { 36 | ...params, 37 | [tupleName]: { ...handleTupleType(tupleParamNames, type, index, curVal) }, 38 | } 39 | } 40 | } 41 | const name = data.names[index] 42 | const parsedValue = parseCallValue(curVal, type) 43 | return { ...params, [name]: parsedValue } 44 | }, {}) 45 | const methodName = data.method 46 | 47 | return { 48 | methodName, 49 | params: paramsObject, 50 | } 51 | } 52 | 53 | function safeDecode(decoder, input) { 54 | let decodedInput = { method: null } 55 | try { 56 | decodedInput = decoder.decodeData(input) 57 | } catch (error) { 58 | // Input was invalid, swallow error 59 | } 60 | return decodedInput 61 | } 62 | 63 | function handleTupleType(tupleParamNames, type, index, curVal) { 64 | const types = type 65 | .slice(1, type.length - 1) // strip parens 66 | .split(',') 67 | 68 | return curVal.reduce((acc, val, i) => { 69 | const name = tupleParamNames[i] 70 | return { ...acc, [name]: parseCallValue(val, types[i]) } 71 | }, {}) 72 | } 73 | 74 | function parseCallValue(val, type) { 75 | try { 76 | if (type === 'address') return standardiseAddress(val) 77 | if (type.includes('address[')) return val.map(a => standardiseAddress(a)) 78 | if (type === 'string' || type.includes('string[')) return val 79 | if (type.includes('int[')) return val.map(v => v.toString()) 80 | if (type.includes('int256[')) return val.map(v => v.toString()) 81 | if (type.includes('int8[')) return val.map(v => v.toString()) 82 | if (type.includes('int')) return val.toString() 83 | if (type.includes('bool')) return val 84 | 85 | // Sometimes our decoder library does not decode bytes correctly and returns buffers 86 | // Here we safegaurd this as to not double decode them. 87 | if (type.includes('bytes32[')) { 88 | return val.map((b) => { 89 | if (typeof b === 'string') { 90 | return b 91 | } 92 | return bytesToHex(b) 93 | }) 94 | } 95 | if (type.includes('bytes[')) { 96 | return val.map((b) => { 97 | if (typeof b === 'string') { 98 | return b 99 | } 100 | return bytesToHex(b) 101 | }) 102 | } 103 | if (type.includes('bytes')) { 104 | if (typeof val === 'string') { 105 | return val 106 | } 107 | return bytesToHex(val) 108 | } 109 | throw Error(`Unknown type ${type}`) 110 | } catch (error) { 111 | throw Error( 112 | `Failed to decode { type: '${JSON.stringify( 113 | type, 114 | )}', val: '${val}', typeof val: '${typeof val}' }: ${error}`, 115 | ) 116 | } 117 | } 118 | 119 | function standardiseAddress(ad) { 120 | if (!ad.startsWith('0x')) return toChecksumAddress(`0x${ad}`) 121 | return toChecksumAddress(ad) 122 | } 123 | -------------------------------------------------------------------------------- /test/data/0x_v3_abi.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "uint256", 6 | "name": "chainId", 7 | "type": "uint256" 8 | } 9 | ], 10 | "payable": false, 11 | "stateMutability": "nonpayable", 12 | "type": "constructor" 13 | }, 14 | { 15 | "anonymous": false, 16 | "inputs": [ 17 | { 18 | "indexed": false, 19 | "internalType": "bytes4", 20 | "name": "id", 21 | "type": "bytes4" 22 | }, 23 | { 24 | "indexed": false, 25 | "internalType": "address", 26 | "name": "assetProxy", 27 | "type": "address" 28 | } 29 | ], 30 | "name": "AssetProxyRegistered", 31 | "type": "event" 32 | }, 33 | { 34 | "anonymous": false, 35 | "inputs": [ 36 | { 37 | "indexed": true, 38 | "internalType": "address", 39 | "name": "makerAddress", 40 | "type": "address" 41 | }, 42 | { 43 | "indexed": true, 44 | "internalType": "address", 45 | "name": "feeRecipientAddress", 46 | "type": "address" 47 | }, 48 | { 49 | "indexed": false, 50 | "internalType": "bytes", 51 | "name": "makerAssetData", 52 | "type": "bytes" 53 | }, 54 | { 55 | "indexed": false, 56 | "internalType": "bytes", 57 | "name": "takerAssetData", 58 | "type": "bytes" 59 | }, 60 | { 61 | "indexed": false, 62 | "internalType": "address", 63 | "name": "senderAddress", 64 | "type": "address" 65 | }, 66 | { 67 | "indexed": true, 68 | "internalType": "bytes32", 69 | "name": "orderHash", 70 | "type": "bytes32" 71 | } 72 | ], 73 | "name": "Cancel", 74 | "type": "event" 75 | }, 76 | { 77 | "anonymous": false, 78 | "inputs": [ 79 | { 80 | "indexed": true, 81 | "internalType": "address", 82 | "name": "makerAddress", 83 | "type": "address" 84 | }, 85 | { 86 | "indexed": true, 87 | "internalType": "address", 88 | "name": "orderSenderAddress", 89 | "type": "address" 90 | }, 91 | { 92 | "indexed": false, 93 | "internalType": "uint256", 94 | "name": "orderEpoch", 95 | "type": "uint256" 96 | } 97 | ], 98 | "name": "CancelUpTo", 99 | "type": "event" 100 | }, 101 | { 102 | "anonymous": false, 103 | "inputs": [ 104 | { 105 | "indexed": true, 106 | "internalType": "address", 107 | "name": "makerAddress", 108 | "type": "address" 109 | }, 110 | { 111 | "indexed": true, 112 | "internalType": "address", 113 | "name": "feeRecipientAddress", 114 | "type": "address" 115 | }, 116 | { 117 | "indexed": false, 118 | "internalType": "bytes", 119 | "name": "makerAssetData", 120 | "type": "bytes" 121 | }, 122 | { 123 | "indexed": false, 124 | "internalType": "bytes", 125 | "name": "takerAssetData", 126 | "type": "bytes" 127 | }, 128 | { 129 | "indexed": false, 130 | "internalType": "bytes", 131 | "name": "makerFeeAssetData", 132 | "type": "bytes" 133 | }, 134 | { 135 | "indexed": false, 136 | "internalType": "bytes", 137 | "name": "takerFeeAssetData", 138 | "type": "bytes" 139 | }, 140 | { 141 | "indexed": true, 142 | "internalType": "bytes32", 143 | "name": "orderHash", 144 | "type": "bytes32" 145 | }, 146 | { 147 | "indexed": false, 148 | "internalType": "address", 149 | "name": "takerAddress", 150 | "type": "address" 151 | }, 152 | { 153 | "indexed": false, 154 | "internalType": "address", 155 | "name": "senderAddress", 156 | "type": "address" 157 | }, 158 | { 159 | "indexed": false, 160 | "internalType": "uint256", 161 | "name": "makerAssetFilledAmount", 162 | "type": "uint256" 163 | }, 164 | { 165 | "indexed": false, 166 | "internalType": "uint256", 167 | "name": "takerAssetFilledAmount", 168 | "type": "uint256" 169 | }, 170 | { 171 | "indexed": false, 172 | "internalType": "uint256", 173 | "name": "makerFeePaid", 174 | "type": "uint256" 175 | }, 176 | { 177 | "indexed": false, 178 | "internalType": "uint256", 179 | "name": "takerFeePaid", 180 | "type": "uint256" 181 | }, 182 | { 183 | "indexed": false, 184 | "internalType": "uint256", 185 | "name": "protocolFeePaid", 186 | "type": "uint256" 187 | } 188 | ], 189 | "name": "Fill", 190 | "type": "event" 191 | }, 192 | { 193 | "anonymous": false, 194 | "inputs": [ 195 | { 196 | "indexed": true, 197 | "internalType": "address", 198 | "name": "previousOwner", 199 | "type": "address" 200 | }, 201 | { 202 | "indexed": true, 203 | "internalType": "address", 204 | "name": "newOwner", 205 | "type": "address" 206 | } 207 | ], 208 | "name": "OwnershipTransferred", 209 | "type": "event" 210 | }, 211 | { 212 | "anonymous": false, 213 | "inputs": [ 214 | { 215 | "indexed": false, 216 | "internalType": "address", 217 | "name": "oldProtocolFeeCollector", 218 | "type": "address" 219 | }, 220 | { 221 | "indexed": false, 222 | "internalType": "address", 223 | "name": "updatedProtocolFeeCollector", 224 | "type": "address" 225 | } 226 | ], 227 | "name": "ProtocolFeeCollectorAddress", 228 | "type": "event" 229 | }, 230 | { 231 | "anonymous": false, 232 | "inputs": [ 233 | { 234 | "indexed": false, 235 | "internalType": "uint256", 236 | "name": "oldProtocolFeeMultiplier", 237 | "type": "uint256" 238 | }, 239 | { 240 | "indexed": false, 241 | "internalType": "uint256", 242 | "name": "updatedProtocolFeeMultiplier", 243 | "type": "uint256" 244 | } 245 | ], 246 | "name": "ProtocolFeeMultiplier", 247 | "type": "event" 248 | }, 249 | { 250 | "anonymous": false, 251 | "inputs": [ 252 | { 253 | "indexed": true, 254 | "internalType": "address", 255 | "name": "signerAddress", 256 | "type": "address" 257 | }, 258 | { 259 | "indexed": true, 260 | "internalType": "address", 261 | "name": "validatorAddress", 262 | "type": "address" 263 | }, 264 | { 265 | "indexed": false, 266 | "internalType": "bool", 267 | "name": "isApproved", 268 | "type": "bool" 269 | } 270 | ], 271 | "name": "SignatureValidatorApproval", 272 | "type": "event" 273 | }, 274 | { 275 | "anonymous": false, 276 | "inputs": [ 277 | { 278 | "indexed": true, 279 | "internalType": "bytes32", 280 | "name": "transactionHash", 281 | "type": "bytes32" 282 | } 283 | ], 284 | "name": "TransactionExecution", 285 | "type": "event" 286 | }, 287 | { 288 | "constant": true, 289 | "inputs": [], 290 | "name": "EIP1271_MAGIC_VALUE", 291 | "outputs": [ 292 | { 293 | "internalType": "bytes4", 294 | "name": "", 295 | "type": "bytes4" 296 | } 297 | ], 298 | "payable": false, 299 | "stateMutability": "view", 300 | "type": "function" 301 | }, 302 | { 303 | "constant": true, 304 | "inputs": [], 305 | "name": "EIP712_EXCHANGE_DOMAIN_HASH", 306 | "outputs": [ 307 | { 308 | "internalType": "bytes32", 309 | "name": "", 310 | "type": "bytes32" 311 | } 312 | ], 313 | "payable": false, 314 | "stateMutability": "view", 315 | "type": "function" 316 | }, 317 | { 318 | "constant": true, 319 | "inputs": [ 320 | { 321 | "internalType": "address", 322 | "name": "", 323 | "type": "address" 324 | }, 325 | { 326 | "internalType": "address", 327 | "name": "", 328 | "type": "address" 329 | } 330 | ], 331 | "name": "allowedValidators", 332 | "outputs": [ 333 | { 334 | "internalType": "bool", 335 | "name": "", 336 | "type": "bool" 337 | } 338 | ], 339 | "payable": false, 340 | "stateMutability": "view", 341 | "type": "function" 342 | }, 343 | { 344 | "constant": false, 345 | "inputs": [ 346 | { 347 | "components": [ 348 | { 349 | "internalType": "address", 350 | "name": "makerAddress", 351 | "type": "address" 352 | }, 353 | { 354 | "internalType": "address", 355 | "name": "takerAddress", 356 | "type": "address" 357 | }, 358 | { 359 | "internalType": "address", 360 | "name": "feeRecipientAddress", 361 | "type": "address" 362 | }, 363 | { 364 | "internalType": "address", 365 | "name": "senderAddress", 366 | "type": "address" 367 | }, 368 | { 369 | "internalType": "uint256", 370 | "name": "makerAssetAmount", 371 | "type": "uint256" 372 | }, 373 | { 374 | "internalType": "uint256", 375 | "name": "takerAssetAmount", 376 | "type": "uint256" 377 | }, 378 | { 379 | "internalType": "uint256", 380 | "name": "makerFee", 381 | "type": "uint256" 382 | }, 383 | { 384 | "internalType": "uint256", 385 | "name": "takerFee", 386 | "type": "uint256" 387 | }, 388 | { 389 | "internalType": "uint256", 390 | "name": "expirationTimeSeconds", 391 | "type": "uint256" 392 | }, 393 | { 394 | "internalType": "uint256", 395 | "name": "salt", 396 | "type": "uint256" 397 | }, 398 | { 399 | "internalType": "bytes", 400 | "name": "makerAssetData", 401 | "type": "bytes" 402 | }, 403 | { 404 | "internalType": "bytes", 405 | "name": "takerAssetData", 406 | "type": "bytes" 407 | }, 408 | { 409 | "internalType": "bytes", 410 | "name": "makerFeeAssetData", 411 | "type": "bytes" 412 | }, 413 | { 414 | "internalType": "bytes", 415 | "name": "takerFeeAssetData", 416 | "type": "bytes" 417 | } 418 | ], 419 | "internalType": "struct LibOrder.Order[]", 420 | "name": "orders", 421 | "type": "tuple[]" 422 | } 423 | ], 424 | "name": "batchCancelOrders", 425 | "outputs": [], 426 | "payable": true, 427 | "stateMutability": "payable", 428 | "type": "function" 429 | }, 430 | { 431 | "constant": false, 432 | "inputs": [ 433 | { 434 | "components": [ 435 | { 436 | "internalType": "uint256", 437 | "name": "salt", 438 | "type": "uint256" 439 | }, 440 | { 441 | "internalType": "uint256", 442 | "name": "expirationTimeSeconds", 443 | "type": "uint256" 444 | }, 445 | { 446 | "internalType": "uint256", 447 | "name": "gasPrice", 448 | "type": "uint256" 449 | }, 450 | { 451 | "internalType": "address", 452 | "name": "signerAddress", 453 | "type": "address" 454 | }, 455 | { 456 | "internalType": "bytes", 457 | "name": "data", 458 | "type": "bytes" 459 | } 460 | ], 461 | "internalType": "struct LibZeroExTransaction.ZeroExTransaction[]", 462 | "name": "transactions", 463 | "type": "tuple[]" 464 | }, 465 | { 466 | "internalType": "bytes[]", 467 | "name": "signatures", 468 | "type": "bytes[]" 469 | } 470 | ], 471 | "name": "batchExecuteTransactions", 472 | "outputs": [ 473 | { 474 | "internalType": "bytes[]", 475 | "name": "", 476 | "type": "bytes[]" 477 | } 478 | ], 479 | "payable": true, 480 | "stateMutability": "payable", 481 | "type": "function" 482 | }, 483 | { 484 | "constant": false, 485 | "inputs": [ 486 | { 487 | "components": [ 488 | { 489 | "internalType": "address", 490 | "name": "makerAddress", 491 | "type": "address" 492 | }, 493 | { 494 | "internalType": "address", 495 | "name": "takerAddress", 496 | "type": "address" 497 | }, 498 | { 499 | "internalType": "address", 500 | "name": "feeRecipientAddress", 501 | "type": "address" 502 | }, 503 | { 504 | "internalType": "address", 505 | "name": "senderAddress", 506 | "type": "address" 507 | }, 508 | { 509 | "internalType": "uint256", 510 | "name": "makerAssetAmount", 511 | "type": "uint256" 512 | }, 513 | { 514 | "internalType": "uint256", 515 | "name": "takerAssetAmount", 516 | "type": "uint256" 517 | }, 518 | { 519 | "internalType": "uint256", 520 | "name": "makerFee", 521 | "type": "uint256" 522 | }, 523 | { 524 | "internalType": "uint256", 525 | "name": "takerFee", 526 | "type": "uint256" 527 | }, 528 | { 529 | "internalType": "uint256", 530 | "name": "expirationTimeSeconds", 531 | "type": "uint256" 532 | }, 533 | { 534 | "internalType": "uint256", 535 | "name": "salt", 536 | "type": "uint256" 537 | }, 538 | { 539 | "internalType": "bytes", 540 | "name": "makerAssetData", 541 | "type": "bytes" 542 | }, 543 | { 544 | "internalType": "bytes", 545 | "name": "takerAssetData", 546 | "type": "bytes" 547 | }, 548 | { 549 | "internalType": "bytes", 550 | "name": "makerFeeAssetData", 551 | "type": "bytes" 552 | }, 553 | { 554 | "internalType": "bytes", 555 | "name": "takerFeeAssetData", 556 | "type": "bytes" 557 | } 558 | ], 559 | "internalType": "struct LibOrder.Order[]", 560 | "name": "orders", 561 | "type": "tuple[]" 562 | }, 563 | { 564 | "internalType": "uint256[]", 565 | "name": "takerAssetFillAmounts", 566 | "type": "uint256[]" 567 | }, 568 | { 569 | "internalType": "bytes[]", 570 | "name": "signatures", 571 | "type": "bytes[]" 572 | } 573 | ], 574 | "name": "batchFillOrKillOrders", 575 | "outputs": [ 576 | { 577 | "components": [ 578 | { 579 | "internalType": "uint256", 580 | "name": "makerAssetFilledAmount", 581 | "type": "uint256" 582 | }, 583 | { 584 | "internalType": "uint256", 585 | "name": "takerAssetFilledAmount", 586 | "type": "uint256" 587 | }, 588 | { 589 | "internalType": "uint256", 590 | "name": "makerFeePaid", 591 | "type": "uint256" 592 | }, 593 | { 594 | "internalType": "uint256", 595 | "name": "takerFeePaid", 596 | "type": "uint256" 597 | }, 598 | { 599 | "internalType": "uint256", 600 | "name": "protocolFeePaid", 601 | "type": "uint256" 602 | } 603 | ], 604 | "internalType": "struct LibFillResults.FillResults[]", 605 | "name": "fillResults", 606 | "type": "tuple[]" 607 | } 608 | ], 609 | "payable": true, 610 | "stateMutability": "payable", 611 | "type": "function" 612 | }, 613 | { 614 | "constant": false, 615 | "inputs": [ 616 | { 617 | "components": [ 618 | { 619 | "internalType": "address", 620 | "name": "makerAddress", 621 | "type": "address" 622 | }, 623 | { 624 | "internalType": "address", 625 | "name": "takerAddress", 626 | "type": "address" 627 | }, 628 | { 629 | "internalType": "address", 630 | "name": "feeRecipientAddress", 631 | "type": "address" 632 | }, 633 | { 634 | "internalType": "address", 635 | "name": "senderAddress", 636 | "type": "address" 637 | }, 638 | { 639 | "internalType": "uint256", 640 | "name": "makerAssetAmount", 641 | "type": "uint256" 642 | }, 643 | { 644 | "internalType": "uint256", 645 | "name": "takerAssetAmount", 646 | "type": "uint256" 647 | }, 648 | { 649 | "internalType": "uint256", 650 | "name": "makerFee", 651 | "type": "uint256" 652 | }, 653 | { 654 | "internalType": "uint256", 655 | "name": "takerFee", 656 | "type": "uint256" 657 | }, 658 | { 659 | "internalType": "uint256", 660 | "name": "expirationTimeSeconds", 661 | "type": "uint256" 662 | }, 663 | { 664 | "internalType": "uint256", 665 | "name": "salt", 666 | "type": "uint256" 667 | }, 668 | { 669 | "internalType": "bytes", 670 | "name": "makerAssetData", 671 | "type": "bytes" 672 | }, 673 | { 674 | "internalType": "bytes", 675 | "name": "takerAssetData", 676 | "type": "bytes" 677 | }, 678 | { 679 | "internalType": "bytes", 680 | "name": "makerFeeAssetData", 681 | "type": "bytes" 682 | }, 683 | { 684 | "internalType": "bytes", 685 | "name": "takerFeeAssetData", 686 | "type": "bytes" 687 | } 688 | ], 689 | "internalType": "struct LibOrder.Order[]", 690 | "name": "orders", 691 | "type": "tuple[]" 692 | }, 693 | { 694 | "internalType": "uint256[]", 695 | "name": "takerAssetFillAmounts", 696 | "type": "uint256[]" 697 | }, 698 | { 699 | "internalType": "bytes[]", 700 | "name": "signatures", 701 | "type": "bytes[]" 702 | } 703 | ], 704 | "name": "batchFillOrders", 705 | "outputs": [ 706 | { 707 | "components": [ 708 | { 709 | "internalType": "uint256", 710 | "name": "makerAssetFilledAmount", 711 | "type": "uint256" 712 | }, 713 | { 714 | "internalType": "uint256", 715 | "name": "takerAssetFilledAmount", 716 | "type": "uint256" 717 | }, 718 | { 719 | "internalType": "uint256", 720 | "name": "makerFeePaid", 721 | "type": "uint256" 722 | }, 723 | { 724 | "internalType": "uint256", 725 | "name": "takerFeePaid", 726 | "type": "uint256" 727 | }, 728 | { 729 | "internalType": "uint256", 730 | "name": "protocolFeePaid", 731 | "type": "uint256" 732 | } 733 | ], 734 | "internalType": "struct LibFillResults.FillResults[]", 735 | "name": "fillResults", 736 | "type": "tuple[]" 737 | } 738 | ], 739 | "payable": true, 740 | "stateMutability": "payable", 741 | "type": "function" 742 | }, 743 | { 744 | "constant": false, 745 | "inputs": [ 746 | { 747 | "components": [ 748 | { 749 | "internalType": "address", 750 | "name": "makerAddress", 751 | "type": "address" 752 | }, 753 | { 754 | "internalType": "address", 755 | "name": "takerAddress", 756 | "type": "address" 757 | }, 758 | { 759 | "internalType": "address", 760 | "name": "feeRecipientAddress", 761 | "type": "address" 762 | }, 763 | { 764 | "internalType": "address", 765 | "name": "senderAddress", 766 | "type": "address" 767 | }, 768 | { 769 | "internalType": "uint256", 770 | "name": "makerAssetAmount", 771 | "type": "uint256" 772 | }, 773 | { 774 | "internalType": "uint256", 775 | "name": "takerAssetAmount", 776 | "type": "uint256" 777 | }, 778 | { 779 | "internalType": "uint256", 780 | "name": "makerFee", 781 | "type": "uint256" 782 | }, 783 | { 784 | "internalType": "uint256", 785 | "name": "takerFee", 786 | "type": "uint256" 787 | }, 788 | { 789 | "internalType": "uint256", 790 | "name": "expirationTimeSeconds", 791 | "type": "uint256" 792 | }, 793 | { 794 | "internalType": "uint256", 795 | "name": "salt", 796 | "type": "uint256" 797 | }, 798 | { 799 | "internalType": "bytes", 800 | "name": "makerAssetData", 801 | "type": "bytes" 802 | }, 803 | { 804 | "internalType": "bytes", 805 | "name": "takerAssetData", 806 | "type": "bytes" 807 | }, 808 | { 809 | "internalType": "bytes", 810 | "name": "makerFeeAssetData", 811 | "type": "bytes" 812 | }, 813 | { 814 | "internalType": "bytes", 815 | "name": "takerFeeAssetData", 816 | "type": "bytes" 817 | } 818 | ], 819 | "internalType": "struct LibOrder.Order[]", 820 | "name": "orders", 821 | "type": "tuple[]" 822 | }, 823 | { 824 | "internalType": "uint256[]", 825 | "name": "takerAssetFillAmounts", 826 | "type": "uint256[]" 827 | }, 828 | { 829 | "internalType": "bytes[]", 830 | "name": "signatures", 831 | "type": "bytes[]" 832 | } 833 | ], 834 | "name": "batchFillOrdersNoThrow", 835 | "outputs": [ 836 | { 837 | "components": [ 838 | { 839 | "internalType": "uint256", 840 | "name": "makerAssetFilledAmount", 841 | "type": "uint256" 842 | }, 843 | { 844 | "internalType": "uint256", 845 | "name": "takerAssetFilledAmount", 846 | "type": "uint256" 847 | }, 848 | { 849 | "internalType": "uint256", 850 | "name": "makerFeePaid", 851 | "type": "uint256" 852 | }, 853 | { 854 | "internalType": "uint256", 855 | "name": "takerFeePaid", 856 | "type": "uint256" 857 | }, 858 | { 859 | "internalType": "uint256", 860 | "name": "protocolFeePaid", 861 | "type": "uint256" 862 | } 863 | ], 864 | "internalType": "struct LibFillResults.FillResults[]", 865 | "name": "fillResults", 866 | "type": "tuple[]" 867 | } 868 | ], 869 | "payable": true, 870 | "stateMutability": "payable", 871 | "type": "function" 872 | }, 873 | { 874 | "constant": false, 875 | "inputs": [ 876 | { 877 | "components": [ 878 | { 879 | "internalType": "address", 880 | "name": "makerAddress", 881 | "type": "address" 882 | }, 883 | { 884 | "internalType": "address", 885 | "name": "takerAddress", 886 | "type": "address" 887 | }, 888 | { 889 | "internalType": "address", 890 | "name": "feeRecipientAddress", 891 | "type": "address" 892 | }, 893 | { 894 | "internalType": "address", 895 | "name": "senderAddress", 896 | "type": "address" 897 | }, 898 | { 899 | "internalType": "uint256", 900 | "name": "makerAssetAmount", 901 | "type": "uint256" 902 | }, 903 | { 904 | "internalType": "uint256", 905 | "name": "takerAssetAmount", 906 | "type": "uint256" 907 | }, 908 | { 909 | "internalType": "uint256", 910 | "name": "makerFee", 911 | "type": "uint256" 912 | }, 913 | { 914 | "internalType": "uint256", 915 | "name": "takerFee", 916 | "type": "uint256" 917 | }, 918 | { 919 | "internalType": "uint256", 920 | "name": "expirationTimeSeconds", 921 | "type": "uint256" 922 | }, 923 | { 924 | "internalType": "uint256", 925 | "name": "salt", 926 | "type": "uint256" 927 | }, 928 | { 929 | "internalType": "bytes", 930 | "name": "makerAssetData", 931 | "type": "bytes" 932 | }, 933 | { 934 | "internalType": "bytes", 935 | "name": "takerAssetData", 936 | "type": "bytes" 937 | }, 938 | { 939 | "internalType": "bytes", 940 | "name": "makerFeeAssetData", 941 | "type": "bytes" 942 | }, 943 | { 944 | "internalType": "bytes", 945 | "name": "takerFeeAssetData", 946 | "type": "bytes" 947 | } 948 | ], 949 | "internalType": "struct LibOrder.Order[]", 950 | "name": "leftOrders", 951 | "type": "tuple[]" 952 | }, 953 | { 954 | "components": [ 955 | { 956 | "internalType": "address", 957 | "name": "makerAddress", 958 | "type": "address" 959 | }, 960 | { 961 | "internalType": "address", 962 | "name": "takerAddress", 963 | "type": "address" 964 | }, 965 | { 966 | "internalType": "address", 967 | "name": "feeRecipientAddress", 968 | "type": "address" 969 | }, 970 | { 971 | "internalType": "address", 972 | "name": "senderAddress", 973 | "type": "address" 974 | }, 975 | { 976 | "internalType": "uint256", 977 | "name": "makerAssetAmount", 978 | "type": "uint256" 979 | }, 980 | { 981 | "internalType": "uint256", 982 | "name": "takerAssetAmount", 983 | "type": "uint256" 984 | }, 985 | { 986 | "internalType": "uint256", 987 | "name": "makerFee", 988 | "type": "uint256" 989 | }, 990 | { 991 | "internalType": "uint256", 992 | "name": "takerFee", 993 | "type": "uint256" 994 | }, 995 | { 996 | "internalType": "uint256", 997 | "name": "expirationTimeSeconds", 998 | "type": "uint256" 999 | }, 1000 | { 1001 | "internalType": "uint256", 1002 | "name": "salt", 1003 | "type": "uint256" 1004 | }, 1005 | { 1006 | "internalType": "bytes", 1007 | "name": "makerAssetData", 1008 | "type": "bytes" 1009 | }, 1010 | { 1011 | "internalType": "bytes", 1012 | "name": "takerAssetData", 1013 | "type": "bytes" 1014 | }, 1015 | { 1016 | "internalType": "bytes", 1017 | "name": "makerFeeAssetData", 1018 | "type": "bytes" 1019 | }, 1020 | { 1021 | "internalType": "bytes", 1022 | "name": "takerFeeAssetData", 1023 | "type": "bytes" 1024 | } 1025 | ], 1026 | "internalType": "struct LibOrder.Order[]", 1027 | "name": "rightOrders", 1028 | "type": "tuple[]" 1029 | }, 1030 | { 1031 | "internalType": "bytes[]", 1032 | "name": "leftSignatures", 1033 | "type": "bytes[]" 1034 | }, 1035 | { 1036 | "internalType": "bytes[]", 1037 | "name": "rightSignatures", 1038 | "type": "bytes[]" 1039 | } 1040 | ], 1041 | "name": "batchMatchOrders", 1042 | "outputs": [ 1043 | { 1044 | "components": [ 1045 | { 1046 | "components": [ 1047 | { 1048 | "internalType": "uint256", 1049 | "name": "makerAssetFilledAmount", 1050 | "type": "uint256" 1051 | }, 1052 | { 1053 | "internalType": "uint256", 1054 | "name": "takerAssetFilledAmount", 1055 | "type": "uint256" 1056 | }, 1057 | { 1058 | "internalType": "uint256", 1059 | "name": "makerFeePaid", 1060 | "type": "uint256" 1061 | }, 1062 | { 1063 | "internalType": "uint256", 1064 | "name": "takerFeePaid", 1065 | "type": "uint256" 1066 | }, 1067 | { 1068 | "internalType": "uint256", 1069 | "name": "protocolFeePaid", 1070 | "type": "uint256" 1071 | } 1072 | ], 1073 | "internalType": "struct LibFillResults.FillResults[]", 1074 | "name": "left", 1075 | "type": "tuple[]" 1076 | }, 1077 | { 1078 | "components": [ 1079 | { 1080 | "internalType": "uint256", 1081 | "name": "makerAssetFilledAmount", 1082 | "type": "uint256" 1083 | }, 1084 | { 1085 | "internalType": "uint256", 1086 | "name": "takerAssetFilledAmount", 1087 | "type": "uint256" 1088 | }, 1089 | { 1090 | "internalType": "uint256", 1091 | "name": "makerFeePaid", 1092 | "type": "uint256" 1093 | }, 1094 | { 1095 | "internalType": "uint256", 1096 | "name": "takerFeePaid", 1097 | "type": "uint256" 1098 | }, 1099 | { 1100 | "internalType": "uint256", 1101 | "name": "protocolFeePaid", 1102 | "type": "uint256" 1103 | } 1104 | ], 1105 | "internalType": "struct LibFillResults.FillResults[]", 1106 | "name": "right", 1107 | "type": "tuple[]" 1108 | }, 1109 | { 1110 | "internalType": "uint256", 1111 | "name": "profitInLeftMakerAsset", 1112 | "type": "uint256" 1113 | }, 1114 | { 1115 | "internalType": "uint256", 1116 | "name": "profitInRightMakerAsset", 1117 | "type": "uint256" 1118 | } 1119 | ], 1120 | "internalType": "struct LibFillResults.BatchMatchedFillResults", 1121 | "name": "batchMatchedFillResults", 1122 | "type": "tuple" 1123 | } 1124 | ], 1125 | "payable": true, 1126 | "stateMutability": "payable", 1127 | "type": "function" 1128 | }, 1129 | { 1130 | "constant": false, 1131 | "inputs": [ 1132 | { 1133 | "components": [ 1134 | { 1135 | "internalType": "address", 1136 | "name": "makerAddress", 1137 | "type": "address" 1138 | }, 1139 | { 1140 | "internalType": "address", 1141 | "name": "takerAddress", 1142 | "type": "address" 1143 | }, 1144 | { 1145 | "internalType": "address", 1146 | "name": "feeRecipientAddress", 1147 | "type": "address" 1148 | }, 1149 | { 1150 | "internalType": "address", 1151 | "name": "senderAddress", 1152 | "type": "address" 1153 | }, 1154 | { 1155 | "internalType": "uint256", 1156 | "name": "makerAssetAmount", 1157 | "type": "uint256" 1158 | }, 1159 | { 1160 | "internalType": "uint256", 1161 | "name": "takerAssetAmount", 1162 | "type": "uint256" 1163 | }, 1164 | { 1165 | "internalType": "uint256", 1166 | "name": "makerFee", 1167 | "type": "uint256" 1168 | }, 1169 | { 1170 | "internalType": "uint256", 1171 | "name": "takerFee", 1172 | "type": "uint256" 1173 | }, 1174 | { 1175 | "internalType": "uint256", 1176 | "name": "expirationTimeSeconds", 1177 | "type": "uint256" 1178 | }, 1179 | { 1180 | "internalType": "uint256", 1181 | "name": "salt", 1182 | "type": "uint256" 1183 | }, 1184 | { 1185 | "internalType": "bytes", 1186 | "name": "makerAssetData", 1187 | "type": "bytes" 1188 | }, 1189 | { 1190 | "internalType": "bytes", 1191 | "name": "takerAssetData", 1192 | "type": "bytes" 1193 | }, 1194 | { 1195 | "internalType": "bytes", 1196 | "name": "makerFeeAssetData", 1197 | "type": "bytes" 1198 | }, 1199 | { 1200 | "internalType": "bytes", 1201 | "name": "takerFeeAssetData", 1202 | "type": "bytes" 1203 | } 1204 | ], 1205 | "internalType": "struct LibOrder.Order[]", 1206 | "name": "leftOrders", 1207 | "type": "tuple[]" 1208 | }, 1209 | { 1210 | "components": [ 1211 | { 1212 | "internalType": "address", 1213 | "name": "makerAddress", 1214 | "type": "address" 1215 | }, 1216 | { 1217 | "internalType": "address", 1218 | "name": "takerAddress", 1219 | "type": "address" 1220 | }, 1221 | { 1222 | "internalType": "address", 1223 | "name": "feeRecipientAddress", 1224 | "type": "address" 1225 | }, 1226 | { 1227 | "internalType": "address", 1228 | "name": "senderAddress", 1229 | "type": "address" 1230 | }, 1231 | { 1232 | "internalType": "uint256", 1233 | "name": "makerAssetAmount", 1234 | "type": "uint256" 1235 | }, 1236 | { 1237 | "internalType": "uint256", 1238 | "name": "takerAssetAmount", 1239 | "type": "uint256" 1240 | }, 1241 | { 1242 | "internalType": "uint256", 1243 | "name": "makerFee", 1244 | "type": "uint256" 1245 | }, 1246 | { 1247 | "internalType": "uint256", 1248 | "name": "takerFee", 1249 | "type": "uint256" 1250 | }, 1251 | { 1252 | "internalType": "uint256", 1253 | "name": "expirationTimeSeconds", 1254 | "type": "uint256" 1255 | }, 1256 | { 1257 | "internalType": "uint256", 1258 | "name": "salt", 1259 | "type": "uint256" 1260 | }, 1261 | { 1262 | "internalType": "bytes", 1263 | "name": "makerAssetData", 1264 | "type": "bytes" 1265 | }, 1266 | { 1267 | "internalType": "bytes", 1268 | "name": "takerAssetData", 1269 | "type": "bytes" 1270 | }, 1271 | { 1272 | "internalType": "bytes", 1273 | "name": "makerFeeAssetData", 1274 | "type": "bytes" 1275 | }, 1276 | { 1277 | "internalType": "bytes", 1278 | "name": "takerFeeAssetData", 1279 | "type": "bytes" 1280 | } 1281 | ], 1282 | "internalType": "struct LibOrder.Order[]", 1283 | "name": "rightOrders", 1284 | "type": "tuple[]" 1285 | }, 1286 | { 1287 | "internalType": "bytes[]", 1288 | "name": "leftSignatures", 1289 | "type": "bytes[]" 1290 | }, 1291 | { 1292 | "internalType": "bytes[]", 1293 | "name": "rightSignatures", 1294 | "type": "bytes[]" 1295 | } 1296 | ], 1297 | "name": "batchMatchOrdersWithMaximalFill", 1298 | "outputs": [ 1299 | { 1300 | "components": [ 1301 | { 1302 | "components": [ 1303 | { 1304 | "internalType": "uint256", 1305 | "name": "makerAssetFilledAmount", 1306 | "type": "uint256" 1307 | }, 1308 | { 1309 | "internalType": "uint256", 1310 | "name": "takerAssetFilledAmount", 1311 | "type": "uint256" 1312 | }, 1313 | { 1314 | "internalType": "uint256", 1315 | "name": "makerFeePaid", 1316 | "type": "uint256" 1317 | }, 1318 | { 1319 | "internalType": "uint256", 1320 | "name": "takerFeePaid", 1321 | "type": "uint256" 1322 | }, 1323 | { 1324 | "internalType": "uint256", 1325 | "name": "protocolFeePaid", 1326 | "type": "uint256" 1327 | } 1328 | ], 1329 | "internalType": "struct LibFillResults.FillResults[]", 1330 | "name": "left", 1331 | "type": "tuple[]" 1332 | }, 1333 | { 1334 | "components": [ 1335 | { 1336 | "internalType": "uint256", 1337 | "name": "makerAssetFilledAmount", 1338 | "type": "uint256" 1339 | }, 1340 | { 1341 | "internalType": "uint256", 1342 | "name": "takerAssetFilledAmount", 1343 | "type": "uint256" 1344 | }, 1345 | { 1346 | "internalType": "uint256", 1347 | "name": "makerFeePaid", 1348 | "type": "uint256" 1349 | }, 1350 | { 1351 | "internalType": "uint256", 1352 | "name": "takerFeePaid", 1353 | "type": "uint256" 1354 | }, 1355 | { 1356 | "internalType": "uint256", 1357 | "name": "protocolFeePaid", 1358 | "type": "uint256" 1359 | } 1360 | ], 1361 | "internalType": "struct LibFillResults.FillResults[]", 1362 | "name": "right", 1363 | "type": "tuple[]" 1364 | }, 1365 | { 1366 | "internalType": "uint256", 1367 | "name": "profitInLeftMakerAsset", 1368 | "type": "uint256" 1369 | }, 1370 | { 1371 | "internalType": "uint256", 1372 | "name": "profitInRightMakerAsset", 1373 | "type": "uint256" 1374 | } 1375 | ], 1376 | "internalType": "struct LibFillResults.BatchMatchedFillResults", 1377 | "name": "batchMatchedFillResults", 1378 | "type": "tuple" 1379 | } 1380 | ], 1381 | "payable": true, 1382 | "stateMutability": "payable", 1383 | "type": "function" 1384 | }, 1385 | { 1386 | "constant": false, 1387 | "inputs": [ 1388 | { 1389 | "components": [ 1390 | { 1391 | "internalType": "address", 1392 | "name": "makerAddress", 1393 | "type": "address" 1394 | }, 1395 | { 1396 | "internalType": "address", 1397 | "name": "takerAddress", 1398 | "type": "address" 1399 | }, 1400 | { 1401 | "internalType": "address", 1402 | "name": "feeRecipientAddress", 1403 | "type": "address" 1404 | }, 1405 | { 1406 | "internalType": "address", 1407 | "name": "senderAddress", 1408 | "type": "address" 1409 | }, 1410 | { 1411 | "internalType": "uint256", 1412 | "name": "makerAssetAmount", 1413 | "type": "uint256" 1414 | }, 1415 | { 1416 | "internalType": "uint256", 1417 | "name": "takerAssetAmount", 1418 | "type": "uint256" 1419 | }, 1420 | { 1421 | "internalType": "uint256", 1422 | "name": "makerFee", 1423 | "type": "uint256" 1424 | }, 1425 | { 1426 | "internalType": "uint256", 1427 | "name": "takerFee", 1428 | "type": "uint256" 1429 | }, 1430 | { 1431 | "internalType": "uint256", 1432 | "name": "expirationTimeSeconds", 1433 | "type": "uint256" 1434 | }, 1435 | { 1436 | "internalType": "uint256", 1437 | "name": "salt", 1438 | "type": "uint256" 1439 | }, 1440 | { 1441 | "internalType": "bytes", 1442 | "name": "makerAssetData", 1443 | "type": "bytes" 1444 | }, 1445 | { 1446 | "internalType": "bytes", 1447 | "name": "takerAssetData", 1448 | "type": "bytes" 1449 | }, 1450 | { 1451 | "internalType": "bytes", 1452 | "name": "makerFeeAssetData", 1453 | "type": "bytes" 1454 | }, 1455 | { 1456 | "internalType": "bytes", 1457 | "name": "takerFeeAssetData", 1458 | "type": "bytes" 1459 | } 1460 | ], 1461 | "internalType": "struct LibOrder.Order", 1462 | "name": "order", 1463 | "type": "tuple" 1464 | } 1465 | ], 1466 | "name": "cancelOrder", 1467 | "outputs": [], 1468 | "payable": true, 1469 | "stateMutability": "payable", 1470 | "type": "function" 1471 | }, 1472 | { 1473 | "constant": false, 1474 | "inputs": [ 1475 | { 1476 | "internalType": "uint256", 1477 | "name": "targetOrderEpoch", 1478 | "type": "uint256" 1479 | } 1480 | ], 1481 | "name": "cancelOrdersUpTo", 1482 | "outputs": [], 1483 | "payable": true, 1484 | "stateMutability": "payable", 1485 | "type": "function" 1486 | }, 1487 | { 1488 | "constant": true, 1489 | "inputs": [ 1490 | { 1491 | "internalType": "bytes32", 1492 | "name": "", 1493 | "type": "bytes32" 1494 | } 1495 | ], 1496 | "name": "cancelled", 1497 | "outputs": [ 1498 | { 1499 | "internalType": "bool", 1500 | "name": "", 1501 | "type": "bool" 1502 | } 1503 | ], 1504 | "payable": false, 1505 | "stateMutability": "view", 1506 | "type": "function" 1507 | }, 1508 | { 1509 | "constant": true, 1510 | "inputs": [], 1511 | "name": "currentContextAddress", 1512 | "outputs": [ 1513 | { 1514 | "internalType": "address", 1515 | "name": "", 1516 | "type": "address" 1517 | } 1518 | ], 1519 | "payable": false, 1520 | "stateMutability": "view", 1521 | "type": "function" 1522 | }, 1523 | { 1524 | "constant": false, 1525 | "inputs": [], 1526 | "name": "detachProtocolFeeCollector", 1527 | "outputs": [], 1528 | "payable": false, 1529 | "stateMutability": "nonpayable", 1530 | "type": "function" 1531 | }, 1532 | { 1533 | "constant": false, 1534 | "inputs": [ 1535 | { 1536 | "components": [ 1537 | { 1538 | "internalType": "uint256", 1539 | "name": "salt", 1540 | "type": "uint256" 1541 | }, 1542 | { 1543 | "internalType": "uint256", 1544 | "name": "expirationTimeSeconds", 1545 | "type": "uint256" 1546 | }, 1547 | { 1548 | "internalType": "uint256", 1549 | "name": "gasPrice", 1550 | "type": "uint256" 1551 | }, 1552 | { 1553 | "internalType": "address", 1554 | "name": "signerAddress", 1555 | "type": "address" 1556 | }, 1557 | { 1558 | "internalType": "bytes", 1559 | "name": "data", 1560 | "type": "bytes" 1561 | } 1562 | ], 1563 | "internalType": "struct LibZeroExTransaction.ZeroExTransaction", 1564 | "name": "transaction", 1565 | "type": "tuple" 1566 | }, 1567 | { 1568 | "internalType": "bytes", 1569 | "name": "signature", 1570 | "type": "bytes" 1571 | } 1572 | ], 1573 | "name": "executeTransaction", 1574 | "outputs": [ 1575 | { 1576 | "internalType": "bytes", 1577 | "name": "", 1578 | "type": "bytes" 1579 | } 1580 | ], 1581 | "payable": true, 1582 | "stateMutability": "payable", 1583 | "type": "function" 1584 | }, 1585 | { 1586 | "constant": false, 1587 | "inputs": [ 1588 | { 1589 | "components": [ 1590 | { 1591 | "internalType": "address", 1592 | "name": "makerAddress", 1593 | "type": "address" 1594 | }, 1595 | { 1596 | "internalType": "address", 1597 | "name": "takerAddress", 1598 | "type": "address" 1599 | }, 1600 | { 1601 | "internalType": "address", 1602 | "name": "feeRecipientAddress", 1603 | "type": "address" 1604 | }, 1605 | { 1606 | "internalType": "address", 1607 | "name": "senderAddress", 1608 | "type": "address" 1609 | }, 1610 | { 1611 | "internalType": "uint256", 1612 | "name": "makerAssetAmount", 1613 | "type": "uint256" 1614 | }, 1615 | { 1616 | "internalType": "uint256", 1617 | "name": "takerAssetAmount", 1618 | "type": "uint256" 1619 | }, 1620 | { 1621 | "internalType": "uint256", 1622 | "name": "makerFee", 1623 | "type": "uint256" 1624 | }, 1625 | { 1626 | "internalType": "uint256", 1627 | "name": "takerFee", 1628 | "type": "uint256" 1629 | }, 1630 | { 1631 | "internalType": "uint256", 1632 | "name": "expirationTimeSeconds", 1633 | "type": "uint256" 1634 | }, 1635 | { 1636 | "internalType": "uint256", 1637 | "name": "salt", 1638 | "type": "uint256" 1639 | }, 1640 | { 1641 | "internalType": "bytes", 1642 | "name": "makerAssetData", 1643 | "type": "bytes" 1644 | }, 1645 | { 1646 | "internalType": "bytes", 1647 | "name": "takerAssetData", 1648 | "type": "bytes" 1649 | }, 1650 | { 1651 | "internalType": "bytes", 1652 | "name": "makerFeeAssetData", 1653 | "type": "bytes" 1654 | }, 1655 | { 1656 | "internalType": "bytes", 1657 | "name": "takerFeeAssetData", 1658 | "type": "bytes" 1659 | } 1660 | ], 1661 | "internalType": "struct LibOrder.Order", 1662 | "name": "order", 1663 | "type": "tuple" 1664 | }, 1665 | { 1666 | "internalType": "uint256", 1667 | "name": "takerAssetFillAmount", 1668 | "type": "uint256" 1669 | }, 1670 | { 1671 | "internalType": "bytes", 1672 | "name": "signature", 1673 | "type": "bytes" 1674 | } 1675 | ], 1676 | "name": "fillOrKillOrder", 1677 | "outputs": [ 1678 | { 1679 | "components": [ 1680 | { 1681 | "internalType": "uint256", 1682 | "name": "makerAssetFilledAmount", 1683 | "type": "uint256" 1684 | }, 1685 | { 1686 | "internalType": "uint256", 1687 | "name": "takerAssetFilledAmount", 1688 | "type": "uint256" 1689 | }, 1690 | { 1691 | "internalType": "uint256", 1692 | "name": "makerFeePaid", 1693 | "type": "uint256" 1694 | }, 1695 | { 1696 | "internalType": "uint256", 1697 | "name": "takerFeePaid", 1698 | "type": "uint256" 1699 | }, 1700 | { 1701 | "internalType": "uint256", 1702 | "name": "protocolFeePaid", 1703 | "type": "uint256" 1704 | } 1705 | ], 1706 | "internalType": "struct LibFillResults.FillResults", 1707 | "name": "fillResults", 1708 | "type": "tuple" 1709 | } 1710 | ], 1711 | "payable": true, 1712 | "stateMutability": "payable", 1713 | "type": "function" 1714 | }, 1715 | { 1716 | "constant": false, 1717 | "inputs": [ 1718 | { 1719 | "components": [ 1720 | { 1721 | "internalType": "address", 1722 | "name": "makerAddress", 1723 | "type": "address" 1724 | }, 1725 | { 1726 | "internalType": "address", 1727 | "name": "takerAddress", 1728 | "type": "address" 1729 | }, 1730 | { 1731 | "internalType": "address", 1732 | "name": "feeRecipientAddress", 1733 | "type": "address" 1734 | }, 1735 | { 1736 | "internalType": "address", 1737 | "name": "senderAddress", 1738 | "type": "address" 1739 | }, 1740 | { 1741 | "internalType": "uint256", 1742 | "name": "makerAssetAmount", 1743 | "type": "uint256" 1744 | }, 1745 | { 1746 | "internalType": "uint256", 1747 | "name": "takerAssetAmount", 1748 | "type": "uint256" 1749 | }, 1750 | { 1751 | "internalType": "uint256", 1752 | "name": "makerFee", 1753 | "type": "uint256" 1754 | }, 1755 | { 1756 | "internalType": "uint256", 1757 | "name": "takerFee", 1758 | "type": "uint256" 1759 | }, 1760 | { 1761 | "internalType": "uint256", 1762 | "name": "expirationTimeSeconds", 1763 | "type": "uint256" 1764 | }, 1765 | { 1766 | "internalType": "uint256", 1767 | "name": "salt", 1768 | "type": "uint256" 1769 | }, 1770 | { 1771 | "internalType": "bytes", 1772 | "name": "makerAssetData", 1773 | "type": "bytes" 1774 | }, 1775 | { 1776 | "internalType": "bytes", 1777 | "name": "takerAssetData", 1778 | "type": "bytes" 1779 | }, 1780 | { 1781 | "internalType": "bytes", 1782 | "name": "makerFeeAssetData", 1783 | "type": "bytes" 1784 | }, 1785 | { 1786 | "internalType": "bytes", 1787 | "name": "takerFeeAssetData", 1788 | "type": "bytes" 1789 | } 1790 | ], 1791 | "internalType": "struct LibOrder.Order", 1792 | "name": "order", 1793 | "type": "tuple" 1794 | }, 1795 | { 1796 | "internalType": "uint256", 1797 | "name": "takerAssetFillAmount", 1798 | "type": "uint256" 1799 | }, 1800 | { 1801 | "internalType": "bytes", 1802 | "name": "signature", 1803 | "type": "bytes" 1804 | } 1805 | ], 1806 | "name": "fillOrder", 1807 | "outputs": [ 1808 | { 1809 | "components": [ 1810 | { 1811 | "internalType": "uint256", 1812 | "name": "makerAssetFilledAmount", 1813 | "type": "uint256" 1814 | }, 1815 | { 1816 | "internalType": "uint256", 1817 | "name": "takerAssetFilledAmount", 1818 | "type": "uint256" 1819 | }, 1820 | { 1821 | "internalType": "uint256", 1822 | "name": "makerFeePaid", 1823 | "type": "uint256" 1824 | }, 1825 | { 1826 | "internalType": "uint256", 1827 | "name": "takerFeePaid", 1828 | "type": "uint256" 1829 | }, 1830 | { 1831 | "internalType": "uint256", 1832 | "name": "protocolFeePaid", 1833 | "type": "uint256" 1834 | } 1835 | ], 1836 | "internalType": "struct LibFillResults.FillResults", 1837 | "name": "fillResults", 1838 | "type": "tuple" 1839 | } 1840 | ], 1841 | "payable": true, 1842 | "stateMutability": "payable", 1843 | "type": "function" 1844 | }, 1845 | { 1846 | "constant": true, 1847 | "inputs": [ 1848 | { 1849 | "internalType": "bytes32", 1850 | "name": "", 1851 | "type": "bytes32" 1852 | } 1853 | ], 1854 | "name": "filled", 1855 | "outputs": [ 1856 | { 1857 | "internalType": "uint256", 1858 | "name": "", 1859 | "type": "uint256" 1860 | } 1861 | ], 1862 | "payable": false, 1863 | "stateMutability": "view", 1864 | "type": "function" 1865 | }, 1866 | { 1867 | "constant": true, 1868 | "inputs": [ 1869 | { 1870 | "internalType": "bytes4", 1871 | "name": "assetProxyId", 1872 | "type": "bytes4" 1873 | } 1874 | ], 1875 | "name": "getAssetProxy", 1876 | "outputs": [ 1877 | { 1878 | "internalType": "address", 1879 | "name": "", 1880 | "type": "address" 1881 | } 1882 | ], 1883 | "payable": false, 1884 | "stateMutability": "view", 1885 | "type": "function" 1886 | }, 1887 | { 1888 | "constant": true, 1889 | "inputs": [ 1890 | { 1891 | "components": [ 1892 | { 1893 | "internalType": "address", 1894 | "name": "makerAddress", 1895 | "type": "address" 1896 | }, 1897 | { 1898 | "internalType": "address", 1899 | "name": "takerAddress", 1900 | "type": "address" 1901 | }, 1902 | { 1903 | "internalType": "address", 1904 | "name": "feeRecipientAddress", 1905 | "type": "address" 1906 | }, 1907 | { 1908 | "internalType": "address", 1909 | "name": "senderAddress", 1910 | "type": "address" 1911 | }, 1912 | { 1913 | "internalType": "uint256", 1914 | "name": "makerAssetAmount", 1915 | "type": "uint256" 1916 | }, 1917 | { 1918 | "internalType": "uint256", 1919 | "name": "takerAssetAmount", 1920 | "type": "uint256" 1921 | }, 1922 | { 1923 | "internalType": "uint256", 1924 | "name": "makerFee", 1925 | "type": "uint256" 1926 | }, 1927 | { 1928 | "internalType": "uint256", 1929 | "name": "takerFee", 1930 | "type": "uint256" 1931 | }, 1932 | { 1933 | "internalType": "uint256", 1934 | "name": "expirationTimeSeconds", 1935 | "type": "uint256" 1936 | }, 1937 | { 1938 | "internalType": "uint256", 1939 | "name": "salt", 1940 | "type": "uint256" 1941 | }, 1942 | { 1943 | "internalType": "bytes", 1944 | "name": "makerAssetData", 1945 | "type": "bytes" 1946 | }, 1947 | { 1948 | "internalType": "bytes", 1949 | "name": "takerAssetData", 1950 | "type": "bytes" 1951 | }, 1952 | { 1953 | "internalType": "bytes", 1954 | "name": "makerFeeAssetData", 1955 | "type": "bytes" 1956 | }, 1957 | { 1958 | "internalType": "bytes", 1959 | "name": "takerFeeAssetData", 1960 | "type": "bytes" 1961 | } 1962 | ], 1963 | "internalType": "struct LibOrder.Order", 1964 | "name": "order", 1965 | "type": "tuple" 1966 | } 1967 | ], 1968 | "name": "getOrderInfo", 1969 | "outputs": [ 1970 | { 1971 | "components": [ 1972 | { 1973 | "internalType": "uint8", 1974 | "name": "orderStatus", 1975 | "type": "uint8" 1976 | }, 1977 | { 1978 | "internalType": "bytes32", 1979 | "name": "orderHash", 1980 | "type": "bytes32" 1981 | }, 1982 | { 1983 | "internalType": "uint256", 1984 | "name": "orderTakerAssetFilledAmount", 1985 | "type": "uint256" 1986 | } 1987 | ], 1988 | "internalType": "struct LibOrder.OrderInfo", 1989 | "name": "orderInfo", 1990 | "type": "tuple" 1991 | } 1992 | ], 1993 | "payable": false, 1994 | "stateMutability": "view", 1995 | "type": "function" 1996 | }, 1997 | { 1998 | "constant": true, 1999 | "inputs": [ 2000 | { 2001 | "internalType": "bytes32", 2002 | "name": "hash", 2003 | "type": "bytes32" 2004 | }, 2005 | { 2006 | "internalType": "address", 2007 | "name": "signerAddress", 2008 | "type": "address" 2009 | }, 2010 | { 2011 | "internalType": "bytes", 2012 | "name": "signature", 2013 | "type": "bytes" 2014 | } 2015 | ], 2016 | "name": "isValidHashSignature", 2017 | "outputs": [ 2018 | { 2019 | "internalType": "bool", 2020 | "name": "isValid", 2021 | "type": "bool" 2022 | } 2023 | ], 2024 | "payable": false, 2025 | "stateMutability": "view", 2026 | "type": "function" 2027 | }, 2028 | { 2029 | "constant": true, 2030 | "inputs": [ 2031 | { 2032 | "components": [ 2033 | { 2034 | "internalType": "address", 2035 | "name": "makerAddress", 2036 | "type": "address" 2037 | }, 2038 | { 2039 | "internalType": "address", 2040 | "name": "takerAddress", 2041 | "type": "address" 2042 | }, 2043 | { 2044 | "internalType": "address", 2045 | "name": "feeRecipientAddress", 2046 | "type": "address" 2047 | }, 2048 | { 2049 | "internalType": "address", 2050 | "name": "senderAddress", 2051 | "type": "address" 2052 | }, 2053 | { 2054 | "internalType": "uint256", 2055 | "name": "makerAssetAmount", 2056 | "type": "uint256" 2057 | }, 2058 | { 2059 | "internalType": "uint256", 2060 | "name": "takerAssetAmount", 2061 | "type": "uint256" 2062 | }, 2063 | { 2064 | "internalType": "uint256", 2065 | "name": "makerFee", 2066 | "type": "uint256" 2067 | }, 2068 | { 2069 | "internalType": "uint256", 2070 | "name": "takerFee", 2071 | "type": "uint256" 2072 | }, 2073 | { 2074 | "internalType": "uint256", 2075 | "name": "expirationTimeSeconds", 2076 | "type": "uint256" 2077 | }, 2078 | { 2079 | "internalType": "uint256", 2080 | "name": "salt", 2081 | "type": "uint256" 2082 | }, 2083 | { 2084 | "internalType": "bytes", 2085 | "name": "makerAssetData", 2086 | "type": "bytes" 2087 | }, 2088 | { 2089 | "internalType": "bytes", 2090 | "name": "takerAssetData", 2091 | "type": "bytes" 2092 | }, 2093 | { 2094 | "internalType": "bytes", 2095 | "name": "makerFeeAssetData", 2096 | "type": "bytes" 2097 | }, 2098 | { 2099 | "internalType": "bytes", 2100 | "name": "takerFeeAssetData", 2101 | "type": "bytes" 2102 | } 2103 | ], 2104 | "internalType": "struct LibOrder.Order", 2105 | "name": "order", 2106 | "type": "tuple" 2107 | }, 2108 | { 2109 | "internalType": "bytes", 2110 | "name": "signature", 2111 | "type": "bytes" 2112 | } 2113 | ], 2114 | "name": "isValidOrderSignature", 2115 | "outputs": [ 2116 | { 2117 | "internalType": "bool", 2118 | "name": "isValid", 2119 | "type": "bool" 2120 | } 2121 | ], 2122 | "payable": false, 2123 | "stateMutability": "view", 2124 | "type": "function" 2125 | }, 2126 | { 2127 | "constant": true, 2128 | "inputs": [ 2129 | { 2130 | "components": [ 2131 | { 2132 | "internalType": "uint256", 2133 | "name": "salt", 2134 | "type": "uint256" 2135 | }, 2136 | { 2137 | "internalType": "uint256", 2138 | "name": "expirationTimeSeconds", 2139 | "type": "uint256" 2140 | }, 2141 | { 2142 | "internalType": "uint256", 2143 | "name": "gasPrice", 2144 | "type": "uint256" 2145 | }, 2146 | { 2147 | "internalType": "address", 2148 | "name": "signerAddress", 2149 | "type": "address" 2150 | }, 2151 | { 2152 | "internalType": "bytes", 2153 | "name": "data", 2154 | "type": "bytes" 2155 | } 2156 | ], 2157 | "internalType": "struct LibZeroExTransaction.ZeroExTransaction", 2158 | "name": "transaction", 2159 | "type": "tuple" 2160 | }, 2161 | { 2162 | "internalType": "bytes", 2163 | "name": "signature", 2164 | "type": "bytes" 2165 | } 2166 | ], 2167 | "name": "isValidTransactionSignature", 2168 | "outputs": [ 2169 | { 2170 | "internalType": "bool", 2171 | "name": "isValid", 2172 | "type": "bool" 2173 | } 2174 | ], 2175 | "payable": false, 2176 | "stateMutability": "view", 2177 | "type": "function" 2178 | }, 2179 | { 2180 | "constant": false, 2181 | "inputs": [ 2182 | { 2183 | "components": [ 2184 | { 2185 | "internalType": "address", 2186 | "name": "makerAddress", 2187 | "type": "address" 2188 | }, 2189 | { 2190 | "internalType": "address", 2191 | "name": "takerAddress", 2192 | "type": "address" 2193 | }, 2194 | { 2195 | "internalType": "address", 2196 | "name": "feeRecipientAddress", 2197 | "type": "address" 2198 | }, 2199 | { 2200 | "internalType": "address", 2201 | "name": "senderAddress", 2202 | "type": "address" 2203 | }, 2204 | { 2205 | "internalType": "uint256", 2206 | "name": "makerAssetAmount", 2207 | "type": "uint256" 2208 | }, 2209 | { 2210 | "internalType": "uint256", 2211 | "name": "takerAssetAmount", 2212 | "type": "uint256" 2213 | }, 2214 | { 2215 | "internalType": "uint256", 2216 | "name": "makerFee", 2217 | "type": "uint256" 2218 | }, 2219 | { 2220 | "internalType": "uint256", 2221 | "name": "takerFee", 2222 | "type": "uint256" 2223 | }, 2224 | { 2225 | "internalType": "uint256", 2226 | "name": "expirationTimeSeconds", 2227 | "type": "uint256" 2228 | }, 2229 | { 2230 | "internalType": "uint256", 2231 | "name": "salt", 2232 | "type": "uint256" 2233 | }, 2234 | { 2235 | "internalType": "bytes", 2236 | "name": "makerAssetData", 2237 | "type": "bytes" 2238 | }, 2239 | { 2240 | "internalType": "bytes", 2241 | "name": "takerAssetData", 2242 | "type": "bytes" 2243 | }, 2244 | { 2245 | "internalType": "bytes", 2246 | "name": "makerFeeAssetData", 2247 | "type": "bytes" 2248 | }, 2249 | { 2250 | "internalType": "bytes", 2251 | "name": "takerFeeAssetData", 2252 | "type": "bytes" 2253 | } 2254 | ], 2255 | "internalType": "struct LibOrder.Order[]", 2256 | "name": "orders", 2257 | "type": "tuple[]" 2258 | }, 2259 | { 2260 | "internalType": "uint256", 2261 | "name": "makerAssetFillAmount", 2262 | "type": "uint256" 2263 | }, 2264 | { 2265 | "internalType": "bytes[]", 2266 | "name": "signatures", 2267 | "type": "bytes[]" 2268 | } 2269 | ], 2270 | "name": "marketBuyOrdersFillOrKill", 2271 | "outputs": [ 2272 | { 2273 | "components": [ 2274 | { 2275 | "internalType": "uint256", 2276 | "name": "makerAssetFilledAmount", 2277 | "type": "uint256" 2278 | }, 2279 | { 2280 | "internalType": "uint256", 2281 | "name": "takerAssetFilledAmount", 2282 | "type": "uint256" 2283 | }, 2284 | { 2285 | "internalType": "uint256", 2286 | "name": "makerFeePaid", 2287 | "type": "uint256" 2288 | }, 2289 | { 2290 | "internalType": "uint256", 2291 | "name": "takerFeePaid", 2292 | "type": "uint256" 2293 | }, 2294 | { 2295 | "internalType": "uint256", 2296 | "name": "protocolFeePaid", 2297 | "type": "uint256" 2298 | } 2299 | ], 2300 | "internalType": "struct LibFillResults.FillResults", 2301 | "name": "fillResults", 2302 | "type": "tuple" 2303 | } 2304 | ], 2305 | "payable": true, 2306 | "stateMutability": "payable", 2307 | "type": "function" 2308 | }, 2309 | { 2310 | "constant": false, 2311 | "inputs": [ 2312 | { 2313 | "components": [ 2314 | { 2315 | "internalType": "address", 2316 | "name": "makerAddress", 2317 | "type": "address" 2318 | }, 2319 | { 2320 | "internalType": "address", 2321 | "name": "takerAddress", 2322 | "type": "address" 2323 | }, 2324 | { 2325 | "internalType": "address", 2326 | "name": "feeRecipientAddress", 2327 | "type": "address" 2328 | }, 2329 | { 2330 | "internalType": "address", 2331 | "name": "senderAddress", 2332 | "type": "address" 2333 | }, 2334 | { 2335 | "internalType": "uint256", 2336 | "name": "makerAssetAmount", 2337 | "type": "uint256" 2338 | }, 2339 | { 2340 | "internalType": "uint256", 2341 | "name": "takerAssetAmount", 2342 | "type": "uint256" 2343 | }, 2344 | { 2345 | "internalType": "uint256", 2346 | "name": "makerFee", 2347 | "type": "uint256" 2348 | }, 2349 | { 2350 | "internalType": "uint256", 2351 | "name": "takerFee", 2352 | "type": "uint256" 2353 | }, 2354 | { 2355 | "internalType": "uint256", 2356 | "name": "expirationTimeSeconds", 2357 | "type": "uint256" 2358 | }, 2359 | { 2360 | "internalType": "uint256", 2361 | "name": "salt", 2362 | "type": "uint256" 2363 | }, 2364 | { 2365 | "internalType": "bytes", 2366 | "name": "makerAssetData", 2367 | "type": "bytes" 2368 | }, 2369 | { 2370 | "internalType": "bytes", 2371 | "name": "takerAssetData", 2372 | "type": "bytes" 2373 | }, 2374 | { 2375 | "internalType": "bytes", 2376 | "name": "makerFeeAssetData", 2377 | "type": "bytes" 2378 | }, 2379 | { 2380 | "internalType": "bytes", 2381 | "name": "takerFeeAssetData", 2382 | "type": "bytes" 2383 | } 2384 | ], 2385 | "internalType": "struct LibOrder.Order[]", 2386 | "name": "orders", 2387 | "type": "tuple[]" 2388 | }, 2389 | { 2390 | "internalType": "uint256", 2391 | "name": "makerAssetFillAmount", 2392 | "type": "uint256" 2393 | }, 2394 | { 2395 | "internalType": "bytes[]", 2396 | "name": "signatures", 2397 | "type": "bytes[]" 2398 | } 2399 | ], 2400 | "name": "marketBuyOrdersNoThrow", 2401 | "outputs": [ 2402 | { 2403 | "components": [ 2404 | { 2405 | "internalType": "uint256", 2406 | "name": "makerAssetFilledAmount", 2407 | "type": "uint256" 2408 | }, 2409 | { 2410 | "internalType": "uint256", 2411 | "name": "takerAssetFilledAmount", 2412 | "type": "uint256" 2413 | }, 2414 | { 2415 | "internalType": "uint256", 2416 | "name": "makerFeePaid", 2417 | "type": "uint256" 2418 | }, 2419 | { 2420 | "internalType": "uint256", 2421 | "name": "takerFeePaid", 2422 | "type": "uint256" 2423 | }, 2424 | { 2425 | "internalType": "uint256", 2426 | "name": "protocolFeePaid", 2427 | "type": "uint256" 2428 | } 2429 | ], 2430 | "internalType": "struct LibFillResults.FillResults", 2431 | "name": "fillResults", 2432 | "type": "tuple" 2433 | } 2434 | ], 2435 | "payable": true, 2436 | "stateMutability": "payable", 2437 | "type": "function" 2438 | }, 2439 | { 2440 | "constant": false, 2441 | "inputs": [ 2442 | { 2443 | "components": [ 2444 | { 2445 | "internalType": "address", 2446 | "name": "makerAddress", 2447 | "type": "address" 2448 | }, 2449 | { 2450 | "internalType": "address", 2451 | "name": "takerAddress", 2452 | "type": "address" 2453 | }, 2454 | { 2455 | "internalType": "address", 2456 | "name": "feeRecipientAddress", 2457 | "type": "address" 2458 | }, 2459 | { 2460 | "internalType": "address", 2461 | "name": "senderAddress", 2462 | "type": "address" 2463 | }, 2464 | { 2465 | "internalType": "uint256", 2466 | "name": "makerAssetAmount", 2467 | "type": "uint256" 2468 | }, 2469 | { 2470 | "internalType": "uint256", 2471 | "name": "takerAssetAmount", 2472 | "type": "uint256" 2473 | }, 2474 | { 2475 | "internalType": "uint256", 2476 | "name": "makerFee", 2477 | "type": "uint256" 2478 | }, 2479 | { 2480 | "internalType": "uint256", 2481 | "name": "takerFee", 2482 | "type": "uint256" 2483 | }, 2484 | { 2485 | "internalType": "uint256", 2486 | "name": "expirationTimeSeconds", 2487 | "type": "uint256" 2488 | }, 2489 | { 2490 | "internalType": "uint256", 2491 | "name": "salt", 2492 | "type": "uint256" 2493 | }, 2494 | { 2495 | "internalType": "bytes", 2496 | "name": "makerAssetData", 2497 | "type": "bytes" 2498 | }, 2499 | { 2500 | "internalType": "bytes", 2501 | "name": "takerAssetData", 2502 | "type": "bytes" 2503 | }, 2504 | { 2505 | "internalType": "bytes", 2506 | "name": "makerFeeAssetData", 2507 | "type": "bytes" 2508 | }, 2509 | { 2510 | "internalType": "bytes", 2511 | "name": "takerFeeAssetData", 2512 | "type": "bytes" 2513 | } 2514 | ], 2515 | "internalType": "struct LibOrder.Order[]", 2516 | "name": "orders", 2517 | "type": "tuple[]" 2518 | }, 2519 | { 2520 | "internalType": "uint256", 2521 | "name": "takerAssetFillAmount", 2522 | "type": "uint256" 2523 | }, 2524 | { 2525 | "internalType": "bytes[]", 2526 | "name": "signatures", 2527 | "type": "bytes[]" 2528 | } 2529 | ], 2530 | "name": "marketSellOrdersFillOrKill", 2531 | "outputs": [ 2532 | { 2533 | "components": [ 2534 | { 2535 | "internalType": "uint256", 2536 | "name": "makerAssetFilledAmount", 2537 | "type": "uint256" 2538 | }, 2539 | { 2540 | "internalType": "uint256", 2541 | "name": "takerAssetFilledAmount", 2542 | "type": "uint256" 2543 | }, 2544 | { 2545 | "internalType": "uint256", 2546 | "name": "makerFeePaid", 2547 | "type": "uint256" 2548 | }, 2549 | { 2550 | "internalType": "uint256", 2551 | "name": "takerFeePaid", 2552 | "type": "uint256" 2553 | }, 2554 | { 2555 | "internalType": "uint256", 2556 | "name": "protocolFeePaid", 2557 | "type": "uint256" 2558 | } 2559 | ], 2560 | "internalType": "struct LibFillResults.FillResults", 2561 | "name": "fillResults", 2562 | "type": "tuple" 2563 | } 2564 | ], 2565 | "payable": true, 2566 | "stateMutability": "payable", 2567 | "type": "function" 2568 | }, 2569 | { 2570 | "constant": false, 2571 | "inputs": [ 2572 | { 2573 | "components": [ 2574 | { 2575 | "internalType": "address", 2576 | "name": "makerAddress", 2577 | "type": "address" 2578 | }, 2579 | { 2580 | "internalType": "address", 2581 | "name": "takerAddress", 2582 | "type": "address" 2583 | }, 2584 | { 2585 | "internalType": "address", 2586 | "name": "feeRecipientAddress", 2587 | "type": "address" 2588 | }, 2589 | { 2590 | "internalType": "address", 2591 | "name": "senderAddress", 2592 | "type": "address" 2593 | }, 2594 | { 2595 | "internalType": "uint256", 2596 | "name": "makerAssetAmount", 2597 | "type": "uint256" 2598 | }, 2599 | { 2600 | "internalType": "uint256", 2601 | "name": "takerAssetAmount", 2602 | "type": "uint256" 2603 | }, 2604 | { 2605 | "internalType": "uint256", 2606 | "name": "makerFee", 2607 | "type": "uint256" 2608 | }, 2609 | { 2610 | "internalType": "uint256", 2611 | "name": "takerFee", 2612 | "type": "uint256" 2613 | }, 2614 | { 2615 | "internalType": "uint256", 2616 | "name": "expirationTimeSeconds", 2617 | "type": "uint256" 2618 | }, 2619 | { 2620 | "internalType": "uint256", 2621 | "name": "salt", 2622 | "type": "uint256" 2623 | }, 2624 | { 2625 | "internalType": "bytes", 2626 | "name": "makerAssetData", 2627 | "type": "bytes" 2628 | }, 2629 | { 2630 | "internalType": "bytes", 2631 | "name": "takerAssetData", 2632 | "type": "bytes" 2633 | }, 2634 | { 2635 | "internalType": "bytes", 2636 | "name": "makerFeeAssetData", 2637 | "type": "bytes" 2638 | }, 2639 | { 2640 | "internalType": "bytes", 2641 | "name": "takerFeeAssetData", 2642 | "type": "bytes" 2643 | } 2644 | ], 2645 | "internalType": "struct LibOrder.Order[]", 2646 | "name": "orders", 2647 | "type": "tuple[]" 2648 | }, 2649 | { 2650 | "internalType": "uint256", 2651 | "name": "takerAssetFillAmount", 2652 | "type": "uint256" 2653 | }, 2654 | { 2655 | "internalType": "bytes[]", 2656 | "name": "signatures", 2657 | "type": "bytes[]" 2658 | } 2659 | ], 2660 | "name": "marketSellOrdersNoThrow", 2661 | "outputs": [ 2662 | { 2663 | "components": [ 2664 | { 2665 | "internalType": "uint256", 2666 | "name": "makerAssetFilledAmount", 2667 | "type": "uint256" 2668 | }, 2669 | { 2670 | "internalType": "uint256", 2671 | "name": "takerAssetFilledAmount", 2672 | "type": "uint256" 2673 | }, 2674 | { 2675 | "internalType": "uint256", 2676 | "name": "makerFeePaid", 2677 | "type": "uint256" 2678 | }, 2679 | { 2680 | "internalType": "uint256", 2681 | "name": "takerFeePaid", 2682 | "type": "uint256" 2683 | }, 2684 | { 2685 | "internalType": "uint256", 2686 | "name": "protocolFeePaid", 2687 | "type": "uint256" 2688 | } 2689 | ], 2690 | "internalType": "struct LibFillResults.FillResults", 2691 | "name": "fillResults", 2692 | "type": "tuple" 2693 | } 2694 | ], 2695 | "payable": true, 2696 | "stateMutability": "payable", 2697 | "type": "function" 2698 | }, 2699 | { 2700 | "constant": false, 2701 | "inputs": [ 2702 | { 2703 | "components": [ 2704 | { 2705 | "internalType": "address", 2706 | "name": "makerAddress", 2707 | "type": "address" 2708 | }, 2709 | { 2710 | "internalType": "address", 2711 | "name": "takerAddress", 2712 | "type": "address" 2713 | }, 2714 | { 2715 | "internalType": "address", 2716 | "name": "feeRecipientAddress", 2717 | "type": "address" 2718 | }, 2719 | { 2720 | "internalType": "address", 2721 | "name": "senderAddress", 2722 | "type": "address" 2723 | }, 2724 | { 2725 | "internalType": "uint256", 2726 | "name": "makerAssetAmount", 2727 | "type": "uint256" 2728 | }, 2729 | { 2730 | "internalType": "uint256", 2731 | "name": "takerAssetAmount", 2732 | "type": "uint256" 2733 | }, 2734 | { 2735 | "internalType": "uint256", 2736 | "name": "makerFee", 2737 | "type": "uint256" 2738 | }, 2739 | { 2740 | "internalType": "uint256", 2741 | "name": "takerFee", 2742 | "type": "uint256" 2743 | }, 2744 | { 2745 | "internalType": "uint256", 2746 | "name": "expirationTimeSeconds", 2747 | "type": "uint256" 2748 | }, 2749 | { 2750 | "internalType": "uint256", 2751 | "name": "salt", 2752 | "type": "uint256" 2753 | }, 2754 | { 2755 | "internalType": "bytes", 2756 | "name": "makerAssetData", 2757 | "type": "bytes" 2758 | }, 2759 | { 2760 | "internalType": "bytes", 2761 | "name": "takerAssetData", 2762 | "type": "bytes" 2763 | }, 2764 | { 2765 | "internalType": "bytes", 2766 | "name": "makerFeeAssetData", 2767 | "type": "bytes" 2768 | }, 2769 | { 2770 | "internalType": "bytes", 2771 | "name": "takerFeeAssetData", 2772 | "type": "bytes" 2773 | } 2774 | ], 2775 | "internalType": "struct LibOrder.Order", 2776 | "name": "leftOrder", 2777 | "type": "tuple" 2778 | }, 2779 | { 2780 | "components": [ 2781 | { 2782 | "internalType": "address", 2783 | "name": "makerAddress", 2784 | "type": "address" 2785 | }, 2786 | { 2787 | "internalType": "address", 2788 | "name": "takerAddress", 2789 | "type": "address" 2790 | }, 2791 | { 2792 | "internalType": "address", 2793 | "name": "feeRecipientAddress", 2794 | "type": "address" 2795 | }, 2796 | { 2797 | "internalType": "address", 2798 | "name": "senderAddress", 2799 | "type": "address" 2800 | }, 2801 | { 2802 | "internalType": "uint256", 2803 | "name": "makerAssetAmount", 2804 | "type": "uint256" 2805 | }, 2806 | { 2807 | "internalType": "uint256", 2808 | "name": "takerAssetAmount", 2809 | "type": "uint256" 2810 | }, 2811 | { 2812 | "internalType": "uint256", 2813 | "name": "makerFee", 2814 | "type": "uint256" 2815 | }, 2816 | { 2817 | "internalType": "uint256", 2818 | "name": "takerFee", 2819 | "type": "uint256" 2820 | }, 2821 | { 2822 | "internalType": "uint256", 2823 | "name": "expirationTimeSeconds", 2824 | "type": "uint256" 2825 | }, 2826 | { 2827 | "internalType": "uint256", 2828 | "name": "salt", 2829 | "type": "uint256" 2830 | }, 2831 | { 2832 | "internalType": "bytes", 2833 | "name": "makerAssetData", 2834 | "type": "bytes" 2835 | }, 2836 | { 2837 | "internalType": "bytes", 2838 | "name": "takerAssetData", 2839 | "type": "bytes" 2840 | }, 2841 | { 2842 | "internalType": "bytes", 2843 | "name": "makerFeeAssetData", 2844 | "type": "bytes" 2845 | }, 2846 | { 2847 | "internalType": "bytes", 2848 | "name": "takerFeeAssetData", 2849 | "type": "bytes" 2850 | } 2851 | ], 2852 | "internalType": "struct LibOrder.Order", 2853 | "name": "rightOrder", 2854 | "type": "tuple" 2855 | }, 2856 | { 2857 | "internalType": "bytes", 2858 | "name": "leftSignature", 2859 | "type": "bytes" 2860 | }, 2861 | { 2862 | "internalType": "bytes", 2863 | "name": "rightSignature", 2864 | "type": "bytes" 2865 | } 2866 | ], 2867 | "name": "matchOrders", 2868 | "outputs": [ 2869 | { 2870 | "components": [ 2871 | { 2872 | "components": [ 2873 | { 2874 | "internalType": "uint256", 2875 | "name": "makerAssetFilledAmount", 2876 | "type": "uint256" 2877 | }, 2878 | { 2879 | "internalType": "uint256", 2880 | "name": "takerAssetFilledAmount", 2881 | "type": "uint256" 2882 | }, 2883 | { 2884 | "internalType": "uint256", 2885 | "name": "makerFeePaid", 2886 | "type": "uint256" 2887 | }, 2888 | { 2889 | "internalType": "uint256", 2890 | "name": "takerFeePaid", 2891 | "type": "uint256" 2892 | }, 2893 | { 2894 | "internalType": "uint256", 2895 | "name": "protocolFeePaid", 2896 | "type": "uint256" 2897 | } 2898 | ], 2899 | "internalType": "struct LibFillResults.FillResults", 2900 | "name": "left", 2901 | "type": "tuple" 2902 | }, 2903 | { 2904 | "components": [ 2905 | { 2906 | "internalType": "uint256", 2907 | "name": "makerAssetFilledAmount", 2908 | "type": "uint256" 2909 | }, 2910 | { 2911 | "internalType": "uint256", 2912 | "name": "takerAssetFilledAmount", 2913 | "type": "uint256" 2914 | }, 2915 | { 2916 | "internalType": "uint256", 2917 | "name": "makerFeePaid", 2918 | "type": "uint256" 2919 | }, 2920 | { 2921 | "internalType": "uint256", 2922 | "name": "takerFeePaid", 2923 | "type": "uint256" 2924 | }, 2925 | { 2926 | "internalType": "uint256", 2927 | "name": "protocolFeePaid", 2928 | "type": "uint256" 2929 | } 2930 | ], 2931 | "internalType": "struct LibFillResults.FillResults", 2932 | "name": "right", 2933 | "type": "tuple" 2934 | }, 2935 | { 2936 | "internalType": "uint256", 2937 | "name": "profitInLeftMakerAsset", 2938 | "type": "uint256" 2939 | }, 2940 | { 2941 | "internalType": "uint256", 2942 | "name": "profitInRightMakerAsset", 2943 | "type": "uint256" 2944 | } 2945 | ], 2946 | "internalType": "struct LibFillResults.MatchedFillResults", 2947 | "name": "matchedFillResults", 2948 | "type": "tuple" 2949 | } 2950 | ], 2951 | "payable": true, 2952 | "stateMutability": "payable", 2953 | "type": "function" 2954 | }, 2955 | { 2956 | "constant": false, 2957 | "inputs": [ 2958 | { 2959 | "components": [ 2960 | { 2961 | "internalType": "address", 2962 | "name": "makerAddress", 2963 | "type": "address" 2964 | }, 2965 | { 2966 | "internalType": "address", 2967 | "name": "takerAddress", 2968 | "type": "address" 2969 | }, 2970 | { 2971 | "internalType": "address", 2972 | "name": "feeRecipientAddress", 2973 | "type": "address" 2974 | }, 2975 | { 2976 | "internalType": "address", 2977 | "name": "senderAddress", 2978 | "type": "address" 2979 | }, 2980 | { 2981 | "internalType": "uint256", 2982 | "name": "makerAssetAmount", 2983 | "type": "uint256" 2984 | }, 2985 | { 2986 | "internalType": "uint256", 2987 | "name": "takerAssetAmount", 2988 | "type": "uint256" 2989 | }, 2990 | { 2991 | "internalType": "uint256", 2992 | "name": "makerFee", 2993 | "type": "uint256" 2994 | }, 2995 | { 2996 | "internalType": "uint256", 2997 | "name": "takerFee", 2998 | "type": "uint256" 2999 | }, 3000 | { 3001 | "internalType": "uint256", 3002 | "name": "expirationTimeSeconds", 3003 | "type": "uint256" 3004 | }, 3005 | { 3006 | "internalType": "uint256", 3007 | "name": "salt", 3008 | "type": "uint256" 3009 | }, 3010 | { 3011 | "internalType": "bytes", 3012 | "name": "makerAssetData", 3013 | "type": "bytes" 3014 | }, 3015 | { 3016 | "internalType": "bytes", 3017 | "name": "takerAssetData", 3018 | "type": "bytes" 3019 | }, 3020 | { 3021 | "internalType": "bytes", 3022 | "name": "makerFeeAssetData", 3023 | "type": "bytes" 3024 | }, 3025 | { 3026 | "internalType": "bytes", 3027 | "name": "takerFeeAssetData", 3028 | "type": "bytes" 3029 | } 3030 | ], 3031 | "internalType": "struct LibOrder.Order", 3032 | "name": "leftOrder", 3033 | "type": "tuple" 3034 | }, 3035 | { 3036 | "components": [ 3037 | { 3038 | "internalType": "address", 3039 | "name": "makerAddress", 3040 | "type": "address" 3041 | }, 3042 | { 3043 | "internalType": "address", 3044 | "name": "takerAddress", 3045 | "type": "address" 3046 | }, 3047 | { 3048 | "internalType": "address", 3049 | "name": "feeRecipientAddress", 3050 | "type": "address" 3051 | }, 3052 | { 3053 | "internalType": "address", 3054 | "name": "senderAddress", 3055 | "type": "address" 3056 | }, 3057 | { 3058 | "internalType": "uint256", 3059 | "name": "makerAssetAmount", 3060 | "type": "uint256" 3061 | }, 3062 | { 3063 | "internalType": "uint256", 3064 | "name": "takerAssetAmount", 3065 | "type": "uint256" 3066 | }, 3067 | { 3068 | "internalType": "uint256", 3069 | "name": "makerFee", 3070 | "type": "uint256" 3071 | }, 3072 | { 3073 | "internalType": "uint256", 3074 | "name": "takerFee", 3075 | "type": "uint256" 3076 | }, 3077 | { 3078 | "internalType": "uint256", 3079 | "name": "expirationTimeSeconds", 3080 | "type": "uint256" 3081 | }, 3082 | { 3083 | "internalType": "uint256", 3084 | "name": "salt", 3085 | "type": "uint256" 3086 | }, 3087 | { 3088 | "internalType": "bytes", 3089 | "name": "makerAssetData", 3090 | "type": "bytes" 3091 | }, 3092 | { 3093 | "internalType": "bytes", 3094 | "name": "takerAssetData", 3095 | "type": "bytes" 3096 | }, 3097 | { 3098 | "internalType": "bytes", 3099 | "name": "makerFeeAssetData", 3100 | "type": "bytes" 3101 | }, 3102 | { 3103 | "internalType": "bytes", 3104 | "name": "takerFeeAssetData", 3105 | "type": "bytes" 3106 | } 3107 | ], 3108 | "internalType": "struct LibOrder.Order", 3109 | "name": "rightOrder", 3110 | "type": "tuple" 3111 | }, 3112 | { 3113 | "internalType": "bytes", 3114 | "name": "leftSignature", 3115 | "type": "bytes" 3116 | }, 3117 | { 3118 | "internalType": "bytes", 3119 | "name": "rightSignature", 3120 | "type": "bytes" 3121 | } 3122 | ], 3123 | "name": "matchOrdersWithMaximalFill", 3124 | "outputs": [ 3125 | { 3126 | "components": [ 3127 | { 3128 | "components": [ 3129 | { 3130 | "internalType": "uint256", 3131 | "name": "makerAssetFilledAmount", 3132 | "type": "uint256" 3133 | }, 3134 | { 3135 | "internalType": "uint256", 3136 | "name": "takerAssetFilledAmount", 3137 | "type": "uint256" 3138 | }, 3139 | { 3140 | "internalType": "uint256", 3141 | "name": "makerFeePaid", 3142 | "type": "uint256" 3143 | }, 3144 | { 3145 | "internalType": "uint256", 3146 | "name": "takerFeePaid", 3147 | "type": "uint256" 3148 | }, 3149 | { 3150 | "internalType": "uint256", 3151 | "name": "protocolFeePaid", 3152 | "type": "uint256" 3153 | } 3154 | ], 3155 | "internalType": "struct LibFillResults.FillResults", 3156 | "name": "left", 3157 | "type": "tuple" 3158 | }, 3159 | { 3160 | "components": [ 3161 | { 3162 | "internalType": "uint256", 3163 | "name": "makerAssetFilledAmount", 3164 | "type": "uint256" 3165 | }, 3166 | { 3167 | "internalType": "uint256", 3168 | "name": "takerAssetFilledAmount", 3169 | "type": "uint256" 3170 | }, 3171 | { 3172 | "internalType": "uint256", 3173 | "name": "makerFeePaid", 3174 | "type": "uint256" 3175 | }, 3176 | { 3177 | "internalType": "uint256", 3178 | "name": "takerFeePaid", 3179 | "type": "uint256" 3180 | }, 3181 | { 3182 | "internalType": "uint256", 3183 | "name": "protocolFeePaid", 3184 | "type": "uint256" 3185 | } 3186 | ], 3187 | "internalType": "struct LibFillResults.FillResults", 3188 | "name": "right", 3189 | "type": "tuple" 3190 | }, 3191 | { 3192 | "internalType": "uint256", 3193 | "name": "profitInLeftMakerAsset", 3194 | "type": "uint256" 3195 | }, 3196 | { 3197 | "internalType": "uint256", 3198 | "name": "profitInRightMakerAsset", 3199 | "type": "uint256" 3200 | } 3201 | ], 3202 | "internalType": "struct LibFillResults.MatchedFillResults", 3203 | "name": "matchedFillResults", 3204 | "type": "tuple" 3205 | } 3206 | ], 3207 | "payable": true, 3208 | "stateMutability": "payable", 3209 | "type": "function" 3210 | }, 3211 | { 3212 | "constant": true, 3213 | "inputs": [ 3214 | { 3215 | "internalType": "address", 3216 | "name": "", 3217 | "type": "address" 3218 | }, 3219 | { 3220 | "internalType": "address", 3221 | "name": "", 3222 | "type": "address" 3223 | } 3224 | ], 3225 | "name": "orderEpoch", 3226 | "outputs": [ 3227 | { 3228 | "internalType": "uint256", 3229 | "name": "", 3230 | "type": "uint256" 3231 | } 3232 | ], 3233 | "payable": false, 3234 | "stateMutability": "view", 3235 | "type": "function" 3236 | }, 3237 | { 3238 | "constant": true, 3239 | "inputs": [], 3240 | "name": "owner", 3241 | "outputs": [ 3242 | { 3243 | "internalType": "address", 3244 | "name": "", 3245 | "type": "address" 3246 | } 3247 | ], 3248 | "payable": false, 3249 | "stateMutability": "view", 3250 | "type": "function" 3251 | }, 3252 | { 3253 | "constant": false, 3254 | "inputs": [ 3255 | { 3256 | "internalType": "bytes32", 3257 | "name": "hash", 3258 | "type": "bytes32" 3259 | } 3260 | ], 3261 | "name": "preSign", 3262 | "outputs": [], 3263 | "payable": true, 3264 | "stateMutability": "payable", 3265 | "type": "function" 3266 | }, 3267 | { 3268 | "constant": true, 3269 | "inputs": [ 3270 | { 3271 | "internalType": "bytes32", 3272 | "name": "", 3273 | "type": "bytes32" 3274 | }, 3275 | { 3276 | "internalType": "address", 3277 | "name": "", 3278 | "type": "address" 3279 | } 3280 | ], 3281 | "name": "preSigned", 3282 | "outputs": [ 3283 | { 3284 | "internalType": "bool", 3285 | "name": "", 3286 | "type": "bool" 3287 | } 3288 | ], 3289 | "payable": false, 3290 | "stateMutability": "view", 3291 | "type": "function" 3292 | }, 3293 | { 3294 | "constant": true, 3295 | "inputs": [], 3296 | "name": "protocolFeeCollector", 3297 | "outputs": [ 3298 | { 3299 | "internalType": "address", 3300 | "name": "", 3301 | "type": "address" 3302 | } 3303 | ], 3304 | "payable": false, 3305 | "stateMutability": "view", 3306 | "type": "function" 3307 | }, 3308 | { 3309 | "constant": true, 3310 | "inputs": [], 3311 | "name": "protocolFeeMultiplier", 3312 | "outputs": [ 3313 | { 3314 | "internalType": "uint256", 3315 | "name": "", 3316 | "type": "uint256" 3317 | } 3318 | ], 3319 | "payable": false, 3320 | "stateMutability": "view", 3321 | "type": "function" 3322 | }, 3323 | { 3324 | "constant": false, 3325 | "inputs": [ 3326 | { 3327 | "internalType": "address", 3328 | "name": "assetProxy", 3329 | "type": "address" 3330 | } 3331 | ], 3332 | "name": "registerAssetProxy", 3333 | "outputs": [], 3334 | "payable": false, 3335 | "stateMutability": "nonpayable", 3336 | "type": "function" 3337 | }, 3338 | { 3339 | "constant": false, 3340 | "inputs": [ 3341 | { 3342 | "internalType": "address", 3343 | "name": "updatedProtocolFeeCollector", 3344 | "type": "address" 3345 | } 3346 | ], 3347 | "name": "setProtocolFeeCollectorAddress", 3348 | "outputs": [], 3349 | "payable": false, 3350 | "stateMutability": "nonpayable", 3351 | "type": "function" 3352 | }, 3353 | { 3354 | "constant": false, 3355 | "inputs": [ 3356 | { 3357 | "internalType": "uint256", 3358 | "name": "updatedProtocolFeeMultiplier", 3359 | "type": "uint256" 3360 | } 3361 | ], 3362 | "name": "setProtocolFeeMultiplier", 3363 | "outputs": [], 3364 | "payable": false, 3365 | "stateMutability": "nonpayable", 3366 | "type": "function" 3367 | }, 3368 | { 3369 | "constant": false, 3370 | "inputs": [ 3371 | { 3372 | "internalType": "address", 3373 | "name": "validatorAddress", 3374 | "type": "address" 3375 | }, 3376 | { 3377 | "internalType": "bool", 3378 | "name": "approval", 3379 | "type": "bool" 3380 | } 3381 | ], 3382 | "name": "setSignatureValidatorApproval", 3383 | "outputs": [], 3384 | "payable": true, 3385 | "stateMutability": "payable", 3386 | "type": "function" 3387 | }, 3388 | { 3389 | "constant": false, 3390 | "inputs": [ 3391 | { 3392 | "internalType": "bytes[]", 3393 | "name": "assetData", 3394 | "type": "bytes[]" 3395 | }, 3396 | { 3397 | "internalType": "address[]", 3398 | "name": "fromAddresses", 3399 | "type": "address[]" 3400 | }, 3401 | { 3402 | "internalType": "address[]", 3403 | "name": "toAddresses", 3404 | "type": "address[]" 3405 | }, 3406 | { 3407 | "internalType": "uint256[]", 3408 | "name": "amounts", 3409 | "type": "uint256[]" 3410 | } 3411 | ], 3412 | "name": "simulateDispatchTransferFromCalls", 3413 | "outputs": [], 3414 | "payable": false, 3415 | "stateMutability": "nonpayable", 3416 | "type": "function" 3417 | }, 3418 | { 3419 | "constant": true, 3420 | "inputs": [ 3421 | { 3422 | "internalType": "bytes32", 3423 | "name": "", 3424 | "type": "bytes32" 3425 | } 3426 | ], 3427 | "name": "transactionsExecuted", 3428 | "outputs": [ 3429 | { 3430 | "internalType": "bool", 3431 | "name": "", 3432 | "type": "bool" 3433 | } 3434 | ], 3435 | "payable": false, 3436 | "stateMutability": "view", 3437 | "type": "function" 3438 | }, 3439 | { 3440 | "constant": false, 3441 | "inputs": [ 3442 | { 3443 | "internalType": "address", 3444 | "name": "newOwner", 3445 | "type": "address" 3446 | } 3447 | ], 3448 | "name": "transferOwnership", 3449 | "outputs": [], 3450 | "payable": false, 3451 | "stateMutability": "nonpayable", 3452 | "type": "function" 3453 | } 3454 | ] 3455 | -------------------------------------------------------------------------------- /test/data/0x_v3_batchFillOrders.txt: -------------------------------------------------------------------------------- 1 | 0x9694a4020000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000075ea4d5a32370f974d40b404e4ce0e00c155497900000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001d17187dc00000000000000000000000000000000000000000000000000000000489f415000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006003a5a10000000000000000000000000000000000000000000000000cfc770750999b8000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000024f47261b000000000000000000000000077d7e314f82e49a4faff5cc1d2ed0bc7a7c1b1f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b0000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000ee14560000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000421b54c660e791da4c5d11f5f82993040ffc11d68c81364312eca3729ebb97fcaea731b7ec5121978e80a3f88c9134687c3d1a551414b11e0d75ab8919ef15759e3d02000000000000000000000000000000000000000000000000000000000000 -------------------------------------------------------------------------------- /test/data/1inch_exchange_v2_abi.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { 6 | "indexed": false, 7 | "internalType": "string", 8 | "name": "reason", 9 | "type": "string" 10 | } 11 | ], 12 | "name": "Error", 13 | "type": "event" 14 | }, 15 | { 16 | "anonymous": false, 17 | "inputs": [ 18 | { 19 | "indexed": true, 20 | "internalType": "address", 21 | "name": "previousOwner", 22 | "type": "address" 23 | }, 24 | { 25 | "indexed": true, 26 | "internalType": "address", 27 | "name": "newOwner", 28 | "type": "address" 29 | } 30 | ], 31 | "name": "OwnershipTransferred", 32 | "type": "event" 33 | }, 34 | { 35 | "anonymous": false, 36 | "inputs": [ 37 | { 38 | "indexed": false, 39 | "internalType": "address", 40 | "name": "account", 41 | "type": "address" 42 | } 43 | ], 44 | "name": "Paused", 45 | "type": "event" 46 | }, 47 | { 48 | "anonymous": false, 49 | "inputs": [ 50 | { 51 | "indexed": true, 52 | "internalType": "address", 53 | "name": "sender", 54 | "type": "address" 55 | }, 56 | { 57 | "indexed": true, 58 | "internalType": "contract IERC20", 59 | "name": "srcToken", 60 | "type": "address" 61 | }, 62 | { 63 | "indexed": true, 64 | "internalType": "contract IERC20", 65 | "name": "dstToken", 66 | "type": "address" 67 | }, 68 | { 69 | "indexed": false, 70 | "internalType": "address", 71 | "name": "dstReceiver", 72 | "type": "address" 73 | }, 74 | { 75 | "indexed": false, 76 | "internalType": "uint256", 77 | "name": "amount", 78 | "type": "uint256" 79 | }, 80 | { 81 | "indexed": false, 82 | "internalType": "uint256", 83 | "name": "spentAmount", 84 | "type": "uint256" 85 | }, 86 | { 87 | "indexed": false, 88 | "internalType": "uint256", 89 | "name": "returnAmount", 90 | "type": "uint256" 91 | }, 92 | { 93 | "indexed": false, 94 | "internalType": "uint256", 95 | "name": "minReturnAmount", 96 | "type": "uint256" 97 | }, 98 | { 99 | "indexed": false, 100 | "internalType": "uint256", 101 | "name": "guaranteedAmount", 102 | "type": "uint256" 103 | }, 104 | { 105 | "indexed": false, 106 | "internalType": "address", 107 | "name": "referrer", 108 | "type": "address" 109 | } 110 | ], 111 | "name": "Swapped", 112 | "type": "event" 113 | }, 114 | { 115 | "anonymous": false, 116 | "inputs": [ 117 | { 118 | "indexed": false, 119 | "internalType": "address", 120 | "name": "account", 121 | "type": "address" 122 | } 123 | ], 124 | "name": "Unpaused", 125 | "type": "event" 126 | }, 127 | { 128 | "inputs": [ 129 | { 130 | "internalType": "contract IOneInchCaller", 131 | "name": "caller", 132 | "type": "address" 133 | }, 134 | { 135 | "components": [ 136 | { 137 | "internalType": "contract IERC20", 138 | "name": "srcToken", 139 | "type": "address" 140 | }, 141 | { 142 | "internalType": "contract IERC20", 143 | "name": "dstToken", 144 | "type": "address" 145 | }, 146 | { 147 | "internalType": "address", 148 | "name": "srcReceiver", 149 | "type": "address" 150 | }, 151 | { 152 | "internalType": "address", 153 | "name": "dstReceiver", 154 | "type": "address" 155 | }, 156 | { 157 | "internalType": "uint256", 158 | "name": "amount", 159 | "type": "uint256" 160 | }, 161 | { 162 | "internalType": "uint256", 163 | "name": "minReturnAmount", 164 | "type": "uint256" 165 | }, 166 | { 167 | "internalType": "uint256", 168 | "name": "guaranteedAmount", 169 | "type": "uint256" 170 | }, 171 | { 172 | "internalType": "uint256", 173 | "name": "flags", 174 | "type": "uint256" 175 | }, 176 | { 177 | "internalType": "address", 178 | "name": "referrer", 179 | "type": "address" 180 | }, 181 | { 182 | "internalType": "bytes", 183 | "name": "permit", 184 | "type": "bytes" 185 | } 186 | ], 187 | "internalType": "struct OneInchExchange.SwapDescription", 188 | "name": "desc", 189 | "type": "tuple" 190 | }, 191 | { 192 | "components": [ 193 | { 194 | "internalType": "uint256", 195 | "name": "targetWithMandatory", 196 | "type": "uint256" 197 | }, 198 | { 199 | "internalType": "uint256", 200 | "name": "gasLimit", 201 | "type": "uint256" 202 | }, 203 | { 204 | "internalType": "uint256", 205 | "name": "value", 206 | "type": "uint256" 207 | }, 208 | { 209 | "internalType": "bytes", 210 | "name": "data", 211 | "type": "bytes" 212 | } 213 | ], 214 | "internalType": "struct IOneInchCaller.CallDescription[]", 215 | "name": "calls", 216 | "type": "tuple[]" 217 | } 218 | ], 219 | "name": "discountedSwap", 220 | "outputs": [ 221 | { 222 | "internalType": "uint256", 223 | "name": "returnAmount", 224 | "type": "uint256" 225 | } 226 | ], 227 | "stateMutability": "payable", 228 | "type": "function" 229 | }, 230 | { 231 | "inputs": [], 232 | "name": "owner", 233 | "outputs": [ 234 | { 235 | "internalType": "address", 236 | "name": "", 237 | "type": "address" 238 | } 239 | ], 240 | "stateMutability": "view", 241 | "type": "function" 242 | }, 243 | { 244 | "inputs": [], 245 | "name": "pause", 246 | "outputs": [], 247 | "stateMutability": "nonpayable", 248 | "type": "function" 249 | }, 250 | { 251 | "inputs": [], 252 | "name": "paused", 253 | "outputs": [ 254 | { 255 | "internalType": "bool", 256 | "name": "", 257 | "type": "bool" 258 | } 259 | ], 260 | "stateMutability": "view", 261 | "type": "function" 262 | }, 263 | { 264 | "inputs": [], 265 | "name": "renounceOwnership", 266 | "outputs": [], 267 | "stateMutability": "nonpayable", 268 | "type": "function" 269 | }, 270 | { 271 | "inputs": [ 272 | { 273 | "internalType": "contract IERC20", 274 | "name": "token", 275 | "type": "address" 276 | }, 277 | { 278 | "internalType": "uint256", 279 | "name": "amount", 280 | "type": "uint256" 281 | } 282 | ], 283 | "name": "rescueFunds", 284 | "outputs": [], 285 | "stateMutability": "nonpayable", 286 | "type": "function" 287 | }, 288 | { 289 | "inputs": [ 290 | { 291 | "internalType": "contract IOneInchCaller", 292 | "name": "caller", 293 | "type": "address" 294 | }, 295 | { 296 | "components": [ 297 | { 298 | "internalType": "contract IERC20", 299 | "name": "srcToken", 300 | "type": "address" 301 | }, 302 | { 303 | "internalType": "contract IERC20", 304 | "name": "dstToken", 305 | "type": "address" 306 | }, 307 | { 308 | "internalType": "address", 309 | "name": "srcReceiver", 310 | "type": "address" 311 | }, 312 | { 313 | "internalType": "address", 314 | "name": "dstReceiver", 315 | "type": "address" 316 | }, 317 | { 318 | "internalType": "uint256", 319 | "name": "amount", 320 | "type": "uint256" 321 | }, 322 | { 323 | "internalType": "uint256", 324 | "name": "minReturnAmount", 325 | "type": "uint256" 326 | }, 327 | { 328 | "internalType": "uint256", 329 | "name": "guaranteedAmount", 330 | "type": "uint256" 331 | }, 332 | { 333 | "internalType": "uint256", 334 | "name": "flags", 335 | "type": "uint256" 336 | }, 337 | { 338 | "internalType": "address", 339 | "name": "referrer", 340 | "type": "address" 341 | }, 342 | { 343 | "internalType": "bytes", 344 | "name": "permit", 345 | "type": "bytes" 346 | } 347 | ], 348 | "internalType": "struct OneInchExchange.SwapDescription", 349 | "name": "desc", 350 | "type": "tuple" 351 | }, 352 | { 353 | "components": [ 354 | { 355 | "internalType": "uint256", 356 | "name": "targetWithMandatory", 357 | "type": "uint256" 358 | }, 359 | { 360 | "internalType": "uint256", 361 | "name": "gasLimit", 362 | "type": "uint256" 363 | }, 364 | { 365 | "internalType": "uint256", 366 | "name": "value", 367 | "type": "uint256" 368 | }, 369 | { 370 | "internalType": "bytes", 371 | "name": "data", 372 | "type": "bytes" 373 | } 374 | ], 375 | "internalType": "struct IOneInchCaller.CallDescription[]", 376 | "name": "calls", 377 | "type": "tuple[]" 378 | } 379 | ], 380 | "name": "swap", 381 | "outputs": [ 382 | { 383 | "internalType": "uint256", 384 | "name": "returnAmount", 385 | "type": "uint256" 386 | } 387 | ], 388 | "stateMutability": "payable", 389 | "type": "function" 390 | }, 391 | { 392 | "inputs": [ 393 | { 394 | "internalType": "address", 395 | "name": "newOwner", 396 | "type": "address" 397 | } 398 | ], 399 | "name": "transferOwnership", 400 | "outputs": [], 401 | "stateMutability": "nonpayable", 402 | "type": "function" 403 | } 404 | ] 405 | -------------------------------------------------------------------------------- /test/data/1inch_exchange_v2_assetEth_withWeth.txt: -------------------------------------------------------------------------------- 1 | 0x90411a32000000000000000000000000b3c9669a5706477a2b237d98edb9b57678926f04000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000584bc13c7d411c00c01a62e8019472de68768430000000000000000000000000b3c9669a5706477a2b237d98edb9b57678926f04000000000000000000000000713a6f15c713e61731e799cdb880712812ba8e6000000000000000000000000000000000000000000000000009bdffea995b6800000000000000000000000000000000000000000000000111abeddce67c968a12000000000000000000000000000000000000000000000111f20f2875f6f26e0600000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e34c4c920c1b6a397cab786ebfd83dcaee1ff6400000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000082000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064d1660f99000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000001e34c4c920c1b6a397cab786ebfd83dcaee1ff640000000000000000000000000000000000000000000000000031e1474081d40000000000000000000000000000000000000000000000000000000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098c1ea358d9940000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000004d0e30db000000000000000000000000000000000000000000000000000000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000006463bd6026a2e7bfab5851b62969a92f7cca0eb6000000000000000000000000000000000000000000000000098c1ea358d9940000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000a4c9f12e9d0000000000000000000000006463bd6026a2e7bfab5851b62969a92f7cca0eb6000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000584bc13c7d411c00c01a62e8019472de68768430000000000000000000000003b3c9669a5706477a2b237d98edb9b57678926f04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002647f8fe7a000000000000000000000000000000000000000000000000000000000000000808000000000000000000000000000000000000000000000000000000000000044000000000000000000000000b3c9669a5706477a2b237d98edb9b57678926f0400000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000a405971224000000000000000000000000584bc13c7d411c00c01a62e8019472de687684300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000000000000000000014458807654b2e77400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004470bdb947000000000000000000000000584bc13c7d411c00c01a62e8019472de68768430000000000000000000000000000000000000000000000111f20f2875f6f26e060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a4b3af37c000000000000000000000000000000000000000000000000000000000000000808000000000000000000000000000000000000000000000000000000000000044000000000000000000000000584bc13c7d411c00c01a62e8019472de68768430000000000000000000000000000000010000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064d1660f99000000000000000000000000584bc13c7d411c00c01a62e8019472de68768430000000000000000000000000713a6f15c713e61731e799cdb880712812ba8e6000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -------------------------------------------------------------------------------- /test/data/1inch_exchange_v3_abi.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { 6 | "indexed": false, 7 | "internalType": "string", 8 | "name": "reason", 9 | "type": "string" 10 | } 11 | ], 12 | "name": "Error", 13 | "type": "event" 14 | }, 15 | { 16 | "anonymous": false, 17 | "inputs": [ 18 | { 19 | "indexed": true, 20 | "internalType": "address", 21 | "name": "previousOwner", 22 | "type": "address" 23 | }, 24 | { 25 | "indexed": true, 26 | "internalType": "address", 27 | "name": "newOwner", 28 | "type": "address" 29 | } 30 | ], 31 | "name": "OwnershipTransferred", 32 | "type": "event" 33 | }, 34 | { 35 | "anonymous": false, 36 | "inputs": [ 37 | { 38 | "indexed": false, 39 | "internalType": "address", 40 | "name": "sender", 41 | "type": "address" 42 | }, 43 | { 44 | "indexed": false, 45 | "internalType": "contract IERC20", 46 | "name": "srcToken", 47 | "type": "address" 48 | }, 49 | { 50 | "indexed": false, 51 | "internalType": "contract IERC20", 52 | "name": "dstToken", 53 | "type": "address" 54 | }, 55 | { 56 | "indexed": false, 57 | "internalType": "address", 58 | "name": "dstReceiver", 59 | "type": "address" 60 | }, 61 | { 62 | "indexed": false, 63 | "internalType": "uint256", 64 | "name": "spentAmount", 65 | "type": "uint256" 66 | }, 67 | { 68 | "indexed": false, 69 | "internalType": "uint256", 70 | "name": "returnAmount", 71 | "type": "uint256" 72 | } 73 | ], 74 | "name": "Swapped", 75 | "type": "event" 76 | }, 77 | { 78 | "inputs": [], 79 | "name": "destroy", 80 | "outputs": [], 81 | "stateMutability": "nonpayable", 82 | "type": "function" 83 | }, 84 | { 85 | "inputs": [ 86 | { 87 | "internalType": "contract IAggregationExecutor", 88 | "name": "caller", 89 | "type": "address" 90 | }, 91 | { 92 | "components": [ 93 | { 94 | "internalType": "contract IERC20", 95 | "name": "srcToken", 96 | "type": "address" 97 | }, 98 | { 99 | "internalType": "contract IERC20", 100 | "name": "dstToken", 101 | "type": "address" 102 | }, 103 | { 104 | "internalType": "address", 105 | "name": "srcReceiver", 106 | "type": "address" 107 | }, 108 | { 109 | "internalType": "address", 110 | "name": "dstReceiver", 111 | "type": "address" 112 | }, 113 | { 114 | "internalType": "uint256", 115 | "name": "amount", 116 | "type": "uint256" 117 | }, 118 | { 119 | "internalType": "uint256", 120 | "name": "minReturnAmount", 121 | "type": "uint256" 122 | }, 123 | { 124 | "internalType": "uint256", 125 | "name": "flags", 126 | "type": "uint256" 127 | }, 128 | { 129 | "internalType": "bytes", 130 | "name": "permit", 131 | "type": "bytes" 132 | } 133 | ], 134 | "internalType": "struct AggregationRouterV3.SwapDescription", 135 | "name": "desc", 136 | "type": "tuple" 137 | }, 138 | { 139 | "internalType": "bytes", 140 | "name": "data", 141 | "type": "bytes" 142 | } 143 | ], 144 | "name": "discountedSwap", 145 | "outputs": [ 146 | { 147 | "internalType": "uint256", 148 | "name": "returnAmount", 149 | "type": "uint256" 150 | }, 151 | { 152 | "internalType": "uint256", 153 | "name": "gasLeft", 154 | "type": "uint256" 155 | }, 156 | { 157 | "internalType": "uint256", 158 | "name": "chiSpent", 159 | "type": "uint256" 160 | } 161 | ], 162 | "stateMutability": "payable", 163 | "type": "function" 164 | }, 165 | { 166 | "inputs": [], 167 | "name": "owner", 168 | "outputs": [ 169 | { 170 | "internalType": "address", 171 | "name": "", 172 | "type": "address" 173 | } 174 | ], 175 | "stateMutability": "view", 176 | "type": "function" 177 | }, 178 | { 179 | "inputs": [], 180 | "name": "renounceOwnership", 181 | "outputs": [], 182 | "stateMutability": "nonpayable", 183 | "type": "function" 184 | }, 185 | { 186 | "inputs": [ 187 | { 188 | "internalType": "contract IERC20", 189 | "name": "token", 190 | "type": "address" 191 | }, 192 | { 193 | "internalType": "uint256", 194 | "name": "amount", 195 | "type": "uint256" 196 | } 197 | ], 198 | "name": "rescueFunds", 199 | "outputs": [], 200 | "stateMutability": "nonpayable", 201 | "type": "function" 202 | }, 203 | { 204 | "inputs": [ 205 | { 206 | "internalType": "contract IAggregationExecutor", 207 | "name": "caller", 208 | "type": "address" 209 | }, 210 | { 211 | "components": [ 212 | { 213 | "internalType": "contract IERC20", 214 | "name": "srcToken", 215 | "type": "address" 216 | }, 217 | { 218 | "internalType": "contract IERC20", 219 | "name": "dstToken", 220 | "type": "address" 221 | }, 222 | { 223 | "internalType": "address", 224 | "name": "srcReceiver", 225 | "type": "address" 226 | }, 227 | { 228 | "internalType": "address", 229 | "name": "dstReceiver", 230 | "type": "address" 231 | }, 232 | { 233 | "internalType": "uint256", 234 | "name": "amount", 235 | "type": "uint256" 236 | }, 237 | { 238 | "internalType": "uint256", 239 | "name": "minReturnAmount", 240 | "type": "uint256" 241 | }, 242 | { 243 | "internalType": "uint256", 244 | "name": "flags", 245 | "type": "uint256" 246 | }, 247 | { 248 | "internalType": "bytes", 249 | "name": "permit", 250 | "type": "bytes" 251 | } 252 | ], 253 | "internalType": "struct AggregationRouterV3.SwapDescription", 254 | "name": "desc", 255 | "type": "tuple" 256 | }, 257 | { 258 | "internalType": "bytes", 259 | "name": "data", 260 | "type": "bytes" 261 | } 262 | ], 263 | "name": "swap", 264 | "outputs": [ 265 | { 266 | "internalType": "uint256", 267 | "name": "returnAmount", 268 | "type": "uint256" 269 | }, 270 | { 271 | "internalType": "uint256", 272 | "name": "gasLeft", 273 | "type": "uint256" 274 | } 275 | ], 276 | "stateMutability": "payable", 277 | "type": "function" 278 | }, 279 | { 280 | "inputs": [ 281 | { 282 | "internalType": "address", 283 | "name": "newOwner", 284 | "type": "address" 285 | } 286 | ], 287 | "name": "transferOwnership", 288 | "outputs": [], 289 | "stateMutability": "nonpayable", 290 | "type": "function" 291 | }, 292 | { 293 | "inputs": [ 294 | { 295 | "internalType": "contract IERC20", 296 | "name": "srcToken", 297 | "type": "address" 298 | }, 299 | { 300 | "internalType": "uint256", 301 | "name": "amount", 302 | "type": "uint256" 303 | }, 304 | { 305 | "internalType": "uint256", 306 | "name": "minReturn", 307 | "type": "uint256" 308 | }, 309 | { 310 | "internalType": "bytes32[]", 311 | "name": "", 312 | "type": "bytes32[]" 313 | } 314 | ], 315 | "name": "unoswap", 316 | "outputs": [ 317 | { 318 | "internalType": "uint256", 319 | "name": "returnAmount", 320 | "type": "uint256" 321 | } 322 | ], 323 | "stateMutability": "payable", 324 | "type": "function" 325 | }, 326 | { 327 | "inputs": [ 328 | { 329 | "internalType": "contract IERC20", 330 | "name": "srcToken", 331 | "type": "address" 332 | }, 333 | { 334 | "internalType": "uint256", 335 | "name": "amount", 336 | "type": "uint256" 337 | }, 338 | { 339 | "internalType": "uint256", 340 | "name": "minReturn", 341 | "type": "uint256" 342 | }, 343 | { 344 | "internalType": "bytes32[]", 345 | "name": "pools", 346 | "type": "bytes32[]" 347 | }, 348 | { 349 | "internalType": "bytes", 350 | "name": "permit", 351 | "type": "bytes" 352 | } 353 | ], 354 | "name": "unoswapWithPermit", 355 | "outputs": [ 356 | { 357 | "internalType": "uint256", 358 | "name": "returnAmount", 359 | "type": "uint256" 360 | } 361 | ], 362 | "stateMutability": "payable", 363 | "type": "function" 364 | }, 365 | { 366 | "stateMutability": "payable", 367 | "type": "receive" 368 | } 369 | ] 370 | -------------------------------------------------------------------------------- /test/data/1inch_exchange_v3_unoswap.txt: -------------------------------------------------------------------------------- 1 | 0x2e95b6c8000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000cd2be2f76000000000000000000000000000000000000000000000119e98301db907169120000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000280000000000000003b6d03400d4a11d5eeaac28ec3f61d100daf4d40471f185200000000000000003b6d034018a797c7c70c1bf22fdee1c09062aba709cacf04 2 | -------------------------------------------------------------------------------- /test/data/1inch_v2_expectedSwap.json: -------------------------------------------------------------------------------- 1 | { 2 | "methodName": "swap", 3 | "params": { 4 | "caller": "0xb3C9669A5706477a2B237D98eDb9B57678926f04", 5 | "desc": { 6 | "srcToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", 7 | "dstToken": "0x584bC13c7D411c00c01A62e8019472dE68768430", 8 | "srcReceiver": "0xb3C9669A5706477a2B237D98eDb9B57678926f04", 9 | "dstReceiver": "0x713a6f15C713e61731E799cdB880712812bA8e60", 10 | "amount": "701998500000000000", 11 | "minReturnAmount": "5048349933155164523026", 12 | "guaranteedAmount": "5053403336491656179206", 13 | "flags": "0", 14 | "referrer": "0x1E34c4C920C1b6a397Cab786eBfd83dCaEE1FF64", 15 | "permit": "0x" 16 | }, 17 | "calls": [ 18 | { 19 | "targetWithMandatory": "0", 20 | "gasLimit": "0", 21 | "value": "0", 22 | "data": "0xd1660f99000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000001e34c4c920c1b6a397cab786ebfd83dcaee1ff640000000000000000000000000000000000000000000000000031e1474081d400" 23 | }, 24 | { 25 | "targetWithMandatory": "1097077688018008265106216665536940668749033598146", 26 | "gasLimit": "0", 27 | "value": "687958530000000000", 28 | "data": "0xd0e30db0" 29 | }, 30 | { 31 | "targetWithMandatory": "1097077688018008265106216665536940668749033598146", 32 | "gasLimit": "0", 33 | "value": "0", 34 | "data": "0xa9059cbb0000000000000000000000006463bd6026a2e7bfab5851b62969a92f7cca0eb6000000000000000000000000000000000000000000000000098c1ea358d99400" 35 | }, 36 | { 37 | "targetWithMandatory": "57896044618658097711785492504343953926634992332820282019728792003956564819968", 38 | "gasLimit": "0", 39 | "value": "0", 40 | "data": "0xc9f12e9d0000000000000000000000006463bd6026a2e7bfab5851b62969a92f7cca0eb6000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000584bc13c7d411c00c01a62e8019472de68768430000000000000000000000003b3c9669a5706477a2b237d98edb9b57678926f040000000000000000000000000000000000000000000000000000000000000000" 41 | }, 42 | { 43 | "targetWithMandatory": "0", 44 | "gasLimit": "0", 45 | "value": "0", 46 | "data": "0x7f8fe7a000000000000000000000000000000000000000000000000000000000000000808000000000000000000000000000000000000000000000000000000000000044000000000000000000000000b3c9669a5706477a2b237d98edb9b57678926f0400000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000a405971224000000000000000000000000584bc13c7d411c00c01a62e8019472de687684300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000000000000000000014458807654b2e77400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004470bdb947000000000000000000000000584bc13c7d411c00c01a62e8019472de68768430000000000000000000000000000000000000000000000111f20f2875f6f26e0600000000000000000000000000000000000000000000000000000000" 47 | }, 48 | { 49 | "targetWithMandatory": "0", 50 | "gasLimit": "0", 51 | "value": "0", 52 | "data": "0xb3af37c000000000000000000000000000000000000000000000000000000000000000808000000000000000000000000000000000000000000000000000000000000044000000000000000000000000584bc13c7d411c00c01a62e8019472de68768430000000000000000000000000000000010000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064d1660f99000000000000000000000000584bc13c7d411c00c01a62e8019472de68768430000000000000000000000000713a6f15c713e61731e799cdb880712812ba8e60000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000" 53 | } 54 | ] 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /test/index.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-shadow */ 2 | const fs = require('fs') 3 | const test = require('tape') 4 | const InputDataDecoder = require('ethereum-input-data-decoder') 5 | const decodeInput = require('../dist/ethereum-input-to-object') 6 | 7 | test('decoder', (t) => { 8 | // This test needs to be commented out until nested tuples are dealt with in 9 | // `ethereum-input-data-decoder`, you can point dependency to this to fix this test 10 | // `git@github.com:alexcampbelling/ethereum-input-data-decoder.git#fix/nested-tuple-array` 11 | 12 | t.test('Checking 1inch v2 swap for bytes type', (t) => { 13 | t.plan(1) 14 | 15 | const decoder = new InputDataDecoder(`${__dirname}/data/1inch_exchange_v2_abi.json`) 16 | 17 | // This used to have trouble decoding, Eth Asset, WETH in the internals 18 | // The important part is that the data which is type 'bytes' isn't double decoded 19 | // https://etherscan.io/tx/0x3693b42398beaf1e367cfe004b6606697764bc99ab1d5c01c300b760034be46c 20 | const data = fs.readFileSync(`${__dirname}/data/1inch_exchange_v2_assetEth_withWeth.txt`) 21 | const result = decodeInput(decoder, data) 22 | 23 | const expectedSwap = fs.readFileSync(`${__dirname}/data/1inch_v2_expectedSwap.json`) 24 | 25 | // Ensure v2 swap calls are not double decoding data 26 | t.deepEquals(result, JSON.parse(expectedSwap)) 27 | }) 28 | 29 | t.test('Checking 1inch v3 unoswap for bytes32[] type', (t) => { 30 | t.plan(1) 31 | 32 | const decoder = new InputDataDecoder(`${__dirname}/data/1inch_exchange_v3_abi.json`) 33 | 34 | // Normal unoswap tx, has a bytes32[] array we want to ensure does not double decode 35 | const data = fs.readFileSync(`${__dirname}/data/1inch_exchange_v3_unoswap.txt`) 36 | const result = decodeInput(decoder, data) 37 | 38 | const expectedUnoswap = { 39 | methodName: 'unoswap', 40 | params: { 41 | srcToken: '0xdAC17F958D2ee523a2206206994597C13D831ec7', 42 | amount: '55075286902', 43 | minReturn: '5200361379387703126290', 44 | '': [ 45 | '0x80000000000000003b6d03400d4a11d5eeaac28ec3f61d100daf4d40471f1852', 46 | '0x00000000000000003b6d034018a797c7c70c1bf22fdee1c09062aba709cacf04'], 47 | }, 48 | } 49 | t.deepEquals(result, expectedUnoswap) 50 | }) 51 | 52 | 53 | t.test('Checking 0x_v3 for bytes[] type', (t) => { 54 | t.plan(1) 55 | 56 | const decoder = new InputDataDecoder(`${__dirname}/data/0x_v3_abi.json`) 57 | 58 | // batchFillOrders which has a bytes[] type, to check we are not double decoding 59 | const data = fs.readFileSync(`${__dirname}/data/0x_v3_batchFillOrders.txt`) 60 | const result = decodeInput(decoder, data) 61 | 62 | const expectedbatchFillOrders = { 63 | methodName: 'batchFillOrders', 64 | params: { 65 | orders: [{ 66 | makerAddress: '0x75ea4d5a32370f974D40b404E4cE0E00C1554979', 67 | takerAddress: '0x0000000000000000000000000000000000000000', 68 | feeRecipientAddress: '0x1000000000000000000000000000000000000011', 69 | senderAddress: '0x0000000000000000000000000000000000000000', 70 | makerAssetAmount: '7808845788', 71 | takerAssetAmount: '1218396496', 72 | makerFee: '0', 73 | takerFee: '0', 74 | expirationTimeSeconds: '1610851745', 75 | salt: '935753695886941056', 76 | makerAssetData: '0xf47261b000000000000000000000000077d7e314f82e49a4faff5cc1d2ed0bc7a7c1b1f0', 77 | takerAssetData: '0xf47261b0000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', 78 | makerFeeAssetData: '0x', 79 | takerFeeAssetData: '0x', 80 | }], 81 | takerAssetFillAmounts: ['15602774'], 82 | signatures: ['0x1b54c660e791da4c5d11f5f82993040ffc11d68c81364312eca3729ebb97fcaea731b7ec5121978e80a3f88c9134687c3d1a551414b11e0d75ab8919ef15759e3d02'], 83 | }, 84 | } 85 | t.deepEquals(result, expectedbatchFillOrders) 86 | }) 87 | }) 88 | --------------------------------------------------------------------------------