Compare commits
	
		
			7 Commits
		
	
	
		
			@0x/contra
			...
			feat/PTP
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					d52d882b14 | ||
| 
						 | 
					4c8629840b | ||
| 
						 | 
					feede28293 | ||
| 
						 | 
					08cf51b101 | ||
| 
						 | 
					4ba6918e06 | ||
| 
						 | 
					52a3ffa77c | ||
| 
						 | 
					afe77a432c | 
@@ -19,6 +19,7 @@ jobs:
 | 
			
		||||
                  command: yarn --frozen-lockfile --ignore-engines install || yarn --frozen-lockfile --ignore-engines install
 | 
			
		||||
            - setup_remote_docker
 | 
			
		||||
            - run: yarn build:ci || yarn build:ci || yarn build:ci || yarn build:ci || yarn build:ci || yarn build:ci
 | 
			
		||||
            - run: yarn build:ts || yarn build:ts || yarn build:ts || yarn build:ts || yarn build:ts || yarn build:ts
 | 
			
		||||
            - save_cache:
 | 
			
		||||
                  key: repo-{{ .Environment.CIRCLE_SHA1 }}
 | 
			
		||||
                  paths:
 | 
			
		||||
@@ -109,8 +110,6 @@ jobs:
 | 
			
		||||
        docker:
 | 
			
		||||
            - image: node:16
 | 
			
		||||
        working_directory: ~/repo
 | 
			
		||||
        environment:
 | 
			
		||||
            RUST_ROUTER: "true"
 | 
			
		||||
        steps:
 | 
			
		||||
            - restore_cache:
 | 
			
		||||
                  keys:
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								.github/workflows/publish.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/publish.yml
									
									
									
									
										vendored
									
									
								
							@@ -28,7 +28,7 @@ jobs:
 | 
			
		||||
                fetch-depth: 0
 | 
			
		||||
            - uses: actions/setup-node@v1
 | 
			
		||||
              with:
 | 
			
		||||
                node-version: 16
 | 
			
		||||
                node-version: 10
 | 
			
		||||
            - uses: actions/setup-python@v2
 | 
			
		||||
            - name: 'configure git'
 | 
			
		||||
              run: |
 | 
			
		||||
 
 | 
			
		||||
@@ -1,22 +1,4 @@
 | 
			
		||||
[
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1650611093,
 | 
			
		||||
        "version": "3.3.29",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Dependencies updated"
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1648739346,
 | 
			
		||||
        "version": "3.3.28",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Dependencies updated"
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1646225739,
 | 
			
		||||
        "version": "3.3.27",
 | 
			
		||||
 
 | 
			
		||||
@@ -5,14 +5,6 @@ Edit the package's CHANGELOG.json file only.
 | 
			
		||||
 | 
			
		||||
CHANGELOG
 | 
			
		||||
 | 
			
		||||
## v3.3.29 - _April 22, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 | 
			
		||||
## v3.3.28 - _March 31, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 | 
			
		||||
## v3.3.27 - _March 2, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "@0x/contracts-erc20",
 | 
			
		||||
    "version": "3.3.29",
 | 
			
		||||
    "version": "3.3.27",
 | 
			
		||||
    "engines": {
 | 
			
		||||
        "node": ">=6.12"
 | 
			
		||||
    },
 | 
			
		||||
@@ -51,18 +51,18 @@
 | 
			
		||||
    },
 | 
			
		||||
    "homepage": "https://github.com/0xProject/protocol/tree/main/contracts/tokens",
 | 
			
		||||
    "devDependencies": {
 | 
			
		||||
        "@0x/abi-gen": "^5.8.0",
 | 
			
		||||
        "@0x/contracts-gen": "^2.0.46",
 | 
			
		||||
        "@0x/contracts-test-utils": "^5.4.20",
 | 
			
		||||
        "@0x/contracts-utils": "^4.8.10",
 | 
			
		||||
        "@0x/dev-utils": "^4.2.14",
 | 
			
		||||
        "@0x/sol-compiler": "^4.8.1",
 | 
			
		||||
        "@0x/abi-gen": "^5.7.2",
 | 
			
		||||
        "@0x/contracts-gen": "^2.0.43",
 | 
			
		||||
        "@0x/contracts-test-utils": "^5.4.18",
 | 
			
		||||
        "@0x/contracts-utils": "^4.8.8",
 | 
			
		||||
        "@0x/dev-utils": "^4.2.11",
 | 
			
		||||
        "@0x/sol-compiler": "^4.7.8",
 | 
			
		||||
        "@0x/ts-doc-gen": "^0.0.28",
 | 
			
		||||
        "@0x/tslint-config": "^4.1.4",
 | 
			
		||||
        "@0x/types": "^3.3.6",
 | 
			
		||||
        "@0x/typescript-typings": "^5.3.1",
 | 
			
		||||
        "@0x/utils": "^6.5.3",
 | 
			
		||||
        "@0x/web3-wrapper": "^7.6.5",
 | 
			
		||||
        "@0x/types": "^3.3.4",
 | 
			
		||||
        "@0x/typescript-typings": "^5.2.1",
 | 
			
		||||
        "@0x/utils": "^6.5.0",
 | 
			
		||||
        "@0x/web3-wrapper": "^7.6.2",
 | 
			
		||||
        "@types/lodash": "4.14.104",
 | 
			
		||||
        "@types/mocha": "^5.2.7",
 | 
			
		||||
        "@types/node": "12.12.54",
 | 
			
		||||
@@ -70,7 +70,7 @@
 | 
			
		||||
        "chai-as-promised": "^7.1.0",
 | 
			
		||||
        "chai-bignumber": "^3.0.0",
 | 
			
		||||
        "dirty-chai": "^2.0.1",
 | 
			
		||||
        "ethereum-types": "^3.7.0",
 | 
			
		||||
        "ethereum-types": "^3.6.0",
 | 
			
		||||
        "lodash": "^4.17.11",
 | 
			
		||||
        "make-promises-safe": "^1.1.0",
 | 
			
		||||
        "mocha": "^6.2.0",
 | 
			
		||||
@@ -79,10 +79,10 @@
 | 
			
		||||
        "solhint": "^1.4.1",
 | 
			
		||||
        "tslint": "5.11.0",
 | 
			
		||||
        "typedoc": "~0.16.11",
 | 
			
		||||
        "typescript": "4.6.3"
 | 
			
		||||
        "typescript": "4.2.2"
 | 
			
		||||
    },
 | 
			
		||||
    "dependencies": {
 | 
			
		||||
        "@0x/base-contract": "^6.5.0",
 | 
			
		||||
        "@0x/base-contract": "^6.4.5",
 | 
			
		||||
        "ethers": "~4.0.4"
 | 
			
		||||
    },
 | 
			
		||||
    "publishConfig": {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,22 +1,4 @@
 | 
			
		||||
[
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1650611093,
 | 
			
		||||
        "version": "5.4.20",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Dependencies updated"
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1648739346,
 | 
			
		||||
        "version": "5.4.19",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Dependencies updated"
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1646225739,
 | 
			
		||||
        "version": "5.4.18",
 | 
			
		||||
 
 | 
			
		||||
@@ -5,14 +5,6 @@ Edit the package's CHANGELOG.json file only.
 | 
			
		||||
 | 
			
		||||
CHANGELOG
 | 
			
		||||
 | 
			
		||||
## v5.4.20 - _April 22, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 | 
			
		||||
## v5.4.19 - _March 31, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 | 
			
		||||
## v5.4.18 - _March 2, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "@0x/contracts-test-utils",
 | 
			
		||||
    "version": "5.4.20",
 | 
			
		||||
    "version": "5.4.18",
 | 
			
		||||
    "engines": {
 | 
			
		||||
        "node": ">=6.12"
 | 
			
		||||
    },
 | 
			
		||||
@@ -34,28 +34,28 @@
 | 
			
		||||
    },
 | 
			
		||||
    "homepage": "https://github.com/0xProject/protocol/tree/main/contracts/test-utils",
 | 
			
		||||
    "devDependencies": {
 | 
			
		||||
        "@0x/sol-compiler": "^4.8.1",
 | 
			
		||||
        "@0x/sol-compiler": "^4.7.8",
 | 
			
		||||
        "@0x/tslint-config": "^4.1.4",
 | 
			
		||||
        "npm-run-all": "^4.1.2",
 | 
			
		||||
        "shx": "^0.2.2",
 | 
			
		||||
        "tslint": "5.11.0",
 | 
			
		||||
        "typescript": "4.6.3"
 | 
			
		||||
        "typescript": "4.2.2"
 | 
			
		||||
    },
 | 
			
		||||
    "dependencies": {
 | 
			
		||||
        "@0x/assert": "^3.0.34",
 | 
			
		||||
        "@0x/base-contract": "^6.5.0",
 | 
			
		||||
        "@0x/contract-addresses": "^6.13.0",
 | 
			
		||||
        "@0x/dev-utils": "^4.2.14",
 | 
			
		||||
        "@0x/json-schemas": "^6.4.4",
 | 
			
		||||
        "@0x/assert": "^3.0.31",
 | 
			
		||||
        "@0x/base-contract": "^6.4.5",
 | 
			
		||||
        "@0x/contract-addresses": "^6.12.0",
 | 
			
		||||
        "@0x/dev-utils": "^4.2.11",
 | 
			
		||||
        "@0x/json-schemas": "^6.4.1",
 | 
			
		||||
        "@0x/order-utils": "^10.4.28",
 | 
			
		||||
        "@0x/sol-coverage": "^4.0.45",
 | 
			
		||||
        "@0x/sol-profiler": "^4.1.35",
 | 
			
		||||
        "@0x/sol-trace": "^3.0.45",
 | 
			
		||||
        "@0x/subproviders": "^6.6.5",
 | 
			
		||||
        "@0x/types": "^3.3.6",
 | 
			
		||||
        "@0x/typescript-typings": "^5.3.1",
 | 
			
		||||
        "@0x/utils": "^6.5.3",
 | 
			
		||||
        "@0x/web3-wrapper": "^7.6.5",
 | 
			
		||||
        "@0x/sol-coverage": "^4.0.42",
 | 
			
		||||
        "@0x/sol-profiler": "^4.1.32",
 | 
			
		||||
        "@0x/sol-trace": "^3.0.42",
 | 
			
		||||
        "@0x/subproviders": "^6.6.2",
 | 
			
		||||
        "@0x/types": "^3.3.4",
 | 
			
		||||
        "@0x/typescript-typings": "^5.2.1",
 | 
			
		||||
        "@0x/utils": "^6.5.0",
 | 
			
		||||
        "@0x/web3-wrapper": "^7.6.2",
 | 
			
		||||
        "@types/bn.js": "^4.11.0",
 | 
			
		||||
        "@types/js-combinatorics": "^0.5.29",
 | 
			
		||||
        "@types/lodash": "4.14.104",
 | 
			
		||||
@@ -67,7 +67,7 @@
 | 
			
		||||
        "chai-bignumber": "^3.0.0",
 | 
			
		||||
        "decimal.js": "^10.2.0",
 | 
			
		||||
        "dirty-chai": "^2.0.1",
 | 
			
		||||
        "ethereum-types": "^3.7.0",
 | 
			
		||||
        "ethereum-types": "^3.6.0",
 | 
			
		||||
        "ethereumjs-util": "^7.0.10",
 | 
			
		||||
        "ethers": "~4.0.4",
 | 
			
		||||
        "js-combinatorics": "^0.5.3",
 | 
			
		||||
 
 | 
			
		||||
@@ -1,22 +1,4 @@
 | 
			
		||||
[
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1650611093,
 | 
			
		||||
        "version": "1.4.12",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Dependencies updated"
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1648739346,
 | 
			
		||||
        "version": "1.4.11",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Dependencies updated"
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1646225739,
 | 
			
		||||
        "version": "1.4.10",
 | 
			
		||||
 
 | 
			
		||||
@@ -5,14 +5,6 @@ Edit the package's CHANGELOG.json file only.
 | 
			
		||||
 | 
			
		||||
CHANGELOG
 | 
			
		||||
 | 
			
		||||
## v1.4.12 - _April 22, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 | 
			
		||||
## v1.4.11 - _March 31, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 | 
			
		||||
## v1.4.10 - _March 2, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "@0x/contracts-treasury",
 | 
			
		||||
    "version": "1.4.12",
 | 
			
		||||
    "version": "1.4.10",
 | 
			
		||||
    "engines": {
 | 
			
		||||
        "node": ">=6.12"
 | 
			
		||||
    },
 | 
			
		||||
@@ -46,14 +46,14 @@
 | 
			
		||||
    },
 | 
			
		||||
    "homepage": "https://github.com/0xProject/protocol/tree/main/contracts/treasury",
 | 
			
		||||
    "devDependencies": {
 | 
			
		||||
        "@0x/abi-gen": "^5.8.0",
 | 
			
		||||
        "@0x/contract-addresses": "^6.13.0",
 | 
			
		||||
        "@0x/abi-gen": "^5.7.2",
 | 
			
		||||
        "@0x/contract-addresses": "^6.12.0",
 | 
			
		||||
        "@0x/contracts-asset-proxy": "^3.7.19",
 | 
			
		||||
        "@0x/contracts-erc20": "^3.3.29",
 | 
			
		||||
        "@0x/contracts-gen": "^2.0.46",
 | 
			
		||||
        "@0x/contracts-erc20": "^3.3.27",
 | 
			
		||||
        "@0x/contracts-gen": "^2.0.43",
 | 
			
		||||
        "@0x/contracts-staking": "^2.0.45",
 | 
			
		||||
        "@0x/contracts-test-utils": "^5.4.20",
 | 
			
		||||
        "@0x/sol-compiler": "^4.8.1",
 | 
			
		||||
        "@0x/contracts-test-utils": "^5.4.18",
 | 
			
		||||
        "@0x/sol-compiler": "^4.7.8",
 | 
			
		||||
        "@0x/ts-doc-gen": "^0.0.28",
 | 
			
		||||
        "@0x/tslint-config": "^4.1.4",
 | 
			
		||||
        "@types/isomorphic-fetch": "^0.0.35",
 | 
			
		||||
@@ -69,17 +69,17 @@
 | 
			
		||||
        "solhint": "^1.4.1",
 | 
			
		||||
        "tslint": "5.11.0",
 | 
			
		||||
        "typedoc": "~0.16.11",
 | 
			
		||||
        "typescript": "4.6.3"
 | 
			
		||||
        "typescript": "4.2.2"
 | 
			
		||||
    },
 | 
			
		||||
    "dependencies": {
 | 
			
		||||
        "@0x/base-contract": "^6.5.0",
 | 
			
		||||
        "@0x/protocol-utils": "^11.12.0",
 | 
			
		||||
        "@0x/subproviders": "^6.6.5",
 | 
			
		||||
        "@0x/types": "^3.3.6",
 | 
			
		||||
        "@0x/typescript-typings": "^5.3.1",
 | 
			
		||||
        "@0x/utils": "^6.5.3",
 | 
			
		||||
        "@0x/web3-wrapper": "^7.6.5",
 | 
			
		||||
        "ethereum-types": "^3.7.0",
 | 
			
		||||
        "@0x/base-contract": "^6.4.5",
 | 
			
		||||
        "@0x/protocol-utils": "^1.11.1",
 | 
			
		||||
        "@0x/subproviders": "^6.6.2",
 | 
			
		||||
        "@0x/types": "^3.3.4",
 | 
			
		||||
        "@0x/typescript-typings": "^5.2.1",
 | 
			
		||||
        "@0x/utils": "^6.5.0",
 | 
			
		||||
        "@0x/web3-wrapper": "^7.6.2",
 | 
			
		||||
        "ethereum-types": "^3.6.0",
 | 
			
		||||
        "ethereumjs-util": "^7.0.10"
 | 
			
		||||
    },
 | 
			
		||||
    "publishConfig": {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,22 +1,4 @@
 | 
			
		||||
[
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1650611093,
 | 
			
		||||
        "version": "4.8.10",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Dependencies updated"
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1648739346,
 | 
			
		||||
        "version": "4.8.9",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Dependencies updated"
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1646225739,
 | 
			
		||||
        "version": "4.8.8",
 | 
			
		||||
 
 | 
			
		||||
@@ -5,14 +5,6 @@ Edit the package's CHANGELOG.json file only.
 | 
			
		||||
 | 
			
		||||
CHANGELOG
 | 
			
		||||
 | 
			
		||||
## v4.8.10 - _April 22, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 | 
			
		||||
## v4.8.9 - _March 31, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 | 
			
		||||
## v4.8.8 - _March 2, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "@0x/contracts-utils",
 | 
			
		||||
    "version": "4.8.10",
 | 
			
		||||
    "version": "4.8.8",
 | 
			
		||||
    "engines": {
 | 
			
		||||
        "node": ">=6.12"
 | 
			
		||||
    },
 | 
			
		||||
@@ -50,15 +50,15 @@
 | 
			
		||||
    },
 | 
			
		||||
    "homepage": "https://github.com/0xProject/protocol/tree/main/contracts/utils",
 | 
			
		||||
    "devDependencies": {
 | 
			
		||||
        "@0x/abi-gen": "^5.8.0",
 | 
			
		||||
        "@0x/contracts-gen": "^2.0.46",
 | 
			
		||||
        "@0x/contracts-test-utils": "^5.4.20",
 | 
			
		||||
        "@0x/dev-utils": "^4.2.14",
 | 
			
		||||
        "@0x/abi-gen": "^5.7.2",
 | 
			
		||||
        "@0x/contracts-gen": "^2.0.43",
 | 
			
		||||
        "@0x/contracts-test-utils": "^5.4.18",
 | 
			
		||||
        "@0x/dev-utils": "^4.2.11",
 | 
			
		||||
        "@0x/order-utils": "^10.4.28",
 | 
			
		||||
        "@0x/sol-compiler": "^4.8.1",
 | 
			
		||||
        "@0x/sol-compiler": "^4.7.8",
 | 
			
		||||
        "@0x/tslint-config": "^4.1.4",
 | 
			
		||||
        "@0x/types": "^3.3.6",
 | 
			
		||||
        "@0x/web3-wrapper": "^7.6.5",
 | 
			
		||||
        "@0x/types": "^3.3.4",
 | 
			
		||||
        "@0x/web3-wrapper": "^7.6.2",
 | 
			
		||||
        "@types/bn.js": "^4.11.0",
 | 
			
		||||
        "@types/lodash": "4.14.104",
 | 
			
		||||
        "@types/mocha": "^5.2.7",
 | 
			
		||||
@@ -76,14 +76,14 @@
 | 
			
		||||
        "solhint": "^1.4.1",
 | 
			
		||||
        "truffle": "^5.0.32",
 | 
			
		||||
        "tslint": "5.11.0",
 | 
			
		||||
        "typescript": "4.6.3"
 | 
			
		||||
        "typescript": "4.2.2"
 | 
			
		||||
    },
 | 
			
		||||
    "dependencies": {
 | 
			
		||||
        "@0x/base-contract": "^6.5.0",
 | 
			
		||||
        "@0x/typescript-typings": "^5.3.1",
 | 
			
		||||
        "@0x/utils": "^6.5.3",
 | 
			
		||||
        "@0x/base-contract": "^6.4.5",
 | 
			
		||||
        "@0x/typescript-typings": "^5.2.1",
 | 
			
		||||
        "@0x/utils": "^6.5.0",
 | 
			
		||||
        "bn.js": "^4.11.8",
 | 
			
		||||
        "ethereum-types": "^3.7.0"
 | 
			
		||||
        "ethereum-types": "^3.6.0"
 | 
			
		||||
    },
 | 
			
		||||
    "publishConfig": {
 | 
			
		||||
        "access": "public"
 | 
			
		||||
 
 | 
			
		||||
@@ -1,23 +1,4 @@
 | 
			
		||||
[
 | 
			
		||||
    {
 | 
			
		||||
        "version": "0.32.0",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Add support for `BalancerV2Batch` fills in FQT",
 | 
			
		||||
                "pr": 462
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "timestamp": 1650611093
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1648739346,
 | 
			
		||||
        "version": "0.31.2",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Dependencies updated"
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1646225739,
 | 
			
		||||
        "version": "0.31.1",
 | 
			
		||||
 
 | 
			
		||||
@@ -5,14 +5,6 @@ Edit the package's CHANGELOG.json file only.
 | 
			
		||||
 | 
			
		||||
CHANGELOG
 | 
			
		||||
 | 
			
		||||
## v0.32.0 - _April 22, 2022_
 | 
			
		||||
 | 
			
		||||
    * Add support for `BalancerV2Batch` fills in FQT (#462)
 | 
			
		||||
 | 
			
		||||
## v0.31.2 - _March 31, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 | 
			
		||||
## v0.31.1 - _March 2, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 
 | 
			
		||||
@@ -25,7 +25,6 @@ import "./BridgeProtocols.sol";
 | 
			
		||||
import "./mixins/MixinAaveV2.sol";
 | 
			
		||||
import "./mixins/MixinBalancer.sol";
 | 
			
		||||
import "./mixins/MixinBalancerV2.sol";
 | 
			
		||||
import "./mixins/MixinBalancerV2Batch.sol";
 | 
			
		||||
import "./mixins/MixinBancor.sol";
 | 
			
		||||
import "./mixins/MixinCoFiX.sol";
 | 
			
		||||
import "./mixins/MixinCompound.sol";
 | 
			
		||||
@@ -34,6 +33,7 @@ import "./mixins/MixinCurveV2.sol";
 | 
			
		||||
import "./mixins/MixinCryptoCom.sol";
 | 
			
		||||
import "./mixins/MixinDodo.sol";
 | 
			
		||||
import "./mixins/MixinDodoV2.sol";
 | 
			
		||||
import "./mixins/MixinGMX.sol";
 | 
			
		||||
import "./mixins/MixinKyber.sol";
 | 
			
		||||
import "./mixins/MixinKyberDmm.sol";
 | 
			
		||||
import "./mixins/MixinLido.sol";
 | 
			
		||||
@@ -53,7 +53,6 @@ contract BridgeAdapter is
 | 
			
		||||
    MixinAaveV2,
 | 
			
		||||
    MixinBalancer,
 | 
			
		||||
    MixinBalancerV2,
 | 
			
		||||
    MixinBalancerV2Batch,
 | 
			
		||||
    MixinBancor,
 | 
			
		||||
    MixinCoFiX,
 | 
			
		||||
    MixinCompound,
 | 
			
		||||
@@ -62,6 +61,7 @@ contract BridgeAdapter is
 | 
			
		||||
    MixinCryptoCom,
 | 
			
		||||
    MixinDodo,
 | 
			
		||||
    MixinDodoV2,
 | 
			
		||||
    MixinGMX,
 | 
			
		||||
    MixinKyber,
 | 
			
		||||
    MixinKyberDmm,
 | 
			
		||||
    MixinLido,
 | 
			
		||||
@@ -89,6 +89,7 @@ contract BridgeAdapter is
 | 
			
		||||
        MixinCryptoCom()
 | 
			
		||||
        MixinDodo()
 | 
			
		||||
        MixinDodoV2()
 | 
			
		||||
        MixinGMX()
 | 
			
		||||
        MixinKyber(weth)
 | 
			
		||||
        MixinLido(weth)
 | 
			
		||||
        MixinMakerPSM()
 | 
			
		||||
@@ -161,11 +162,6 @@ contract BridgeAdapter is
 | 
			
		||||
                sellAmount,
 | 
			
		||||
                order.bridgeData
 | 
			
		||||
            );
 | 
			
		||||
        } else if (protocolId == BridgeProtocols.BALANCERV2BATCH) {
 | 
			
		||||
            boughtAmount = _tradeBalancerV2Batch(
 | 
			
		||||
                sellAmount,
 | 
			
		||||
                order.bridgeData
 | 
			
		||||
            );
 | 
			
		||||
        } else if (protocolId == BridgeProtocols.KYBER) {
 | 
			
		||||
            boughtAmount = _tradeKyber(
 | 
			
		||||
                sellToken,
 | 
			
		||||
@@ -272,6 +268,12 @@ contract BridgeAdapter is
 | 
			
		||||
                sellAmount,
 | 
			
		||||
                order.bridgeData
 | 
			
		||||
            );
 | 
			
		||||
        } else if (protocolId == BridgeProtocols.GMX) {
 | 
			
		||||
            boughtAmount = _tradeGMX(
 | 
			
		||||
                buyToken,
 | 
			
		||||
                sellAmount,
 | 
			
		||||
                order.bridgeData
 | 
			
		||||
            );
 | 
			
		||||
        } else {
 | 
			
		||||
            boughtAmount = _tradeZeroExBridge(
 | 
			
		||||
                sellToken,
 | 
			
		||||
 
 | 
			
		||||
@@ -27,30 +27,30 @@ library BridgeProtocols {
 | 
			
		||||
    // A incrementally increasing, append-only list of protocol IDs.
 | 
			
		||||
    // We don't use an enum so solidity doesn't throw when we pass in a
 | 
			
		||||
    // new protocol ID that hasn't been rolled up yet.
 | 
			
		||||
    uint128 internal constant UNKNOWN         = 0;
 | 
			
		||||
    uint128 internal constant CURVE           = 1;
 | 
			
		||||
    uint128 internal constant UNISWAPV2       = 2;
 | 
			
		||||
    uint128 internal constant UNISWAP         = 3;
 | 
			
		||||
    uint128 internal constant BALANCER        = 4;
 | 
			
		||||
    uint128 internal constant KYBER           = 5;
 | 
			
		||||
    uint128 internal constant MOONISWAP       = 6;
 | 
			
		||||
    uint128 internal constant MSTABLE         = 7;
 | 
			
		||||
    uint128 internal constant OASIS           = 8;
 | 
			
		||||
    uint128 internal constant SHELL           = 9;
 | 
			
		||||
    uint128 internal constant DODO            = 10;
 | 
			
		||||
    uint128 internal constant DODOV2          = 11;
 | 
			
		||||
    uint128 internal constant CRYPTOCOM       = 12;
 | 
			
		||||
    uint128 internal constant BANCOR          = 13;
 | 
			
		||||
    uint128 internal constant COFIX           = 14;
 | 
			
		||||
    uint128 internal constant NERVE           = 15;
 | 
			
		||||
    uint128 internal constant MAKERPSM        = 16;
 | 
			
		||||
    uint128 internal constant BALANCERV2      = 17;
 | 
			
		||||
    uint128 internal constant UNISWAPV3       = 18;
 | 
			
		||||
    uint128 internal constant KYBERDMM        = 19;
 | 
			
		||||
    uint128 internal constant CURVEV2         = 20;
 | 
			
		||||
    uint128 internal constant LIDO            = 21;
 | 
			
		||||
    uint128 internal constant CLIPPER         = 22; // Not used: Clipper is now using PLP interface
 | 
			
		||||
    uint128 internal constant AAVEV2          = 23;
 | 
			
		||||
    uint128 internal constant COMPOUND        = 24;
 | 
			
		||||
    uint128 internal constant BALANCERV2BATCH = 25;
 | 
			
		||||
    uint128 internal constant UNKNOWN     = 0;
 | 
			
		||||
    uint128 internal constant CURVE       = 1;
 | 
			
		||||
    uint128 internal constant UNISWAPV2   = 2;
 | 
			
		||||
    uint128 internal constant UNISWAP     = 3;
 | 
			
		||||
    uint128 internal constant BALANCER    = 4;
 | 
			
		||||
    uint128 internal constant KYBER       = 5;
 | 
			
		||||
    uint128 internal constant MOONISWAP   = 6;
 | 
			
		||||
    uint128 internal constant MSTABLE     = 7;
 | 
			
		||||
    uint128 internal constant OASIS       = 8;
 | 
			
		||||
    uint128 internal constant SHELL       = 9;
 | 
			
		||||
    uint128 internal constant DODO        = 10;
 | 
			
		||||
    uint128 internal constant DODOV2      = 11;
 | 
			
		||||
    uint128 internal constant CRYPTOCOM   = 12;
 | 
			
		||||
    uint128 internal constant BANCOR      = 13;
 | 
			
		||||
    uint128 internal constant COFIX       = 14;
 | 
			
		||||
    uint128 internal constant NERVE       = 15;
 | 
			
		||||
    uint128 internal constant MAKERPSM    = 16;
 | 
			
		||||
    uint128 internal constant BALANCERV2  = 17;
 | 
			
		||||
    uint128 internal constant UNISWAPV3   = 18;
 | 
			
		||||
    uint128 internal constant KYBERDMM    = 19;
 | 
			
		||||
    uint128 internal constant CURVEV2     = 20;
 | 
			
		||||
    uint128 internal constant LIDO        = 21;
 | 
			
		||||
    uint128 internal constant CLIPPER     = 22; // Not used: Clipper is now using PLP interface
 | 
			
		||||
    uint128 internal constant AAVEV2      = 23;
 | 
			
		||||
    uint128 internal constant COMPOUND    = 24;
 | 
			
		||||
    uint128 internal constant GMX         = 25;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,107 +0,0 @@
 | 
			
		||||
// SPDX-License-Identifier: Apache-2.0
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
  Copyright 2020 ZeroEx Intl.
 | 
			
		||||
 | 
			
		||||
  Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
  you may not use this file except in compliance with the License.
 | 
			
		||||
  You may obtain a copy of the License at
 | 
			
		||||
 | 
			
		||||
    http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 | 
			
		||||
  Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
  distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
  See the License for the specific language governing permissions and
 | 
			
		||||
  limitations under the License.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
pragma solidity ^0.6.5;
 | 
			
		||||
pragma experimental ABIEncoderV2;
 | 
			
		||||
 | 
			
		||||
import "@0x/contracts-erc20/contracts/src/v06/LibERC20TokenV06.sol";
 | 
			
		||||
import "@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
interface IBalancerV2BatchSwapVault {
 | 
			
		||||
 | 
			
		||||
    enum SwapKind { GIVEN_IN, GIVEN_OUT }
 | 
			
		||||
 | 
			
		||||
    struct BatchSwapStep {
 | 
			
		||||
        bytes32 poolId;
 | 
			
		||||
        uint256 assetInIndex;
 | 
			
		||||
        uint256 assetOutIndex;
 | 
			
		||||
        uint256 amount;
 | 
			
		||||
        bytes userData;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    struct FundManagement {
 | 
			
		||||
        address sender;
 | 
			
		||||
        bool fromInternalBalance;
 | 
			
		||||
        address payable recipient;
 | 
			
		||||
        bool toInternalBalance;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function batchSwap(
 | 
			
		||||
        SwapKind kind,
 | 
			
		||||
        BatchSwapStep[] calldata swaps,
 | 
			
		||||
        IERC20TokenV06[] calldata assets,
 | 
			
		||||
        FundManagement calldata funds,
 | 
			
		||||
        int256[] calldata limits,
 | 
			
		||||
        uint256 deadline
 | 
			
		||||
    ) external returns (int256[] memory amounts);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
contract MixinBalancerV2Batch {
 | 
			
		||||
 | 
			
		||||
    using LibERC20TokenV06 for IERC20TokenV06;
 | 
			
		||||
 | 
			
		||||
    struct BalancerV2BatchBridgeData {
 | 
			
		||||
        IBalancerV2BatchSwapVault vault;
 | 
			
		||||
        IBalancerV2BatchSwapVault.BatchSwapStep[] swapSteps;
 | 
			
		||||
        IERC20TokenV06[] assets;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function _tradeBalancerV2Batch(
 | 
			
		||||
        uint256 sellAmount,
 | 
			
		||||
        bytes memory bridgeData
 | 
			
		||||
    )
 | 
			
		||||
        internal
 | 
			
		||||
        returns (uint256 boughtAmount)
 | 
			
		||||
    {
 | 
			
		||||
        // Decode the bridge data.
 | 
			
		||||
        (
 | 
			
		||||
            IBalancerV2BatchSwapVault vault,
 | 
			
		||||
            IBalancerV2BatchSwapVault.BatchSwapStep[] memory swapSteps,
 | 
			
		||||
            address[] memory assets_
 | 
			
		||||
        ) = abi.decode(bridgeData, (IBalancerV2BatchSwapVault, IBalancerV2BatchSwapVault.BatchSwapStep[], address[]));
 | 
			
		||||
        IERC20TokenV06[] memory assets;
 | 
			
		||||
        assembly { assets := assets_ }
 | 
			
		||||
 | 
			
		||||
        // Grant an allowance to the exchange to spend `fromTokenAddress` token.
 | 
			
		||||
        assets[0].approveIfBelow(address(vault), sellAmount);
 | 
			
		||||
 | 
			
		||||
        swapSteps[0].amount = sellAmount;
 | 
			
		||||
        int256[] memory limits = new int256[](assets.length);
 | 
			
		||||
        for (uint256 i = 0; i < limits.length; ++i) {
 | 
			
		||||
            limits[i] = type(int256).max;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        int256[] memory amounts = vault.batchSwap(
 | 
			
		||||
            IBalancerV2BatchSwapVault.SwapKind.GIVEN_IN,
 | 
			
		||||
            swapSteps,
 | 
			
		||||
            assets,
 | 
			
		||||
            IBalancerV2BatchSwapVault.FundManagement({
 | 
			
		||||
                sender: address(this),
 | 
			
		||||
                fromInternalBalance: false,
 | 
			
		||||
                recipient: payable(address(this)),
 | 
			
		||||
                toInternalBalance: false
 | 
			
		||||
            }),
 | 
			
		||||
            limits,
 | 
			
		||||
            block.timestamp + 1
 | 
			
		||||
        );
 | 
			
		||||
        require(amounts[amounts.length - 1] <= 0, 'Unexpected BalancerV2Batch output');
 | 
			
		||||
        return uint256(amounts[amounts.length - 1] * -1);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,104 @@
 | 
			
		||||
// SPDX-License-Identifier: Apache-2.0
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
  Copyright 2020 ZeroEx Intl.
 | 
			
		||||
 | 
			
		||||
  Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
  you may not use this file except in compliance with the License.
 | 
			
		||||
  You may obtain a copy of the License at
 | 
			
		||||
 | 
			
		||||
    http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 | 
			
		||||
  Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
  distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
  See the License for the specific language governing permissions and
 | 
			
		||||
  limitations under the License.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
pragma solidity ^0.6.5;
 | 
			
		||||
pragma experimental ABIEncoderV2;
 | 
			
		||||
 | 
			
		||||
import "@0x/contracts-erc20/contracts/src/v06/LibERC20TokenV06.sol";
 | 
			
		||||
import "@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol";
 | 
			
		||||
import "@0x/contracts-utils/contracts/src/v06/LibSafeMathV06.sol";
 | 
			
		||||
import "../IBridgeAdapter.sol";
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
    UniswapV2
 | 
			
		||||
*/
 | 
			
		||||
interface IGmxRouter {
 | 
			
		||||
 | 
			
		||||
    // /// @dev Swaps an exact amount of input tokens for as many output tokens as possible, along the route determined by the path.
 | 
			
		||||
    // ///      The first element of path is the input token, the last is the output token, and any intermediate elements represent
 | 
			
		||||
    // ///      intermediate pairs to trade through (if, for example, a direct pair does not exist).
 | 
			
		||||
    // /// @param _path An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.
 | 
			
		||||
    // /// @param _amountIn The amount of input tokens to send.
 | 
			
		||||
    // /// @param _minOut The minimum amount of output tokens that must be received for the transaction not to revert.
 | 
			
		||||
    // /// @param _reciever Recipient of the output tokens.
 | 
			
		||||
    function swap(
 | 
			
		||||
       address[] calldata _path, uint256 _amountIn, uint256 _minOut, address _receiver
 | 
			
		||||
    ) external;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
contract MixinGMX {
 | 
			
		||||
 | 
			
		||||
    using LibERC20TokenV06 for IERC20TokenV06;
 | 
			
		||||
    using LibSafeMathV06 for uint256;
 | 
			
		||||
 | 
			
		||||
    function _tradeGMX(
 | 
			
		||||
        IERC20TokenV06 buyToken,
 | 
			
		||||
        uint256 sellAmount,
 | 
			
		||||
        bytes memory bridgeData
 | 
			
		||||
    )
 | 
			
		||||
        public
 | 
			
		||||
        returns (uint256 boughtAmount)
 | 
			
		||||
    {
 | 
			
		||||
        address _router;
 | 
			
		||||
        address reader;
 | 
			
		||||
        address vault;
 | 
			
		||||
        address[] memory _path;
 | 
			
		||||
        IGmxRouter router;
 | 
			
		||||
        IERC20TokenV06[] memory path;
 | 
			
		||||
        
 | 
			
		||||
        {
 | 
			
		||||
            //decode the bridge data
 | 
			
		||||
            (_router, reader, vault, _path) = abi.decode(bridgeData, (address, address, address, address[]));
 | 
			
		||||
            // To get around `abi.decode()` not supporting interface array types.
 | 
			
		||||
            assembly { path := _path }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        require(path.length >= 2, "MixinGMX/PATH_LENGTH_MUST_BE_AT_LEAST_TWO");
 | 
			
		||||
        require(
 | 
			
		||||
            path[path.length - 1] == buyToken,
 | 
			
		||||
            "MixinGMX/LAST_ELEMENT_OF_PATH_MUST_MATCH_OUTPUT_TOKEN"
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        //connect to the GMX router
 | 
			
		||||
        router = IGmxRouter(_router);
 | 
			
		||||
 | 
			
		||||
        // Grant the GMX router an allowance to sell the first token.
 | 
			
		||||
        path[0].approveIfBelow(address(router), sellAmount);
 | 
			
		||||
 | 
			
		||||
        //track the balance to know how much we bought
 | 
			
		||||
        uint256 beforeBalance = buyToken.balanceOf(address(this));
 | 
			
		||||
        router.swap(
 | 
			
		||||
            // Convert to `buyToken` along this path.
 | 
			
		||||
            _path,
 | 
			
		||||
             // Sell all tokens we hold.
 | 
			
		||||
            sellAmount,
 | 
			
		||||
             // Minimum buy amount.
 | 
			
		||||
            0,
 | 
			
		||||
            // Recipient is `this`.
 | 
			
		||||
            address(this)
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        //calculate the difference in balance from preswap->postswap to find how many tokens out
 | 
			
		||||
        boughtAmount = buyToken.balanceOf(address(this)).safeSub(beforeBalance);
 | 
			
		||||
 | 
			
		||||
        return boughtAmount;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "@0x/contracts-zero-ex",
 | 
			
		||||
    "version": "0.32.0",
 | 
			
		||||
    "version": "0.31.1",
 | 
			
		||||
    "engines": {
 | 
			
		||||
        "node": ">=6.12"
 | 
			
		||||
    },
 | 
			
		||||
@@ -43,7 +43,7 @@
 | 
			
		||||
    "config": {
 | 
			
		||||
        "publicInterfaceContracts": "IZeroEx,ZeroEx,FullMigration,InitialMigration,IFlashWallet,IERC20Transformer,IOwnableFeature,ISimpleFunctionRegistryFeature,ITransformERC20Feature,FillQuoteTransformer,PayTakerTransformer,PositiveSlippageFeeTransformer,WethTransformer,OwnableFeature,SimpleFunctionRegistryFeature,TransformERC20Feature,AffiliateFeeTransformer,MetaTransactionsFeature,LogMetadataTransformer,BridgeAdapter,LiquidityProviderFeature,ILiquidityProviderFeature,NativeOrdersFeature,INativeOrdersFeature,FeeCollectorController,FeeCollector,CurveLiquidityProvider,BatchFillNativeOrdersFeature,IBatchFillNativeOrdersFeature,MultiplexFeature,IMultiplexFeature,OtcOrdersFeature,IOtcOrdersFeature",
 | 
			
		||||
        "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually.",
 | 
			
		||||
        "abis": "./test/generated-artifacts/@(AffiliateFeeTransformer|BatchFillNativeOrdersFeature|BootstrapFeature|BridgeAdapter|BridgeProtocols|CurveLiquidityProvider|ERC1155OrdersFeature|ERC165Feature|ERC721OrdersFeature|FeeCollector|FeeCollectorController|FillQuoteTransformer|FixinCommon|FixinEIP712|FixinERC1155Spender|FixinERC721Spender|FixinProtocolFees|FixinReentrancyGuard|FixinTokenSpender|FlashWallet|FullMigration|FundRecoveryFeature|IBatchFillNativeOrdersFeature|IBootstrapFeature|IBridgeAdapter|IERC1155OrdersFeature|IERC1155Token|IERC165Feature|IERC20Bridge|IERC20Transformer|IERC721OrdersFeature|IERC721Token|IFeature|IFeeRecipient|IFlashWallet|IFundRecoveryFeature|ILiquidityProvider|ILiquidityProviderFeature|ILiquidityProviderSandbox|IMetaTransactionsFeature|IMooniswapPool|IMultiplexFeature|INativeOrdersEvents|INativeOrdersFeature|IOtcOrdersFeature|IOwnableFeature|IPancakeSwapFeature|IPropertyValidator|ISimpleFunctionRegistryFeature|IStaking|ITakerCallback|ITestSimpleFunctionRegistryFeature|ITokenSpenderFeature|ITransformERC20Feature|IUniswapFeature|IUniswapV2Pair|IUniswapV3Feature|IUniswapV3Pool|IZeroEx|InitialMigration|LibBootstrap|LibCommonRichErrors|LibERC1155OrdersStorage|LibERC20Transformer|LibERC721OrdersStorage|LibFeeCollector|LibLiquidityProviderRichErrors|LibMetaTransactionsRichErrors|LibMetaTransactionsStorage|LibMigrate|LibNFTOrder|LibNFTOrdersRichErrors|LibNativeOrder|LibNativeOrdersRichErrors|LibNativeOrdersStorage|LibOtcOrdersStorage|LibOwnableRichErrors|LibOwnableStorage|LibProxyRichErrors|LibProxyStorage|LibReentrancyGuardStorage|LibSignature|LibSignatureRichErrors|LibSimpleFunctionRegistryRichErrors|LibSimpleFunctionRegistryStorage|LibStorage|LibTransformERC20RichErrors|LibTransformERC20Storage|LibWalletRichErrors|LiquidityProviderFeature|LiquidityProviderSandbox|LogMetadataTransformer|MetaTransactionsFeature|MixinAaveV2|MixinBalancer|MixinBalancerV2|MixinBalancerV2Batch|MixinBancor|MixinCoFiX|MixinCompound|MixinCryptoCom|MixinCurve|MixinCurveV2|MixinDodo|MixinDodoV2|MixinKyber|MixinKyberDmm|MixinLido|MixinMStable|MixinMakerPSM|MixinMooniswap|MixinNerve|MixinOasis|MixinShell|MixinUniswap|MixinUniswapV2|MixinUniswapV3|MixinZeroExBridge|MooniswapLiquidityProvider|MultiplexFeature|MultiplexLiquidityProvider|MultiplexOtc|MultiplexRfq|MultiplexTransformERC20|MultiplexUniswapV2|MultiplexUniswapV3|NFTOrders|NativeOrdersCancellation|NativeOrdersFeature|NativeOrdersInfo|NativeOrdersProtocolFees|NativeOrdersSettlement|OtcOrdersFeature|OwnableFeature|PancakeSwapFeature|PayTakerTransformer|PermissionlessTransformerDeployer|PositiveSlippageFeeTransformer|SimpleFunctionRegistryFeature|TestBridge|TestCallTarget|TestCurve|TestDelegateCaller|TestFeeCollectorController|TestFeeRecipient|TestFillQuoteTransformerBridge|TestFillQuoteTransformerExchange|TestFillQuoteTransformerHost|TestFixinProtocolFees|TestFixinTokenSpender|TestFullMigration|TestInitialMigration|TestLibNativeOrder|TestLibSignature|TestLiquidityProvider|TestMetaTransactionsNativeOrdersFeature|TestMetaTransactionsTransformERC20Feature|TestMigrator|TestMintTokenERC20Transformer|TestMintableERC1155Token|TestMintableERC20Token|TestMintableERC721Token|TestMooniswap|TestNFTOrderPresigner|TestNativeOrdersFeature|TestNoEthRecipient|TestOrderSignerRegistryWithContractWallet|TestPermissionlessTransformerDeployerSuicidal|TestPermissionlessTransformerDeployerTransformer|TestPropertyValidator|TestRfqOriginRegistration|TestSimpleFunctionRegistryFeatureImpl1|TestSimpleFunctionRegistryFeatureImpl2|TestStaking|TestTokenSpenderERC20Token|TestTransformERC20|TestTransformerBase|TestTransformerDeployerTransformer|TestTransformerHost|TestUniswapV2Factory|TestUniswapV2Pool|TestUniswapV3Factory|TestUniswapV3Feature|TestUniswapV3Pool|TestWeth|TestWethTransformerHost|TestZeroExFeature|TransformERC20Feature|Transformer|TransformerDeployer|UniswapFeature|UniswapV3Feature|WethTransformer|ZeroEx|ZeroExOptimized).json"
 | 
			
		||||
        "abis": "./test/generated-artifacts/@(AffiliateFeeTransformer|BatchFillNativeOrdersFeature|BootstrapFeature|BridgeAdapter|BridgeProtocols|CurveLiquidityProvider|ERC1155OrdersFeature|ERC165Feature|ERC721OrdersFeature|FeeCollector|FeeCollectorController|FillQuoteTransformer|FixinCommon|FixinEIP712|FixinERC1155Spender|FixinERC721Spender|FixinProtocolFees|FixinReentrancyGuard|FixinTokenSpender|FlashWallet|FullMigration|FundRecoveryFeature|IBatchFillNativeOrdersFeature|IBootstrapFeature|IBridgeAdapter|IERC1155OrdersFeature|IERC1155Token|IERC165Feature|IERC20Bridge|IERC20Transformer|IERC721OrdersFeature|IERC721Token|IFeature|IFeeRecipient|IFlashWallet|IFundRecoveryFeature|ILiquidityProvider|ILiquidityProviderFeature|ILiquidityProviderSandbox|IMetaTransactionsFeature|IMooniswapPool|IMultiplexFeature|INativeOrdersEvents|INativeOrdersFeature|IOtcOrdersFeature|IOwnableFeature|IPancakeSwapFeature|IPropertyValidator|ISimpleFunctionRegistryFeature|IStaking|ITakerCallback|ITestSimpleFunctionRegistryFeature|ITokenSpenderFeature|ITransformERC20Feature|IUniswapFeature|IUniswapV2Pair|IUniswapV3Feature|IUniswapV3Pool|IZeroEx|InitialMigration|LibBootstrap|LibCommonRichErrors|LibERC1155OrdersStorage|LibERC20Transformer|LibERC721OrdersStorage|LibFeeCollector|LibLiquidityProviderRichErrors|LibMetaTransactionsRichErrors|LibMetaTransactionsStorage|LibMigrate|LibNFTOrder|LibNFTOrdersRichErrors|LibNativeOrder|LibNativeOrdersRichErrors|LibNativeOrdersStorage|LibOtcOrdersStorage|LibOwnableRichErrors|LibOwnableStorage|LibProxyRichErrors|LibProxyStorage|LibReentrancyGuardStorage|LibSignature|LibSignatureRichErrors|LibSimpleFunctionRegistryRichErrors|LibSimpleFunctionRegistryStorage|LibStorage|LibTransformERC20RichErrors|LibTransformERC20Storage|LibWalletRichErrors|LiquidityProviderFeature|LiquidityProviderSandbox|LogMetadataTransformer|MetaTransactionsFeature|MixinAaveV2|MixinBalancer|MixinBalancerV2|MixinBancor|MixinCoFiX|MixinCompound|MixinCryptoCom|MixinCurve|MixinCurveV2|MixinDodo|MixinDodoV2|MixinGMX|MixinKyber|MixinKyberDmm|MixinLido|MixinMStable|MixinMakerPSM|MixinMooniswap|MixinNerve|MixinOasis|MixinShell|MixinUniswap|MixinUniswapV2|MixinUniswapV3|MixinZeroExBridge|MooniswapLiquidityProvider|MultiplexFeature|MultiplexLiquidityProvider|MultiplexOtc|MultiplexRfq|MultiplexTransformERC20|MultiplexUniswapV2|MultiplexUniswapV3|NFTOrders|NativeOrdersCancellation|NativeOrdersFeature|NativeOrdersInfo|NativeOrdersProtocolFees|NativeOrdersSettlement|OtcOrdersFeature|OwnableFeature|PancakeSwapFeature|PayTakerTransformer|PermissionlessTransformerDeployer|PositiveSlippageFeeTransformer|SimpleFunctionRegistryFeature|TestBridge|TestCallTarget|TestCurve|TestDelegateCaller|TestFeeCollectorController|TestFeeRecipient|TestFillQuoteTransformerBridge|TestFillQuoteTransformerExchange|TestFillQuoteTransformerHost|TestFixinProtocolFees|TestFixinTokenSpender|TestFullMigration|TestInitialMigration|TestLibNativeOrder|TestLibSignature|TestLiquidityProvider|TestMetaTransactionsNativeOrdersFeature|TestMetaTransactionsTransformERC20Feature|TestMigrator|TestMintTokenERC20Transformer|TestMintableERC1155Token|TestMintableERC20Token|TestMintableERC721Token|TestMooniswap|TestNFTOrderPresigner|TestNativeOrdersFeature|TestNoEthRecipient|TestOrderSignerRegistryWithContractWallet|TestPermissionlessTransformerDeployerSuicidal|TestPermissionlessTransformerDeployerTransformer|TestPropertyValidator|TestRfqOriginRegistration|TestSimpleFunctionRegistryFeatureImpl1|TestSimpleFunctionRegistryFeatureImpl2|TestStaking|TestTokenSpenderERC20Token|TestTransformERC20|TestTransformerBase|TestTransformerDeployerTransformer|TestTransformerHost|TestUniswapV2Factory|TestUniswapV2Pool|TestUniswapV3Factory|TestUniswapV3Feature|TestUniswapV3Pool|TestWeth|TestWethTransformerHost|TestZeroExFeature|TransformERC20Feature|Transformer|TransformerDeployer|UniswapFeature|UniswapV3Feature|WethTransformer|ZeroEx|ZeroExOptimized).json"
 | 
			
		||||
    },
 | 
			
		||||
    "repository": {
 | 
			
		||||
        "type": "git",
 | 
			
		||||
@@ -55,14 +55,14 @@
 | 
			
		||||
    },
 | 
			
		||||
    "homepage": "https://github.com/0xProject/protocol/tree/main/contracts/zero-ex",
 | 
			
		||||
    "devDependencies": {
 | 
			
		||||
        "@0x/abi-gen": "^5.8.0",
 | 
			
		||||
        "@0x/contract-addresses": "^6.13.0",
 | 
			
		||||
        "@0x/contracts-erc20": "^3.3.29",
 | 
			
		||||
        "@0x/contracts-gen": "^2.0.46",
 | 
			
		||||
        "@0x/contracts-test-utils": "^5.4.20",
 | 
			
		||||
        "@0x/dev-utils": "^4.2.14",
 | 
			
		||||
        "@0x/abi-gen": "^5.7.2",
 | 
			
		||||
        "@0x/contract-addresses": "^6.12.0",
 | 
			
		||||
        "@0x/contracts-erc20": "^3.3.27",
 | 
			
		||||
        "@0x/contracts-gen": "^2.0.43",
 | 
			
		||||
        "@0x/contracts-test-utils": "^5.4.18",
 | 
			
		||||
        "@0x/dev-utils": "^4.2.11",
 | 
			
		||||
        "@0x/order-utils": "^10.4.28",
 | 
			
		||||
        "@0x/sol-compiler": "^4.8.1",
 | 
			
		||||
        "@0x/sol-compiler": "^4.7.8",
 | 
			
		||||
        "@0x/ts-doc-gen": "^0.0.28",
 | 
			
		||||
        "@0x/tslint-config": "^4.1.4",
 | 
			
		||||
        "@types/isomorphic-fetch": "^0.0.35",
 | 
			
		||||
@@ -79,17 +79,17 @@
 | 
			
		||||
        "truffle": "^5.0.32",
 | 
			
		||||
        "tslint": "5.11.0",
 | 
			
		||||
        "typedoc": "~0.16.11",
 | 
			
		||||
        "typescript": "4.6.3"
 | 
			
		||||
        "typescript": "4.2.2"
 | 
			
		||||
    },
 | 
			
		||||
    "dependencies": {
 | 
			
		||||
        "@0x/base-contract": "^6.5.0",
 | 
			
		||||
        "@0x/protocol-utils": "^11.12.0",
 | 
			
		||||
        "@0x/subproviders": "^6.6.5",
 | 
			
		||||
        "@0x/types": "^3.3.6",
 | 
			
		||||
        "@0x/typescript-typings": "^5.3.1",
 | 
			
		||||
        "@0x/utils": "^6.5.3",
 | 
			
		||||
        "@0x/web3-wrapper": "^7.6.5",
 | 
			
		||||
        "ethereum-types": "^3.7.0",
 | 
			
		||||
        "@0x/base-contract": "^6.4.5",
 | 
			
		||||
        "@0x/protocol-utils": "^1.11.1",
 | 
			
		||||
        "@0x/subproviders": "^6.6.2",
 | 
			
		||||
        "@0x/types": "^3.3.4",
 | 
			
		||||
        "@0x/typescript-typings": "^5.2.1",
 | 
			
		||||
        "@0x/utils": "^6.5.0",
 | 
			
		||||
        "@0x/web3-wrapper": "^7.6.2",
 | 
			
		||||
        "ethereum-types": "^3.6.0",
 | 
			
		||||
        "ethereumjs-util": "^7.0.10",
 | 
			
		||||
        "ethers": "~4.0.4"
 | 
			
		||||
    },
 | 
			
		||||
 
 | 
			
		||||
@@ -101,7 +101,6 @@ import * as MetaTransactionsFeature from '../test/generated-artifacts/MetaTransa
 | 
			
		||||
import * as MixinAaveV2 from '../test/generated-artifacts/MixinAaveV2.json';
 | 
			
		||||
import * as MixinBalancer from '../test/generated-artifacts/MixinBalancer.json';
 | 
			
		||||
import * as MixinBalancerV2 from '../test/generated-artifacts/MixinBalancerV2.json';
 | 
			
		||||
import * as MixinBalancerV2Batch from '../test/generated-artifacts/MixinBalancerV2Batch.json';
 | 
			
		||||
import * as MixinBancor from '../test/generated-artifacts/MixinBancor.json';
 | 
			
		||||
import * as MixinCoFiX from '../test/generated-artifacts/MixinCoFiX.json';
 | 
			
		||||
import * as MixinCompound from '../test/generated-artifacts/MixinCompound.json';
 | 
			
		||||
@@ -110,6 +109,7 @@ import * as MixinCurve from '../test/generated-artifacts/MixinCurve.json';
 | 
			
		||||
import * as MixinCurveV2 from '../test/generated-artifacts/MixinCurveV2.json';
 | 
			
		||||
import * as MixinDodo from '../test/generated-artifacts/MixinDodo.json';
 | 
			
		||||
import * as MixinDodoV2 from '../test/generated-artifacts/MixinDodoV2.json';
 | 
			
		||||
import * as MixinGMX from '../test/generated-artifacts/MixinGMX.json';
 | 
			
		||||
import * as MixinKyber from '../test/generated-artifacts/MixinKyber.json';
 | 
			
		||||
import * as MixinKyberDmm from '../test/generated-artifacts/MixinKyberDmm.json';
 | 
			
		||||
import * as MixinLido from '../test/generated-artifacts/MixinLido.json';
 | 
			
		||||
@@ -314,7 +314,6 @@ export const artifacts = {
 | 
			
		||||
    MixinAaveV2: MixinAaveV2 as ContractArtifact,
 | 
			
		||||
    MixinBalancer: MixinBalancer as ContractArtifact,
 | 
			
		||||
    MixinBalancerV2: MixinBalancerV2 as ContractArtifact,
 | 
			
		||||
    MixinBalancerV2Batch: MixinBalancerV2Batch as ContractArtifact,
 | 
			
		||||
    MixinBancor: MixinBancor as ContractArtifact,
 | 
			
		||||
    MixinCoFiX: MixinCoFiX as ContractArtifact,
 | 
			
		||||
    MixinCompound: MixinCompound as ContractArtifact,
 | 
			
		||||
@@ -323,6 +322,7 @@ export const artifacts = {
 | 
			
		||||
    MixinCurveV2: MixinCurveV2 as ContractArtifact,
 | 
			
		||||
    MixinDodo: MixinDodo as ContractArtifact,
 | 
			
		||||
    MixinDodoV2: MixinDodoV2 as ContractArtifact,
 | 
			
		||||
    MixinGMX: MixinGMX as ContractArtifact,
 | 
			
		||||
    MixinKyber: MixinKyber as ContractArtifact,
 | 
			
		||||
    MixinKyberDmm: MixinKyberDmm as ContractArtifact,
 | 
			
		||||
    MixinLido: MixinLido as ContractArtifact,
 | 
			
		||||
 
 | 
			
		||||
@@ -99,7 +99,6 @@ export * from '../test/generated-wrappers/meta_transactions_feature';
 | 
			
		||||
export * from '../test/generated-wrappers/mixin_aave_v2';
 | 
			
		||||
export * from '../test/generated-wrappers/mixin_balancer';
 | 
			
		||||
export * from '../test/generated-wrappers/mixin_balancer_v2';
 | 
			
		||||
export * from '../test/generated-wrappers/mixin_balancer_v2_batch';
 | 
			
		||||
export * from '../test/generated-wrappers/mixin_bancor';
 | 
			
		||||
export * from '../test/generated-wrappers/mixin_co_fi_x';
 | 
			
		||||
export * from '../test/generated-wrappers/mixin_compound';
 | 
			
		||||
@@ -108,6 +107,7 @@ export * from '../test/generated-wrappers/mixin_curve';
 | 
			
		||||
export * from '../test/generated-wrappers/mixin_curve_v2';
 | 
			
		||||
export * from '../test/generated-wrappers/mixin_dodo';
 | 
			
		||||
export * from '../test/generated-wrappers/mixin_dodo_v2';
 | 
			
		||||
export * from '../test/generated-wrappers/mixin_g_m_x';
 | 
			
		||||
export * from '../test/generated-wrappers/mixin_kyber';
 | 
			
		||||
export * from '../test/generated-wrappers/mixin_kyber_dmm';
 | 
			
		||||
export * from '../test/generated-wrappers/mixin_lido';
 | 
			
		||||
 
 | 
			
		||||
@@ -132,7 +132,6 @@
 | 
			
		||||
        "test/generated-artifacts/MixinAaveV2.json",
 | 
			
		||||
        "test/generated-artifacts/MixinBalancer.json",
 | 
			
		||||
        "test/generated-artifacts/MixinBalancerV2.json",
 | 
			
		||||
        "test/generated-artifacts/MixinBalancerV2Batch.json",
 | 
			
		||||
        "test/generated-artifacts/MixinBancor.json",
 | 
			
		||||
        "test/generated-artifacts/MixinCoFiX.json",
 | 
			
		||||
        "test/generated-artifacts/MixinCompound.json",
 | 
			
		||||
@@ -141,6 +140,7 @@
 | 
			
		||||
        "test/generated-artifacts/MixinCurveV2.json",
 | 
			
		||||
        "test/generated-artifacts/MixinDodo.json",
 | 
			
		||||
        "test/generated-artifacts/MixinDodoV2.json",
 | 
			
		||||
        "test/generated-artifacts/MixinGMX.json",
 | 
			
		||||
        "test/generated-artifacts/MixinKyber.json",
 | 
			
		||||
        "test/generated-artifacts/MixinKyberDmm.json",
 | 
			
		||||
        "test/generated-artifacts/MixinLido.json",
 | 
			
		||||
 
 | 
			
		||||
@@ -60,8 +60,8 @@
 | 
			
		||||
        "ignoreDependencyVersionsForPackage": "contract-wrappers"
 | 
			
		||||
    },
 | 
			
		||||
    "devDependencies": {
 | 
			
		||||
        "@0x/monorepo-scripts": "^3.2.1",
 | 
			
		||||
        "@0x-lerna-fork/lerna": "3.16.10",
 | 
			
		||||
        "@0x/monorepo-scripts": "^3.2.4",
 | 
			
		||||
        "@0xproject/npm-cli-login": "^0.0.11",
 | 
			
		||||
        "async-child-process": "^1.1.1",
 | 
			
		||||
        "coveralls": "^3.0.0",
 | 
			
		||||
@@ -71,11 +71,11 @@
 | 
			
		||||
        "npm-run-all": "^4.1.2",
 | 
			
		||||
        "prettier": "1.19.1",
 | 
			
		||||
        "source-map-support": "^0.5.6",
 | 
			
		||||
        "typescript": "4.6.3",
 | 
			
		||||
        "typescript": "4.2.2",
 | 
			
		||||
        "wsrun": "^5.2.4"
 | 
			
		||||
    },
 | 
			
		||||
    "resolutions": {
 | 
			
		||||
        "merkle-patricia-tree": "3.0.0",
 | 
			
		||||
        "**/bignumber.js": "^9.0.2"
 | 
			
		||||
        "bignumber.js": "9.0.2"
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,62 +1,4 @@
 | 
			
		||||
[
 | 
			
		||||
    {
 | 
			
		||||
        "version": "16.57.0",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Add BalancerV2 batch swap support",
 | 
			
		||||
                "pr": 462
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "timestamp": 1650611093
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "version": "16.56.0",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Add estimatedGas to ExtendedQuoteReport",
 | 
			
		||||
                "pr": 463
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "timestamp": 1650575781
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "version": "16.55.0",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Fix fillRfqOrder VIP being used for swaps that need transformERC20",
 | 
			
		||||
                "pr": 461
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "timestamp": 1649347667
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "version": "16.54.0",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Add true VIP support for eligible RFQt swaps",
 | 
			
		||||
                "pr": 458
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "timestamp": 1649215576
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "version": "16.53.0",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Adds support for STG/USDC pool on Curve Mainnet",
 | 
			
		||||
                "pr": 451
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Use neon-router in asset-swapper tests",
 | 
			
		||||
                "pr": 453
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Add sampler blocknumber to quote report data",
 | 
			
		||||
                "pr": 448
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "timestamp": 1648739346
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "version": "16.52.0",
 | 
			
		||||
        "changes": [
 | 
			
		||||
 
 | 
			
		||||
@@ -5,32 +5,6 @@ Edit the package's CHANGELOG.json file only.
 | 
			
		||||
 | 
			
		||||
CHANGELOG
 | 
			
		||||
 | 
			
		||||
## v16.57.0 - _April 22, 2022_
 | 
			
		||||
 | 
			
		||||
    * Add BalancerV2 batch swap support (#462)
 | 
			
		||||
 | 
			
		||||
## v16.56.0 - _April 21, 2022_
 | 
			
		||||
 | 
			
		||||
    * Add estimatedGas to ExtendedQuoteReport (#463)
 | 
			
		||||
 | 
			
		||||
## v16.55.0 - _April 7, 2022_
 | 
			
		||||
 | 
			
		||||
    * Fix fillRfqOrder VIP being used for swaps that need transformERC20 (#461)
 | 
			
		||||
 | 
			
		||||
## v16.54.0 - _April 6, 2022_
 | 
			
		||||
 | 
			
		||||
    * Add true VIP support for eligible RFQt swaps (#458)
 | 
			
		||||
 | 
			
		||||
## v16.53.0 - _March 31, 2022_
 | 
			
		||||
 | 
			
		||||
    * Adds support for STG/USDC pool on Curve Mainnet (#451)
 | 
			
		||||
    * Use neon-router in asset-swapper tests (#453)
 | 
			
		||||
    * Add sampler blocknumber to quote report data (#448)
 | 
			
		||||
 | 
			
		||||
## v16.52.0 - _Invalid date_
 | 
			
		||||
 | 
			
		||||
    * Adds support for mobius money on celo (#423)
 | 
			
		||||
 | 
			
		||||
## v16.51.0 - _March 10, 2022_
 | 
			
		||||
 | 
			
		||||
    * Added `Curve` `YFI-ETH` pool (#444)
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,7 @@
 | 
			
		||||
    "shouldSaveStandardInput": true,
 | 
			
		||||
    "compilerSettings": {
 | 
			
		||||
        "evmVersion": "istanbul",
 | 
			
		||||
        "optimizer": { "enabled": true, "runs": 200, "details": { "yul": false, "deduplicate": true } },
 | 
			
		||||
        "optimizer": { "enabled": true, "runs": 200, "details": { "yul": true, "deduplicate": true } },
 | 
			
		||||
        "outputSelection": {
 | 
			
		||||
            "*": {
 | 
			
		||||
                "*": [
 | 
			
		||||
 
 | 
			
		||||
@@ -1,105 +0,0 @@
 | 
			
		||||
// SPDX-License-Identifier: Apache-2.0
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
  Copyright 2021 ZeroEx Intl.
 | 
			
		||||
 | 
			
		||||
  Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
  you may not use this file except in compliance with the License.
 | 
			
		||||
  You may obtain a copy of the License at
 | 
			
		||||
 | 
			
		||||
    http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 | 
			
		||||
  Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
  distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
  See the License for the specific language governing permissions and
 | 
			
		||||
  limitations under the License.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
pragma solidity ^0.6;
 | 
			
		||||
pragma experimental ABIEncoderV2;
 | 
			
		||||
 | 
			
		||||
import "./interfaces/IBalancerV2Vault.sol";
 | 
			
		||||
import "./BalancerV2Common.sol";
 | 
			
		||||
 | 
			
		||||
contract BalancerV2BatchSampler is BalancerV2Common {
 | 
			
		||||
 | 
			
		||||
    // Replaces amount for first step with each takerTokenAmount and calls queryBatchSwap using supplied steps
 | 
			
		||||
    /// @dev Sample sell quotes from Balancer V2 supporting multihops.
 | 
			
		||||
    /// @param swapSteps Array of swap steps (can be >= 1).
 | 
			
		||||
    /// @param swapAssets Array of token address for swaps.
 | 
			
		||||
    /// @param takerTokenAmounts Taker token sell amount for each sample.
 | 
			
		||||
    function sampleMultihopSellsFromBalancerV2(
 | 
			
		||||
        IBalancerV2Vault vault,
 | 
			
		||||
        IBalancerV2Vault.BatchSwapStep[] memory swapSteps,
 | 
			
		||||
        address[] memory swapAssets,
 | 
			
		||||
        uint256[] memory takerTokenAmounts
 | 
			
		||||
    )
 | 
			
		||||
        public
 | 
			
		||||
        returns (uint256[] memory makerTokenAmounts)
 | 
			
		||||
    {
 | 
			
		||||
        uint256 numSamples = takerTokenAmounts.length;
 | 
			
		||||
        makerTokenAmounts = new uint256[](numSamples);
 | 
			
		||||
        IBalancerV2Vault.FundManagement memory swapFunds =
 | 
			
		||||
            _createSwapFunds();
 | 
			
		||||
 | 
			
		||||
        for (uint256 i = 0; i < numSamples; i++) {
 | 
			
		||||
            swapSteps[0].amount = takerTokenAmounts[i];
 | 
			
		||||
            try
 | 
			
		||||
                // For sells we specify the takerToken which is what the vault will receive from the trade
 | 
			
		||||
                vault.queryBatchSwap(IBalancerV2Vault.SwapKind.GIVEN_IN, swapSteps, swapAssets, swapFunds)
 | 
			
		||||
            // amounts represent pool balance deltas from the swap (incoming balance, outgoing balance)
 | 
			
		||||
            returns (int256[] memory amounts) {
 | 
			
		||||
                // Outgoing balance is negative so we need to flip the sign
 | 
			
		||||
                // Note - queryBatchSwap will return a delta for each token in the assets array and last asset should be tokenOut
 | 
			
		||||
                int256 amountOutFromPool = amounts[amounts.length - 1] * -1;
 | 
			
		||||
                if (amountOutFromPool <= 0) {
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
                makerTokenAmounts[i] = uint256(amountOutFromPool);
 | 
			
		||||
            } catch {
 | 
			
		||||
                // Swallow failures, leaving all results as zero.
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Replaces amount for first step with each makerTokenAmount and calls queryBatchSwap using supplied steps
 | 
			
		||||
    /// @dev Sample buy quotes from Balancer V2 supporting multihops.
 | 
			
		||||
    /// @param swapSteps Array of swap steps (can be >= 1).
 | 
			
		||||
    /// @param swapAssets Array of token address for swaps.
 | 
			
		||||
    /// @param makerTokenAmounts Maker token buy amount for each sample.
 | 
			
		||||
    function sampleMultihopBuysFromBalancerV2(
 | 
			
		||||
        IBalancerV2Vault vault,
 | 
			
		||||
        IBalancerV2Vault.BatchSwapStep[] memory swapSteps,
 | 
			
		||||
        address[] memory swapAssets,
 | 
			
		||||
        uint256[] memory makerTokenAmounts
 | 
			
		||||
    )
 | 
			
		||||
        public
 | 
			
		||||
        returns (uint256[] memory takerTokenAmounts)
 | 
			
		||||
    {
 | 
			
		||||
        uint256 numSamples = makerTokenAmounts.length;
 | 
			
		||||
        takerTokenAmounts = new uint256[](numSamples);
 | 
			
		||||
        IBalancerV2Vault.FundManagement memory swapFunds =
 | 
			
		||||
            _createSwapFunds();
 | 
			
		||||
 | 
			
		||||
        for (uint256 i = 0; i < numSamples; i++) {
 | 
			
		||||
            swapSteps[0].amount = makerTokenAmounts[i];
 | 
			
		||||
            try
 | 
			
		||||
                // Uses GIVEN_OUT type for Buy
 | 
			
		||||
                vault.queryBatchSwap(IBalancerV2Vault.SwapKind.GIVEN_OUT, swapSteps, swapAssets, swapFunds)
 | 
			
		||||
            // amounts represent pool balance deltas from the swap (incoming balance, outgoing balance)
 | 
			
		||||
            returns (int256[] memory amounts) {
 | 
			
		||||
                int256 amountIntoPool = amounts[0];
 | 
			
		||||
                if (amountIntoPool <= 0) {
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
                takerTokenAmounts[i] = uint256(amountIntoPool);
 | 
			
		||||
            } catch {
 | 
			
		||||
                // Swallow failures, leaving all results as zero.
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,41 +0,0 @@
 | 
			
		||||
// SPDX-License-Identifier: Apache-2.0
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
  Copyright 2021 ZeroEx Intl.
 | 
			
		||||
 | 
			
		||||
  Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
  you may not use this file except in compliance with the License.
 | 
			
		||||
  You may obtain a copy of the License at
 | 
			
		||||
 | 
			
		||||
    http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 | 
			
		||||
  Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
  distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
  See the License for the specific language governing permissions and
 | 
			
		||||
  limitations under the License.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
pragma solidity ^0.6;
 | 
			
		||||
pragma experimental ABIEncoderV2;
 | 
			
		||||
 | 
			
		||||
import "./interfaces/IBalancerV2Vault.sol";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
contract BalancerV2Common {
 | 
			
		||||
 | 
			
		||||
    function _createSwapFunds()
 | 
			
		||||
        internal
 | 
			
		||||
        view
 | 
			
		||||
        returns (IBalancerV2Vault.FundManagement memory)
 | 
			
		||||
    {
 | 
			
		||||
        return
 | 
			
		||||
            IBalancerV2Vault.FundManagement({
 | 
			
		||||
                sender: address(this),
 | 
			
		||||
                fromInternalBalance: false,
 | 
			
		||||
                recipient: payable(address(this)),
 | 
			
		||||
                toInternalBalance: false
 | 
			
		||||
            });
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -21,11 +21,44 @@ pragma solidity ^0.6;
 | 
			
		||||
pragma experimental ABIEncoderV2;
 | 
			
		||||
 | 
			
		||||
import "./SamplerUtils.sol";
 | 
			
		||||
import "./interfaces/IBalancerV2Vault.sol";
 | 
			
		||||
import "./BalancerV2Common.sol";
 | 
			
		||||
 | 
			
		||||
/// @dev Minimal Balancer V2 Vault interface
 | 
			
		||||
///      for documentation refer to https://github.com/balancer-labs/balancer-core-v2/blob/master/contracts/vault/interfaces/IVault.sol
 | 
			
		||||
interface IBalancerV2Vault {
 | 
			
		||||
    enum SwapKind { GIVEN_IN, GIVEN_OUT }
 | 
			
		||||
 | 
			
		||||
contract BalancerV2Sampler is SamplerUtils, BalancerV2Common {
 | 
			
		||||
    struct BatchSwapStep {
 | 
			
		||||
        bytes32 poolId;
 | 
			
		||||
        uint256 assetInIndex;
 | 
			
		||||
        uint256 assetOutIndex;
 | 
			
		||||
        uint256 amount;
 | 
			
		||||
        bytes userData;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    struct FundManagement {
 | 
			
		||||
        address sender;
 | 
			
		||||
        bool fromInternalBalance;
 | 
			
		||||
        address payable recipient;
 | 
			
		||||
        bool toInternalBalance;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function queryBatchSwap(
 | 
			
		||||
        SwapKind kind,
 | 
			
		||||
        BatchSwapStep[] calldata swaps,
 | 
			
		||||
        IAsset[] calldata assets,
 | 
			
		||||
        FundManagement calldata funds
 | 
			
		||||
    ) external returns (int256[] memory assetDeltas);
 | 
			
		||||
}
 | 
			
		||||
interface IAsset {
 | 
			
		||||
    // solhint-disable-previous-line no-empty-blocks
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
contract BalancerV2Sampler is SamplerUtils {
 | 
			
		||||
 | 
			
		||||
    struct BalancerV2PoolInfo {
 | 
			
		||||
        bytes32 poolId;
 | 
			
		||||
        address vault;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// @dev Sample sell quotes from Balancer V2.
 | 
			
		||||
    /// @param poolInfo Struct with pool related data
 | 
			
		||||
@@ -35,7 +68,7 @@ contract BalancerV2Sampler is SamplerUtils, BalancerV2Common {
 | 
			
		||||
    /// @return makerTokenAmounts Maker amounts bought at each taker token
 | 
			
		||||
    ///         amount.
 | 
			
		||||
    function sampleSellsFromBalancerV2(
 | 
			
		||||
        IBalancerV2Vault.BalancerV2PoolInfo memory poolInfo,
 | 
			
		||||
        BalancerV2PoolInfo memory poolInfo,
 | 
			
		||||
        address takerToken,
 | 
			
		||||
        address makerToken,
 | 
			
		||||
        uint256[] memory takerTokenAmounts
 | 
			
		||||
@@ -45,9 +78,9 @@ contract BalancerV2Sampler is SamplerUtils, BalancerV2Common {
 | 
			
		||||
    {
 | 
			
		||||
        _assertValidPair(makerToken, takerToken);
 | 
			
		||||
        IBalancerV2Vault vault = IBalancerV2Vault(poolInfo.vault);
 | 
			
		||||
        address[] memory swapAssets = new address[](2);
 | 
			
		||||
        swapAssets[0] = takerToken;
 | 
			
		||||
        swapAssets[1] = makerToken;
 | 
			
		||||
        IAsset[] memory swapAssets = new IAsset[](2);
 | 
			
		||||
        swapAssets[0] = IAsset(takerToken);
 | 
			
		||||
        swapAssets[1] = IAsset(makerToken);
 | 
			
		||||
 | 
			
		||||
        uint256 numSamples = takerTokenAmounts.length;
 | 
			
		||||
        makerTokenAmounts = new uint256[](numSamples);
 | 
			
		||||
@@ -64,7 +97,7 @@ contract BalancerV2Sampler is SamplerUtils, BalancerV2Common {
 | 
			
		||||
            // amounts represent pool balance deltas from the swap (incoming balance, outgoing balance)
 | 
			
		||||
            returns (int256[] memory amounts) {
 | 
			
		||||
                // Outgoing balance is negative so we need to flip the sign
 | 
			
		||||
                int256 amountOutFromPool = amounts[amounts.length - 1] * -1;
 | 
			
		||||
                int256 amountOutFromPool = amounts[1] * -1;
 | 
			
		||||
                if (amountOutFromPool <= 0) {
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
@@ -84,7 +117,7 @@ contract BalancerV2Sampler is SamplerUtils, BalancerV2Common {
 | 
			
		||||
    /// @return takerTokenAmounts Taker amounts sold at each maker token
 | 
			
		||||
    ///         amount.
 | 
			
		||||
    function sampleBuysFromBalancerV2(
 | 
			
		||||
        IBalancerV2Vault.BalancerV2PoolInfo memory poolInfo,
 | 
			
		||||
        BalancerV2PoolInfo memory poolInfo,
 | 
			
		||||
        address takerToken,
 | 
			
		||||
        address makerToken,
 | 
			
		||||
        uint256[] memory makerTokenAmounts
 | 
			
		||||
@@ -94,9 +127,9 @@ contract BalancerV2Sampler is SamplerUtils, BalancerV2Common {
 | 
			
		||||
    {
 | 
			
		||||
        _assertValidPair(makerToken, takerToken);
 | 
			
		||||
        IBalancerV2Vault vault = IBalancerV2Vault(poolInfo.vault);
 | 
			
		||||
        address[] memory swapAssets = new address[](2);
 | 
			
		||||
        swapAssets[0] = takerToken;
 | 
			
		||||
        swapAssets[1] = makerToken;
 | 
			
		||||
        IAsset[] memory swapAssets = new IAsset[](2);
 | 
			
		||||
        swapAssets[0] = IAsset(takerToken);
 | 
			
		||||
        swapAssets[1] = IAsset(makerToken);
 | 
			
		||||
 | 
			
		||||
        uint256 numSamples = makerTokenAmounts.length;
 | 
			
		||||
        takerTokenAmounts = new uint256[](numSamples);
 | 
			
		||||
@@ -124,7 +157,7 @@ contract BalancerV2Sampler is SamplerUtils, BalancerV2Common {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function _createSwapSteps(
 | 
			
		||||
        IBalancerV2Vault.BalancerV2PoolInfo memory poolInfo,
 | 
			
		||||
        BalancerV2PoolInfo memory poolInfo,
 | 
			
		||||
        uint256 amount
 | 
			
		||||
    ) private pure returns (IBalancerV2Vault.BatchSwapStep[] memory) {
 | 
			
		||||
        IBalancerV2Vault.BatchSwapStep[] memory swapSteps =
 | 
			
		||||
@@ -139,4 +172,18 @@ contract BalancerV2Sampler is SamplerUtils, BalancerV2Common {
 | 
			
		||||
 | 
			
		||||
        return swapSteps;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function _createSwapFunds()
 | 
			
		||||
        private
 | 
			
		||||
        view
 | 
			
		||||
        returns (IBalancerV2Vault.FundManagement memory)
 | 
			
		||||
    {
 | 
			
		||||
        return
 | 
			
		||||
            IBalancerV2Vault.FundManagement({
 | 
			
		||||
                sender: address(this),
 | 
			
		||||
                fromInternalBalance: false,
 | 
			
		||||
                recipient: payable(address(this)),
 | 
			
		||||
                toInternalBalance: false
 | 
			
		||||
            });
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -23,6 +23,7 @@ pragma experimental ABIEncoderV2;
 | 
			
		||||
import "./interfaces/IBancor.sol";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
contract BancorSampler {
 | 
			
		||||
 | 
			
		||||
    /// @dev Base gas limit for Bancor calls.
 | 
			
		||||
 
 | 
			
		||||
@@ -22,20 +22,22 @@ pragma experimental ABIEncoderV2;
 | 
			
		||||
 | 
			
		||||
import "./BalancerSampler.sol";
 | 
			
		||||
import "./BalancerV2Sampler.sol";
 | 
			
		||||
import "./BalancerV2BatchSampler.sol";
 | 
			
		||||
import "./BancorSampler.sol";
 | 
			
		||||
import "./CompoundSampler.sol";
 | 
			
		||||
import "./CurveSampler.sol";
 | 
			
		||||
import "./DODOSampler.sol";
 | 
			
		||||
import "./DODOV2Sampler.sol";
 | 
			
		||||
import "./GMXSampler.sol";
 | 
			
		||||
import "./KyberSampler.sol";
 | 
			
		||||
import "./KyberDmmSampler.sol";
 | 
			
		||||
import "./LidoSampler.sol";
 | 
			
		||||
import "./LiquidityProviderSampler.sol";
 | 
			
		||||
import "./MakerPSMSampler.sol";
 | 
			
		||||
import "./MultiBridgeSampler.sol";
 | 
			
		||||
import "./MStableSampler.sol";
 | 
			
		||||
import "./MooniswapSampler.sol";
 | 
			
		||||
import "./NativeOrderSampler.sol";
 | 
			
		||||
import "./PlatypusSampler.sol";
 | 
			
		||||
import "./ShellSampler.sol";
 | 
			
		||||
import "./SmoothySampler.sol";
 | 
			
		||||
import "./TwoHopSampler.sol";
 | 
			
		||||
@@ -48,12 +50,12 @@ import "./UtilitySampler.sol";
 | 
			
		||||
contract ERC20BridgeSampler is
 | 
			
		||||
    BalancerSampler,
 | 
			
		||||
    BalancerV2Sampler,
 | 
			
		||||
    BalancerV2BatchSampler,
 | 
			
		||||
    BancorSampler,
 | 
			
		||||
    CompoundSampler,
 | 
			
		||||
    CurveSampler,
 | 
			
		||||
    DODOSampler,
 | 
			
		||||
    DODOV2Sampler,
 | 
			
		||||
    GMXSampler,
 | 
			
		||||
    KyberSampler,
 | 
			
		||||
    KyberDmmSampler,
 | 
			
		||||
    LidoSampler,
 | 
			
		||||
@@ -61,7 +63,9 @@ contract ERC20BridgeSampler is
 | 
			
		||||
    MakerPSMSampler,
 | 
			
		||||
    MStableSampler,
 | 
			
		||||
    MooniswapSampler,
 | 
			
		||||
    MultiBridgeSampler,
 | 
			
		||||
    NativeOrderSampler,
 | 
			
		||||
    PlatypusSampler,
 | 
			
		||||
    ShellSampler,
 | 
			
		||||
    SmoothySampler,
 | 
			
		||||
    TwoHopSampler,
 | 
			
		||||
@@ -92,6 +96,4 @@ contract ERC20BridgeSampler is
 | 
			
		||||
            (callResults[i].success, callResults[i].data) = address(this).call(callDatas[i]);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    receive() external payable {}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										99
									
								
								packages/asset-swapper/contracts/src/GMXSampler.sol
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										99
									
								
								packages/asset-swapper/contracts/src/GMXSampler.sol
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,99 @@
 | 
			
		||||
pragma solidity ^0.6;
 | 
			
		||||
pragma experimental ABIEncoderV2;
 | 
			
		||||
 | 
			
		||||
import "./interfaces/IGMX.sol";
 | 
			
		||||
import "./ApproximateBuys.sol";
 | 
			
		||||
import "./SamplerUtils.sol";
 | 
			
		||||
 | 
			
		||||
contract GMXSampler is
 | 
			
		||||
    SamplerUtils,
 | 
			
		||||
    ApproximateBuys
 | 
			
		||||
{
 | 
			
		||||
    struct GMXInfo {
 | 
			
		||||
        address reader;
 | 
			
		||||
        address vault;
 | 
			
		||||
        address[] path;
 | 
			
		||||
    }
 | 
			
		||||
    // address immutable WAVAX = 0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7;
 | 
			
		||||
    // address immutable AVAX = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
 | 
			
		||||
 | 
			
		||||
    function sampleSellsFromGMX(
 | 
			
		||||
        address reader,
 | 
			
		||||
        address vault,
 | 
			
		||||
        address[] memory path,
 | 
			
		||||
        uint256[] memory takerTokenAmounts
 | 
			
		||||
    )
 | 
			
		||||
        public
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256[] memory makerTokenAmounts)
 | 
			
		||||
    {
 | 
			
		||||
        uint256 numSamples = takerTokenAmounts.length;
 | 
			
		||||
        makerTokenAmounts = new uint256[](numSamples);
 | 
			
		||||
        for (uint256 i = 0; i < numSamples; i++) {
 | 
			
		||||
            try
 | 
			
		||||
                IGMX(reader).getAmountOut(IVault(vault), path[0], path[1], takerTokenAmounts[i])
 | 
			
		||||
                returns (uint256 amountAfterFees, uint256 feeAmount)
 | 
			
		||||
            {
 | 
			
		||||
                makerTokenAmounts[i] = amountAfterFees;
 | 
			
		||||
                // Break early if there are 0 amounts
 | 
			
		||||
                if (makerTokenAmounts[i] == 0) {
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
            } catch (bytes memory) {
 | 
			
		||||
                // Swallow failures, leaving all results as zero.
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function sampleBuysFromGMX(
 | 
			
		||||
        address reader,
 | 
			
		||||
        address vault,
 | 
			
		||||
        address[] memory path,
 | 
			
		||||
        uint256[] memory makerTokenAmounts
 | 
			
		||||
    )
 | 
			
		||||
        public
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256[] memory takerTokenAmounts)
 | 
			
		||||
    {
 | 
			
		||||
        address[] memory invertBuyPath = new address[](2);
 | 
			
		||||
        invertBuyPath[0] = path[1];
 | 
			
		||||
        invertBuyPath[1] = path[0];
 | 
			
		||||
        return _sampleApproximateBuys(
 | 
			
		||||
                ApproximateBuyQuoteOpts({
 | 
			
		||||
                    makerTokenData: abi.encode(reader, vault, invertBuyPath),
 | 
			
		||||
                    takerTokenData: abi.encode(reader, vault, path),
 | 
			
		||||
                    getSellQuoteCallback: _sampleSellForApproximateBuyFromGMX
 | 
			
		||||
                }),
 | 
			
		||||
                makerTokenAmounts
 | 
			
		||||
            );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    function _sampleSellForApproximateBuyFromGMX(
 | 
			
		||||
        bytes memory takerTokenData,
 | 
			
		||||
        bytes memory makerTokenData,
 | 
			
		||||
        uint256 sellAmount
 | 
			
		||||
    )
 | 
			
		||||
        private
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256 buyAmount)
 | 
			
		||||
    {
 | 
			
		||||
        (address _reader, address _vault, address[] memory _path ) = abi.decode(takerTokenData, (address, address, address[]));
 | 
			
		||||
 | 
			
		||||
        (bool success, bytes memory resultData) = address(this).staticcall(abi.encodeWithSelector(
 | 
			
		||||
            this.sampleSellsFromGMX.selector,
 | 
			
		||||
            _reader,
 | 
			
		||||
            _vault,
 | 
			
		||||
            _path,
 | 
			
		||||
            _toSingleValueArray(sellAmount)
 | 
			
		||||
        ));
 | 
			
		||||
        if(!success) {
 | 
			
		||||
            return 0;
 | 
			
		||||
        }
 | 
			
		||||
        // solhint-disable-next-line indent
 | 
			
		||||
        return abi.decode(resultData, (uint256[]))[0];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										82
									
								
								packages/asset-swapper/contracts/src/MultiBridgeSampler.sol
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										82
									
								
								packages/asset-swapper/contracts/src/MultiBridgeSampler.sol
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,82 @@
 | 
			
		||||
// SPDX-License-Identifier: Apache-2.0
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
  Copyright 2020 ZeroEx Intl.
 | 
			
		||||
 | 
			
		||||
  Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
  you may not use this file except in compliance with the License.
 | 
			
		||||
  You may obtain a copy of the License at
 | 
			
		||||
 | 
			
		||||
    http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 | 
			
		||||
  Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
  distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
  See the License for the specific language governing permissions and
 | 
			
		||||
  limitations under the License.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
pragma solidity ^0.6;
 | 
			
		||||
pragma experimental ABIEncoderV2;
 | 
			
		||||
 | 
			
		||||
import "./interfaces/IMultiBridge.sol";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
contract MultiBridgeSampler {
 | 
			
		||||
 | 
			
		||||
    /// @dev Default gas limit for multibridge calls.
 | 
			
		||||
    uint256 constant private DEFAULT_CALL_GAS = 400e3; // 400k
 | 
			
		||||
 | 
			
		||||
    /// @dev Sample sell quotes from MultiBridge.
 | 
			
		||||
    /// @param multibridge Address of the MultiBridge contract.
 | 
			
		||||
    /// @param takerToken Address of the taker token (what to sell).
 | 
			
		||||
    /// @param intermediateToken The address of the intermediate token to
 | 
			
		||||
    ///        use in an indirect route.
 | 
			
		||||
    /// @param makerToken Address of the maker token (what to buy).
 | 
			
		||||
    /// @param takerTokenAmounts Taker token sell amount for each sample.
 | 
			
		||||
    /// @return makerTokenAmounts Maker amounts bought at each taker token
 | 
			
		||||
    ///         amount.
 | 
			
		||||
    function sampleSellsFromMultiBridge(
 | 
			
		||||
        address multibridge,
 | 
			
		||||
        address takerToken,
 | 
			
		||||
        address intermediateToken,
 | 
			
		||||
        address makerToken,
 | 
			
		||||
        uint256[] memory takerTokenAmounts
 | 
			
		||||
    )
 | 
			
		||||
        public
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256[] memory makerTokenAmounts)
 | 
			
		||||
    {
 | 
			
		||||
        // Initialize array of maker token amounts.
 | 
			
		||||
        uint256 numSamples = takerTokenAmounts.length;
 | 
			
		||||
        makerTokenAmounts = new uint256[](numSamples);
 | 
			
		||||
 | 
			
		||||
        // If no address provided, return all zeros.
 | 
			
		||||
        if (multibridge == address(0)) {
 | 
			
		||||
            return makerTokenAmounts;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        for (uint256 i = 0; i < numSamples; i++) {
 | 
			
		||||
            (bool didSucceed, bytes memory resultData) =
 | 
			
		||||
                multibridge.staticcall.gas(DEFAULT_CALL_GAS)(
 | 
			
		||||
                    abi.encodeWithSelector(
 | 
			
		||||
                        IMultiBridge(0).getSellQuote.selector,
 | 
			
		||||
                        takerToken,
 | 
			
		||||
                        intermediateToken,
 | 
			
		||||
                        makerToken,
 | 
			
		||||
                        takerTokenAmounts[i]
 | 
			
		||||
                    ));
 | 
			
		||||
            uint256 buyAmount = 0;
 | 
			
		||||
            if (didSucceed) {
 | 
			
		||||
                buyAmount = abi.decode(resultData, (uint256));
 | 
			
		||||
            }
 | 
			
		||||
            // Exit early if the amount is too high for the source to serve
 | 
			
		||||
            if (buyAmount == 0) {
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            makerTokenAmounts[i] = buyAmount;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										118
									
								
								packages/asset-swapper/contracts/src/PlatypusSampler.sol
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										118
									
								
								packages/asset-swapper/contracts/src/PlatypusSampler.sol
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,118 @@
 | 
			
		||||
pragma solidity ^0.6;
 | 
			
		||||
pragma experimental ABIEncoderV2;
 | 
			
		||||
 | 
			
		||||
import "./interfaces/IPlatypus.sol";
 | 
			
		||||
import "./ApproximateBuys.sol";
 | 
			
		||||
import "./SamplerUtils.sol";
 | 
			
		||||
 | 
			
		||||
contract PlatypusSampler is
 | 
			
		||||
    SamplerUtils,
 | 
			
		||||
    ApproximateBuys
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
    function sampleSellsFromPlatypus(
 | 
			
		||||
        address router,
 | 
			
		||||
        address[] memory path,
 | 
			
		||||
        address[] memory pool,
 | 
			
		||||
        uint256[] memory takerTokenAmounts
 | 
			
		||||
    )
 | 
			
		||||
        public
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256[] memory makerTokenAmounts)
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        uint256 numSamples = takerTokenAmounts.length;
 | 
			
		||||
        makerTokenAmounts = new uint256[](numSamples);
 | 
			
		||||
        for (uint256 i = 0; i < numSamples; i++) {
 | 
			
		||||
            try
 | 
			
		||||
                IPlatypus(router).quotePotentialSwaps(path, pool, takerTokenAmounts[i])
 | 
			
		||||
                returns (uint256 amountAfterFees, uint256 feeAmount)
 | 
			
		||||
            {
 | 
			
		||||
                makerTokenAmounts[i] = amountAfterFees;
 | 
			
		||||
                // Break early if there are 0 amounts
 | 
			
		||||
                if (makerTokenAmounts[i] == 0) {
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
            } catch (bytes memory) {
 | 
			
		||||
                // Swallow failures, leaving all results as zero.
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function sampleBuysFromPlatypus(
 | 
			
		||||
        address router,
 | 
			
		||||
        address[] memory path,
 | 
			
		||||
        address[] memory pool,
 | 
			
		||||
        uint256[] memory makerTokenAmounts
 | 
			
		||||
    )
 | 
			
		||||
        public
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256[] memory takerTokenAmounts)
 | 
			
		||||
    {
 | 
			
		||||
        address[] memory invertBuyPath;
 | 
			
		||||
        address[] memory invertPoolPath;
 | 
			
		||||
 | 
			
		||||
        if(path.length > 2){
 | 
			
		||||
 | 
			
		||||
            invertBuyPath = new address[](3);
 | 
			
		||||
            invertPoolPath = new address[](2);
 | 
			
		||||
 | 
			
		||||
            invertBuyPath[0] = path[2];
 | 
			
		||||
            invertBuyPath[2] = path[0];
 | 
			
		||||
            invertBuyPath[1] = path[1];
 | 
			
		||||
 | 
			
		||||
            invertPoolPath[0] = pool[1];
 | 
			
		||||
            invertPoolPath[1] = pool[0];
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
 | 
			
		||||
            invertBuyPath = new address[](2);
 | 
			
		||||
            invertPoolPath = new address[](1);
 | 
			
		||||
 | 
			
		||||
            invertBuyPath[0] = path[1];
 | 
			
		||||
            invertBuyPath[1] = path[0];
 | 
			
		||||
            invertPoolPath[0] = pool[0];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        uint256[] memory result = _sampleApproximateBuys(
 | 
			
		||||
                ApproximateBuyQuoteOpts({
 | 
			
		||||
                    makerTokenData: abi.encode(router, invertBuyPath, invertPoolPath),
 | 
			
		||||
                    takerTokenData: abi.encode(router, path, pool),
 | 
			
		||||
                    getSellQuoteCallback: _sampleSellForApproximateBuyFromPlatypus
 | 
			
		||||
                }),
 | 
			
		||||
                makerTokenAmounts
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    function _sampleSellForApproximateBuyFromPlatypus(
 | 
			
		||||
        bytes memory makerTokenData,
 | 
			
		||||
        bytes memory takerTokenData,
 | 
			
		||||
        uint256 sellAmount
 | 
			
		||||
    )
 | 
			
		||||
        private
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256 buyAmount)
 | 
			
		||||
    {
 | 
			
		||||
        (address router,  address[] memory _path, address[] memory _pool ) = abi.decode(makerTokenData, (address, address[], address[]));
 | 
			
		||||
 | 
			
		||||
        (bool success, bytes memory resultData) = address(this).staticcall(abi.encodeWithSelector(
 | 
			
		||||
            this.sampleSellsFromPlatypus.selector,
 | 
			
		||||
            router,
 | 
			
		||||
            _path,
 | 
			
		||||
            _pool,
 | 
			
		||||
            _toSingleValueArray(sellAmount)
 | 
			
		||||
        ));
 | 
			
		||||
 | 
			
		||||
        if(!success) {
 | 
			
		||||
            return 0;
 | 
			
		||||
        }
 | 
			
		||||
        // solhint-disable-next-line indent
 | 
			
		||||
        return abi.decode(resultData, (uint256[]))[0];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1,54 +0,0 @@
 | 
			
		||||
// SPDX-License-Identifier: Apache-2.0
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
  Copyright 2020 ZeroEx Intl.
 | 
			
		||||
 | 
			
		||||
  Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
  you may not use this file except in compliance with the License.
 | 
			
		||||
  You may obtain a copy of the License at
 | 
			
		||||
 | 
			
		||||
    http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 | 
			
		||||
  Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
  distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
  See the License for the specific language governing permissions and
 | 
			
		||||
  limitations under the License.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
pragma solidity ^0.6;
 | 
			
		||||
pragma experimental ABIEncoderV2;
 | 
			
		||||
 | 
			
		||||
/// @dev Minimal Balancer V2 Vault interface
 | 
			
		||||
///      for documentation refer to https://github.com/balancer-labs/balancer-core-v2/blob/master/contracts/vault/interfaces/IVault.sol
 | 
			
		||||
interface IBalancerV2Vault {
 | 
			
		||||
    enum SwapKind { GIVEN_IN, GIVEN_OUT }
 | 
			
		||||
 | 
			
		||||
    struct BatchSwapStep {
 | 
			
		||||
        bytes32 poolId;
 | 
			
		||||
        uint256 assetInIndex;
 | 
			
		||||
        uint256 assetOutIndex;
 | 
			
		||||
        uint256 amount;
 | 
			
		||||
        bytes userData;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    struct FundManagement {
 | 
			
		||||
        address sender;
 | 
			
		||||
        bool fromInternalBalance;
 | 
			
		||||
        address payable recipient;
 | 
			
		||||
        bool toInternalBalance;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    struct BalancerV2PoolInfo {
 | 
			
		||||
        bytes32 poolId;
 | 
			
		||||
        address vault;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function queryBatchSwap(
 | 
			
		||||
        SwapKind kind,
 | 
			
		||||
        BatchSwapStep[] calldata swaps,
 | 
			
		||||
        address[] calldata assets,
 | 
			
		||||
        FundManagement calldata funds
 | 
			
		||||
    ) external returns (int256[] memory assetDeltas);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										23
									
								
								packages/asset-swapper/contracts/src/interfaces/IGMX.sol
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								packages/asset-swapper/contracts/src/interfaces/IGMX.sol
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
pragma solidity ^0.6;
 | 
			
		||||
pragma experimental ABIEncoderV2;
 | 
			
		||||
 | 
			
		||||
interface IGMX {
 | 
			
		||||
    function getMaxAmountIn(IVault _vault, address _tokenIn, address _tokenOut)
 | 
			
		||||
        external
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256);
 | 
			
		||||
 | 
			
		||||
    function getAmountOut(IVault _vault, address _tokenIn, address _tokenOut, uint256 _amountIn)
 | 
			
		||||
        external
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256, uint256);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
interface IVault {
 | 
			
		||||
    function getFeeBasisPoints(address _token, uint256 _usdgDelta, uint256 _feeBasisPoints, uint256 _taxBasisPoints, bool _increment) external view returns (uint256);
 | 
			
		||||
    function stableSwapFeeBasisPoints() external view returns (uint256);
 | 
			
		||||
    function stableTokens(address _token) external view returns (bool);
 | 
			
		||||
    function tokenDecimals(address _token) external view returns (uint256);
 | 
			
		||||
    function getMaxPrice(address _token) external view returns (uint256);
 | 
			
		||||
    function getMinPrice(address _token) external view returns (uint256);
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,10 @@
 | 
			
		||||
 | 
			
		||||
pragma solidity ^0.6;
 | 
			
		||||
 | 
			
		||||
interface IPlatypus {
 | 
			
		||||
    function quotePotentialSwaps(
 | 
			
		||||
        address[] memory tokenPath,
 | 
			
		||||
        address[] memory poolPath,
 | 
			
		||||
        uint256 fromAmount
 | 
			
		||||
    ) external view returns (uint256 potentialOutcome, uint256 haircut);
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,39 @@
 | 
			
		||||
// SPDX-License-Identifier: Apache-2.0
 | 
			
		||||
pragma solidity ^0.6;
 | 
			
		||||
pragma experimental ABIEncoderV2;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
contract DummyLiquidityProvider
 | 
			
		||||
{
 | 
			
		||||
    /// @dev Quotes the amount of `makerToken` that would be obtained by
 | 
			
		||||
    ///      selling `sellAmount` of `takerToken`.
 | 
			
		||||
    /// @param sellAmount Amount of `takerToken` to sell.
 | 
			
		||||
    /// @return makerTokenAmount Amount of `makerToken` that would be obtained.
 | 
			
		||||
    function getSellQuote(
 | 
			
		||||
        address, /* takerToken */
 | 
			
		||||
        address, /* makerToken */
 | 
			
		||||
        uint256 sellAmount
 | 
			
		||||
    )
 | 
			
		||||
        external
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256 makerTokenAmount)
 | 
			
		||||
    {
 | 
			
		||||
        makerTokenAmount = sellAmount - 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// @dev Quotes the amount of `takerToken` that would need to be sold in
 | 
			
		||||
    ///      order to obtain `buyAmount` of `makerToken`.
 | 
			
		||||
    /// @param buyAmount Amount of `makerToken` to buy.
 | 
			
		||||
    /// @return takerTokenAmount Amount of `takerToken` that would need to be sold.
 | 
			
		||||
    function getBuyQuote(
 | 
			
		||||
        address, /* takerToken */
 | 
			
		||||
        address, /* makerToken */
 | 
			
		||||
        uint256 buyAmount
 | 
			
		||||
    )
 | 
			
		||||
        external
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256 takerTokenAmount)
 | 
			
		||||
    {
 | 
			
		||||
        takerTokenAmount = buyAmount + 1;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										455
									
								
								packages/asset-swapper/contracts/test/TestERC20BridgeSampler.sol
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										455
									
								
								packages/asset-swapper/contracts/test/TestERC20BridgeSampler.sol
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,455 @@
 | 
			
		||||
// SPDX-License-Identifier: Apache-2.0
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
  Copyright 2020 ZeroEx Intl.
 | 
			
		||||
 | 
			
		||||
  Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
  you may not use this file except in compliance with the License.
 | 
			
		||||
  You may obtain a copy of the License at
 | 
			
		||||
 | 
			
		||||
    http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 | 
			
		||||
  Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
  distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
  See the License for the specific language governing permissions and
 | 
			
		||||
  limitations under the License.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
pragma solidity ^0.6;
 | 
			
		||||
pragma experimental ABIEncoderV2;
 | 
			
		||||
 | 
			
		||||
import "../src/ERC20BridgeSampler.sol";
 | 
			
		||||
import "../src/interfaces/IKyberNetwork.sol";
 | 
			
		||||
import "../src/interfaces/IUniswapV2Router01.sol";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
library LibDeterministicQuotes {
 | 
			
		||||
 | 
			
		||||
    address private constant WETH_ADDRESS = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
 | 
			
		||||
    uint256 private constant RATE_DENOMINATOR = 1 ether;
 | 
			
		||||
    uint256 private constant MIN_RATE = RATE_DENOMINATOR / 100;
 | 
			
		||||
    uint256 private constant MAX_RATE = 100 * RATE_DENOMINATOR;
 | 
			
		||||
    uint8 private constant MIN_DECIMALS = 4;
 | 
			
		||||
    uint8 private constant MAX_DECIMALS = 20;
 | 
			
		||||
 | 
			
		||||
    function getDeterministicSellQuote(
 | 
			
		||||
        bytes32 salt,
 | 
			
		||||
        address sellToken,
 | 
			
		||||
        address buyToken,
 | 
			
		||||
        uint256 sellAmount
 | 
			
		||||
    )
 | 
			
		||||
        internal
 | 
			
		||||
        pure
 | 
			
		||||
        returns (uint256 buyAmount)
 | 
			
		||||
    {
 | 
			
		||||
        uint256 sellBase = uint256(10) ** getDeterministicTokenDecimals(sellToken);
 | 
			
		||||
        uint256 buyBase = uint256(10) ** getDeterministicTokenDecimals(buyToken);
 | 
			
		||||
        uint256 rate = getDeterministicRate(salt, sellToken, buyToken);
 | 
			
		||||
        return sellAmount * rate * buyBase / sellBase / RATE_DENOMINATOR;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function getDeterministicBuyQuote(
 | 
			
		||||
        bytes32 salt,
 | 
			
		||||
        address sellToken,
 | 
			
		||||
        address buyToken,
 | 
			
		||||
        uint256 buyAmount
 | 
			
		||||
    )
 | 
			
		||||
        internal
 | 
			
		||||
        pure
 | 
			
		||||
        returns (uint256 sellAmount)
 | 
			
		||||
    {
 | 
			
		||||
        uint256 sellBase = uint256(10) ** getDeterministicTokenDecimals(sellToken);
 | 
			
		||||
        uint256 buyBase = uint256(10) ** getDeterministicTokenDecimals(buyToken);
 | 
			
		||||
        uint256 rate = getDeterministicRate(salt, sellToken, buyToken);
 | 
			
		||||
        return buyAmount * RATE_DENOMINATOR * sellBase / rate / buyBase;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function getDeterministicTokenDecimals(address token)
 | 
			
		||||
        internal
 | 
			
		||||
        pure
 | 
			
		||||
        returns (uint8 decimals)
 | 
			
		||||
    {
 | 
			
		||||
        if (token == WETH_ADDRESS) {
 | 
			
		||||
            return 18;
 | 
			
		||||
        }
 | 
			
		||||
        bytes32 seed = keccak256(abi.encodePacked(token));
 | 
			
		||||
        return uint8(uint256(seed) % (MAX_DECIMALS - MIN_DECIMALS)) + MIN_DECIMALS;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function getDeterministicRate(bytes32 salt, address sellToken, address buyToken)
 | 
			
		||||
        internal
 | 
			
		||||
        pure
 | 
			
		||||
        returns (uint256 rate)
 | 
			
		||||
    {
 | 
			
		||||
        bytes32 seed = keccak256(abi.encodePacked(salt, sellToken, buyToken));
 | 
			
		||||
        return uint256(seed) % (MAX_RATE - MIN_RATE) + MIN_RATE;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
contract TestDeploymentConstants {
 | 
			
		||||
 | 
			
		||||
    // solhint-disable separate-by-one-line-in-contract
 | 
			
		||||
 | 
			
		||||
    // Mainnet addresses ///////////////////////////////////////////////////////
 | 
			
		||||
    /// @dev Mainnet address of the WETH contract.
 | 
			
		||||
    address constant private WETH_ADDRESS = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
 | 
			
		||||
 | 
			
		||||
    /// @dev Overridable way to get the WETH address.
 | 
			
		||||
    /// @return wethAddress The WETH address.
 | 
			
		||||
    function _getWethAddress()
 | 
			
		||||
        internal
 | 
			
		||||
        view
 | 
			
		||||
        returns (address wethAddress)
 | 
			
		||||
    {
 | 
			
		||||
        return WETH_ADDRESS;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
contract FailTrigger {
 | 
			
		||||
 | 
			
		||||
    // Give this address a balance to force operations to fail.
 | 
			
		||||
    address payable constant public FAILURE_ADDRESS = 0xe9dB8717BC5DFB20aaf538b4a5a02B7791FF430C;
 | 
			
		||||
 | 
			
		||||
    // Funds `FAILURE_ADDRESS`.
 | 
			
		||||
    function enableFailTrigger() external payable {
 | 
			
		||||
        FAILURE_ADDRESS.transfer(msg.value);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function _revertIfShouldFail() internal view {
 | 
			
		||||
        if (FAILURE_ADDRESS.balance != 0) {
 | 
			
		||||
            revert("FAIL_TRIGGERED");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
contract TestERC20BridgeSamplerUniswapExchange is
 | 
			
		||||
    IUniswapExchangeQuotes,
 | 
			
		||||
    TestDeploymentConstants,
 | 
			
		||||
    FailTrigger
 | 
			
		||||
{
 | 
			
		||||
    bytes32 constant private BASE_SALT = 0x1d6a6a0506b0b4a554b907a4c29d9f4674e461989d9c1921feb17b26716385ab;
 | 
			
		||||
 | 
			
		||||
    address public tokenAddress;
 | 
			
		||||
    bytes32 public salt;
 | 
			
		||||
 | 
			
		||||
    constructor(address _tokenAddress) public {
 | 
			
		||||
        tokenAddress = _tokenAddress;
 | 
			
		||||
        salt = keccak256(abi.encodePacked(BASE_SALT, _tokenAddress));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Deterministic `IUniswapExchangeQuotes.getEthToTokenInputPrice()`.
 | 
			
		||||
    function getEthToTokenInputPrice(
 | 
			
		||||
        uint256 ethSold
 | 
			
		||||
    )
 | 
			
		||||
        override
 | 
			
		||||
        external
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256 tokensBought)
 | 
			
		||||
    {
 | 
			
		||||
        _revertIfShouldFail();
 | 
			
		||||
        return LibDeterministicQuotes.getDeterministicSellQuote(
 | 
			
		||||
            salt,
 | 
			
		||||
            tokenAddress,
 | 
			
		||||
            _getWethAddress(),
 | 
			
		||||
            ethSold
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Deterministic `IUniswapExchangeQuotes.getEthToTokenOutputPrice()`.
 | 
			
		||||
    function getEthToTokenOutputPrice(
 | 
			
		||||
        uint256 tokensBought
 | 
			
		||||
    )
 | 
			
		||||
        override
 | 
			
		||||
        external
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256 ethSold)
 | 
			
		||||
    {
 | 
			
		||||
        _revertIfShouldFail();
 | 
			
		||||
        return LibDeterministicQuotes.getDeterministicBuyQuote(
 | 
			
		||||
            salt,
 | 
			
		||||
            _getWethAddress(),
 | 
			
		||||
            tokenAddress,
 | 
			
		||||
            tokensBought
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Deterministic `IUniswapExchangeQuotes.getTokenToEthInputPrice()`.
 | 
			
		||||
    function getTokenToEthInputPrice(
 | 
			
		||||
        uint256 tokensSold
 | 
			
		||||
    )
 | 
			
		||||
        override
 | 
			
		||||
        external
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256 ethBought)
 | 
			
		||||
    {
 | 
			
		||||
        _revertIfShouldFail();
 | 
			
		||||
        return LibDeterministicQuotes.getDeterministicSellQuote(
 | 
			
		||||
            salt,
 | 
			
		||||
            tokenAddress,
 | 
			
		||||
            _getWethAddress(),
 | 
			
		||||
            tokensSold
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Deterministic `IUniswapExchangeQuotes.getTokenToEthOutputPrice()`.
 | 
			
		||||
    function getTokenToEthOutputPrice(
 | 
			
		||||
        uint256 ethBought
 | 
			
		||||
    )
 | 
			
		||||
        override
 | 
			
		||||
        external
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256 tokensSold)
 | 
			
		||||
    {
 | 
			
		||||
        _revertIfShouldFail();
 | 
			
		||||
        return LibDeterministicQuotes.getDeterministicBuyQuote(
 | 
			
		||||
            salt,
 | 
			
		||||
            _getWethAddress(),
 | 
			
		||||
            tokenAddress,
 | 
			
		||||
            ethBought
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
contract TestERC20BridgeSamplerUniswapV2Router01 is
 | 
			
		||||
    IUniswapV2Router01,
 | 
			
		||||
    TestDeploymentConstants,
 | 
			
		||||
    FailTrigger
 | 
			
		||||
{
 | 
			
		||||
    bytes32 constant private SALT = 0xadc7fcb33c735913b8635927e66896b356a53a912ab2ceff929e60a04b53b3c1;
 | 
			
		||||
 | 
			
		||||
    // Deterministic `IUniswapV2Router01.getAmountsOut()`.
 | 
			
		||||
    function getAmountsOut(uint256 amountIn, address[] calldata path)
 | 
			
		||||
        override
 | 
			
		||||
        external
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256[] memory amounts)
 | 
			
		||||
    {
 | 
			
		||||
        require(path.length >= 2, "PATH_TOO_SHORT");
 | 
			
		||||
        _revertIfShouldFail();
 | 
			
		||||
        amounts = new uint256[](path.length);
 | 
			
		||||
        amounts[0] = amountIn;
 | 
			
		||||
        for (uint256 i = 0; i < path.length - 1; ++i) {
 | 
			
		||||
            amounts[i + 1] = LibDeterministicQuotes.getDeterministicSellQuote(
 | 
			
		||||
                SALT,
 | 
			
		||||
                path[i],
 | 
			
		||||
                path[i + 1],
 | 
			
		||||
                amounts[i]
 | 
			
		||||
            );
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Deterministic `IUniswapV2Router01.getAmountsInt()`.
 | 
			
		||||
    function getAmountsIn(uint256 amountOut, address[] calldata path)
 | 
			
		||||
        override
 | 
			
		||||
        external
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256[] memory amounts)
 | 
			
		||||
    {
 | 
			
		||||
        require(path.length >= 2, "PATH_TOO_SHORT");
 | 
			
		||||
        _revertIfShouldFail();
 | 
			
		||||
        amounts = new uint256[](path.length);
 | 
			
		||||
        amounts[path.length - 1] = amountOut;
 | 
			
		||||
        for (uint256 i = path.length - 1; i > 0; --i) {
 | 
			
		||||
            amounts[i - 1] = LibDeterministicQuotes.getDeterministicBuyQuote(
 | 
			
		||||
                SALT,
 | 
			
		||||
                path[i - 1],
 | 
			
		||||
                path[i],
 | 
			
		||||
                amounts[i]
 | 
			
		||||
            );
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// solhint-disable space-after-comma
 | 
			
		||||
contract TestERC20BridgeSamplerKyberNetwork is
 | 
			
		||||
    TestDeploymentConstants,
 | 
			
		||||
    FailTrigger
 | 
			
		||||
{
 | 
			
		||||
    bytes32 constant private SALT = 0x0ff3ca9d46195c39f9a12afb74207b4970349fb3cfb1e459bbf170298d326bc7;
 | 
			
		||||
    address constant public ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
 | 
			
		||||
 | 
			
		||||
    enum TradeType {BestOfAll, MaskIn, MaskOut, Split}
 | 
			
		||||
    enum ProcessWithRate {NotRequired, Required}
 | 
			
		||||
 | 
			
		||||
    // IKyberHintHandler
 | 
			
		||||
    function buildTokenToEthHint(
 | 
			
		||||
        address tokenSrc,
 | 
			
		||||
        TradeType /* tokenToEthType */,
 | 
			
		||||
        bytes32[] calldata /* tokenToEthReserveIds */,
 | 
			
		||||
        uint256[] calldata /* tokenToEthSplits */
 | 
			
		||||
    ) external view returns (bytes memory hint)
 | 
			
		||||
    {
 | 
			
		||||
        return abi.encode(tokenSrc);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function buildEthToTokenHint(
 | 
			
		||||
        address tokenDest,
 | 
			
		||||
        TradeType /* ethToTokenType */,
 | 
			
		||||
        bytes32[] calldata /* ethToTokenReserveIds */,
 | 
			
		||||
        uint256[] calldata /* ethToTokenSplits */
 | 
			
		||||
    ) external view returns (bytes memory hint)
 | 
			
		||||
    {
 | 
			
		||||
        return abi.encode(tokenDest);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // IKyberHintHandler
 | 
			
		||||
    function buildTokenToTokenHint(
 | 
			
		||||
        address tokenSrc,
 | 
			
		||||
        TradeType /* tokenToEthType */,
 | 
			
		||||
        bytes32[] calldata /* tokenToEthReserveIds */,
 | 
			
		||||
        uint256[] calldata /* tokenToEthSplits */,
 | 
			
		||||
        address /* tokenDest  */,
 | 
			
		||||
        TradeType /* EthToTokenType */,
 | 
			
		||||
        bytes32[] calldata /* EthToTokenReserveIds */,
 | 
			
		||||
        uint256[] calldata /* EthToTokenSplits */
 | 
			
		||||
    ) external view returns (bytes memory hint)
 | 
			
		||||
    {
 | 
			
		||||
        return abi.encode(tokenSrc);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // IKyberHintHandler
 | 
			
		||||
    function getTradingReserves(
 | 
			
		||||
        address tokenSrc,
 | 
			
		||||
        address tokenDest,
 | 
			
		||||
        bool isTokenToToken,
 | 
			
		||||
        bytes calldata hint
 | 
			
		||||
    )
 | 
			
		||||
        external
 | 
			
		||||
        view
 | 
			
		||||
        returns (
 | 
			
		||||
            bytes32[] memory reserveIds,
 | 
			
		||||
            uint256[] memory splitValuesBps,
 | 
			
		||||
            ProcessWithRate processWithRate
 | 
			
		||||
        )
 | 
			
		||||
    {
 | 
			
		||||
        reserveIds = new bytes32[](1);
 | 
			
		||||
        reserveIds[0] = bytes32(uint256(1));
 | 
			
		||||
        splitValuesBps = new uint256[](0);
 | 
			
		||||
        processWithRate = ProcessWithRate.NotRequired;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Deterministic `IKyberNetworkProxy.getExpectedRateAfterFee()`.
 | 
			
		||||
    function getExpectedRateAfterFee(
 | 
			
		||||
        address fromToken,
 | 
			
		||||
        address toToken,
 | 
			
		||||
        uint256 /* srcQty */,
 | 
			
		||||
        uint256 /* fee */,
 | 
			
		||||
        bytes calldata /* hint */
 | 
			
		||||
    )
 | 
			
		||||
        external
 | 
			
		||||
        view
 | 
			
		||||
        returns
 | 
			
		||||
        (uint256 expectedRate)
 | 
			
		||||
    {
 | 
			
		||||
        _revertIfShouldFail();
 | 
			
		||||
        fromToken = fromToken == ETH_ADDRESS ? _getWethAddress() : fromToken;
 | 
			
		||||
        toToken = toToken == ETH_ADDRESS ? _getWethAddress() : toToken;
 | 
			
		||||
        expectedRate = LibDeterministicQuotes.getDeterministicRate(
 | 
			
		||||
            SALT,
 | 
			
		||||
            fromToken,
 | 
			
		||||
            toToken
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Deterministic `IKyberNetworkProxy.getExpectedRate()`.
 | 
			
		||||
    function getExpectedRate(
 | 
			
		||||
        address fromToken,
 | 
			
		||||
        address toToken,
 | 
			
		||||
        uint256
 | 
			
		||||
    )
 | 
			
		||||
        external
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256 expectedRate, uint256)
 | 
			
		||||
    {
 | 
			
		||||
        _revertIfShouldFail();
 | 
			
		||||
        fromToken = fromToken == ETH_ADDRESS ? _getWethAddress() : fromToken;
 | 
			
		||||
        toToken = toToken == ETH_ADDRESS ? _getWethAddress() : toToken;
 | 
			
		||||
        expectedRate = LibDeterministicQuotes.getDeterministicRate(
 | 
			
		||||
            SALT,
 | 
			
		||||
            fromToken,
 | 
			
		||||
            toToken
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
contract TestERC20BridgeSamplerUniswapExchangeFactory is
 | 
			
		||||
    IUniswapExchangeFactory
 | 
			
		||||
{
 | 
			
		||||
    mapping (address => IUniswapExchangeQuotes) private _exchangesByToken;
 | 
			
		||||
 | 
			
		||||
    // Creates Uniswap exchange contracts for tokens.
 | 
			
		||||
    function createTokenExchanges(address[] calldata tokenAddresses)
 | 
			
		||||
        external
 | 
			
		||||
    {
 | 
			
		||||
        for (uint256 i = 0; i < tokenAddresses.length; i++) {
 | 
			
		||||
            address tokenAddress = tokenAddresses[i];
 | 
			
		||||
            _exchangesByToken[tokenAddress] =
 | 
			
		||||
                new TestERC20BridgeSamplerUniswapExchange(tokenAddress);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // `IUniswapExchangeFactory.getExchange()`.
 | 
			
		||||
    function getExchange(address tokenAddress)
 | 
			
		||||
        override
 | 
			
		||||
        external
 | 
			
		||||
        view
 | 
			
		||||
        returns (address)
 | 
			
		||||
    {
 | 
			
		||||
        return address(_exchangesByToken[tokenAddress]);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
contract TestERC20BridgeSampler is
 | 
			
		||||
    ERC20BridgeSampler,
 | 
			
		||||
    FailTrigger
 | 
			
		||||
{
 | 
			
		||||
    TestERC20BridgeSamplerUniswapExchangeFactory public uniswap;
 | 
			
		||||
    TestERC20BridgeSamplerUniswapV2Router01 public uniswapV2Router;
 | 
			
		||||
    TestERC20BridgeSamplerKyberNetwork public kyber;
 | 
			
		||||
 | 
			
		||||
    uint8 private constant MAX_ORDER_STATUS = uint8(IExchange.OrderStatus.CANCELLED) + 1;
 | 
			
		||||
 | 
			
		||||
    constructor() public ERC20BridgeSampler() {
 | 
			
		||||
        uniswap = new TestERC20BridgeSamplerUniswapExchangeFactory();
 | 
			
		||||
        uniswapV2Router = new TestERC20BridgeSamplerUniswapV2Router01();
 | 
			
		||||
        kyber = new TestERC20BridgeSamplerKyberNetwork();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Creates Uniswap exchange contracts for tokens.
 | 
			
		||||
    function createTokenExchanges(address[] calldata tokenAddresses)
 | 
			
		||||
        external
 | 
			
		||||
    {
 | 
			
		||||
        uniswap.createTokenExchanges(tokenAddresses);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Overridden to return deterministic states.
 | 
			
		||||
    function getLimitOrderFillableTakerAmount(
 | 
			
		||||
        IExchange.LimitOrder memory order,
 | 
			
		||||
        IExchange.Signature memory,
 | 
			
		||||
        IExchange
 | 
			
		||||
    )
 | 
			
		||||
        override
 | 
			
		||||
        public
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint256 fillableTakerAmount)
 | 
			
		||||
    {
 | 
			
		||||
        return uint256(keccak256(abi.encode(order.salt))) % order.takerAmount;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Overriden to return deterministic decimals.
 | 
			
		||||
    function _getTokenDecimals(address tokenAddress)
 | 
			
		||||
        override
 | 
			
		||||
        internal
 | 
			
		||||
        view
 | 
			
		||||
        returns (uint8 decimals)
 | 
			
		||||
    {
 | 
			
		||||
        return LibDeterministicQuotes.getDeterministicTokenDecimals(tokenAddress);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "@0x/asset-swapper",
 | 
			
		||||
    "version": "16.57.0",
 | 
			
		||||
    "version": "16.51.0",
 | 
			
		||||
    "engines": {
 | 
			
		||||
        "node": ">=6.12"
 | 
			
		||||
    },
 | 
			
		||||
@@ -39,7 +39,7 @@
 | 
			
		||||
    "config": {
 | 
			
		||||
        "publicInterfaceContracts": "ERC20BridgeSampler,BalanceChecker,FakeTaker",
 | 
			
		||||
        "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually.",
 | 
			
		||||
        "abis": "./test/generated-artifacts/@(ApproximateBuys|BalanceChecker|BalancerSampler|BalancerV2BatchSampler|BalancerV2Common|BalancerV2Sampler|BancorSampler|CompoundSampler|CurveSampler|DODOSampler|DODOV2Sampler|ERC20BridgeSampler|FakeTaker|IBalancer|IBalancerV2Vault|IBancor|ICurve|IKyberNetwork|IMStable|IMooniswap|IMultiBridge|IShell|ISmoothy|IUniswapExchangeQuotes|IUniswapV2Router01|KyberDmmSampler|KyberSampler|LidoSampler|LiquidityProviderSampler|MStableSampler|MakerPSMSampler|MooniswapSampler|NativeOrderSampler|SamplerUtils|ShellSampler|SmoothySampler|TestNativeOrderSampler|TwoHopSampler|UniswapSampler|UniswapV2Sampler|UniswapV3Sampler|UtilitySampler).json",
 | 
			
		||||
        "abis": "./test/generated-artifacts/@(ApproximateBuys|BalanceChecker|BalancerSampler|BalancerV2Sampler|BancorSampler|CompoundSampler|CurveSampler|DODOSampler|DODOV2Sampler|DummyLiquidityProvider|ERC20BridgeSampler|FakeTaker|GMXSampler|IBalancer|IBancor|ICurve|IGMX|IKyberNetwork|IMStable|IMooniswap|IMultiBridge|IPlatypus|IShell|ISmoothy|IUniswapExchangeQuotes|IUniswapV2Router01|KyberDmmSampler|KyberSampler|LidoSampler|LiquidityProviderSampler|MStableSampler|MakerPSMSampler|MooniswapSampler|MultiBridgeSampler|NativeOrderSampler|PlatypusSampler|SamplerUtils|ShellSampler|SmoothySampler|TestERC20BridgeSampler|TestNativeOrderSampler|TwoHopSampler|UniswapSampler|UniswapV2Sampler|UniswapV3Sampler|UtilitySampler).json",
 | 
			
		||||
        "postpublish": {
 | 
			
		||||
            "assets": []
 | 
			
		||||
        }
 | 
			
		||||
@@ -58,22 +58,21 @@
 | 
			
		||||
        "registry": "git@github.com:0xProject/gitpkg-registry.git"
 | 
			
		||||
    },
 | 
			
		||||
    "dependencies": {
 | 
			
		||||
        "@0x/assert": "^3.0.34",
 | 
			
		||||
        "@0x/base-contract": "^6.5.0",
 | 
			
		||||
        "@0x/contract-addresses": "^6.13.0",
 | 
			
		||||
        "@0x/contract-wrappers": "^13.20.1",
 | 
			
		||||
        "@0x/contracts-erc20": "^3.3.29",
 | 
			
		||||
        "@0x/contracts-zero-ex": "^0.32.0",
 | 
			
		||||
        "@0x/dev-utils": "^4.2.14",
 | 
			
		||||
        "@0x/json-schemas": "^6.4.4",
 | 
			
		||||
        "@0x/assert": "^3.0.31",
 | 
			
		||||
        "@0x/base-contract": "^6.4.5",
 | 
			
		||||
        "@0x/contract-addresses": "^6.12.0",
 | 
			
		||||
        "@0x/contract-wrappers": "^13.19.1",
 | 
			
		||||
        "@0x/contracts-erc20": "^3.3.27",
 | 
			
		||||
        "@0x/contracts-zero-ex": "^0.31.1",
 | 
			
		||||
        "@0x/dev-utils": "^4.2.11",
 | 
			
		||||
        "@0x/json-schemas": "^6.4.1",
 | 
			
		||||
        "@0x/neon-router": "^0.3.5",
 | 
			
		||||
        "@0x/protocol-utils": "^11.12.0",
 | 
			
		||||
        "@0x/protocol-utils": "^1.11.1",
 | 
			
		||||
        "@0x/quote-server": "^6.0.6",
 | 
			
		||||
        "@0x/types": "^3.3.6",
 | 
			
		||||
        "@0x/typescript-typings": "^5.3.1",
 | 
			
		||||
        "@0x/utils": "^6.5.3",
 | 
			
		||||
        "@0x/web3-wrapper": "^7.6.5",
 | 
			
		||||
        "@balancer-labs/sdk": "^0.1.6",
 | 
			
		||||
        "@0x/types": "^3.3.4",
 | 
			
		||||
        "@0x/typescript-typings": "^5.2.1",
 | 
			
		||||
        "@0x/utils": "^6.5.0",
 | 
			
		||||
        "@0x/web3-wrapper": "^7.6.2",
 | 
			
		||||
        "@balancer-labs/sor": "0.3.2",
 | 
			
		||||
        "@bancor/sdk": "0.2.9",
 | 
			
		||||
        "@ethersproject/abi": "^5.0.1",
 | 
			
		||||
@@ -85,30 +84,29 @@
 | 
			
		||||
        "axios-mock-adapter": "^1.19.0",
 | 
			
		||||
        "cream-sor": "^0.3.3",
 | 
			
		||||
        "decimal.js": "^10.2.0",
 | 
			
		||||
        "ethereum-types": "^3.7.0",
 | 
			
		||||
        "ethereum-types": "^3.6.0",
 | 
			
		||||
        "ethereumjs-util": "^7.0.10",
 | 
			
		||||
        "fast-abi": "^0.0.4",
 | 
			
		||||
        "graphql": "^15.4.0",
 | 
			
		||||
        "graphql-request": "^3.4.0",
 | 
			
		||||
        "heartbeats": "^5.0.1",
 | 
			
		||||
        "lodash": "^4.17.11",
 | 
			
		||||
        "sorV2": "npm:@balancer-labs/sor"
 | 
			
		||||
        "lodash": "^4.17.11"
 | 
			
		||||
    },
 | 
			
		||||
    "devDependencies": {
 | 
			
		||||
        "@0x/abi-gen": "^5.8.0",
 | 
			
		||||
        "@0x/abi-gen": "^5.7.2",
 | 
			
		||||
        "@0x/contracts-asset-proxy": "^3.7.19",
 | 
			
		||||
        "@0x/contracts-exchange": "^3.2.38",
 | 
			
		||||
        "@0x/contracts-exchange-libs": "^4.3.37",
 | 
			
		||||
        "@0x/contracts-gen": "^2.0.46",
 | 
			
		||||
        "@0x/contracts-test-utils": "^5.4.20",
 | 
			
		||||
        "@0x/contracts-utils": "^4.8.10",
 | 
			
		||||
        "@0x/contracts-gen": "^2.0.43",
 | 
			
		||||
        "@0x/contracts-test-utils": "^5.4.18",
 | 
			
		||||
        "@0x/contracts-utils": "^4.8.8",
 | 
			
		||||
        "@0x/mesh-rpc-client": "^9.4.2",
 | 
			
		||||
        "@0x/migrations": "^8.1.18",
 | 
			
		||||
        "@0x/sol-compiler": "^4.8.1",
 | 
			
		||||
        "@0x/subproviders": "^6.6.5",
 | 
			
		||||
        "@0x/migrations": "^8.1.16",
 | 
			
		||||
        "@0x/sol-compiler": "^4.7.8",
 | 
			
		||||
        "@0x/subproviders": "^6.6.2",
 | 
			
		||||
        "@0x/ts-doc-gen": "^0.0.28",
 | 
			
		||||
        "@0x/tslint-config": "^4.1.4",
 | 
			
		||||
        "@0x/types": "^3.3.6",
 | 
			
		||||
        "@0x/types": "^3.3.4",
 | 
			
		||||
        "@types/lodash": "4.14.104",
 | 
			
		||||
        "@types/mocha": "^5.2.7",
 | 
			
		||||
        "@types/node": "12.12.54",
 | 
			
		||||
@@ -125,10 +123,11 @@
 | 
			
		||||
        "tslint": "5.11.0",
 | 
			
		||||
        "typedoc": "~0.16.11",
 | 
			
		||||
        "typemoq": "^2.1.0",
 | 
			
		||||
        "typescript": "4.6.3"
 | 
			
		||||
        "typescript": "4.2.2"
 | 
			
		||||
    },
 | 
			
		||||
    "publishConfig": {
 | 
			
		||||
        "access": "public"
 | 
			
		||||
    },
 | 
			
		||||
    "gitHead": "4f91bfd907996b2f4dd383778b50c479c2602b56"
 | 
			
		||||
    "gitHead": "4f91bfd907996b2f4dd383778b50c479c2602b56",
 | 
			
		||||
    "resolutions": {}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -42,7 +42,6 @@ import {
 | 
			
		||||
    FinalUniswapV3FillData,
 | 
			
		||||
    LiquidityProviderFillData,
 | 
			
		||||
    MooniswapFillData,
 | 
			
		||||
    NativeRfqOrderFillData,
 | 
			
		||||
    OptimizedMarketBridgeOrder,
 | 
			
		||||
    OptimizedMarketOrder,
 | 
			
		||||
    UniswapV2FillData,
 | 
			
		||||
@@ -61,7 +60,6 @@ import {
 | 
			
		||||
    isDirectSwapCompatible,
 | 
			
		||||
    isMultiplexBatchFillCompatible,
 | 
			
		||||
    isMultiplexMultiHopFillCompatible,
 | 
			
		||||
    requiresTransformERC20,
 | 
			
		||||
} from './quote_consumer_utils';
 | 
			
		||||
 | 
			
		||||
// tslint:disable-next-line:custom-no-magic-numbers
 | 
			
		||||
@@ -335,49 +333,6 @@ export class ExchangeProxySwapQuoteConsumer implements SwapQuoteConsumerBase {
 | 
			
		||||
            };
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // RFQT VIP
 | 
			
		||||
        if (
 | 
			
		||||
            [ChainId.Mainnet, ChainId.Polygon].includes(this.chainId) &&
 | 
			
		||||
            !isToETH &&
 | 
			
		||||
            !isFromETH &&
 | 
			
		||||
            quote.orders.every(o => o.type === FillQuoteTransformerOrderType.Rfq) &&
 | 
			
		||||
            !requiresTransformERC20(optsWithDefaults)
 | 
			
		||||
        ) {
 | 
			
		||||
            const rfqOrdersData = quote.orders.map(o => o.fillData as NativeRfqOrderFillData);
 | 
			
		||||
            const fillAmountPerOrder = (() => {
 | 
			
		||||
                // Don't think order taker amounts are clipped to actual sell amount
 | 
			
		||||
                // (the last one might be too large) so figure them out manually.
 | 
			
		||||
                let remaining = sellAmount;
 | 
			
		||||
                const fillAmounts = [];
 | 
			
		||||
                for (const o of quote.orders) {
 | 
			
		||||
                    const fillAmount = BigNumber.min(o.takerAmount, remaining);
 | 
			
		||||
                    fillAmounts.push(fillAmount);
 | 
			
		||||
                    remaining = remaining.minus(fillAmount);
 | 
			
		||||
                }
 | 
			
		||||
                return fillAmounts;
 | 
			
		||||
            })();
 | 
			
		||||
            const callData =
 | 
			
		||||
                quote.orders.length === 1
 | 
			
		||||
                    ? this._exchangeProxy
 | 
			
		||||
                          .fillRfqOrder(rfqOrdersData[0].order, rfqOrdersData[0].signature, fillAmountPerOrder[0])
 | 
			
		||||
                          .getABIEncodedTransactionData()
 | 
			
		||||
                    : this._exchangeProxy
 | 
			
		||||
                          .batchFillRfqOrders(
 | 
			
		||||
                              rfqOrdersData.map(d => d.order),
 | 
			
		||||
                              rfqOrdersData.map(d => d.signature),
 | 
			
		||||
                              fillAmountPerOrder,
 | 
			
		||||
                              true,
 | 
			
		||||
                          )
 | 
			
		||||
                          .getABIEncodedTransactionData();
 | 
			
		||||
            return {
 | 
			
		||||
                calldataHexString: callData,
 | 
			
		||||
                ethAmount: ZERO_AMOUNT,
 | 
			
		||||
                toAddress: this._exchangeProxy.address,
 | 
			
		||||
                allowanceTarget: this._exchangeProxy.address,
 | 
			
		||||
                gasOverhead: ZERO_AMOUNT,
 | 
			
		||||
            };
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (this.chainId === ChainId.Mainnet && isMultiplexBatchFillCompatible(quote, optsWithDefaults)) {
 | 
			
		||||
            return {
 | 
			
		||||
                calldataHexString: this._encodeMultiplexBatchFillCalldata(
 | 
			
		||||
 
 | 
			
		||||
@@ -357,7 +357,7 @@ export class SwapQuoter {
 | 
			
		||||
        if (nativeOrders.length === 0) {
 | 
			
		||||
            nativeOrders.push(createDummyOrder(makerToken, takerToken));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        //  ** Prepare options for fetching market side liquidity **
 | 
			
		||||
        // Scale fees by gas price.
 | 
			
		||||
        const cloneOpts = _.omit(opts, 'gasPrice') as GetMarketOrdersOpts;
 | 
			
		||||
@@ -519,7 +519,7 @@ function createSwapQuote(
 | 
			
		||||
        : calculateQuoteInfo(optimizedOrders, operation, assetFillAmount, gasPrice, gasSchedule, slippage);
 | 
			
		||||
 | 
			
		||||
    // Put together the swap quote
 | 
			
		||||
    const { makerTokenDecimals, takerTokenDecimals, blockNumber } = optimizerResult.marketSideLiquidity;
 | 
			
		||||
    const { makerTokenDecimals, takerTokenDecimals } = optimizerResult.marketSideLiquidity;
 | 
			
		||||
    const swapQuote = {
 | 
			
		||||
        makerToken,
 | 
			
		||||
        takerToken,
 | 
			
		||||
@@ -536,7 +536,6 @@ function createSwapQuote(
 | 
			
		||||
        extendedQuoteReportSources,
 | 
			
		||||
        isTwoHop,
 | 
			
		||||
        priceComparisonsReport,
 | 
			
		||||
        blockNumber,
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    if (operation === MarketOperation.Buy) {
 | 
			
		||||
 
 | 
			
		||||
@@ -179,7 +179,6 @@ export interface SwapQuoteBase {
 | 
			
		||||
    takerTokenDecimals: number;
 | 
			
		||||
    takerAmountPerEth: BigNumber;
 | 
			
		||||
    makerAmountPerEth: BigNumber;
 | 
			
		||||
    blockNumber: number;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 
 | 
			
		||||
@@ -62,8 +62,9 @@ import {
 | 
			
		||||
    UNISWAPV2_ROUTER_BY_CHAIN_ID,
 | 
			
		||||
    WAULTSWAP_ROUTER_BY_CHAIN_ID,
 | 
			
		||||
    XSIGMA_MAINNET_INFOS,
 | 
			
		||||
    PLATYPUS_AVALANCHE_INFOS,
 | 
			
		||||
} from './constants';
 | 
			
		||||
import { CurveInfo, ERC20BridgeSource } from './types';
 | 
			
		||||
import { CurveInfo, ERC20BridgeSource, PlatypusInfo } from './types';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Filter Kyber reserves which should not be used (0xbb bridged reserves)
 | 
			
		||||
@@ -463,6 +464,48 @@ export function getMobiusMoneyInfoForPair(chainId: ChainId, takerToken: string,
 | 
			
		||||
    );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getPlatypusInfoForPair(chainId: ChainId, takerToken: string, makerToken: string): PlatypusInfo[] {
 | 
			
		||||
    if (chainId !== ChainId.Avalanche) {
 | 
			
		||||
        return [];
 | 
			
		||||
    }
 | 
			
		||||
    let ptpPools: PlatypusInfo[] = [];
 | 
			
		||||
    const makerTokenPool = Object.values(PLATYPUS_AVALANCHE_INFOS).filter(c =>
 | 
			
		||||
        [makerToken].every(
 | 
			
		||||
            t =>
 | 
			
		||||
                c.tokens.includes(t),
 | 
			
		||||
        ),
 | 
			
		||||
    );
 | 
			
		||||
    const takerTokenPool = Object.values(PLATYPUS_AVALANCHE_INFOS).filter(c =>
 | 
			
		||||
        [takerToken].every(
 | 
			
		||||
            t =>
 | 
			
		||||
                c.tokens.includes(t),
 | 
			
		||||
        ),
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    if( makerTokenPool[0].tokens.includes(takerToken)){
 | 
			
		||||
        let pool: PlatypusInfo = {
 | 
			
		||||
            gasSchedule: makerTokenPool[0].gasSchedule,
 | 
			
		||||
            poolAddress: [makerTokenPool[0].poolAddress[0]],
 | 
			
		||||
            tokens: [makerToken,takerToken],
 | 
			
		||||
        };
 | 
			
		||||
        ptpPools.push(pool);
 | 
			
		||||
    }
 | 
			
		||||
    else{
 | 
			
		||||
        const intermediateToken = makerTokenPool[0].tokens.filter(element => takerTokenPool[0].tokens.includes(element));
 | 
			
		||||
        //return similar values from two arrays
 | 
			
		||||
 | 
			
		||||
        let pool: PlatypusInfo = {
 | 
			
		||||
            gasSchedule: makerTokenPool[0].gasSchedule + makerTokenPool[0].gasSchedule,
 | 
			
		||||
            poolAddress: [makerTokenPool[0].poolAddress[0], takerTokenPool[0].poolAddress[0]],
 | 
			
		||||
            tokens: [makerToken,intermediateToken[0],takerToken],
 | 
			
		||||
        };
 | 
			
		||||
        ptpPools.push(pool);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return ptpPools;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getShellLikeInfosForPair(
 | 
			
		||||
    chainId: ChainId,
 | 
			
		||||
    takerToken: string,
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,6 @@ import { TokenAdjacencyGraphBuilder } from '../token_adjacency_graph_builder';
 | 
			
		||||
import { SourceFilters } from './source_filters';
 | 
			
		||||
import {
 | 
			
		||||
    AaveV2FillData,
 | 
			
		||||
    BalancerV2BatchSwapFillData,
 | 
			
		||||
    BancorFillData,
 | 
			
		||||
    CompoundFillData,
 | 
			
		||||
    CurveFillData,
 | 
			
		||||
@@ -28,6 +27,8 @@ import {
 | 
			
		||||
    LiquidityProviderRegistry,
 | 
			
		||||
    MakerPsmFillData,
 | 
			
		||||
    MultiHopFillData,
 | 
			
		||||
    PlatypusFillData,
 | 
			
		||||
    PlatypusInfo,
 | 
			
		||||
    PsmInfo,
 | 
			
		||||
    TokenAdjacencyGraph,
 | 
			
		||||
    UniswapV2FillData,
 | 
			
		||||
@@ -185,6 +186,8 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
 | 
			
		||||
            ERC20BridgeSource.KyberDmm,
 | 
			
		||||
            ERC20BridgeSource.AaveV2,
 | 
			
		||||
            ERC20BridgeSource.Synapse,
 | 
			
		||||
            ERC20BridgeSource.GMX,
 | 
			
		||||
            ERC20BridgeSource.Platypus,
 | 
			
		||||
        ]),
 | 
			
		||||
        [ChainId.Fantom]: new SourceFilters([
 | 
			
		||||
            ERC20BridgeSource.MultiHop,
 | 
			
		||||
@@ -332,6 +335,8 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
 | 
			
		||||
            ERC20BridgeSource.KyberDmm,
 | 
			
		||||
            ERC20BridgeSource.AaveV2,
 | 
			
		||||
            ERC20BridgeSource.Synapse,
 | 
			
		||||
            ERC20BridgeSource.GMX,
 | 
			
		||||
            ERC20BridgeSource.Platypus,
 | 
			
		||||
        ]),
 | 
			
		||||
        [ChainId.Fantom]: new SourceFilters([
 | 
			
		||||
            ERC20BridgeSource.MultiHop,
 | 
			
		||||
@@ -483,8 +488,6 @@ export const MAINNET_TOKENS = {
 | 
			
		||||
    OHM: '0x383518188c0c6d7730d91b2c03a03c837814a899',
 | 
			
		||||
    OHMV2: '0x64aa3364f17a4d01c6f1751fd97c2bd3d7e7f1d5',
 | 
			
		||||
    BTRFLY: '0xc0d4ceb216b3ba9c3701b291766fdcba977cec3a',
 | 
			
		||||
    // Stargate
 | 
			
		||||
    STG: '0xaf5191b0de278c7286d6c7cc6ab6bb8a73ba2cd6',
 | 
			
		||||
    //
 | 
			
		||||
    LUSD: '0x5f98805a4e8be255a32880fdec7f6728c6568ba0',
 | 
			
		||||
    // Fei Ecosystem
 | 
			
		||||
@@ -554,6 +557,7 @@ export const AVALANCHE_TOKENS = {
 | 
			
		||||
    // native USDC on Avalanche
 | 
			
		||||
    nUSDC: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e',
 | 
			
		||||
    USDT: '0xc7198437980c041c805a1edcba50c1ce5db95118',
 | 
			
		||||
    USDt: '0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7',
 | 
			
		||||
    aDAI: '0x47afa96cdc9fab46904a55a6ad4bf6660b53c38a',
 | 
			
		||||
    aUSDC: '0x46a51127c3ce23fb7ab1de06226147f446e4a857',
 | 
			
		||||
    aUSDT: '0x532e6537fea298397212f09a61e03311686f548e',
 | 
			
		||||
@@ -561,6 +565,10 @@ export const AVALANCHE_TOKENS = {
 | 
			
		||||
    nUSD: '0xcfc37a6ab183dd4aed08c204d1c2773c0b1bdf46',
 | 
			
		||||
    aWETH: '0x53f7c5869a859f0aec3d334ee8b4cf01e3492f21',
 | 
			
		||||
    MIM: '0x130966628846bfd36ff31a822705796e8cb8c18d',
 | 
			
		||||
    sAVAX: '0x2b2c81e08f1af8835a78bb2a90ae924ace0ea4be',
 | 
			
		||||
    UST: '0xb599c3590f42f8f995ecfa0f85d2980b76862fc1',
 | 
			
		||||
    FRAX: '0xd24c2ad096400b6fbcd2ad8b24e7acbc21a1da64',
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const CELO_TOKENS = {
 | 
			
		||||
@@ -670,7 +678,6 @@ export const CURVE_POOLS = {
 | 
			
		||||
    ib: '0x2dded6da1bf5dbdf597c45fcfaa3194e53ecfeaf', // iron bank
 | 
			
		||||
    link: '0xf178c0b5bb7e7abf4e12a4838c7b7c5ba2c623c0', // link
 | 
			
		||||
    btrflyweth: '0xf43b15ab692fde1f9c24a9fce700adcc809d5391', // redacted cartel
 | 
			
		||||
    stgusdc: '0x3211c6cbef1429da3d0d58494938299c92ad5860', // stargate
 | 
			
		||||
    // StableSwap "open pools" (crv.finance)
 | 
			
		||||
    TUSD: '0xecd5e75afb02efa118af914515d6521aabd189f1',
 | 
			
		||||
    STABLEx: '0x3252efd4ea2d6c78091a1f43982ee2c3659cc3d1',
 | 
			
		||||
@@ -837,6 +844,14 @@ export const ACRYPTOS_POOLS = {
 | 
			
		||||
    acs3btc: '0xbe7caa236544d1b9a0e7f91e94b9f5bfd3b5ca81',
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const PLATYPUS_AVALANCHE_POOLS = {
 | 
			
		||||
    usd: '0x66357dcace80431aee0a7507e2e361b7e2402370',
 | 
			
		||||
    ust: '0xe0d166de15665bc4b7185b2e35e847e51316e126',
 | 
			
		||||
    frax: '0xb8e567fc23c39c94a1f6359509d7b43d1fbed824',
 | 
			
		||||
    mim: '0x30c30d826be87cd0a4b90855c2f38f7fcfe4eaa7',
 | 
			
		||||
    sAVAX: '0x4658ea7e9960d6158a261104aaa160cc953bb6ba',
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID = valueByChainId<string[]>(
 | 
			
		||||
    {
 | 
			
		||||
        [ChainId.Mainnet]: [
 | 
			
		||||
@@ -1354,11 +1369,6 @@ export const CURVE_MAINNET_INFOS: { [name: string]: CurveInfo } = {
 | 
			
		||||
        pool: CURVE_POOLS.wethyfi,
 | 
			
		||||
        gasSchedule: 250e3,
 | 
			
		||||
    }),
 | 
			
		||||
    [CURVE_POOLS.stgusdc]: createCurveFactoryCryptoExchangePool({
 | 
			
		||||
        tokens: [MAINNET_TOKENS.STG, MAINNET_TOKENS.USDC],
 | 
			
		||||
        pool: CURVE_POOLS.stgusdc,
 | 
			
		||||
        gasSchedule: 250e3,
 | 
			
		||||
    }),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const CURVE_V2_MAINNET_INFOS: { [name: string]: CurveInfo } = {
 | 
			
		||||
@@ -1825,6 +1835,34 @@ export const ACRYPTOS_BSC_INFOS: { [name: string]: CurveInfo } = {
 | 
			
		||||
    }),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const PLATYPUS_AVALANCHE_INFOS: { [name: string]: PlatypusInfo } = {
 | 
			
		||||
    [PLATYPUS_AVALANCHE_POOLS.usd]: {
 | 
			
		||||
        poolAddress: [PLATYPUS_AVALANCHE_POOLS.usd],
 | 
			
		||||
        tokens: [AVALANCHE_TOKENS.USDT, AVALANCHE_TOKENS.USDC, AVALANCHE_TOKENS.DAI, AVALANCHE_TOKENS.nUSDC, AVALANCHE_TOKENS.USDt],
 | 
			
		||||
        gasSchedule: 350e3,
 | 
			
		||||
    },
 | 
			
		||||
    [PLATYPUS_AVALANCHE_POOLS.ust]: {
 | 
			
		||||
        poolAddress: [PLATYPUS_AVALANCHE_POOLS.ust],
 | 
			
		||||
        tokens: [AVALANCHE_TOKENS.nUSDC, AVALANCHE_TOKENS.UST],
 | 
			
		||||
        gasSchedule: 350e3,
 | 
			
		||||
    },
 | 
			
		||||
    [PLATYPUS_AVALANCHE_POOLS.frax]: {
 | 
			
		||||
        poolAddress: [PLATYPUS_AVALANCHE_POOLS.frax],
 | 
			
		||||
        tokens: [AVALANCHE_TOKENS.nUSDC, AVALANCHE_TOKENS.FRAX], //liq issues
 | 
			
		||||
        gasSchedule: 350e3,
 | 
			
		||||
    },
 | 
			
		||||
    [PLATYPUS_AVALANCHE_POOLS.mim]: {
 | 
			
		||||
        poolAddress: [PLATYPUS_AVALANCHE_POOLS.mim],
 | 
			
		||||
        tokens: [AVALANCHE_TOKENS.MIM, AVALANCHE_TOKENS.nUSDC],
 | 
			
		||||
        gasSchedule: 350e3,
 | 
			
		||||
    },
 | 
			
		||||
    [PLATYPUS_AVALANCHE_POOLS.sAVAX]: {
 | 
			
		||||
        poolAddress: [PLATYPUS_AVALANCHE_POOLS.sAVAX],
 | 
			
		||||
        tokens: [AVALANCHE_TOKENS.WAVAX, AVALANCHE_TOKENS.sAVAX], //add unwrapping
 | 
			
		||||
        gasSchedule: 350e3,
 | 
			
		||||
    },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Kyber reserve prefixes
 | 
			
		||||
 * 0xff Fed price reserve
 | 
			
		||||
@@ -2157,12 +2195,11 @@ export const BALANCER_SUBGRAPH_URL = 'https://api.thegraph.com/subgraphs/name/ba
 | 
			
		||||
export const BALANCER_TOP_POOLS_FETCHED = 250;
 | 
			
		||||
export const BALANCER_MAX_POOLS_FETCHED = 3;
 | 
			
		||||
 | 
			
		||||
export const BALANCER_V2_SUBGRAPH_URL_BY_CHAIN = valueByChainId(
 | 
			
		||||
export const BALANCER_V2_SUBGRAPH_URL_BY_CHAIN = valueByChainId<string>(
 | 
			
		||||
    {
 | 
			
		||||
        [ChainId.Mainnet]: 'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-v2',
 | 
			
		||||
        [ChainId.Polygon]: 'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-polygon-v2',
 | 
			
		||||
    },
 | 
			
		||||
    null,
 | 
			
		||||
    'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-v2',
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
export const BEETHOVEN_X_SUBGRAPH_URL_BY_CHAIN = valueByChainId<string>(
 | 
			
		||||
@@ -2354,6 +2391,33 @@ export const SPOOKYSWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
 | 
			
		||||
    },
 | 
			
		||||
    NULL_ADDRESS,
 | 
			
		||||
);
 | 
			
		||||
export const GMX_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
 | 
			
		||||
    {
 | 
			
		||||
        [ChainId.Avalanche]: '0x5f719c2f1095f7b9fc68a68e35b51194f4b6abe8',
 | 
			
		||||
    },
 | 
			
		||||
    NULL_ADDRESS,
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
export const GMX_READER_BY_CHAIN_ID = valueByChainId<string>(
 | 
			
		||||
    {
 | 
			
		||||
        [ChainId.Avalanche]: '0x67b789d48c926006f5132bfce4e976f0a7a63d5d',
 | 
			
		||||
    },
 | 
			
		||||
    NULL_ADDRESS,
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
export const GMX_VAULT_BY_CHAIN_ID = valueByChainId<string>(
 | 
			
		||||
    {
 | 
			
		||||
        [ChainId.Avalanche]: '0x9ab2de34a33fb459b538c43f251eb825645e8595',
 | 
			
		||||
    },
 | 
			
		||||
    NULL_ADDRESS,
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
export const PLATYPUS_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
 | 
			
		||||
    {
 | 
			
		||||
        [ChainId.Avalanche]: '0x73256ec7575d999c360c1eec118ecbefd8da7d12',
 | 
			
		||||
    },
 | 
			
		||||
    NULL_ADDRESS,
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
export const VIP_ERC20_BRIDGE_SOURCES_BY_CHAIN_ID = valueByChainId<ERC20BridgeSource[]>(
 | 
			
		||||
    {
 | 
			
		||||
@@ -2435,9 +2499,7 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
 | 
			
		||||
    [ERC20BridgeSource.Linkswap]: uniswapV2CloneGasSchedule,
 | 
			
		||||
    [ERC20BridgeSource.ShibaSwap]: uniswapV2CloneGasSchedule,
 | 
			
		||||
    [ERC20BridgeSource.Balancer]: () => 120e3,
 | 
			
		||||
    [ERC20BridgeSource.BalancerV2]: (fillData?: FillData) => {
 | 
			
		||||
        return 100e3 + ((fillData as BalancerV2BatchSwapFillData).swapSteps.length - 1) * 50e3;
 | 
			
		||||
    },
 | 
			
		||||
    [ERC20BridgeSource.BalancerV2]: () => 100e3,
 | 
			
		||||
    [ERC20BridgeSource.Cream]: () => 120e3,
 | 
			
		||||
    [ERC20BridgeSource.MStable]: () => 200e3,
 | 
			
		||||
    [ERC20BridgeSource.MakerPsm]: (fillData?: FillData) => {
 | 
			
		||||
@@ -2560,6 +2622,8 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
 | 
			
		||||
    //
 | 
			
		||||
    [ERC20BridgeSource.Pangolin]: uniswapV2CloneGasSchedule,
 | 
			
		||||
    [ERC20BridgeSource.TraderJoe]: uniswapV2CloneGasSchedule,
 | 
			
		||||
    [ERC20BridgeSource.GMX]: () => 450e3,
 | 
			
		||||
    [ERC20BridgeSource.Platypus]: () => 450e3,
 | 
			
		||||
 | 
			
		||||
    //
 | 
			
		||||
    // Celo
 | 
			
		||||
 
 | 
			
		||||
@@ -241,7 +241,6 @@ export class MarketOperationUtils {
 | 
			
		||||
                dexQuotes,
 | 
			
		||||
            },
 | 
			
		||||
            isRfqSupported,
 | 
			
		||||
            blockNumber: blockNumber.toNumber(),
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -270,7 +269,6 @@ export class MarketOperationUtils {
 | 
			
		||||
 | 
			
		||||
        // Call the sampler contract.
 | 
			
		||||
        const samplerPromise = this._sampler.executeAsync(
 | 
			
		||||
            this._sampler.getBlockNumber(),
 | 
			
		||||
            this._sampler.getTokenDecimals([makerToken, takerToken]),
 | 
			
		||||
            // Get native order fillable amounts.
 | 
			
		||||
            this._sampler.getLimitOrderFillableMakerAmounts(nativeOrders, this.contractAddresses.exchangeProxy),
 | 
			
		||||
@@ -304,7 +302,6 @@ export class MarketOperationUtils {
 | 
			
		||||
 | 
			
		||||
        const [
 | 
			
		||||
            [
 | 
			
		||||
                blockNumber,
 | 
			
		||||
                tokenDecimals,
 | 
			
		||||
                orderFillableMakerAmounts,
 | 
			
		||||
                ethToMakerAssetRate,
 | 
			
		||||
@@ -345,7 +342,6 @@ export class MarketOperationUtils {
 | 
			
		||||
                dexQuotes,
 | 
			
		||||
            },
 | 
			
		||||
            isRfqSupported,
 | 
			
		||||
            blockNumber: blockNumber.toNumber(),
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -376,7 +372,6 @@ export class MarketOperationUtils {
 | 
			
		||||
        const feeSourceFilters = this._feeSources.exclude(_opts.excludedFeeSources);
 | 
			
		||||
 | 
			
		||||
        const ops = [
 | 
			
		||||
            this._sampler.getBlockNumber(),
 | 
			
		||||
            ...batchNativeOrders.map(orders =>
 | 
			
		||||
                this._sampler.getLimitOrderFillableMakerAmounts(orders, this.contractAddresses.exchangeProxy),
 | 
			
		||||
            ),
 | 
			
		||||
@@ -401,15 +396,13 @@ export class MarketOperationUtils {
 | 
			
		||||
            ),
 | 
			
		||||
        ];
 | 
			
		||||
 | 
			
		||||
        const [blockNumberRaw, ...executeResults] = await this._sampler.executeBatchAsync(ops);
 | 
			
		||||
        const executeResults = await this._sampler.executeBatchAsync(ops);
 | 
			
		||||
        const batchOrderFillableMakerAmounts = executeResults.splice(0, batchNativeOrders.length) as BigNumber[][];
 | 
			
		||||
        const batchEthToTakerAssetRate = executeResults.splice(0, batchNativeOrders.length) as BigNumber[];
 | 
			
		||||
        const batchDexQuotes = executeResults.splice(0, batchNativeOrders.length) as DexSample[][][];
 | 
			
		||||
        const batchTokenDecimals = executeResults.splice(0, batchNativeOrders.length) as number[][];
 | 
			
		||||
        const inputAmountPerEth = ZERO_AMOUNT;
 | 
			
		||||
 | 
			
		||||
        const blockNumber: number = (blockNumberRaw as BigNumber).toNumber();
 | 
			
		||||
 | 
			
		||||
        return Promise.all(
 | 
			
		||||
            batchNativeOrders.map(async (nativeOrders, i) => {
 | 
			
		||||
                if (nativeOrders.length === 0) {
 | 
			
		||||
@@ -442,7 +435,6 @@ export class MarketOperationUtils {
 | 
			
		||||
                                twoHopQuotes: [],
 | 
			
		||||
                            },
 | 
			
		||||
                            isRfqSupported: false,
 | 
			
		||||
                            blockNumber,
 | 
			
		||||
                        },
 | 
			
		||||
                        {
 | 
			
		||||
                            bridgeSlippage: _opts.bridgeSlippage,
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,6 @@ import {
 | 
			
		||||
    AaveV2FillData,
 | 
			
		||||
    AggregationError,
 | 
			
		||||
    BalancerFillData,
 | 
			
		||||
    BalancerV2BatchSwapFillData,
 | 
			
		||||
    BalancerV2FillData,
 | 
			
		||||
    BancorFillData,
 | 
			
		||||
    CollapsedFill,
 | 
			
		||||
@@ -21,6 +20,7 @@ import {
 | 
			
		||||
    FinalUniswapV3FillData,
 | 
			
		||||
    GeistFillData,
 | 
			
		||||
    GenericRouterFillData,
 | 
			
		||||
    GMXFillData,
 | 
			
		||||
    KyberDmmFillData,
 | 
			
		||||
    KyberFillData,
 | 
			
		||||
    LidoFillData,
 | 
			
		||||
@@ -35,6 +35,7 @@ import {
 | 
			
		||||
    OptimizedMarketOrder,
 | 
			
		||||
    OptimizedMarketOrderBase,
 | 
			
		||||
    OrderDomain,
 | 
			
		||||
    PlatypusFillData,
 | 
			
		||||
    ShellFillData,
 | 
			
		||||
    UniswapV2FillData,
 | 
			
		||||
    UniswapV3FillData,
 | 
			
		||||
@@ -87,7 +88,7 @@ export function getErc20BridgeSourceToBridgeSource(source: ERC20BridgeSource): s
 | 
			
		||||
        case ERC20BridgeSource.Balancer:
 | 
			
		||||
            return encodeBridgeSourceId(BridgeProtocol.Balancer, 'Balancer');
 | 
			
		||||
        case ERC20BridgeSource.BalancerV2:
 | 
			
		||||
            return encodeBridgeSourceId(BridgeProtocol.BalancerV2Batch, 'BalancerV2');
 | 
			
		||||
            return encodeBridgeSourceId(BridgeProtocol.BalancerV2, 'BalancerV2');
 | 
			
		||||
        case ERC20BridgeSource.Bancor:
 | 
			
		||||
            return encodeBridgeSourceId(BridgeProtocol.Bancor, 'Bancor');
 | 
			
		||||
        // case ERC20BridgeSource.CoFiX:
 | 
			
		||||
@@ -209,6 +210,10 @@ export function getErc20BridgeSourceToBridgeSource(source: ERC20BridgeSource): s
 | 
			
		||||
            return encodeBridgeSourceId(BridgeProtocol.AaveV2, 'Geist');
 | 
			
		||||
        case ERC20BridgeSource.MobiusMoney:
 | 
			
		||||
            return encodeBridgeSourceId(BridgeProtocol.Nerve, 'MobiusMoney');
 | 
			
		||||
        case ERC20BridgeSource.GMX:
 | 
			
		||||
            return encodeBridgeSourceId(BridgeProtocol.GMX, 'GMX');
 | 
			
		||||
        case ERC20BridgeSource.Platypus:
 | 
			
		||||
            return encodeBridgeSourceId(BridgeProtocol.Platypus, 'Platypus');
 | 
			
		||||
        default:
 | 
			
		||||
            throw new Error(AggregationError.NoBridgeForSource);
 | 
			
		||||
    }
 | 
			
		||||
@@ -259,18 +264,9 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder
 | 
			
		||||
            bridgeData = encoder.encode([balancerFillData.poolAddress]);
 | 
			
		||||
            break;
 | 
			
		||||
        case ERC20BridgeSource.BalancerV2:
 | 
			
		||||
            {
 | 
			
		||||
                const balancerV2FillData = (order as OptimizedMarketBridgeOrder<BalancerV2BatchSwapFillData>).fillData;
 | 
			
		||||
                bridgeData = encoder.encode([
 | 
			
		||||
                    balancerV2FillData.vault,
 | 
			
		||||
                    balancerV2FillData.swapSteps,
 | 
			
		||||
                    balancerV2FillData.assets,
 | 
			
		||||
                ]);
 | 
			
		||||
            }
 | 
			
		||||
            break;
 | 
			
		||||
        case ERC20BridgeSource.Beethovenx:
 | 
			
		||||
            const beethovenFillData = (order as OptimizedMarketBridgeOrder<BalancerV2FillData>).fillData;
 | 
			
		||||
            const { vault, poolId } = beethovenFillData;
 | 
			
		||||
            const balancerV2FillData = (order as OptimizedMarketBridgeOrder<BalancerV2FillData>).fillData;
 | 
			
		||||
            const { vault, poolId } = balancerV2FillData;
 | 
			
		||||
            bridgeData = encoder.encode([vault, poolId]);
 | 
			
		||||
            break;
 | 
			
		||||
        case ERC20BridgeSource.Bancor:
 | 
			
		||||
@@ -377,6 +373,23 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder
 | 
			
		||||
            const geistFillData = (order as OptimizedMarketBridgeOrder<GeistFillData>).fillData;
 | 
			
		||||
            bridgeData = encoder.encode([geistFillData.lendingPool, geistFillData.gToken]);
 | 
			
		||||
            break;
 | 
			
		||||
        case ERC20BridgeSource.GMX:
 | 
			
		||||
            const gmxFillData = (order as OptimizedMarketBridgeOrder<GMXFillData>).fillData;
 | 
			
		||||
            bridgeData = encoder.encode([
 | 
			
		||||
                gmxFillData.router,
 | 
			
		||||
                gmxFillData.reader,
 | 
			
		||||
                gmxFillData.vault,
 | 
			
		||||
                gmxFillData.tokenAddressPath,
 | 
			
		||||
            ]);
 | 
			
		||||
            break;
 | 
			
		||||
        case ERC20BridgeSource.Platypus:
 | 
			
		||||
            const platypusFillData = (order as OptimizedMarketBridgeOrder<PlatypusFillData>).fillData;
 | 
			
		||||
            bridgeData = encoder.encode([
 | 
			
		||||
                platypusFillData.router,
 | 
			
		||||
                platypusFillData.pool,
 | 
			
		||||
                platypusFillData.tokenAddressPath,
 | 
			
		||||
            ]);
 | 
			
		||||
            break;
 | 
			
		||||
 | 
			
		||||
        default:
 | 
			
		||||
            throw new Error(AggregationError.NoBridgeForSource);
 | 
			
		||||
@@ -462,6 +475,8 @@ const balancerV2Encoder = AbiEncoder.create([
 | 
			
		||||
    { name: 'poolId', type: 'bytes32' },
 | 
			
		||||
]);
 | 
			
		||||
const routerAddressPathEncoder = AbiEncoder.create('(address,address[])');
 | 
			
		||||
const gmxAddressPathEncoder = AbiEncoder.create('(address,address,address,address[])');
 | 
			
		||||
const platypusAddressPathEncoder = AbiEncoder.create('(address,address[],address[])');
 | 
			
		||||
const tokenAddressEncoder = AbiEncoder.create([{ name: 'tokenAddress', type: 'address' }]);
 | 
			
		||||
 | 
			
		||||
export const BRIDGE_ENCODERS: {
 | 
			
		||||
@@ -515,6 +530,9 @@ export const BRIDGE_ENCODERS: {
 | 
			
		||||
    [ERC20BridgeSource.SpiritSwap]: routerAddressPathEncoder,
 | 
			
		||||
    [ERC20BridgeSource.SpookySwap]: routerAddressPathEncoder,
 | 
			
		||||
    [ERC20BridgeSource.MorpheusSwap]: routerAddressPathEncoder,
 | 
			
		||||
    // Avalanche
 | 
			
		||||
    [ERC20BridgeSource.GMX]: gmxAddressPathEncoder,
 | 
			
		||||
    [ERC20BridgeSource.Platypus]: platypusAddressPathEncoder,
 | 
			
		||||
    // Celo
 | 
			
		||||
    [ERC20BridgeSource.UbeSwap]: routerAddressPathEncoder,
 | 
			
		||||
    // BSC
 | 
			
		||||
@@ -543,21 +561,7 @@ export const BRIDGE_ENCODERS: {
 | 
			
		||||
    [ERC20BridgeSource.Uniswap]: poolEncoder,
 | 
			
		||||
    // Custom integrations
 | 
			
		||||
    [ERC20BridgeSource.MakerPsm]: makerPsmEncoder,
 | 
			
		||||
    [ERC20BridgeSource.BalancerV2]: AbiEncoder.create([
 | 
			
		||||
        { name: 'vault', type: 'address' },
 | 
			
		||||
        {
 | 
			
		||||
            name: 'swapSteps',
 | 
			
		||||
            type: 'tuple[]',
 | 
			
		||||
            components: [
 | 
			
		||||
                { name: 'poolId', type: 'bytes32' },
 | 
			
		||||
                { name: 'assetInIndex', type: 'uint256' },
 | 
			
		||||
                { name: 'assetOutIndex', type: 'uint256' },
 | 
			
		||||
                { name: 'amount', type: 'uint256' },
 | 
			
		||||
                { name: 'userData', type: 'bytes' },
 | 
			
		||||
            ],
 | 
			
		||||
        },
 | 
			
		||||
        { name: 'assets', type: 'address[]' },
 | 
			
		||||
    ]),
 | 
			
		||||
    [ERC20BridgeSource.BalancerV2]: balancerV2Encoder,
 | 
			
		||||
    [ERC20BridgeSource.Beethovenx]: balancerV2Encoder,
 | 
			
		||||
    [ERC20BridgeSource.UniswapV3]: AbiEncoder.create([
 | 
			
		||||
        { name: 'router', type: 'address' },
 | 
			
		||||
 
 | 
			
		||||
@@ -227,9 +227,8 @@ function findRoutesAndCreateOptimalPath(
 | 
			
		||||
        const sourcePathId = hexUtils.random();
 | 
			
		||||
        const singleSourceSamplesWithOutput = [...singleSourceSamples];
 | 
			
		||||
        for (let i = singleSourceSamples.length - 1; i >= 0; i--) {
 | 
			
		||||
            const currentOutput = singleSourceSamples[i].output;
 | 
			
		||||
            if (currentOutput.isZero() || !currentOutput.isFinite()) {
 | 
			
		||||
                // Remove trailing 0/invalid output samples
 | 
			
		||||
            if (singleSourceSamples[i].output.isZero()) {
 | 
			
		||||
                // Remove trailing 0 output samples
 | 
			
		||||
                singleSourceSamplesWithOutput.pop();
 | 
			
		||||
            } else {
 | 
			
		||||
                break;
 | 
			
		||||
 
 | 
			
		||||
@@ -51,7 +51,7 @@ export class BalancerV2PoolsCache extends PoolsCache {
 | 
			
		||||
 | 
			
		||||
    constructor(
 | 
			
		||||
        chainId: ChainId,
 | 
			
		||||
        private readonly subgraphUrl: string = BALANCER_V2_SUBGRAPH_URL_BY_CHAIN[chainId]!,
 | 
			
		||||
        private readonly subgraphUrl: string = BALANCER_V2_SUBGRAPH_URL_BY_CHAIN[chainId],
 | 
			
		||||
        private readonly maxPoolsFetched: number = BALANCER_MAX_POOLS_FETCHED,
 | 
			
		||||
        private readonly _topPoolsFetched: number = BALANCER_TOP_POOLS_FETCHED,
 | 
			
		||||
        private readonly _warningLogger: LogFunction = DEFAULT_WARNING_LOGGER,
 | 
			
		||||
 
 | 
			
		||||
@@ -1,190 +0,0 @@
 | 
			
		||||
import { ChainId } from '@0x/contract-addresses';
 | 
			
		||||
import { BigNumber } from '@0x/utils';
 | 
			
		||||
import {
 | 
			
		||||
    BalancerSDK,
 | 
			
		||||
    BalancerSdkConfig,
 | 
			
		||||
    formatSequence,
 | 
			
		||||
    getTokenAddressesForSwap,
 | 
			
		||||
    NewPath,
 | 
			
		||||
    parseToPoolsDict,
 | 
			
		||||
    PoolDictionary,
 | 
			
		||||
    RouteProposer,
 | 
			
		||||
    SwapTypes,
 | 
			
		||||
} from '@balancer-labs/sdk';
 | 
			
		||||
 | 
			
		||||
import { DEFAULT_WARNING_LOGGER } from '../../../constants';
 | 
			
		||||
import { LogFunction } from '../../../types';
 | 
			
		||||
import { BALANCER_V2_SUBGRAPH_URL_BY_CHAIN, ONE_SECOND_MS } from '../constants';
 | 
			
		||||
import { BalancerSwapInfo, BalancerSwaps } from '../types';
 | 
			
		||||
 | 
			
		||||
import { CacheValue, EMPTY_BALANCER_SWAPS, SwapInfoCache } from './pair_swaps_cache';
 | 
			
		||||
import { SubgraphPoolDataService } from './sgPoolDataService';
 | 
			
		||||
 | 
			
		||||
// tslint:disable-next-line:custom-no-magic-numbers
 | 
			
		||||
const ONE_DAY_MS = 24 * 60 * 60 * ONE_SECOND_MS;
 | 
			
		||||
 | 
			
		||||
export interface BalancerPoolResponse {
 | 
			
		||||
    poolType: string;
 | 
			
		||||
    id: string;
 | 
			
		||||
    tokens: Array<{ address: string }>;
 | 
			
		||||
    tokensList: string[];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export class BalancerV2SwapInfoCache extends SwapInfoCache {
 | 
			
		||||
    private static readonly _MAX_POOLS_PER_PATH = 4;
 | 
			
		||||
    private static readonly _MAX_CANDIDATE_PATHS_PER_PAIR = 2;
 | 
			
		||||
    private readonly _routeProposer: RouteProposer;
 | 
			
		||||
    private readonly _poolDataService: SubgraphPoolDataService;
 | 
			
		||||
 | 
			
		||||
    constructor(
 | 
			
		||||
        chainId: ChainId,
 | 
			
		||||
        subgraphUrl: string | null = BALANCER_V2_SUBGRAPH_URL_BY_CHAIN[chainId],
 | 
			
		||||
        private readonly _warningLogger: LogFunction = DEFAULT_WARNING_LOGGER,
 | 
			
		||||
        cache: { [key: string]: CacheValue } = {},
 | 
			
		||||
    ) {
 | 
			
		||||
        super(cache);
 | 
			
		||||
        const config: BalancerSdkConfig = {
 | 
			
		||||
            network: chainId as number, // wtf TS
 | 
			
		||||
            rpcUrl: '', // Not actually used by SDK for this.
 | 
			
		||||
        };
 | 
			
		||||
        const balancerSdk = new BalancerSDK(config);
 | 
			
		||||
        // The RouteProposer finds paths between a token pair using direct/multihop/linearPool routes
 | 
			
		||||
        this._routeProposer = balancerSdk.sor.routeProposer;
 | 
			
		||||
        // Uses Subgraph to retrieve up to date pool data required for routeProposer
 | 
			
		||||
        this._poolDataService = new SubgraphPoolDataService({
 | 
			
		||||
            chainId,
 | 
			
		||||
            subgraphUrl,
 | 
			
		||||
        });
 | 
			
		||||
        void this._loadTopPoolsAsync();
 | 
			
		||||
        // Reload the top pools every 12 hours
 | 
			
		||||
        setInterval(async () => void this._loadTopPoolsAsync(), ONE_DAY_MS / 2);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected async _loadTopPoolsAsync(): Promise<void> {
 | 
			
		||||
        const fromToSwapInfo: {
 | 
			
		||||
            [from: string]: { [to: string]: BalancerSwaps };
 | 
			
		||||
        } = {};
 | 
			
		||||
 | 
			
		||||
        // Retrieve pool data from Subgraph
 | 
			
		||||
        const pools = await this._poolDataService.getPools();
 | 
			
		||||
        // timestamp is used for Element pools
 | 
			
		||||
        const timestamp = Math.floor(Date.now() / ONE_SECOND_MS);
 | 
			
		||||
        const poolsDict = parseToPoolsDict(pools, timestamp);
 | 
			
		||||
 | 
			
		||||
        for (const pool of pools) {
 | 
			
		||||
            const { tokensList } = pool;
 | 
			
		||||
            // tslint:disable-next-line: await-promise
 | 
			
		||||
            await null; // This loop can be CPU heavy so yield to event loop.
 | 
			
		||||
            for (const from of tokensList) {
 | 
			
		||||
                for (const to of tokensList.filter(t => t.toLowerCase() !== from.toLowerCase())) {
 | 
			
		||||
                    fromToSwapInfo[from] = fromToSwapInfo[from] || {};
 | 
			
		||||
                    // If a record for pair already exists skip as all paths alreay found
 | 
			
		||||
                    if (fromToSwapInfo[from][to]) {
 | 
			
		||||
                        continue;
 | 
			
		||||
                    } else {
 | 
			
		||||
                        try {
 | 
			
		||||
                            const expiresAt = Date.now() + this._cacheTimeMs;
 | 
			
		||||
                            // Retrieve swap steps and assets for a token pair
 | 
			
		||||
                            // This only needs to be called once per pair as all paths will be created from single call
 | 
			
		||||
                            const pairSwapInfo = this._getPoolPairSwapInfo(poolsDict, from, to);
 | 
			
		||||
                            fromToSwapInfo[from][to] = pairSwapInfo;
 | 
			
		||||
                            this._cacheSwapInfoForPair(from, to, fromToSwapInfo[from][to], expiresAt);
 | 
			
		||||
                        } catch (err) {
 | 
			
		||||
                            this._warningLogger(err, `Failed to load Balancer V2 top pools`);
 | 
			
		||||
                            // soldier on
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Will retrieve fresh pair and path data from Subgraph and return and array of swap info for pair..
 | 
			
		||||
     * @param takerToken Address of takerToken.
 | 
			
		||||
     * @param makerToken Address of makerToken.
 | 
			
		||||
     * @returns Swap data for pair consisting of assets and swap steps for ExactIn and ExactOut swap types.
 | 
			
		||||
     */
 | 
			
		||||
    protected async _fetchSwapInfoForPairAsync(takerToken: string, makerToken: string): Promise<BalancerSwaps> {
 | 
			
		||||
        try {
 | 
			
		||||
            // retrieve up to date pools from SG
 | 
			
		||||
            const pools = await this._poolDataService.getPools();
 | 
			
		||||
 | 
			
		||||
            // timestamp is used for Element pools
 | 
			
		||||
            const timestamp = Math.floor(Date.now() / ONE_SECOND_MS);
 | 
			
		||||
            const poolDictionary = parseToPoolsDict(pools, timestamp);
 | 
			
		||||
            return this._getPoolPairSwapInfo(poolDictionary, takerToken, makerToken);
 | 
			
		||||
        } catch (e) {
 | 
			
		||||
            return EMPTY_BALANCER_SWAPS;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Uses pool data from provided dictionary to find top swap paths for token pair.
 | 
			
		||||
     * @param pools Dictionary of pool data.
 | 
			
		||||
     * @param takerToken Address of taker token.
 | 
			
		||||
     * @param makerToken Address of maker token.
 | 
			
		||||
     * @returns Swap data for pair consisting of assets and swap steps for ExactIn and ExactOut swap types.
 | 
			
		||||
     */
 | 
			
		||||
    private _getPoolPairSwapInfo(pools: PoolDictionary, takerToken: string, makerToken: string): BalancerSwaps {
 | 
			
		||||
        /*
 | 
			
		||||
        Uses Balancer SDK to construct available paths for pair.
 | 
			
		||||
        Paths can be direct, i.e. both tokens are in same pool or multihop.
 | 
			
		||||
        Will also create paths for the new Balancer Linear pools.
 | 
			
		||||
        These are returned in order of available liquidity which is useful for filtering.
 | 
			
		||||
        */
 | 
			
		||||
        const paths = this._routeProposer.getCandidatePathsFromDict(
 | 
			
		||||
            takerToken,
 | 
			
		||||
            makerToken,
 | 
			
		||||
            SwapTypes.SwapExactIn,
 | 
			
		||||
            pools,
 | 
			
		||||
            BalancerV2SwapInfoCache._MAX_POOLS_PER_PATH,
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        if (paths.length === 0) {
 | 
			
		||||
            return EMPTY_BALANCER_SWAPS;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Convert paths data to swap information suitable for queryBatchSwap. Only use top 2 liquid paths
 | 
			
		||||
        return formatSwaps(paths.slice(0, BalancerV2SwapInfoCache._MAX_CANDIDATE_PATHS_PER_PAIR));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Given an array of Balancer paths, returns swap information that can be passed to queryBatchSwap.
 | 
			
		||||
 * @param paths Array of Balancer paths.
 | 
			
		||||
 * @returns Formatted swap data consisting of assets and swap steps for ExactIn and ExactOut swap types.
 | 
			
		||||
 */
 | 
			
		||||
function formatSwaps(paths: NewPath[]): BalancerSwaps {
 | 
			
		||||
    const formattedSwapsExactIn: BalancerSwapInfo[] = [];
 | 
			
		||||
    const formattedSwapsExactOut: BalancerSwapInfo[] = [];
 | 
			
		||||
    let assets: string[];
 | 
			
		||||
    paths.forEach(path => {
 | 
			
		||||
        // Add a swap amount for each swap so we can use formatSequence. (This will be overwritten with actual amount during query)
 | 
			
		||||
        path.swaps.forEach(s => (s.swapAmount = '0'));
 | 
			
		||||
        const tokenAddresses = getTokenAddressesForSwap(path.swaps);
 | 
			
		||||
        // Formats for both ExactIn and ExactOut swap types
 | 
			
		||||
        const swapsExactIn = formatSequence(SwapTypes.SwapExactIn, path.swaps, tokenAddresses);
 | 
			
		||||
        const swapsExactOut = formatSequence(SwapTypes.SwapExactOut, path.swaps, tokenAddresses);
 | 
			
		||||
        assets = tokenAddresses;
 | 
			
		||||
        formattedSwapsExactIn.push({
 | 
			
		||||
            assets,
 | 
			
		||||
            swapSteps: swapsExactIn.map(s => ({
 | 
			
		||||
                ...s,
 | 
			
		||||
                amount: new BigNumber(s.amount),
 | 
			
		||||
            })),
 | 
			
		||||
        });
 | 
			
		||||
        formattedSwapsExactOut.push({
 | 
			
		||||
            assets,
 | 
			
		||||
            swapSteps: swapsExactOut.map(s => ({
 | 
			
		||||
                ...s,
 | 
			
		||||
                amount: new BigNumber(s.amount),
 | 
			
		||||
            })),
 | 
			
		||||
        });
 | 
			
		||||
    });
 | 
			
		||||
    const formattedSwaps: BalancerSwaps = {
 | 
			
		||||
        swapInfoExactIn: formattedSwapsExactIn,
 | 
			
		||||
        swapInfoExactOut: formattedSwapsExactOut,
 | 
			
		||||
    };
 | 
			
		||||
    return formattedSwaps;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,91 +0,0 @@
 | 
			
		||||
import { BalancerSwaps } from '../types';
 | 
			
		||||
 | 
			
		||||
import { ONE_HOUR_IN_SECONDS, ONE_SECOND_MS } from '../constants';
 | 
			
		||||
 | 
			
		||||
export interface CacheValue {
 | 
			
		||||
    expiresAt: number;
 | 
			
		||||
    balancerSwaps: BalancerSwaps;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// tslint:disable:custom-no-magic-numbers
 | 
			
		||||
// Cache results for 30mins
 | 
			
		||||
const DEFAULT_CACHE_TIME_MS = (ONE_HOUR_IN_SECONDS / 2) * ONE_SECOND_MS;
 | 
			
		||||
const DEFAULT_TIMEOUT_MS = ONE_SECOND_MS;
 | 
			
		||||
export const EMPTY_BALANCER_SWAPS = { swapInfoExactIn: [], swapInfoExactOut: [] };
 | 
			
		||||
// tslint:enable:custom-no-magic-numbers
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Caches SwapInfo for a pair of tokens.
 | 
			
		||||
 * SwapInfo includes swap steps and asset information for those swap steps.
 | 
			
		||||
 */
 | 
			
		||||
export abstract class SwapInfoCache {
 | 
			
		||||
    protected static _isExpired(value: CacheValue): boolean {
 | 
			
		||||
        return Date.now() >= value.expiresAt;
 | 
			
		||||
    }
 | 
			
		||||
    constructor(
 | 
			
		||||
        protected readonly _cache: { [key: string]: CacheValue },
 | 
			
		||||
        protected readonly _cacheTimeMs: number = DEFAULT_CACHE_TIME_MS,
 | 
			
		||||
    ) {}
 | 
			
		||||
 | 
			
		||||
    public async getFreshPoolsForPairAsync(
 | 
			
		||||
        takerToken: string,
 | 
			
		||||
        makerToken: string,
 | 
			
		||||
        timeoutMs: number = DEFAULT_TIMEOUT_MS,
 | 
			
		||||
    ): Promise<BalancerSwaps> {
 | 
			
		||||
        const timeout = new Promise<BalancerSwaps>(resolve => setTimeout(resolve, timeoutMs, []));
 | 
			
		||||
        return Promise.race([this._getAndSaveFreshSwapInfoForPairAsync(takerToken, makerToken), timeout]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public getCachedSwapInfoForPair(
 | 
			
		||||
        takerToken: string,
 | 
			
		||||
        makerToken: string,
 | 
			
		||||
        ignoreExpired: boolean = true,
 | 
			
		||||
    ): BalancerSwaps | undefined {
 | 
			
		||||
        const key = JSON.stringify([takerToken, makerToken]);
 | 
			
		||||
        const value = this._cache[key];
 | 
			
		||||
        if (ignoreExpired) {
 | 
			
		||||
            return value === undefined ? EMPTY_BALANCER_SWAPS : value.balancerSwaps;
 | 
			
		||||
        }
 | 
			
		||||
        if (!value) {
 | 
			
		||||
            return undefined;
 | 
			
		||||
        }
 | 
			
		||||
        if (SwapInfoCache._isExpired(value)) {
 | 
			
		||||
            return undefined;
 | 
			
		||||
        }
 | 
			
		||||
        return value.balancerSwaps;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public isFresh(takerToken: string, makerToken: string): boolean {
 | 
			
		||||
        const cached = this.getCachedSwapInfoForPair(takerToken, makerToken, false);
 | 
			
		||||
        return cached !== undefined;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected async _getAndSaveFreshSwapInfoForPairAsync(
 | 
			
		||||
        takerToken: string,
 | 
			
		||||
        makerToken: string,
 | 
			
		||||
    ): Promise<BalancerSwaps> {
 | 
			
		||||
        const key = JSON.stringify([takerToken, makerToken]);
 | 
			
		||||
        const value = this._cache[key];
 | 
			
		||||
        if (value === undefined || value.expiresAt >= Date.now()) {
 | 
			
		||||
            const swapInfo = await this._fetchSwapInfoForPairAsync(takerToken, makerToken);
 | 
			
		||||
            const expiresAt = Date.now() + this._cacheTimeMs;
 | 
			
		||||
            this._cacheSwapInfoForPair(takerToken, makerToken, swapInfo, expiresAt);
 | 
			
		||||
        }
 | 
			
		||||
        return this._cache[key].balancerSwaps;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected _cacheSwapInfoForPair(
 | 
			
		||||
        takerToken: string,
 | 
			
		||||
        makerToken: string,
 | 
			
		||||
        swapInfo: BalancerSwaps,
 | 
			
		||||
        expiresAt: number,
 | 
			
		||||
    ): void {
 | 
			
		||||
        const key = JSON.stringify([takerToken, makerToken]);
 | 
			
		||||
        this._cache[key] = {
 | 
			
		||||
            expiresAt,
 | 
			
		||||
            balancerSwaps: swapInfo,
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected abstract _fetchSwapInfoForPairAsync(takerToken: string, makerToken: string): Promise<BalancerSwaps>;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,114 +0,0 @@
 | 
			
		||||
import { ChainId } from '@0x/contract-addresses';
 | 
			
		||||
import { logUtils } from '@0x/utils';
 | 
			
		||||
import { PoolDataService, SubgraphPoolBase } from '@balancer-labs/sdk';
 | 
			
		||||
import { gql, request } from 'graphql-request';
 | 
			
		||||
 | 
			
		||||
const queryWithLinear = gql`
 | 
			
		||||
    query fetchTopPoolsWithLinear($maxPoolsFetched: Int!) {
 | 
			
		||||
        pools: pools(
 | 
			
		||||
            first: $maxPoolsFetched
 | 
			
		||||
            where: { swapEnabled: true }
 | 
			
		||||
            orderBy: totalLiquidity
 | 
			
		||||
            orderDirection: desc
 | 
			
		||||
        ) {
 | 
			
		||||
            id
 | 
			
		||||
            address
 | 
			
		||||
            poolType
 | 
			
		||||
            swapFee
 | 
			
		||||
            totalShares
 | 
			
		||||
            tokens {
 | 
			
		||||
                address
 | 
			
		||||
                balance
 | 
			
		||||
                decimals
 | 
			
		||||
                weight
 | 
			
		||||
                priceRate
 | 
			
		||||
            }
 | 
			
		||||
            tokensList
 | 
			
		||||
            totalWeight
 | 
			
		||||
            amp
 | 
			
		||||
            expiryTime
 | 
			
		||||
            unitSeconds
 | 
			
		||||
            principalToken
 | 
			
		||||
            baseToken
 | 
			
		||||
            swapEnabled
 | 
			
		||||
            wrappedIndex
 | 
			
		||||
            mainIndex
 | 
			
		||||
            lowerTarget
 | 
			
		||||
            upperTarget
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
`;
 | 
			
		||||
 | 
			
		||||
const queryWithOutLinear = gql`
 | 
			
		||||
    query fetchTopPoolsWithoutLinear($maxPoolsFetched: Int!) {
 | 
			
		||||
        pools: pools(
 | 
			
		||||
            first: $maxPoolsFetched
 | 
			
		||||
            where: { swapEnabled: true }
 | 
			
		||||
            orderBy: totalLiquidity
 | 
			
		||||
            orderDirection: desc
 | 
			
		||||
        ) {
 | 
			
		||||
            id
 | 
			
		||||
            address
 | 
			
		||||
            poolType
 | 
			
		||||
            swapFee
 | 
			
		||||
            totalShares
 | 
			
		||||
            tokens {
 | 
			
		||||
                address
 | 
			
		||||
                balance
 | 
			
		||||
                decimals
 | 
			
		||||
                weight
 | 
			
		||||
                priceRate
 | 
			
		||||
            }
 | 
			
		||||
            tokensList
 | 
			
		||||
            totalWeight
 | 
			
		||||
            amp
 | 
			
		||||
            expiryTime
 | 
			
		||||
            unitSeconds
 | 
			
		||||
            principalToken
 | 
			
		||||
            baseToken
 | 
			
		||||
            swapEnabled
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
`;
 | 
			
		||||
 | 
			
		||||
const QUERY_BY_CHAIN_ID: { [chainId: number]: string } = {
 | 
			
		||||
    [ChainId.Mainnet]: queryWithLinear,
 | 
			
		||||
    [ChainId.Polygon]: queryWithOutLinear,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const DEFAULT_MAX_POOLS_FETCHED = 96;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Simple service to query required info from Subgraph for Balancer Pools.
 | 
			
		||||
 * Because Balancer Subgraphs have slightly different schema depending on network the queries are adjusted as needed.
 | 
			
		||||
 */
 | 
			
		||||
export class SubgraphPoolDataService implements PoolDataService {
 | 
			
		||||
    private readonly _gqlQuery: string | undefined;
 | 
			
		||||
 | 
			
		||||
    constructor(
 | 
			
		||||
        private readonly _config: {
 | 
			
		||||
            chainId: number;
 | 
			
		||||
            subgraphUrl: string | null;
 | 
			
		||||
            maxPoolsFetched?: number;
 | 
			
		||||
        },
 | 
			
		||||
    ) {
 | 
			
		||||
        this._config.maxPoolsFetched = this._config.maxPoolsFetched || DEFAULT_MAX_POOLS_FETCHED;
 | 
			
		||||
        this._gqlQuery = QUERY_BY_CHAIN_ID[this._config.chainId];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // tslint:disable-next-line: async-suffix
 | 
			
		||||
    public async getPools(): Promise<SubgraphPoolBase[]> {
 | 
			
		||||
        if (!this._gqlQuery || !this._config.subgraphUrl) {
 | 
			
		||||
            return [];
 | 
			
		||||
        }
 | 
			
		||||
        try {
 | 
			
		||||
            const { pools } = await request<{ pools: SubgraphPoolBase[] }>(this._config.subgraphUrl, this._gqlQuery, {
 | 
			
		||||
                maxPoolsFetched: this._config.maxPoolsFetched,
 | 
			
		||||
            });
 | 
			
		||||
            return pools;
 | 
			
		||||
        } catch (err) {
 | 
			
		||||
            logUtils.warn(`Failed to fetch BalancerV2 subgraph pools: ${err.message}`);
 | 
			
		||||
            return [];
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -5,8 +5,9 @@ import { SamplerOverrides } from '../../types';
 | 
			
		||||
import { ERC20BridgeSamplerContract } from '../../wrappers';
 | 
			
		||||
 | 
			
		||||
import { BancorService } from './bancor_service';
 | 
			
		||||
import { PoolsCacheMap, SamplerOperations } from './sampler_operations';
 | 
			
		||||
import { BatchedOperation, LiquidityProviderRegistry, TokenAdjacencyGraph } from './types';
 | 
			
		||||
import { PoolsCache } from './pools_cache';
 | 
			
		||||
import { SamplerOperations } from './sampler_operations';
 | 
			
		||||
import { BatchedOperation, ERC20BridgeSource, LiquidityProviderRegistry, TokenAdjacencyGraph } from './types';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Generate sample amounts up to `maxFillAmount`.
 | 
			
		||||
@@ -36,7 +37,7 @@ export class DexOrderSampler extends SamplerOperations {
 | 
			
		||||
        public readonly chainId: ChainId,
 | 
			
		||||
        _samplerContract: ERC20BridgeSamplerContract,
 | 
			
		||||
        private readonly _samplerOverrides?: SamplerOverrides,
 | 
			
		||||
        poolsCaches?: PoolsCacheMap,
 | 
			
		||||
        poolsCaches?: { [key in ERC20BridgeSource]: PoolsCache },
 | 
			
		||||
        tokenAdjacencyGraph?: TokenAdjacencyGraph,
 | 
			
		||||
        liquidityProviderRegistry?: LiquidityProviderRegistry,
 | 
			
		||||
        bancorServiceFn: () => Promise<BancorService | undefined> = async () => undefined,
 | 
			
		||||
 
 | 
			
		||||
@@ -14,6 +14,7 @@ import {
 | 
			
		||||
    getCurveLikeInfosForPair,
 | 
			
		||||
    getDodoV2Offsets,
 | 
			
		||||
    getKyberOffsets,
 | 
			
		||||
    getPlatypusInfoForPair,
 | 
			
		||||
    getShellLikeInfosForPair,
 | 
			
		||||
    isAllowedKyberReserveId,
 | 
			
		||||
    isBadTokenForSource,
 | 
			
		||||
@@ -30,6 +31,9 @@ import {
 | 
			
		||||
    COMPOUND_API_URL_BY_CHAIN_ID,
 | 
			
		||||
    DODOV1_CONFIG_BY_CHAIN_ID,
 | 
			
		||||
    DODOV2_FACTORIES_BY_CHAIN_ID,
 | 
			
		||||
    GMX_READER_BY_CHAIN_ID,
 | 
			
		||||
    GMX_ROUTER_BY_CHAIN_ID,
 | 
			
		||||
    GMX_VAULT_BY_CHAIN_ID,
 | 
			
		||||
    KYBER_CONFIG_BY_CHAIN_ID,
 | 
			
		||||
    KYBER_DMM_ROUTER_BY_CHAIN_ID,
 | 
			
		||||
    LIDO_INFO_BY_CHAIN,
 | 
			
		||||
@@ -42,6 +46,7 @@ import {
 | 
			
		||||
    NATIVE_FEE_TOKEN_BY_CHAIN_ID,
 | 
			
		||||
    NULL_ADDRESS,
 | 
			
		||||
    NULL_BYTES,
 | 
			
		||||
    PLATYPUS_ROUTER_BY_CHAIN_ID,
 | 
			
		||||
    SELL_SOURCE_FILTER_BY_CHAIN_ID,
 | 
			
		||||
    UNISWAPV1_ROUTER_BY_CHAIN_ID,
 | 
			
		||||
    UNISWAPV3_CONFIG_BY_CHAIN_ID,
 | 
			
		||||
@@ -51,7 +56,6 @@ import { getGeistInfoForPair } from './geist_utils';
 | 
			
		||||
import { getLiquidityProvidersForPair } from './liquidity_provider_utils';
 | 
			
		||||
import { getIntermediateTokens } from './multihop_utils';
 | 
			
		||||
import { BalancerPoolsCache, BalancerV2PoolsCache, CreamPoolsCache, PoolsCache } from './pools_cache';
 | 
			
		||||
import { BalancerV2SwapInfoCache } from './pools_cache/balancer_v2_utils_new';
 | 
			
		||||
import { SamplerContractOperation } from './sampler_contract_operation';
 | 
			
		||||
import { SamplerNoOperation } from './sampler_no_operation';
 | 
			
		||||
import { SourceFilters } from './source_filters';
 | 
			
		||||
@@ -59,8 +63,6 @@ import {
 | 
			
		||||
    AaveV2FillData,
 | 
			
		||||
    AaveV2Info,
 | 
			
		||||
    BalancerFillData,
 | 
			
		||||
    BalancerSwapInfo,
 | 
			
		||||
    BalancerV2BatchSwapFillData,
 | 
			
		||||
    BalancerV2FillData,
 | 
			
		||||
    BalancerV2PoolInfo,
 | 
			
		||||
    BancorFillData,
 | 
			
		||||
@@ -74,6 +76,7 @@ import {
 | 
			
		||||
    GeistFillData,
 | 
			
		||||
    GeistInfo,
 | 
			
		||||
    GenericRouterFillData,
 | 
			
		||||
    GMXFillData,
 | 
			
		||||
    HopInfo,
 | 
			
		||||
    KyberDmmFillData,
 | 
			
		||||
    KyberFillData,
 | 
			
		||||
@@ -85,6 +88,7 @@ import {
 | 
			
		||||
    MakerPsmFillData,
 | 
			
		||||
    MooniswapFillData,
 | 
			
		||||
    MultiHopFillData,
 | 
			
		||||
    PlatypusFillData,
 | 
			
		||||
    PsmInfo,
 | 
			
		||||
    ShellFillData,
 | 
			
		||||
    SourceQuoteOperation,
 | 
			
		||||
@@ -106,10 +110,6 @@ export const TWO_HOP_SOURCE_FILTERS = SourceFilters.all().exclude([
 | 
			
		||||
 */
 | 
			
		||||
export const BATCH_SOURCE_FILTERS = SourceFilters.all().exclude([ERC20BridgeSource.MultiHop, ERC20BridgeSource.Native]);
 | 
			
		||||
 | 
			
		||||
export type PoolsCacheMap = { [key in Exclude<SourcesWithPoolsCache, ERC20BridgeSource.BalancerV2>]: PoolsCache } & {
 | 
			
		||||
    [ERC20BridgeSource.BalancerV2]: BalancerV2SwapInfoCache;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// tslint:disable:no-inferred-empty-object-type no-unbound-method
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -118,7 +118,7 @@ export type PoolsCacheMap = { [key in Exclude<SourcesWithPoolsCache, ERC20Bridge
 | 
			
		||||
 */
 | 
			
		||||
export class SamplerOperations {
 | 
			
		||||
    public readonly liquidityProviderRegistry: LiquidityProviderRegistry;
 | 
			
		||||
    public readonly poolsCaches: PoolsCacheMap;
 | 
			
		||||
    public readonly poolsCaches: { [key in SourcesWithPoolsCache]: PoolsCache };
 | 
			
		||||
    public readonly aaveReservesCache: AaveV2ReservesCache | undefined;
 | 
			
		||||
    public readonly compoundCTokenCache: CompoundCTokenCache | undefined;
 | 
			
		||||
    protected _bancorService?: BancorService;
 | 
			
		||||
@@ -133,7 +133,7 @@ export class SamplerOperations {
 | 
			
		||||
    constructor(
 | 
			
		||||
        public readonly chainId: ChainId,
 | 
			
		||||
        protected readonly _samplerContract: ERC20BridgeSamplerContract,
 | 
			
		||||
        poolsCaches?: PoolsCacheMap,
 | 
			
		||||
        poolsCaches?: { [key in SourcesWithPoolsCache]: PoolsCache },
 | 
			
		||||
        protected readonly tokenAdjacencyGraph: TokenAdjacencyGraph = { default: [] },
 | 
			
		||||
        liquidityProviderRegistry: LiquidityProviderRegistry = {},
 | 
			
		||||
        bancorServiceFn: () => Promise<BancorService | undefined> = async () => undefined,
 | 
			
		||||
@@ -145,13 +145,13 @@ export class SamplerOperations {
 | 
			
		||||
        this.poolsCaches = poolsCaches
 | 
			
		||||
            ? poolsCaches
 | 
			
		||||
            : {
 | 
			
		||||
                  [ERC20BridgeSource.BalancerV2]: new BalancerV2PoolsCache(chainId),
 | 
			
		||||
                  [ERC20BridgeSource.Beethovenx]: new BalancerV2PoolsCache(
 | 
			
		||||
                      chainId,
 | 
			
		||||
                      BEETHOVEN_X_SUBGRAPH_URL_BY_CHAIN[chainId],
 | 
			
		||||
                  ),
 | 
			
		||||
                  [ERC20BridgeSource.Balancer]: new BalancerPoolsCache(),
 | 
			
		||||
                  [ERC20BridgeSource.Cream]: new CreamPoolsCache(),
 | 
			
		||||
                  [ERC20BridgeSource.BalancerV2]: new BalancerV2SwapInfoCache(chainId),
 | 
			
		||||
              };
 | 
			
		||||
 | 
			
		||||
        const aaveSubgraphUrl = AAVE_V2_SUBGRAPH_URL_BY_CHAIN_ID[chainId];
 | 
			
		||||
@@ -571,49 +571,6 @@ export class SamplerOperations {
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public getBalancerV2MulthopSellQuotes(
 | 
			
		||||
        vault: string,
 | 
			
		||||
        quoteSwaps: BalancerSwapInfo, // Should always be sell swap steps.
 | 
			
		||||
        fillSwaps: BalancerSwapInfo, // Should always be sell swap steps.
 | 
			
		||||
        takerFillAmounts: BigNumber[],
 | 
			
		||||
        source: ERC20BridgeSource,
 | 
			
		||||
    ): SourceQuoteOperation<BalancerV2BatchSwapFillData> {
 | 
			
		||||
        const quoteSwapSteps = quoteSwaps.swapSteps.map(s => ({
 | 
			
		||||
            ...s,
 | 
			
		||||
            assetInIndex: new BigNumber(s.assetInIndex),
 | 
			
		||||
            assetOutIndex: new BigNumber(s.assetOutIndex),
 | 
			
		||||
        }));
 | 
			
		||||
        return new SamplerContractOperation({
 | 
			
		||||
            source,
 | 
			
		||||
            fillData: { vault, swapSteps: fillSwaps.swapSteps, assets: fillSwaps.assets },
 | 
			
		||||
            contract: this._samplerContract,
 | 
			
		||||
            function: this._samplerContract.sampleMultihopSellsFromBalancerV2,
 | 
			
		||||
            params: [vault, quoteSwapSteps, quoteSwaps.assets, takerFillAmounts],
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public getBalancerV2MulthopBuyQuotes(
 | 
			
		||||
        vault: string,
 | 
			
		||||
        quoteSwaps: BalancerSwapInfo, // Should always be buy swap steps.
 | 
			
		||||
        fillSwaps: BalancerSwapInfo, // Should always be a sell quote.
 | 
			
		||||
        makerFillAmounts: BigNumber[],
 | 
			
		||||
        source: ERC20BridgeSource,
 | 
			
		||||
    ): SourceQuoteOperation<BalancerV2BatchSwapFillData> {
 | 
			
		||||
        const quoteSwapSteps = quoteSwaps.swapSteps.map(s => ({
 | 
			
		||||
            ...s,
 | 
			
		||||
            assetInIndex: new BigNumber(s.assetInIndex),
 | 
			
		||||
            assetOutIndex: new BigNumber(s.assetOutIndex),
 | 
			
		||||
        }));
 | 
			
		||||
        return new SamplerContractOperation({
 | 
			
		||||
            source,
 | 
			
		||||
            // NOTE: fillData is set up for sells but quote function is set up for buys.
 | 
			
		||||
            fillData: { vault, swapSteps: fillSwaps.swapSteps, assets: fillSwaps.assets },
 | 
			
		||||
            contract: this._samplerContract,
 | 
			
		||||
            function: this._samplerContract.sampleMultihopBuysFromBalancerV2,
 | 
			
		||||
            params: [vault, quoteSwapSteps, quoteSwaps.assets, makerFillAmounts],
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public getBalancerV2SellQuotes(
 | 
			
		||||
        poolInfo: BalancerV2PoolInfo,
 | 
			
		||||
        makerToken: string,
 | 
			
		||||
@@ -1263,6 +1220,65 @@ export class SamplerOperations {
 | 
			
		||||
            params: [cToken, takerToken, makerToken, makerFillAmounts],
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    public getGMXSellQuotes(
 | 
			
		||||
        router: string,
 | 
			
		||||
        reader: string,
 | 
			
		||||
        vault: string,
 | 
			
		||||
        tokenAddressPath: string[],
 | 
			
		||||
        takerFillAmounts: BigNumber[],
 | 
			
		||||
    ): SourceQuoteOperation<GMXFillData> {
 | 
			
		||||
        return new SamplerContractOperation({
 | 
			
		||||
            source: ERC20BridgeSource.GMX,
 | 
			
		||||
            fillData: { router, reader, vault, tokenAddressPath },
 | 
			
		||||
            contract: this._samplerContract,
 | 
			
		||||
            function: this._samplerContract.sampleSellsFromGMX,
 | 
			
		||||
            params: [reader, vault, tokenAddressPath, takerFillAmounts],
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    public getGMXBuyQuotes(
 | 
			
		||||
        router: string,
 | 
			
		||||
        reader: string,
 | 
			
		||||
        vault: string,
 | 
			
		||||
        tokenAddressPath: string[],
 | 
			
		||||
        makerFillAmounts: BigNumber[],
 | 
			
		||||
    ): SourceQuoteOperation<GMXFillData> {
 | 
			
		||||
        return new SamplerContractOperation({
 | 
			
		||||
            source: ERC20BridgeSource.GMX,
 | 
			
		||||
            fillData: { router, reader, vault, tokenAddressPath },
 | 
			
		||||
            contract: this._samplerContract,
 | 
			
		||||
            function: this._samplerContract.sampleBuysFromGMX,
 | 
			
		||||
            params: [reader, vault, tokenAddressPath, makerFillAmounts],
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public getPlatypusSellQuotes(
 | 
			
		||||
        router: string,
 | 
			
		||||
        pool: string[],
 | 
			
		||||
        tokenAddressPath: string[],
 | 
			
		||||
        takerFillAmounts: BigNumber[],
 | 
			
		||||
    ): SourceQuoteOperation<PlatypusFillData> {
 | 
			
		||||
        return new SamplerContractOperation({
 | 
			
		||||
            source: ERC20BridgeSource.Platypus,
 | 
			
		||||
            fillData: { router, pool, tokenAddressPath },
 | 
			
		||||
            contract: this._samplerContract,
 | 
			
		||||
            function: this._samplerContract.sampleSellsFromPlatypus,
 | 
			
		||||
            params: [router, tokenAddressPath, pool, takerFillAmounts],
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    public getPlatypusBuyQuotes(
 | 
			
		||||
        router: string,
 | 
			
		||||
        pool: string[],
 | 
			
		||||
        tokenAddressPath: string[],
 | 
			
		||||
        makerFillAmounts: BigNumber[],
 | 
			
		||||
    ): SourceQuoteOperation<PlatypusFillData> {
 | 
			
		||||
        return new SamplerContractOperation({
 | 
			
		||||
            source: ERC20BridgeSource.Platypus,
 | 
			
		||||
            fillData: { router, tokenAddressPath, pool },
 | 
			
		||||
            contract: this._samplerContract,
 | 
			
		||||
            function: this._samplerContract.sampleBuysFromPlatypus,
 | 
			
		||||
            params: [router, tokenAddressPath, pool, makerFillAmounts],
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public getMedianSellRate(
 | 
			
		||||
        sources: ERC20BridgeSource[],
 | 
			
		||||
@@ -1498,23 +1514,15 @@ export class SamplerOperations {
 | 
			
		||||
                                ERC20BridgeSource.Balancer,
 | 
			
		||||
                            ),
 | 
			
		||||
                        );
 | 
			
		||||
                    case ERC20BridgeSource.BalancerV2: {
 | 
			
		||||
                        const swaps = this.poolsCaches[source].getCachedSwapInfoForPair(takerToken, makerToken);
 | 
			
		||||
 | 
			
		||||
                        const vault = BALANCER_V2_VAULT_ADDRESS_BY_CHAIN[this.chainId];
 | 
			
		||||
                        if (!swaps || vault === NULL_ADDRESS) {
 | 
			
		||||
                            return [];
 | 
			
		||||
                        }
 | 
			
		||||
                        // Changed to retrieve queryBatchSwap for swap steps > 1 of length
 | 
			
		||||
                        return swaps.swapInfoExactIn.map(swapInfo =>
 | 
			
		||||
                            this.getBalancerV2MulthopSellQuotes(vault, swapInfo, swapInfo, takerFillAmounts, source),
 | 
			
		||||
                        );
 | 
			
		||||
                    }
 | 
			
		||||
                    case ERC20BridgeSource.Beethovenx: {
 | 
			
		||||
                    case ERC20BridgeSource.BalancerV2:
 | 
			
		||||
                    case ERC20BridgeSource.Beethovenx:
 | 
			
		||||
                        const poolIds =
 | 
			
		||||
                            this.poolsCaches[source].getCachedPoolAddressesForPair(takerToken, makerToken) || [];
 | 
			
		||||
 | 
			
		||||
                        const vault = BEETHOVEN_X_VAULT_ADDRESS_BY_CHAIN[this.chainId];
 | 
			
		||||
                        const vault =
 | 
			
		||||
                            source === ERC20BridgeSource.BalancerV2
 | 
			
		||||
                                ? BALANCER_V2_VAULT_ADDRESS_BY_CHAIN[this.chainId]
 | 
			
		||||
                                : BEETHOVEN_X_VAULT_ADDRESS_BY_CHAIN[this.chainId];
 | 
			
		||||
                        if (vault === NULL_ADDRESS) {
 | 
			
		||||
                            return [];
 | 
			
		||||
                        }
 | 
			
		||||
@@ -1527,7 +1535,6 @@ export class SamplerOperations {
 | 
			
		||||
                                source,
 | 
			
		||||
                            ),
 | 
			
		||||
                        );
 | 
			
		||||
                    }
 | 
			
		||||
                    case ERC20BridgeSource.Cream:
 | 
			
		||||
                        return (
 | 
			
		||||
                            this.poolsCaches[ERC20BridgeSource.Cream].getCachedPoolAddressesForPair(
 | 
			
		||||
@@ -1664,8 +1671,28 @@ export class SamplerOperations {
 | 
			
		||||
                            takerFillAmounts,
 | 
			
		||||
                        );
 | 
			
		||||
                    }
 | 
			
		||||
                    default:
 | 
			
		||||
                        throw new Error(`Unsupported sell sample source: ${source}`);
 | 
			
		||||
                    case ERC20BridgeSource.GMX: {
 | 
			
		||||
                        return this.getGMXSellQuotes(
 | 
			
		||||
                            GMX_ROUTER_BY_CHAIN_ID[this.chainId],
 | 
			
		||||
                            GMX_READER_BY_CHAIN_ID[this.chainId],
 | 
			
		||||
                            GMX_VAULT_BY_CHAIN_ID[this.chainId],
 | 
			
		||||
                            [takerToken, makerToken],
 | 
			
		||||
                            takerFillAmounts,
 | 
			
		||||
                        );
 | 
			
		||||
                    }
 | 
			
		||||
                    case ERC20BridgeSource.Platypus: {
 | 
			
		||||
                        return getPlatypusInfoForPair(this.chainId, takerToken, makerToken).map(pool =>
 | 
			
		||||
                            this.getPlatypusSellQuotes(
 | 
			
		||||
                            PLATYPUS_ROUTER_BY_CHAIN_ID[this.chainId],
 | 
			
		||||
                            pool.poolAddress,
 | 
			
		||||
                            pool.tokens,
 | 
			
		||||
                            takerFillAmounts,
 | 
			
		||||
                            ),
 | 
			
		||||
                        );
 | 
			
		||||
                    }
 | 
			
		||||
                default:
 | 
			
		||||
                    throw new Error(`Unsupported sell sample source: ${source}`);
 | 
			
		||||
 | 
			
		||||
                }
 | 
			
		||||
            }),
 | 
			
		||||
        );
 | 
			
		||||
@@ -1821,29 +1848,15 @@ export class SamplerOperations {
 | 
			
		||||
                                ERC20BridgeSource.Balancer,
 | 
			
		||||
                            ),
 | 
			
		||||
                        );
 | 
			
		||||
                    case ERC20BridgeSource.BalancerV2: {
 | 
			
		||||
                        const swaps = this.poolsCaches[source].getCachedSwapInfoForPair(takerToken, makerToken);
 | 
			
		||||
 | 
			
		||||
                        const vault = BALANCER_V2_VAULT_ADDRESS_BY_CHAIN[this.chainId];
 | 
			
		||||
                        if (!swaps || vault === NULL_ADDRESS) {
 | 
			
		||||
                            return [];
 | 
			
		||||
                        }
 | 
			
		||||
                        // Changed to retrieve queryBatchSwap for swap steps > 1 of length
 | 
			
		||||
                        return swaps.swapInfoExactOut.map((quoteSwapInfo, i) =>
 | 
			
		||||
                            this.getBalancerV2MulthopBuyQuotes(
 | 
			
		||||
                                vault,
 | 
			
		||||
                                quoteSwapInfo,
 | 
			
		||||
                                swaps.swapInfoExactIn[i],
 | 
			
		||||
                                makerFillAmounts,
 | 
			
		||||
                                source,
 | 
			
		||||
                            ),
 | 
			
		||||
                        );
 | 
			
		||||
                    }
 | 
			
		||||
                    case ERC20BridgeSource.Beethovenx: {
 | 
			
		||||
                    case ERC20BridgeSource.BalancerV2:
 | 
			
		||||
                    case ERC20BridgeSource.Beethovenx:
 | 
			
		||||
                        const poolIds =
 | 
			
		||||
                            this.poolsCaches[source].getCachedPoolAddressesForPair(takerToken, makerToken) || [];
 | 
			
		||||
 | 
			
		||||
                        const vault = BEETHOVEN_X_VAULT_ADDRESS_BY_CHAIN[this.chainId];
 | 
			
		||||
                        const vault =
 | 
			
		||||
                            source === ERC20BridgeSource.BalancerV2
 | 
			
		||||
                                ? BALANCER_V2_VAULT_ADDRESS_BY_CHAIN[this.chainId]
 | 
			
		||||
                                : BEETHOVEN_X_VAULT_ADDRESS_BY_CHAIN[this.chainId];
 | 
			
		||||
                        if (vault === NULL_ADDRESS) {
 | 
			
		||||
                            return [];
 | 
			
		||||
                        }
 | 
			
		||||
@@ -1856,7 +1869,6 @@ export class SamplerOperations {
 | 
			
		||||
                                source,
 | 
			
		||||
                            ),
 | 
			
		||||
                        );
 | 
			
		||||
                    }
 | 
			
		||||
                    case ERC20BridgeSource.Cream:
 | 
			
		||||
                        return (
 | 
			
		||||
                            this.poolsCaches[ERC20BridgeSource.Cream].getCachedPoolAddressesForPair(
 | 
			
		||||
@@ -1983,6 +1995,25 @@ export class SamplerOperations {
 | 
			
		||||
                        }
 | 
			
		||||
                        return this.getCompoundBuyQuotes(cToken.tokenAddress, makerToken, takerToken, makerFillAmounts);
 | 
			
		||||
                    }
 | 
			
		||||
                    case ERC20BridgeSource.GMX: {
 | 
			
		||||
                        return this.getGMXBuyQuotes(
 | 
			
		||||
                            GMX_ROUTER_BY_CHAIN_ID[this.chainId],
 | 
			
		||||
                            GMX_READER_BY_CHAIN_ID[this.chainId],
 | 
			
		||||
                            GMX_VAULT_BY_CHAIN_ID[this.chainId],
 | 
			
		||||
                            [takerToken, makerToken],
 | 
			
		||||
                            makerFillAmounts,
 | 
			
		||||
                        );
 | 
			
		||||
                    }
 | 
			
		||||
                    case ERC20BridgeSource.Platypus: {
 | 
			
		||||
                        return getPlatypusInfoForPair(this.chainId, takerToken, makerToken).map(pool =>
 | 
			
		||||
                            this.getPlatypusBuyQuotes(
 | 
			
		||||
                            PLATYPUS_ROUTER_BY_CHAIN_ID[this.chainId],
 | 
			
		||||
                            pool.poolAddress,
 | 
			
		||||
                            pool.tokens,
 | 
			
		||||
                            makerFillAmounts,
 | 
			
		||||
                            ),
 | 
			
		||||
                        );
 | 
			
		||||
                    }
 | 
			
		||||
                    default:
 | 
			
		||||
                        throw new Error(`Unsupported buy sample source: ${source}`);
 | 
			
		||||
                }
 | 
			
		||||
 
 | 
			
		||||
@@ -94,6 +94,9 @@ export enum ERC20BridgeSource {
 | 
			
		||||
    // Avalanche
 | 
			
		||||
    Pangolin = 'Pangolin',
 | 
			
		||||
    TraderJoe = 'TraderJoe',
 | 
			
		||||
    // tslint:disable-next-line: enum-naming
 | 
			
		||||
    GMX = 'GMX',
 | 
			
		||||
    Platypus = 'Platypus',
 | 
			
		||||
    // Celo only
 | 
			
		||||
    UbeSwap = 'UbeSwap',
 | 
			
		||||
    MobiusMoney = 'MobiusMoney',
 | 
			
		||||
@@ -188,6 +191,11 @@ export interface GeistInfo {
 | 
			
		||||
    underlyingToken: string;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface PlatypusInfo {
 | 
			
		||||
    poolAddress: string[];
 | 
			
		||||
    tokens: string[];
 | 
			
		||||
    gasSchedule: number;
 | 
			
		||||
}
 | 
			
		||||
// Internal `fillData` field for `Fill` objects.
 | 
			
		||||
export interface FillData {}
 | 
			
		||||
 | 
			
		||||
@@ -209,23 +217,6 @@ export interface CurveFillData extends FillData {
 | 
			
		||||
    pool: CurveInfo;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface BalancerBatchSwapStep {
 | 
			
		||||
    poolId: string;
 | 
			
		||||
    assetInIndex: number;
 | 
			
		||||
    assetOutIndex: number;
 | 
			
		||||
    amount: BigNumber;
 | 
			
		||||
    userData: string;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface BalancerSwaps {
 | 
			
		||||
    swapInfoExactIn: BalancerSwapInfo[];
 | 
			
		||||
    swapInfoExactOut: BalancerSwapInfo[];
 | 
			
		||||
}
 | 
			
		||||
export interface BalancerSwapInfo {
 | 
			
		||||
    assets: string[];
 | 
			
		||||
    swapSteps: BalancerBatchSwapStep[];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface BalancerFillData extends FillData {
 | 
			
		||||
    poolAddress: string;
 | 
			
		||||
}
 | 
			
		||||
@@ -235,17 +226,24 @@ export interface BalancerV2FillData extends FillData {
 | 
			
		||||
    poolId: string;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface BalancerV2BatchSwapFillData extends FillData {
 | 
			
		||||
    vault: string;
 | 
			
		||||
    swapSteps: BalancerBatchSwapStep[];
 | 
			
		||||
    assets: string[];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface UniswapV2FillData extends FillData {
 | 
			
		||||
    tokenAddressPath: string[];
 | 
			
		||||
    router: string;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface GMXFillData extends FillData {
 | 
			
		||||
    router: string;
 | 
			
		||||
    reader: string;
 | 
			
		||||
    vault: string;
 | 
			
		||||
    tokenAddressPath: string[];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface PlatypusFillData extends FillData {
 | 
			
		||||
    router: string;
 | 
			
		||||
    pool: string[];
 | 
			
		||||
    tokenAddressPath: string[];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface ShellFillData extends FillData {
 | 
			
		||||
    poolAddress: string;
 | 
			
		||||
}
 | 
			
		||||
@@ -633,7 +631,6 @@ export interface MarketSideLiquidity {
 | 
			
		||||
    takerTokenDecimals: number;
 | 
			
		||||
    quotes: RawQuotes;
 | 
			
		||||
    isRfqSupported: boolean;
 | 
			
		||||
    blockNumber: number;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface RawQuotes {
 | 
			
		||||
 
 | 
			
		||||
@@ -106,8 +106,6 @@ export interface ExtendedQuoteReport {
 | 
			
		||||
    decodedUniqueId?: string;
 | 
			
		||||
    sourcesConsidered: ExtendedQuoteReportIndexedEntryOutbound[];
 | 
			
		||||
    sourcesDelivered: ExtendedQuoteReportIndexedEntryOutbound[] | undefined;
 | 
			
		||||
    blockNumber: number | undefined;
 | 
			
		||||
    estimatedGas: string;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface PriceComparisonsReport {
 | 
			
		||||
 
 | 
			
		||||
@@ -8,24 +8,25 @@ import { ContractArtifact } from 'ethereum-types';
 | 
			
		||||
import * as ApproximateBuys from '../test/generated-artifacts/ApproximateBuys.json';
 | 
			
		||||
import * as BalanceChecker from '../test/generated-artifacts/BalanceChecker.json';
 | 
			
		||||
import * as BalancerSampler from '../test/generated-artifacts/BalancerSampler.json';
 | 
			
		||||
import * as BalancerV2BatchSampler from '../test/generated-artifacts/BalancerV2BatchSampler.json';
 | 
			
		||||
import * as BalancerV2Common from '../test/generated-artifacts/BalancerV2Common.json';
 | 
			
		||||
import * as BalancerV2Sampler from '../test/generated-artifacts/BalancerV2Sampler.json';
 | 
			
		||||
import * as BancorSampler from '../test/generated-artifacts/BancorSampler.json';
 | 
			
		||||
import * as CompoundSampler from '../test/generated-artifacts/CompoundSampler.json';
 | 
			
		||||
import * as CurveSampler from '../test/generated-artifacts/CurveSampler.json';
 | 
			
		||||
import * as DODOSampler from '../test/generated-artifacts/DODOSampler.json';
 | 
			
		||||
import * as DODOV2Sampler from '../test/generated-artifacts/DODOV2Sampler.json';
 | 
			
		||||
import * as DummyLiquidityProvider from '../test/generated-artifacts/DummyLiquidityProvider.json';
 | 
			
		||||
import * as ERC20BridgeSampler from '../test/generated-artifacts/ERC20BridgeSampler.json';
 | 
			
		||||
import * as FakeTaker from '../test/generated-artifacts/FakeTaker.json';
 | 
			
		||||
import * as GMXSampler from '../test/generated-artifacts/GMXSampler.json';
 | 
			
		||||
import * as IBalancer from '../test/generated-artifacts/IBalancer.json';
 | 
			
		||||
import * as IBalancerV2Vault from '../test/generated-artifacts/IBalancerV2Vault.json';
 | 
			
		||||
import * as IBancor from '../test/generated-artifacts/IBancor.json';
 | 
			
		||||
import * as ICurve from '../test/generated-artifacts/ICurve.json';
 | 
			
		||||
import * as IGMX from '../test/generated-artifacts/IGMX.json';
 | 
			
		||||
import * as IKyberNetwork from '../test/generated-artifacts/IKyberNetwork.json';
 | 
			
		||||
import * as IMooniswap from '../test/generated-artifacts/IMooniswap.json';
 | 
			
		||||
import * as IMStable from '../test/generated-artifacts/IMStable.json';
 | 
			
		||||
import * as IMultiBridge from '../test/generated-artifacts/IMultiBridge.json';
 | 
			
		||||
import * as IPlatypus from '../test/generated-artifacts/IPlatypus.json';
 | 
			
		||||
import * as IShell from '../test/generated-artifacts/IShell.json';
 | 
			
		||||
import * as ISmoothy from '../test/generated-artifacts/ISmoothy.json';
 | 
			
		||||
import * as IUniswapExchangeQuotes from '../test/generated-artifacts/IUniswapExchangeQuotes.json';
 | 
			
		||||
@@ -37,10 +38,13 @@ import * as LiquidityProviderSampler from '../test/generated-artifacts/Liquidity
 | 
			
		||||
import * as MakerPSMSampler from '../test/generated-artifacts/MakerPSMSampler.json';
 | 
			
		||||
import * as MooniswapSampler from '../test/generated-artifacts/MooniswapSampler.json';
 | 
			
		||||
import * as MStableSampler from '../test/generated-artifacts/MStableSampler.json';
 | 
			
		||||
import * as MultiBridgeSampler from '../test/generated-artifacts/MultiBridgeSampler.json';
 | 
			
		||||
import * as NativeOrderSampler from '../test/generated-artifacts/NativeOrderSampler.json';
 | 
			
		||||
import * as PlatypusSampler from '../test/generated-artifacts/PlatypusSampler.json';
 | 
			
		||||
import * as SamplerUtils from '../test/generated-artifacts/SamplerUtils.json';
 | 
			
		||||
import * as ShellSampler from '../test/generated-artifacts/ShellSampler.json';
 | 
			
		||||
import * as SmoothySampler from '../test/generated-artifacts/SmoothySampler.json';
 | 
			
		||||
import * as TestERC20BridgeSampler from '../test/generated-artifacts/TestERC20BridgeSampler.json';
 | 
			
		||||
import * as TestNativeOrderSampler from '../test/generated-artifacts/TestNativeOrderSampler.json';
 | 
			
		||||
import * as TwoHopSampler from '../test/generated-artifacts/TwoHopSampler.json';
 | 
			
		||||
import * as UniswapSampler from '../test/generated-artifacts/UniswapSampler.json';
 | 
			
		||||
@@ -51,8 +55,6 @@ export const artifacts = {
 | 
			
		||||
    ApproximateBuys: ApproximateBuys as ContractArtifact,
 | 
			
		||||
    BalanceChecker: BalanceChecker as ContractArtifact,
 | 
			
		||||
    BalancerSampler: BalancerSampler as ContractArtifact,
 | 
			
		||||
    BalancerV2BatchSampler: BalancerV2BatchSampler as ContractArtifact,
 | 
			
		||||
    BalancerV2Common: BalancerV2Common as ContractArtifact,
 | 
			
		||||
    BalancerV2Sampler: BalancerV2Sampler as ContractArtifact,
 | 
			
		||||
    BancorSampler: BancorSampler as ContractArtifact,
 | 
			
		||||
    CompoundSampler: CompoundSampler as ContractArtifact,
 | 
			
		||||
@@ -61,6 +63,7 @@ export const artifacts = {
 | 
			
		||||
    DODOV2Sampler: DODOV2Sampler as ContractArtifact,
 | 
			
		||||
    ERC20BridgeSampler: ERC20BridgeSampler as ContractArtifact,
 | 
			
		||||
    FakeTaker: FakeTaker as ContractArtifact,
 | 
			
		||||
    GMXSampler: GMXSampler as ContractArtifact,
 | 
			
		||||
    KyberDmmSampler: KyberDmmSampler as ContractArtifact,
 | 
			
		||||
    KyberSampler: KyberSampler as ContractArtifact,
 | 
			
		||||
    LidoSampler: LidoSampler as ContractArtifact,
 | 
			
		||||
@@ -68,7 +71,9 @@ export const artifacts = {
 | 
			
		||||
    MStableSampler: MStableSampler as ContractArtifact,
 | 
			
		||||
    MakerPSMSampler: MakerPSMSampler as ContractArtifact,
 | 
			
		||||
    MooniswapSampler: MooniswapSampler as ContractArtifact,
 | 
			
		||||
    MultiBridgeSampler: MultiBridgeSampler as ContractArtifact,
 | 
			
		||||
    NativeOrderSampler: NativeOrderSampler as ContractArtifact,
 | 
			
		||||
    PlatypusSampler: PlatypusSampler as ContractArtifact,
 | 
			
		||||
    SamplerUtils: SamplerUtils as ContractArtifact,
 | 
			
		||||
    ShellSampler: ShellSampler as ContractArtifact,
 | 
			
		||||
    SmoothySampler: SmoothySampler as ContractArtifact,
 | 
			
		||||
@@ -78,16 +83,19 @@ export const artifacts = {
 | 
			
		||||
    UniswapV3Sampler: UniswapV3Sampler as ContractArtifact,
 | 
			
		||||
    UtilitySampler: UtilitySampler as ContractArtifact,
 | 
			
		||||
    IBalancer: IBalancer as ContractArtifact,
 | 
			
		||||
    IBalancerV2Vault: IBalancerV2Vault as ContractArtifact,
 | 
			
		||||
    IBancor: IBancor as ContractArtifact,
 | 
			
		||||
    ICurve: ICurve as ContractArtifact,
 | 
			
		||||
    IGMX: IGMX as ContractArtifact,
 | 
			
		||||
    IKyberNetwork: IKyberNetwork as ContractArtifact,
 | 
			
		||||
    IMStable: IMStable as ContractArtifact,
 | 
			
		||||
    IMooniswap: IMooniswap as ContractArtifact,
 | 
			
		||||
    IMultiBridge: IMultiBridge as ContractArtifact,
 | 
			
		||||
    IPlatypus: IPlatypus as ContractArtifact,
 | 
			
		||||
    IShell: IShell as ContractArtifact,
 | 
			
		||||
    ISmoothy: ISmoothy as ContractArtifact,
 | 
			
		||||
    IUniswapExchangeQuotes: IUniswapExchangeQuotes as ContractArtifact,
 | 
			
		||||
    IUniswapV2Router01: IUniswapV2Router01 as ContractArtifact,
 | 
			
		||||
    DummyLiquidityProvider: DummyLiquidityProvider as ContractArtifact,
 | 
			
		||||
    TestERC20BridgeSampler: TestERC20BridgeSampler as ContractArtifact,
 | 
			
		||||
    TestNativeOrderSampler: TestNativeOrderSampler as ContractArtifact,
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -66,7 +66,6 @@ const buyMarketSideLiquidity: MarketSideLiquidity = {
 | 
			
		||||
    },
 | 
			
		||||
    quoteSourceFilters: new SourceFilters(),
 | 
			
		||||
    isRfqSupported: false,
 | 
			
		||||
    blockNumber: 1337420,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const sellMarketSideLiquidity: MarketSideLiquidity = {
 | 
			
		||||
@@ -88,7 +87,6 @@ const sellMarketSideLiquidity: MarketSideLiquidity = {
 | 
			
		||||
    },
 | 
			
		||||
    quoteSourceFilters: new SourceFilters(),
 | 
			
		||||
    isRfqSupported: false,
 | 
			
		||||
    blockNumber: 1337420,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
describe('getComparisonPrices', async () => {
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -141,7 +141,6 @@ describe('ExchangeProxySwapQuoteConsumer', () => {
 | 
			
		||||
            ...(side === MarketOperation.Buy
 | 
			
		||||
                ? { type: MarketOperation.Buy, makerTokenFillAmount }
 | 
			
		||||
                : { type: MarketOperation.Sell, takerTokenFillAmount }),
 | 
			
		||||
            blockNumber: 1337420,
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -483,8 +483,7 @@ describe('MarketOperationUtils tests', () => {
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it('queries `numSamples` samples', async () => {
 | 
			
		||||
                // neon-router requires at least 3 samples
 | 
			
		||||
                const numSamples = _.random(3, NUM_SAMPLES);
 | 
			
		||||
                const numSamples = _.random(1, NUM_SAMPLES);
 | 
			
		||||
                let actualNumSamples = 0;
 | 
			
		||||
                replaceSamplerOps({
 | 
			
		||||
                    getSellQuotes: (sources, makerToken, takerToken, amounts, wethAddress) => {
 | 
			
		||||
@@ -502,7 +501,6 @@ describe('MarketOperationUtils tests', () => {
 | 
			
		||||
                await getMarketSellOrdersAsync(marketOperationUtils, ORDERS, FILL_AMOUNT, {
 | 
			
		||||
                    ...DEFAULT_OPTS,
 | 
			
		||||
                    numSamples,
 | 
			
		||||
                    neonRouterNumSamples: numSamples,
 | 
			
		||||
                });
 | 
			
		||||
                expect(actualNumSamples).eq(numSamples);
 | 
			
		||||
            });
 | 
			
		||||
@@ -748,7 +746,6 @@ describe('MarketOperationUtils tests', () => {
 | 
			
		||||
                                ],
 | 
			
		||||
                            },
 | 
			
		||||
                            isRfqSupported: true,
 | 
			
		||||
                            blockNumber: 1337420,
 | 
			
		||||
                        };
 | 
			
		||||
                    });
 | 
			
		||||
                const result = await mockedMarketOpUtils.object.getOptimizerResultAsync(
 | 
			
		||||
@@ -1081,8 +1078,7 @@ describe('MarketOperationUtils tests', () => {
 | 
			
		||||
 | 
			
		||||
            const ETH_TO_MAKER_RATE = 1.5;
 | 
			
		||||
 | 
			
		||||
            // TODO: disabled as this is not supported by neon-router
 | 
			
		||||
            it.skip('factors in fees for native orders', async () => {
 | 
			
		||||
            it('factors in fees for native orders', async () => {
 | 
			
		||||
                // Native orders will have the best rates but have fees,
 | 
			
		||||
                // dropping their effective rates.
 | 
			
		||||
                const nativeFeeRate = 0.06;
 | 
			
		||||
@@ -1185,9 +1181,7 @@ describe('MarketOperationUtils tests', () => {
 | 
			
		||||
                expect(orderSources.sort()).to.deep.eq(expectedSources.sort());
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            // NOTE: Currently fallbacks for native orders are disabled
 | 
			
		||||
            // TODO: remove this if we remove fallbacks completely
 | 
			
		||||
            it.skip('does not create a fallback if below maxFallbackSlippage', async () => {
 | 
			
		||||
            it('does not create a fallback if below maxFallbackSlippage', async () => {
 | 
			
		||||
                const rates: RatesBySource = {};
 | 
			
		||||
                rates[ERC20BridgeSource.Native] = [1, 1, 0.01, 0.01];
 | 
			
		||||
                rates[ERC20BridgeSource.Uniswap] = [1, 1, 0.01, 0.01];
 | 
			
		||||
@@ -1331,8 +1325,7 @@ describe('MarketOperationUtils tests', () => {
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            it('queries `numSamples` samples', async () => {
 | 
			
		||||
                // neon-router requires at least 3 samples
 | 
			
		||||
                const numSamples = _.random(3, 16);
 | 
			
		||||
                const numSamples = _.random(1, 16);
 | 
			
		||||
                let actualNumSamples = 0;
 | 
			
		||||
                replaceSamplerOps({
 | 
			
		||||
                    getBuyQuotes: (sources, makerToken, takerToken, amounts, wethAddress) => {
 | 
			
		||||
@@ -1350,8 +1343,6 @@ describe('MarketOperationUtils tests', () => {
 | 
			
		||||
                await getMarketBuyOrdersAsync(marketOperationUtils, ORDERS, FILL_AMOUNT, {
 | 
			
		||||
                    ...DEFAULT_OPTS,
 | 
			
		||||
                    numSamples,
 | 
			
		||||
                    // Make sure to use same number of samples in neon-router for compatibility
 | 
			
		||||
                    neonRouterNumSamples: numSamples,
 | 
			
		||||
                });
 | 
			
		||||
                expect(actualNumSamples).eq(numSamples);
 | 
			
		||||
            });
 | 
			
		||||
@@ -1503,8 +1494,7 @@ describe('MarketOperationUtils tests', () => {
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            // TODO: disabled as this is not supported by neon-router
 | 
			
		||||
            it.skip('can mix convex sources', async () => {
 | 
			
		||||
            it('can mix convex sources', async () => {
 | 
			
		||||
                const rates: RatesBySource = { ...ZERO_RATES };
 | 
			
		||||
                rates[ERC20BridgeSource.Native] = [0.4, 0.3, 0.2, 0.1];
 | 
			
		||||
                rates[ERC20BridgeSource.Uniswap] = [0.5, 0.05, 0.05, 0.05];
 | 
			
		||||
@@ -1531,8 +1521,7 @@ describe('MarketOperationUtils tests', () => {
 | 
			
		||||
 | 
			
		||||
            const ETH_TO_TAKER_RATE = 1.5;
 | 
			
		||||
 | 
			
		||||
            // TODO: disabled as this is not supported by neon-router
 | 
			
		||||
            it.skip('factors in fees for native orders', async () => {
 | 
			
		||||
            it('factors in fees for native orders', async () => {
 | 
			
		||||
                // Native orders will have the best rates but have fees,
 | 
			
		||||
                // dropping their effective rates.
 | 
			
		||||
                const nativeFeeRate = 0.06;
 | 
			
		||||
@@ -1609,9 +1598,7 @@ describe('MarketOperationUtils tests', () => {
 | 
			
		||||
                expect(orderSources.sort()).to.deep.eq(expectedSources.sort());
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            // NOTE: Currently fallbacks for native orders are disabled
 | 
			
		||||
            // TODO: remove this if we remove fallbacks completely
 | 
			
		||||
            it.skip('does not create a fallback if below maxFallbackSlippage', async () => {
 | 
			
		||||
            it('does not create a fallback if below maxFallbackSlippage', async () => {
 | 
			
		||||
                const rates: RatesBySource = { ...ZERO_RATES };
 | 
			
		||||
                rates[ERC20BridgeSource.Native] = [1, 1, 0.01, 0.01];
 | 
			
		||||
                rates[ERC20BridgeSource.Uniswap] = [1, 1, 0.01, 0.01];
 | 
			
		||||
 
 | 
			
		||||
@@ -44,7 +44,6 @@ export async function getFullyFillableSwapQuoteWithNoFeesAsync(
 | 
			
		||||
        makerAmountPerEth: constants.ZERO_AMOUNT,
 | 
			
		||||
        makerTokenDecimals: 18,
 | 
			
		||||
        takerTokenDecimals: 18,
 | 
			
		||||
        blockNumber: 1337420,
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    if (operation === MarketOperation.Buy) {
 | 
			
		||||
 
 | 
			
		||||
@@ -6,28 +6,29 @@
 | 
			
		||||
export * from '../test/generated-wrappers/approximate_buys';
 | 
			
		||||
export * from '../test/generated-wrappers/balance_checker';
 | 
			
		||||
export * from '../test/generated-wrappers/balancer_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/balancer_v2_batch_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/balancer_v2_common';
 | 
			
		||||
export * from '../test/generated-wrappers/balancer_v2_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/bancor_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/compound_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/curve_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/d_o_d_o_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/d_o_d_o_v2_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/dummy_liquidity_provider';
 | 
			
		||||
export * from '../test/generated-wrappers/erc20_bridge_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/fake_taker';
 | 
			
		||||
export * from '../test/generated-wrappers/g_m_x_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/i_balancer';
 | 
			
		||||
export * from '../test/generated-wrappers/i_balancer_v2_vault';
 | 
			
		||||
export * from '../test/generated-wrappers/i_bancor';
 | 
			
		||||
export * from '../test/generated-wrappers/i_curve';
 | 
			
		||||
export * from '../test/generated-wrappers/i_kyber_network';
 | 
			
		||||
export * from '../test/generated-wrappers/i_m_stable';
 | 
			
		||||
export * from '../test/generated-wrappers/i_mooniswap';
 | 
			
		||||
export * from '../test/generated-wrappers/i_multi_bridge';
 | 
			
		||||
export * from '../test/generated-wrappers/i_platypus';
 | 
			
		||||
export * from '../test/generated-wrappers/i_shell';
 | 
			
		||||
export * from '../test/generated-wrappers/i_smoothy';
 | 
			
		||||
export * from '../test/generated-wrappers/i_uniswap_exchange_quotes';
 | 
			
		||||
export * from '../test/generated-wrappers/i_uniswap_v2_router01';
 | 
			
		||||
export * from '../test/generated-wrappers/igmx';
 | 
			
		||||
export * from '../test/generated-wrappers/kyber_dmm_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/kyber_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/lido_sampler';
 | 
			
		||||
@@ -35,10 +36,13 @@ export * from '../test/generated-wrappers/liquidity_provider_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/m_stable_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/maker_p_s_m_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/mooniswap_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/multi_bridge_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/native_order_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/platypus_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/sampler_utils';
 | 
			
		||||
export * from '../test/generated-wrappers/shell_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/smoothy_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/test_erc20_bridge_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/test_native_order_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/two_hop_sampler';
 | 
			
		||||
export * from '../test/generated-wrappers/uniswap_sampler';
 | 
			
		||||
 
 | 
			
		||||
@@ -9,24 +9,25 @@
 | 
			
		||||
        "test/generated-artifacts/ApproximateBuys.json",
 | 
			
		||||
        "test/generated-artifacts/BalanceChecker.json",
 | 
			
		||||
        "test/generated-artifacts/BalancerSampler.json",
 | 
			
		||||
        "test/generated-artifacts/BalancerV2BatchSampler.json",
 | 
			
		||||
        "test/generated-artifacts/BalancerV2Common.json",
 | 
			
		||||
        "test/generated-artifacts/BalancerV2Sampler.json",
 | 
			
		||||
        "test/generated-artifacts/BancorSampler.json",
 | 
			
		||||
        "test/generated-artifacts/CompoundSampler.json",
 | 
			
		||||
        "test/generated-artifacts/CurveSampler.json",
 | 
			
		||||
        "test/generated-artifacts/DODOSampler.json",
 | 
			
		||||
        "test/generated-artifacts/DODOV2Sampler.json",
 | 
			
		||||
        "test/generated-artifacts/DummyLiquidityProvider.json",
 | 
			
		||||
        "test/generated-artifacts/ERC20BridgeSampler.json",
 | 
			
		||||
        "test/generated-artifacts/FakeTaker.json",
 | 
			
		||||
        "test/generated-artifacts/GMXSampler.json",
 | 
			
		||||
        "test/generated-artifacts/IBalancer.json",
 | 
			
		||||
        "test/generated-artifacts/IBalancerV2Vault.json",
 | 
			
		||||
        "test/generated-artifacts/IBancor.json",
 | 
			
		||||
        "test/generated-artifacts/ICurve.json",
 | 
			
		||||
        "test/generated-artifacts/IGMX.json",
 | 
			
		||||
        "test/generated-artifacts/IKyberNetwork.json",
 | 
			
		||||
        "test/generated-artifacts/IMStable.json",
 | 
			
		||||
        "test/generated-artifacts/IMooniswap.json",
 | 
			
		||||
        "test/generated-artifacts/IMultiBridge.json",
 | 
			
		||||
        "test/generated-artifacts/IPlatypus.json",
 | 
			
		||||
        "test/generated-artifacts/IShell.json",
 | 
			
		||||
        "test/generated-artifacts/ISmoothy.json",
 | 
			
		||||
        "test/generated-artifacts/IUniswapExchangeQuotes.json",
 | 
			
		||||
@@ -38,10 +39,13 @@
 | 
			
		||||
        "test/generated-artifacts/MStableSampler.json",
 | 
			
		||||
        "test/generated-artifacts/MakerPSMSampler.json",
 | 
			
		||||
        "test/generated-artifacts/MooniswapSampler.json",
 | 
			
		||||
        "test/generated-artifacts/MultiBridgeSampler.json",
 | 
			
		||||
        "test/generated-artifacts/NativeOrderSampler.json",
 | 
			
		||||
        "test/generated-artifacts/PlatypusSampler.json",
 | 
			
		||||
        "test/generated-artifacts/SamplerUtils.json",
 | 
			
		||||
        "test/generated-artifacts/ShellSampler.json",
 | 
			
		||||
        "test/generated-artifacts/SmoothySampler.json",
 | 
			
		||||
        "test/generated-artifacts/TestERC20BridgeSampler.json",
 | 
			
		||||
        "test/generated-artifacts/TestNativeOrderSampler.json",
 | 
			
		||||
        "test/generated-artifacts/TwoHopSampler.json",
 | 
			
		||||
        "test/generated-artifacts/UniswapSampler.json",
 | 
			
		||||
 
 | 
			
		||||
@@ -1,23 +1,4 @@
 | 
			
		||||
[
 | 
			
		||||
    {
 | 
			
		||||
        "version": "6.13.0",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Redeploy FQT on mainnet and polygon",
 | 
			
		||||
                "pr": 462
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "timestamp": 1650611093
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1648739346,
 | 
			
		||||
        "version": "6.12.1",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Dependencies updated"
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "version": "6.12.0",
 | 
			
		||||
        "changes": [
 | 
			
		||||
 
 | 
			
		||||
@@ -5,14 +5,6 @@ Edit the package's CHANGELOG.json file only.
 | 
			
		||||
 | 
			
		||||
CHANGELOG
 | 
			
		||||
 | 
			
		||||
## v6.13.0 - _April 22, 2022_
 | 
			
		||||
 | 
			
		||||
    * Redeploy FQT on mainnet and polygon (#462)
 | 
			
		||||
 | 
			
		||||
## v6.12.1 - _March 31, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 | 
			
		||||
## v6.12.0 - _March 2, 2022_
 | 
			
		||||
 | 
			
		||||
    * Update fantom fillQuoteTransformer addresses (#398)
 | 
			
		||||
 
 | 
			
		||||
@@ -37,7 +37,7 @@
 | 
			
		||||
            "wethTransformer": "0xb2bc06a4efb20fc6553a69dbfa49b7be938034a7",
 | 
			
		||||
            "payTakerTransformer": "0x4638a7ebe75b911b995d0ec73a81e4f85f41f24e",
 | 
			
		||||
            "affiliateFeeTransformer": "0xda6d9fc5998f550a094585cf9171f0e8ee3ac59f",
 | 
			
		||||
            "fillQuoteTransformer": "0xadbe39f2988a8be1c1120f05e28cc888b150c8a6",
 | 
			
		||||
            "fillQuoteTransformer": "0xb4fa284689c9784a60d840eb136bb16c5246191f",
 | 
			
		||||
            "positiveSlippageFeeTransformer": "0xa9416ce1dbde8d331210c07b5c253d94ee4cc3fd"
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
@@ -289,7 +289,7 @@
 | 
			
		||||
            "wethTransformer": "0xe309d011cc6f189a3e8dcba85922715a019fed38",
 | 
			
		||||
            "payTakerTransformer": "0x5ba7b9be86cda01cfbf56e0fb97184783be9dda1",
 | 
			
		||||
            "affiliateFeeTransformer": "0xbed27284b42e5684e987169cf1da09c5d6c49fa8",
 | 
			
		||||
            "fillQuoteTransformer": "0xd4a518760030dae1adbde9496f8a3b478e83932a",
 | 
			
		||||
            "fillQuoteTransformer": "0xd3afdf4a8ea9183e76c9c2306cda03ea4afffea5",
 | 
			
		||||
            "positiveSlippageFeeTransformer": "0x4cd8f1c0df4d40fcc1e073845d5f6f4ed5cc8dab"
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "@0x/contract-addresses",
 | 
			
		||||
    "version": "6.13.0",
 | 
			
		||||
    "version": "6.12.0",
 | 
			
		||||
    "engines": {
 | 
			
		||||
        "node": ">=6.12"
 | 
			
		||||
    },
 | 
			
		||||
@@ -30,7 +30,7 @@
 | 
			
		||||
    "devDependencies": {
 | 
			
		||||
        "gitpkg": "https://github.com/0xProject/gitpkg.git",
 | 
			
		||||
        "shx": "^0.2.2",
 | 
			
		||||
        "typescript": "4.6.3"
 | 
			
		||||
        "typescript": "4.2.2"
 | 
			
		||||
    },
 | 
			
		||||
    "publishConfig": {
 | 
			
		||||
        "access": "public"
 | 
			
		||||
 
 | 
			
		||||
@@ -1,14 +1,4 @@
 | 
			
		||||
[
 | 
			
		||||
    {
 | 
			
		||||
        "version": "3.18.0",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Regenerate all artifacts",
 | 
			
		||||
                "pr": 449
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "timestamp": 1648739346
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "version": "3.17.0",
 | 
			
		||||
        "changes": [
 | 
			
		||||
 
 | 
			
		||||
@@ -5,10 +5,6 @@ Edit the package's CHANGELOG.json file only.
 | 
			
		||||
 | 
			
		||||
CHANGELOG
 | 
			
		||||
 | 
			
		||||
## v3.18.0 - _March 31, 2022_
 | 
			
		||||
 | 
			
		||||
    * Regenerate all artifacts (#449)
 | 
			
		||||
 | 
			
		||||
## v3.17.0 - _February 22, 2022_
 | 
			
		||||
 | 
			
		||||
    * Update IZeroEx artifact (#429)
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@@ -135,10 +135,10 @@
 | 
			
		||||
        },
 | 
			
		||||
        "evm": {
 | 
			
		||||
            "bytecode": {
 | 
			
		||||
                "object": "0x608060405234801561001057600080fd5b506106bf806100206000396000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c806370a082311161005057806370a0823114610121578063a9059cbb14610154578063dd62ed3e1461018d57610072565b8063095ea7b31461007757806318160ddd146100c457806323b872dd146100de575b600080fd5b6100b06004803603604081101561008d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356101c8565b604080519115158252519081900360200190f35b6100cc61023b565b60408051918252519081900360200190f35b6100b0600480360360608110156100f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610241565b6100cc6004803603602081101561013757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661049d565b6100b06004803603604081101561016a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356104c5565b6100cc600480360360408110156101a357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610652565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260408120548211156102d557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604080832033845290915290205482111561037457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f45524332305f494e53554646494349454e545f414c4c4f57414e434500000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902054828101101561040a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff80841660008181526020818152604080832080548801905593881680835284832080548890039055600182528483203384528252918490208054879003905583518681529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b3360009081526020819052604081205482111561054357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110156105d957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b336000818152602081815260408083208054879003905573ffffffffffffffffffffffffffffffffffffffff871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff91821660009081526001602090815260408083209390941682529190915220549056fea265627a7a72315820a51afc8c5cb32c94c3f05c807ed412c5091b6f59e504ef34013b272c3c46a3ee64736f6c63430005110032"
 | 
			
		||||
                "object": "0x608060405234801561001057600080fd5b506106bf806100206000396000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c806370a082311161005057806370a0823114610121578063a9059cbb14610154578063dd62ed3e1461018d57610072565b8063095ea7b31461007757806318160ddd146100c457806323b872dd146100de575b600080fd5b6100b06004803603604081101561008d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356101c8565b604080519115158252519081900360200190f35b6100cc61023b565b60408051918252519081900360200190f35b6100b0600480360360608110156100f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610241565b6100cc6004803603602081101561013757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661049d565b6100b06004803603604081101561016a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356104c5565b6100cc600480360360408110156101a357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610652565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260408120548211156102d557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604080832033845290915290205482111561037457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f45524332305f494e53554646494349454e545f414c4c4f57414e434500000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902054828101101561040a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff80841660008181526020818152604080832080548801905593881680835284832080548890039055600182528483203384528252918490208054879003905583518681529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b3360009081526020819052604081205482111561054357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110156105d957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b336000818152602081815260408083208054879003905573ffffffffffffffffffffffffffffffffffffffff871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff91821660009081526001602090815260408083209390941682529190915220549056fea265627a7a723158200a0e5b4813b81b4a59cf323e9296dbdc12eadc2b35caf21c2052aa9fc5df88b364736f6c63430005110032"
 | 
			
		||||
            },
 | 
			
		||||
            "deployedBytecode": {
 | 
			
		||||
                "object": "0x608060405234801561001057600080fd5b50600436106100725760003560e01c806370a082311161005057806370a0823114610121578063a9059cbb14610154578063dd62ed3e1461018d57610072565b8063095ea7b31461007757806318160ddd146100c457806323b872dd146100de575b600080fd5b6100b06004803603604081101561008d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356101c8565b604080519115158252519081900360200190f35b6100cc61023b565b60408051918252519081900360200190f35b6100b0600480360360608110156100f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610241565b6100cc6004803603602081101561013757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661049d565b6100b06004803603604081101561016a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356104c5565b6100cc600480360360408110156101a357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610652565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260408120548211156102d557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604080832033845290915290205482111561037457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f45524332305f494e53554646494349454e545f414c4c4f57414e434500000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902054828101101561040a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff80841660008181526020818152604080832080548801905593881680835284832080548890039055600182528483203384528252918490208054879003905583518681529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b3360009081526020819052604081205482111561054357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110156105d957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b336000818152602081815260408083208054879003905573ffffffffffffffffffffffffffffffffffffffff871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff91821660009081526001602090815260408083209390941682529190915220549056fea265627a7a72315820a51afc8c5cb32c94c3f05c807ed412c5091b6f59e504ef34013b272c3c46a3ee64736f6c63430005110032"
 | 
			
		||||
                "object": "0x608060405234801561001057600080fd5b50600436106100725760003560e01c806370a082311161005057806370a0823114610121578063a9059cbb14610154578063dd62ed3e1461018d57610072565b8063095ea7b31461007757806318160ddd146100c457806323b872dd146100de575b600080fd5b6100b06004803603604081101561008d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356101c8565b604080519115158252519081900360200190f35b6100cc61023b565b60408051918252519081900360200190f35b6100b0600480360360608110156100f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610241565b6100cc6004803603602081101561013757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661049d565b6100b06004803603604081101561016a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356104c5565b6100cc600480360360408110156101a357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610652565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260408120548211156102d557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604080832033845290915290205482111561037457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f45524332305f494e53554646494349454e545f414c4c4f57414e434500000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902054828101101561040a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff80841660008181526020818152604080832080548801905593881680835284832080548890039055600182528483203384528252918490208054879003905583518681529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b3360009081526020819052604081205482111561054357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110156105d957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b336000818152602081815260408083208054879003905573ffffffffffffffffffffffffffffffffffffffff871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff91821660009081526001602090815260408083209390941682529190915220549056fea265627a7a723158200a0e5b4813b81b4a59cf323e9296dbdc12eadc2b35caf21c2052aa9fc5df88b364736f6c63430005110032"
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
 
 | 
			
		||||
@@ -158,10 +158,10 @@
 | 
			
		||||
        "devdoc": { "methods": {} },
 | 
			
		||||
        "evm": {
 | 
			
		||||
            "bytecode": {
 | 
			
		||||
                "object": "0x60c0604052600d60808190526c2bb930b83832b21022ba3432b960991b60a090815261002e916000919061007a565b50604080518082019091526004808252630ae8aa8960e31b602090920191825261005a9160019161007a565b506002805460ff1916601217905534801561007457600080fd5b50610115565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100bb57805160ff19168380011785556100e8565b828001600101855582156100e8579182015b828111156100e85782518255916020019190600101906100cd565b506100f49291506100f8565b5090565b61011291905b808211156100f457600081556001016100fe565b90565b6107f9806101246000396000f3fe6080604052600436106100bc5760003560e01c8063313ce56711610074578063a9059cbb1161004e578063a9059cbb146102cb578063d0e30db0146100bc578063dd62ed3e14610311576100bc565b8063313ce5671461024b57806370a082311461027657806395d89b41146102b6576100bc565b806318160ddd116100a557806318160ddd146101aa57806323b872dd146101d15780632e1a7d4d14610221576100bc565b806306fdde03146100c6578063095ea7b314610150575b6100c4610359565b005b3480156100d257600080fd5b506100db6103a8565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101155781810151838201526020016100fd565b50505050905090810190601f1680156101425780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015c57600080fd5b506101966004803603604081101561017357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610454565b604080519115158252519081900360200190f35b3480156101b657600080fd5b506101bf6104c7565b60408051918252519081900360200190f35b3480156101dd57600080fd5b50610196600480360360608110156101f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013590911690604001356104cb565b34801561022d57600080fd5b506100c46004803603602081101561024457600080fd5b503561066b565b34801561025757600080fd5b50610260610700565b6040805160ff9092168252519081900360200190f35b34801561028257600080fd5b506101bf6004803603602081101561029957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610709565b3480156102c257600080fd5b506100db61071b565b3480156102d757600080fd5b50610196600480360360408110156102ee57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610793565b34801561031d57600080fd5b506101bf6004803603604081101561033457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160200135166107a7565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b820191906000526020600020905b81548152906001019060200180831161042f57829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b4790565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600360205260408120548211156104fd57600080fd5b73ffffffffffffffffffffffffffffffffffffffff84163314801590610573575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b156105ed5773ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020548211156105b557600080fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020805483900390555b73ffffffffffffffffffffffffffffffffffffffff808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b3360009081526003602052604090205481111561068757600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f193505050501580156106c6573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b60006107a03384846104cb565b9392505050565b60046020908152600092835260408084209091529082529020548156fea265627a7a723158207b3f55a80647ba1c13f3619b5076feeeb78e1bd7df76cf334f47aa40f79b623864736f6c63430005110032"
 | 
			
		||||
                "object": "0x60c0604052600d60808190526c2bb930b83832b21022ba3432b960991b60a090815261002e916000919061007a565b50604080518082019091526004808252630ae8aa8960e31b602090920191825261005a9160019161007a565b506002805460ff1916601217905534801561007457600080fd5b50610115565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100bb57805160ff19168380011785556100e8565b828001600101855582156100e8579182015b828111156100e85782518255916020019190600101906100cd565b506100f49291506100f8565b5090565b61011291905b808211156100f457600081556001016100fe565b90565b6107f9806101246000396000f3fe6080604052600436106100bc5760003560e01c8063313ce56711610074578063a9059cbb1161004e578063a9059cbb146102cb578063d0e30db0146100bc578063dd62ed3e14610311576100bc565b8063313ce5671461024b57806370a082311461027657806395d89b41146102b6576100bc565b806318160ddd116100a557806318160ddd146101aa57806323b872dd146101d15780632e1a7d4d14610221576100bc565b806306fdde03146100c6578063095ea7b314610150575b6100c4610359565b005b3480156100d257600080fd5b506100db6103a8565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101155781810151838201526020016100fd565b50505050905090810190601f1680156101425780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015c57600080fd5b506101966004803603604081101561017357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610454565b604080519115158252519081900360200190f35b3480156101b657600080fd5b506101bf6104c7565b60408051918252519081900360200190f35b3480156101dd57600080fd5b50610196600480360360608110156101f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013590911690604001356104cb565b34801561022d57600080fd5b506100c46004803603602081101561024457600080fd5b503561066b565b34801561025757600080fd5b50610260610700565b6040805160ff9092168252519081900360200190f35b34801561028257600080fd5b506101bf6004803603602081101561029957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610709565b3480156102c257600080fd5b506100db61071b565b3480156102d757600080fd5b50610196600480360360408110156102ee57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610793565b34801561031d57600080fd5b506101bf6004803603604081101561033457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160200135166107a7565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b820191906000526020600020905b81548152906001019060200180831161042f57829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b4790565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600360205260408120548211156104fd57600080fd5b73ffffffffffffffffffffffffffffffffffffffff84163314801590610573575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b156105ed5773ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020548211156105b557600080fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020805483900390555b73ffffffffffffffffffffffffffffffffffffffff808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b3360009081526003602052604090205481111561068757600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f193505050501580156106c6573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b60006107a03384846104cb565b9392505050565b60046020908152600092835260408084209091529082529020548156fea265627a7a723158206b7dcca2f4268299085314087a9c8506d18f6b6a5debabd331b75cf760e6714564736f6c63430005110032"
 | 
			
		||||
            },
 | 
			
		||||
            "deployedBytecode": {
 | 
			
		||||
                "object": "0x6080604052600436106100bc5760003560e01c8063313ce56711610074578063a9059cbb1161004e578063a9059cbb146102cb578063d0e30db0146100bc578063dd62ed3e14610311576100bc565b8063313ce5671461024b57806370a082311461027657806395d89b41146102b6576100bc565b806318160ddd116100a557806318160ddd146101aa57806323b872dd146101d15780632e1a7d4d14610221576100bc565b806306fdde03146100c6578063095ea7b314610150575b6100c4610359565b005b3480156100d257600080fd5b506100db6103a8565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101155781810151838201526020016100fd565b50505050905090810190601f1680156101425780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015c57600080fd5b506101966004803603604081101561017357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610454565b604080519115158252519081900360200190f35b3480156101b657600080fd5b506101bf6104c7565b60408051918252519081900360200190f35b3480156101dd57600080fd5b50610196600480360360608110156101f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013590911690604001356104cb565b34801561022d57600080fd5b506100c46004803603602081101561024457600080fd5b503561066b565b34801561025757600080fd5b50610260610700565b6040805160ff9092168252519081900360200190f35b34801561028257600080fd5b506101bf6004803603602081101561029957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610709565b3480156102c257600080fd5b506100db61071b565b3480156102d757600080fd5b50610196600480360360408110156102ee57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610793565b34801561031d57600080fd5b506101bf6004803603604081101561033457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160200135166107a7565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b820191906000526020600020905b81548152906001019060200180831161042f57829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b4790565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600360205260408120548211156104fd57600080fd5b73ffffffffffffffffffffffffffffffffffffffff84163314801590610573575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b156105ed5773ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020548211156105b557600080fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020805483900390555b73ffffffffffffffffffffffffffffffffffffffff808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b3360009081526003602052604090205481111561068757600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f193505050501580156106c6573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b60006107a03384846104cb565b9392505050565b60046020908152600092835260408084209091529082529020548156fea265627a7a723158207b3f55a80647ba1c13f3619b5076feeeb78e1bd7df76cf334f47aa40f79b623864736f6c63430005110032"
 | 
			
		||||
                "object": "0x6080604052600436106100bc5760003560e01c8063313ce56711610074578063a9059cbb1161004e578063a9059cbb146102cb578063d0e30db0146100bc578063dd62ed3e14610311576100bc565b8063313ce5671461024b57806370a082311461027657806395d89b41146102b6576100bc565b806318160ddd116100a557806318160ddd146101aa57806323b872dd146101d15780632e1a7d4d14610221576100bc565b806306fdde03146100c6578063095ea7b314610150575b6100c4610359565b005b3480156100d257600080fd5b506100db6103a8565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101155781810151838201526020016100fd565b50505050905090810190601f1680156101425780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015c57600080fd5b506101966004803603604081101561017357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610454565b604080519115158252519081900360200190f35b3480156101b657600080fd5b506101bf6104c7565b60408051918252519081900360200190f35b3480156101dd57600080fd5b50610196600480360360608110156101f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013590911690604001356104cb565b34801561022d57600080fd5b506100c46004803603602081101561024457600080fd5b503561066b565b34801561025757600080fd5b50610260610700565b6040805160ff9092168252519081900360200190f35b34801561028257600080fd5b506101bf6004803603602081101561029957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610709565b3480156102c257600080fd5b506100db61071b565b3480156102d757600080fd5b50610196600480360360408110156102ee57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610793565b34801561031d57600080fd5b506101bf6004803603604081101561033457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160200135166107a7565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b820191906000526020600020905b81548152906001019060200180831161042f57829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b4790565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600360205260408120548211156104fd57600080fd5b73ffffffffffffffffffffffffffffffffffffffff84163314801590610573575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b156105ed5773ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020548211156105b557600080fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020805483900390555b73ffffffffffffffffffffffffffffffffffffffff808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b3360009081526003602052604090205481111561068757600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f193505050501580156106c6573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b60006107a03384846104cb565b9392505050565b60046020908152600092835260408084209091529082529020548156fea265627a7a723158206b7dcca2f4268299085314087a9c8506d18f6b6a5debabd331b75cf760e6714564736f6c63430005110032"
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
 
 | 
			
		||||
@@ -125,10 +125,10 @@
 | 
			
		||||
        },
 | 
			
		||||
        "evm": {
 | 
			
		||||
            "bytecode": {
 | 
			
		||||
                "object": "0x60606040526b033b2e3c9fd0803ce8000000600355341561001c57fe5b5b600354600160a060020a0333166000908152602081905260409020555b5b61078d8061004a6000396000f300606060405236156100965763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610098578063095ea7b31461014657806318160ddd1461018657806323b872dd146101a8578063313ce567146101ee57806370a082311461021457806395d89b411461024f578063a9059cbb146102fd578063dd62ed3e1461033d575bfe5b34156100a057fe5b6100a861037e565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014e57fe5b61017273ffffffffffffffffffffffffffffffffffffffff600435166024356103b5565b604080519115158252519081900360200190f35b341561018e57fe5b61019661042d565b60408051918252519081900360200190f35b34156101b057fe5b61017273ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610433565b604080519115158252519081900360200190f35b34156101f657fe5b6101fe6105d4565b6040805160ff9092168252519081900360200190f35b341561021c57fe5b61019673ffffffffffffffffffffffffffffffffffffffff600435166105d9565b60408051918252519081900360200190f35b341561025757fe5b6100a8610605565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561030557fe5b61017273ffffffffffffffffffffffffffffffffffffffff6004351660243561063c565b604080519115158252519081900360200190f35b341561034557fe5b61019673ffffffffffffffffffffffffffffffffffffffff60043581169060243516610727565b60408051918252519081900360200190f35b60408051808201909152601181527f30782050726f746f636f6c20546f6b656e000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60035481565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906104835750828110155b80156104b6575073ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090205483810110155b156105c65773ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220805487019055918716815220805484900390557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156105585773ffffffffffffffffffffffffffffffffffffffff808616600090815260016020908152604080832033909416835292905220805484900390555b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191506105cb565b600091505b5b509392505050565b601281565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b60408051808201909152600381527f5a52580000000000000000000000000000000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff3316600090815260208190526040812054829010801590610699575073ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110155b156107185773ffffffffffffffffffffffffffffffffffffffff33811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610427565b506000610427565b5b92915050565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600160209081526040808320938516835292905220545b929150505600a165627a7a723058207bda76ca54110f114be74ab23875a2d1613700e2cc4fdadfc8f235d9729b4c450029"
 | 
			
		||||
                "object": "0x60606040526b033b2e3c9fd0803ce8000000600355341561001c57fe5b5b600354600160a060020a0333166000908152602081905260409020555b5b61078d8061004a6000396000f300606060405236156100965763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610098578063095ea7b31461014657806318160ddd1461018657806323b872dd146101a8578063313ce567146101ee57806370a082311461021457806395d89b411461024f578063a9059cbb146102fd578063dd62ed3e1461033d575bfe5b34156100a057fe5b6100a861037e565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014e57fe5b61017273ffffffffffffffffffffffffffffffffffffffff600435166024356103b5565b604080519115158252519081900360200190f35b341561018e57fe5b61019661042d565b60408051918252519081900360200190f35b34156101b057fe5b61017273ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610433565b604080519115158252519081900360200190f35b34156101f657fe5b6101fe6105d4565b6040805160ff9092168252519081900360200190f35b341561021c57fe5b61019673ffffffffffffffffffffffffffffffffffffffff600435166105d9565b60408051918252519081900360200190f35b341561025757fe5b6100a8610605565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561030557fe5b61017273ffffffffffffffffffffffffffffffffffffffff6004351660243561063c565b604080519115158252519081900360200190f35b341561034557fe5b61019673ffffffffffffffffffffffffffffffffffffffff60043581169060243516610727565b60408051918252519081900360200190f35b60408051808201909152601181527f30782050726f746f636f6c20546f6b656e000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60035481565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906104835750828110155b80156104b6575073ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090205483810110155b156105c65773ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220805487019055918716815220805484900390557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156105585773ffffffffffffffffffffffffffffffffffffffff808616600090815260016020908152604080832033909416835292905220805484900390555b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191506105cb565b600091505b5b509392505050565b601281565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b60408051808201909152600381527f5a52580000000000000000000000000000000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff3316600090815260208190526040812054829010801590610699575073ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110155b156107185773ffffffffffffffffffffffffffffffffffffffff33811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610427565b506000610427565b5b92915050565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600160209081526040808320938516835292905220545b929150505600a165627a7a7230582046535601227b5593da4370a7dfeedd2cba029ac1cbef52fe6cae0e64fbbb37ce0029"
 | 
			
		||||
            },
 | 
			
		||||
            "deployedBytecode": {
 | 
			
		||||
                "object": "0x606060405236156100965763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610098578063095ea7b31461014657806318160ddd1461018657806323b872dd146101a8578063313ce567146101ee57806370a082311461021457806395d89b411461024f578063a9059cbb146102fd578063dd62ed3e1461033d575bfe5b34156100a057fe5b6100a861037e565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014e57fe5b61017273ffffffffffffffffffffffffffffffffffffffff600435166024356103b5565b604080519115158252519081900360200190f35b341561018e57fe5b61019661042d565b60408051918252519081900360200190f35b34156101b057fe5b61017273ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610433565b604080519115158252519081900360200190f35b34156101f657fe5b6101fe6105d4565b6040805160ff9092168252519081900360200190f35b341561021c57fe5b61019673ffffffffffffffffffffffffffffffffffffffff600435166105d9565b60408051918252519081900360200190f35b341561025757fe5b6100a8610605565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561030557fe5b61017273ffffffffffffffffffffffffffffffffffffffff6004351660243561063c565b604080519115158252519081900360200190f35b341561034557fe5b61019673ffffffffffffffffffffffffffffffffffffffff60043581169060243516610727565b60408051918252519081900360200190f35b60408051808201909152601181527f30782050726f746f636f6c20546f6b656e000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60035481565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906104835750828110155b80156104b6575073ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090205483810110155b156105c65773ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220805487019055918716815220805484900390557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156105585773ffffffffffffffffffffffffffffffffffffffff808616600090815260016020908152604080832033909416835292905220805484900390555b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191506105cb565b600091505b5b509392505050565b601281565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b60408051808201909152600381527f5a52580000000000000000000000000000000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff3316600090815260208190526040812054829010801590610699575073ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110155b156107185773ffffffffffffffffffffffffffffffffffffffff33811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610427565b506000610427565b5b92915050565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600160209081526040808320938516835292905220545b929150505600a165627a7a723058207bda76ca54110f114be74ab23875a2d1613700e2cc4fdadfc8f235d9729b4c450029"
 | 
			
		||||
                "object": "0x606060405236156100965763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610098578063095ea7b31461014657806318160ddd1461018657806323b872dd146101a8578063313ce567146101ee57806370a082311461021457806395d89b411461024f578063a9059cbb146102fd578063dd62ed3e1461033d575bfe5b34156100a057fe5b6100a861037e565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014e57fe5b61017273ffffffffffffffffffffffffffffffffffffffff600435166024356103b5565b604080519115158252519081900360200190f35b341561018e57fe5b61019661042d565b60408051918252519081900360200190f35b34156101b057fe5b61017273ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610433565b604080519115158252519081900360200190f35b34156101f657fe5b6101fe6105d4565b6040805160ff9092168252519081900360200190f35b341561021c57fe5b61019673ffffffffffffffffffffffffffffffffffffffff600435166105d9565b60408051918252519081900360200190f35b341561025757fe5b6100a8610605565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561030557fe5b61017273ffffffffffffffffffffffffffffffffffffffff6004351660243561063c565b604080519115158252519081900360200190f35b341561034557fe5b61019673ffffffffffffffffffffffffffffffffffffffff60043581169060243516610727565b60408051918252519081900360200190f35b60408051808201909152601181527f30782050726f746f636f6c20546f6b656e000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60035481565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906104835750828110155b80156104b6575073ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090205483810110155b156105c65773ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220805487019055918716815220805484900390557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156105585773ffffffffffffffffffffffffffffffffffffffff808616600090815260016020908152604080832033909416835292905220805484900390555b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191506105cb565b600091505b5b509392505050565b601281565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b60408051808201909152600381527f5a52580000000000000000000000000000000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff3316600090815260208190526040812054829010801590610699575073ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110155b156107185773ffffffffffffffffffffffffffffffffffffffff33811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610427565b506000610427565b5b92915050565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600160209081526040808320938516835292905220545b929150505600a165627a7a7230582046535601227b5593da4370a7dfeedd2cba029ac1cbef52fe6cae0e64fbbb37ce0029"
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "@0x/contract-artifacts",
 | 
			
		||||
    "version": "3.18.0",
 | 
			
		||||
    "version": "3.17.0",
 | 
			
		||||
    "engines": {
 | 
			
		||||
        "node": ">=6.12"
 | 
			
		||||
    },
 | 
			
		||||
@@ -30,13 +30,13 @@
 | 
			
		||||
    },
 | 
			
		||||
    "homepage": "https://github.com/0xProject/protocol/tree/main/packages/contract-artifacts",
 | 
			
		||||
    "devDependencies": {
 | 
			
		||||
        "@0x/utils": "^6.5.3",
 | 
			
		||||
        "@0x/utils": "^6.5.0",
 | 
			
		||||
        "@types/mocha": "^5.2.7",
 | 
			
		||||
        "chai": "^4.0.1",
 | 
			
		||||
        "lodash": "^4.17.11",
 | 
			
		||||
        "mocha": "^6.2.0",
 | 
			
		||||
        "shx": "^0.2.2",
 | 
			
		||||
        "typescript": "4.6.3"
 | 
			
		||||
        "typescript": "4.2.2"
 | 
			
		||||
    },
 | 
			
		||||
    "publishConfig": {
 | 
			
		||||
        "access": "public"
 | 
			
		||||
 
 | 
			
		||||
@@ -1,23 +1,4 @@
 | 
			
		||||
[
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1650611093,
 | 
			
		||||
        "version": "13.20.1",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Dependencies updated"
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "version": "13.20.0",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Regenerate all wrappers",
 | 
			
		||||
                "pr": 449
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "timestamp": 1648739346
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1646225739,
 | 
			
		||||
        "version": "13.19.1",
 | 
			
		||||
 
 | 
			
		||||
@@ -5,14 +5,6 @@ Edit the package's CHANGELOG.json file only.
 | 
			
		||||
 | 
			
		||||
CHANGELOG
 | 
			
		||||
 | 
			
		||||
## v13.20.1 - _April 22, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 | 
			
		||||
## v13.20.0 - _March 31, 2022_
 | 
			
		||||
 | 
			
		||||
    * Regenerate all wrappers (#449)
 | 
			
		||||
 | 
			
		||||
## v13.19.1 - _March 2, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "@0x/contract-wrappers",
 | 
			
		||||
    "version": "13.20.1",
 | 
			
		||||
    "version": "13.19.1",
 | 
			
		||||
    "engines": {
 | 
			
		||||
        "node": ">=6.12"
 | 
			
		||||
    },
 | 
			
		||||
@@ -52,17 +52,17 @@
 | 
			
		||||
        "gitpkg": "https://github.com/0xProject/gitpkg.git",
 | 
			
		||||
        "tslint": "5.11.0",
 | 
			
		||||
        "typedoc": "~0.16.11",
 | 
			
		||||
        "typescript": "4.6.3"
 | 
			
		||||
        "typescript": "4.2.2"
 | 
			
		||||
    },
 | 
			
		||||
    "dependencies": {
 | 
			
		||||
        "@0x/assert": "^3.0.34",
 | 
			
		||||
        "@0x/base-contract": "^6.5.0",
 | 
			
		||||
        "@0x/contract-addresses": "^6.13.0",
 | 
			
		||||
        "@0x/json-schemas": "^6.4.4",
 | 
			
		||||
        "@0x/types": "^3.3.6",
 | 
			
		||||
        "@0x/utils": "^6.5.3",
 | 
			
		||||
        "@0x/web3-wrapper": "^7.6.5",
 | 
			
		||||
        "ethereum-types": "^3.7.0",
 | 
			
		||||
        "@0x/assert": "^3.0.31",
 | 
			
		||||
        "@0x/base-contract": "^6.4.5",
 | 
			
		||||
        "@0x/contract-addresses": "^6.12.0",
 | 
			
		||||
        "@0x/json-schemas": "^6.4.1",
 | 
			
		||||
        "@0x/types": "^3.3.4",
 | 
			
		||||
        "@0x/utils": "^6.5.0",
 | 
			
		||||
        "@0x/web3-wrapper": "^7.6.2",
 | 
			
		||||
        "ethereum-types": "^3.6.0",
 | 
			
		||||
        "ethers": "~4.0.4"
 | 
			
		||||
    },
 | 
			
		||||
    "publishConfig": {
 | 
			
		||||
 
 | 
			
		||||
@@ -475,7 +475,7 @@ export class BrokerContract extends BaseContract {
 | 
			
		||||
        txDefaults: Partial<TxData>,
 | 
			
		||||
        libraryAddresses: { [libraryName: string]: string } = {},
 | 
			
		||||
    ): Promise<{ [libraryName: string]: string }> {
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences || {};
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences;
 | 
			
		||||
        // Go through all linked libraries, recursively deploying them if necessary.
 | 
			
		||||
        for (const link of Object.values(links)) {
 | 
			
		||||
            for (const libraryName of Object.keys(link)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -499,7 +499,7 @@ export class CoordinatorContract extends BaseContract {
 | 
			
		||||
        txDefaults: Partial<TxData>,
 | 
			
		||||
        libraryAddresses: { [libraryName: string]: string } = {},
 | 
			
		||||
    ): Promise<{ [libraryName: string]: string }> {
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences || {};
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences;
 | 
			
		||||
        // Go through all linked libraries, recursively deploying them if necessary.
 | 
			
		||||
        for (const link of Object.values(links)) {
 | 
			
		||||
            for (const libraryName of Object.keys(link)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -1516,7 +1516,7 @@ export class DevUtilsContract extends BaseContract {
 | 
			
		||||
        txDefaults: Partial<TxData>,
 | 
			
		||||
        libraryAddresses: { [libraryName: string]: string } = {},
 | 
			
		||||
    ): Promise<{ [libraryName: string]: string }> {
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences || {};
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences;
 | 
			
		||||
        // Go through all linked libraries, recursively deploying them if necessary.
 | 
			
		||||
        for (const link of Object.values(links)) {
 | 
			
		||||
            for (const libraryName of Object.keys(link)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -347,7 +347,7 @@ export class ERC20TokenContract extends BaseContract {
 | 
			
		||||
        txDefaults: Partial<TxData>,
 | 
			
		||||
        libraryAddresses: { [libraryName: string]: string } = {},
 | 
			
		||||
    ): Promise<{ [libraryName: string]: string }> {
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences || {};
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences;
 | 
			
		||||
        // Go through all linked libraries, recursively deploying them if necessary.
 | 
			
		||||
        for (const link of Object.values(links)) {
 | 
			
		||||
            for (const libraryName of Object.keys(link)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -437,7 +437,7 @@ export class ERC721TokenContract extends BaseContract {
 | 
			
		||||
        txDefaults: Partial<TxData>,
 | 
			
		||||
        libraryAddresses: { [libraryName: string]: string } = {},
 | 
			
		||||
    ): Promise<{ [libraryName: string]: string }> {
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences || {};
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences;
 | 
			
		||||
        // Go through all linked libraries, recursively deploying them if necessary.
 | 
			
		||||
        for (const link of Object.values(links)) {
 | 
			
		||||
            for (const libraryName of Object.keys(link)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -3147,7 +3147,7 @@ export class ExchangeContract extends BaseContract {
 | 
			
		||||
        txDefaults: Partial<TxData>,
 | 
			
		||||
        libraryAddresses: { [libraryName: string]: string } = {},
 | 
			
		||||
    ): Promise<{ [libraryName: string]: string }> {
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences || {};
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences;
 | 
			
		||||
        // Go through all linked libraries, recursively deploying them if necessary.
 | 
			
		||||
        for (const link of Object.values(links)) {
 | 
			
		||||
            for (const libraryName of Object.keys(link)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -699,7 +699,7 @@ export class ForwarderContract extends BaseContract {
 | 
			
		||||
        txDefaults: Partial<TxData>,
 | 
			
		||||
        libraryAddresses: { [libraryName: string]: string } = {},
 | 
			
		||||
    ): Promise<{ [libraryName: string]: string }> {
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences || {};
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences;
 | 
			
		||||
        // Go through all linked libraries, recursively deploying them if necessary.
 | 
			
		||||
        for (const link of Object.values(links)) {
 | 
			
		||||
            for (const libraryName of Object.keys(link)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -201,7 +201,7 @@ export class GodsUnchainedValidatorContract extends BaseContract {
 | 
			
		||||
        txDefaults: Partial<TxData>,
 | 
			
		||||
        libraryAddresses: { [libraryName: string]: string } = {},
 | 
			
		||||
    ): Promise<{ [libraryName: string]: string }> {
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences || {};
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences;
 | 
			
		||||
        // Go through all linked libraries, recursively deploying them if necessary.
 | 
			
		||||
        for (const link of Object.values(links)) {
 | 
			
		||||
            for (const libraryName of Object.keys(link)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -270,7 +270,7 @@ export class IAssetDataContract extends BaseContract {
 | 
			
		||||
        txDefaults: Partial<TxData>,
 | 
			
		||||
        libraryAddresses: { [libraryName: string]: string } = {},
 | 
			
		||||
    ): Promise<{ [libraryName: string]: string }> {
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences || {};
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences;
 | 
			
		||||
        // Go through all linked libraries, recursively deploying them if necessary.
 | 
			
		||||
        for (const link of Object.values(links)) {
 | 
			
		||||
            for (const libraryName of Object.keys(link)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -251,7 +251,7 @@ export class ILiquidityProviderContract extends BaseContract {
 | 
			
		||||
        txDefaults: Partial<TxData>,
 | 
			
		||||
        libraryAddresses: { [libraryName: string]: string } = {},
 | 
			
		||||
    ): Promise<{ [libraryName: string]: string }> {
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences || {};
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences;
 | 
			
		||||
        // Go through all linked libraries, recursively deploying them if necessary.
 | 
			
		||||
        for (const link of Object.values(links)) {
 | 
			
		||||
            for (const libraryName of Object.keys(link)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -415,7 +415,7 @@ export class ITransformERC20Contract extends BaseContract {
 | 
			
		||||
        txDefaults: Partial<TxData>,
 | 
			
		||||
        libraryAddresses: { [libraryName: string]: string } = {},
 | 
			
		||||
    ): Promise<{ [libraryName: string]: string }> {
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences || {};
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences;
 | 
			
		||||
        // Go through all linked libraries, recursively deploying them if necessary.
 | 
			
		||||
        for (const link of Object.values(links)) {
 | 
			
		||||
            for (const libraryName of Object.keys(link)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -7149,7 +7149,7 @@ export class IZeroExContract extends BaseContract {
 | 
			
		||||
        txDefaults: Partial<TxData>,
 | 
			
		||||
        libraryAddresses: { [libraryName: string]: string } = {},
 | 
			
		||||
    ): Promise<{ [libraryName: string]: string }> {
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences || {};
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences;
 | 
			
		||||
        // Go through all linked libraries, recursively deploying them if necessary.
 | 
			
		||||
        for (const link of Object.values(links)) {
 | 
			
		||||
            for (const libraryName of Object.keys(link)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -173,7 +173,7 @@ export class MaximumGasPriceContract extends BaseContract {
 | 
			
		||||
        txDefaults: Partial<TxData>,
 | 
			
		||||
        libraryAddresses: { [libraryName: string]: string } = {},
 | 
			
		||||
    ): Promise<{ [libraryName: string]: string }> {
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences || {};
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences;
 | 
			
		||||
        // Go through all linked libraries, recursively deploying them if necessary.
 | 
			
		||||
        for (const link of Object.values(links)) {
 | 
			
		||||
            for (const libraryName of Object.keys(link)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -1616,7 +1616,7 @@ export class StakingContract extends BaseContract {
 | 
			
		||||
        txDefaults: Partial<TxData>,
 | 
			
		||||
        libraryAddresses: { [libraryName: string]: string } = {},
 | 
			
		||||
    ): Promise<{ [libraryName: string]: string }> {
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences || {};
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences;
 | 
			
		||||
        // Go through all linked libraries, recursively deploying them if necessary.
 | 
			
		||||
        for (const link of Object.values(links)) {
 | 
			
		||||
            for (const libraryName of Object.keys(link)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -743,7 +743,7 @@ export class StakingProxyContract extends BaseContract {
 | 
			
		||||
        txDefaults: Partial<TxData>,
 | 
			
		||||
        libraryAddresses: { [libraryName: string]: string } = {},
 | 
			
		||||
    ): Promise<{ [libraryName: string]: string }> {
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences || {};
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences;
 | 
			
		||||
        // Go through all linked libraries, recursively deploying them if necessary.
 | 
			
		||||
        for (const link of Object.values(links)) {
 | 
			
		||||
            for (const libraryName of Object.keys(link)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -471,7 +471,7 @@ export class WETH9Contract extends BaseContract {
 | 
			
		||||
        txDefaults: Partial<TxData>,
 | 
			
		||||
        libraryAddresses: { [libraryName: string]: string } = {},
 | 
			
		||||
    ): Promise<{ [libraryName: string]: string }> {
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences || {};
 | 
			
		||||
        const links = artifact.compilerOutput.evm.bytecode.linkReferences;
 | 
			
		||||
        // Go through all linked libraries, recursively deploying them if necessary.
 | 
			
		||||
        for (const link of Object.values(links)) {
 | 
			
		||||
            for (const libraryName of Object.keys(link)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,22 +1,4 @@
 | 
			
		||||
[
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1650611093,
 | 
			
		||||
        "version": "8.1.18",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Dependencies updated"
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1648739346,
 | 
			
		||||
        "version": "8.1.17",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Dependencies updated"
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1646225739,
 | 
			
		||||
        "version": "8.1.16",
 | 
			
		||||
 
 | 
			
		||||
@@ -5,14 +5,6 @@ Edit the package's CHANGELOG.json file only.
 | 
			
		||||
 | 
			
		||||
CHANGELOG
 | 
			
		||||
 | 
			
		||||
## v8.1.18 - _April 22, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 | 
			
		||||
## v8.1.17 - _March 31, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 | 
			
		||||
## v8.1.16 - _March 2, 2022_
 | 
			
		||||
 | 
			
		||||
    * Dependencies updated
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "@0x/migrations",
 | 
			
		||||
    "version": "8.1.18",
 | 
			
		||||
    "version": "8.1.16",
 | 
			
		||||
    "engines": {
 | 
			
		||||
        "node": ">=6.12"
 | 
			
		||||
    },
 | 
			
		||||
@@ -48,10 +48,10 @@
 | 
			
		||||
        "registry": "git@github.com:0xProject/gitpkg-registry.git"
 | 
			
		||||
    },
 | 
			
		||||
    "devDependencies": {
 | 
			
		||||
        "@0x/dev-utils": "^4.2.14",
 | 
			
		||||
        "@0x/dev-utils": "^4.2.11",
 | 
			
		||||
        "@0x/ts-doc-gen": "^0.0.28",
 | 
			
		||||
        "@0x/tslint-config": "^4.1.4",
 | 
			
		||||
        "@0x/types": "^3.3.6",
 | 
			
		||||
        "@0x/types": "^3.3.4",
 | 
			
		||||
        "@types/yargs": "^11.0.0",
 | 
			
		||||
        "chai": "^4.0.1",
 | 
			
		||||
        "dirty-chai": "^2.0.1",
 | 
			
		||||
@@ -62,34 +62,34 @@
 | 
			
		||||
        "shx": "^0.2.2",
 | 
			
		||||
        "tslint": "5.11.0",
 | 
			
		||||
        "typedoc": "~0.16.11",
 | 
			
		||||
        "typescript": "4.6.3",
 | 
			
		||||
        "typescript": "4.2.2",
 | 
			
		||||
        "web3-provider-engine": "14.0.6",
 | 
			
		||||
        "yargs": "^10.0.3"
 | 
			
		||||
    },
 | 
			
		||||
    "dependencies": {
 | 
			
		||||
        "@0x/base-contract": "^6.5.0",
 | 
			
		||||
        "@0x/contract-addresses": "^6.13.0",
 | 
			
		||||
        "@0x/base-contract": "^6.4.5",
 | 
			
		||||
        "@0x/contract-addresses": "^6.12.0",
 | 
			
		||||
        "@0x/contracts-asset-proxy": "^3.7.19",
 | 
			
		||||
        "@0x/contracts-coordinator": "^3.1.38",
 | 
			
		||||
        "@0x/contracts-dev-utils": "^1.3.36",
 | 
			
		||||
        "@0x/contracts-erc1155": "^2.1.37",
 | 
			
		||||
        "@0x/contracts-erc20": "^3.3.29",
 | 
			
		||||
        "@0x/contracts-erc20": "^3.3.27",
 | 
			
		||||
        "@0x/contracts-erc721": "^3.1.37",
 | 
			
		||||
        "@0x/contracts-exchange": "^3.2.38",
 | 
			
		||||
        "@0x/contracts-exchange-forwarder": "^4.2.38",
 | 
			
		||||
        "@0x/contracts-extensions": "^6.2.32",
 | 
			
		||||
        "@0x/contracts-multisig": "^4.1.38",
 | 
			
		||||
        "@0x/contracts-staking": "^2.0.45",
 | 
			
		||||
        "@0x/contracts-utils": "^4.8.10",
 | 
			
		||||
        "@0x/contracts-zero-ex": "^0.32.0",
 | 
			
		||||
        "@0x/sol-compiler": "^4.8.1",
 | 
			
		||||
        "@0x/subproviders": "^6.6.5",
 | 
			
		||||
        "@0x/typescript-typings": "^5.3.1",
 | 
			
		||||
        "@0x/utils": "^6.5.3",
 | 
			
		||||
        "@0x/web3-wrapper": "^7.6.5",
 | 
			
		||||
        "@0x/contracts-utils": "^4.8.8",
 | 
			
		||||
        "@0x/contracts-zero-ex": "^0.31.1",
 | 
			
		||||
        "@0x/sol-compiler": "^4.7.8",
 | 
			
		||||
        "@0x/subproviders": "^6.6.2",
 | 
			
		||||
        "@0x/typescript-typings": "^5.2.1",
 | 
			
		||||
        "@0x/utils": "^6.5.0",
 | 
			
		||||
        "@0x/web3-wrapper": "^7.6.2",
 | 
			
		||||
        "@ledgerhq/hw-app-eth": "^4.3.0",
 | 
			
		||||
        "@types/web3-provider-engine": "^14.0.0",
 | 
			
		||||
        "ethereum-types": "^3.7.0",
 | 
			
		||||
        "ethereum-types": "^3.6.0",
 | 
			
		||||
        "ethereumjs-util": "^7.1.0",
 | 
			
		||||
        "ethers": "~4.0.4",
 | 
			
		||||
        "lodash": "^4.17.11"
 | 
			
		||||
 
 | 
			
		||||
@@ -1,20 +1,9 @@
 | 
			
		||||
[
 | 
			
		||||
    {
 | 
			
		||||
        "version": "11.12.0",
 | 
			
		||||
        "version": "1.12.0",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Add `BalancerV2Batch` to `BridgeProtocol` enum",
 | 
			
		||||
                "pr": 462
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "timestamp": 1650611093
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "timestamp": 1648739346,
 | 
			
		||||
        "version": "1.11.2",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Dependencies updated"
 | 
			
		||||
                "note": "Added Support for GMX liquidity source on Avalanche"
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user