Compare commits
39 Commits
@0x/contra
...
@0x/contra
Author | SHA1 | Date | |
---|---|---|---|
|
15f75a08d5 | ||
|
29f9c5473d | ||
|
ea1528aea6 | ||
|
cded58c30d | ||
|
da17b49b81 | ||
|
4728cdfa7c | ||
|
97fb843f01 | ||
|
8afb044877 | ||
|
7f869868c9 | ||
|
31275228ac | ||
|
3b446e887a | ||
|
431196c391 | ||
|
d574ca1628 | ||
|
f97e6892b6 | ||
|
7742901e5c | ||
|
de68cb25d0 | ||
|
68fb6c2c27 | ||
|
a47c031ad1 | ||
|
817049456c | ||
|
e1a061789f | ||
|
28573ba772 | ||
|
880b9413f6 | ||
|
9a7c4b21a9 | ||
|
ac56038eca | ||
|
4dd2fb6903 | ||
|
0baec61f06 | ||
|
d4751788d1 | ||
|
ae68c061d1 | ||
|
b0387245f0 | ||
|
c2d06a4a23 | ||
|
270108abb7 | ||
|
e76c33232d | ||
|
58ff2dc492 | ||
|
13c45a0e96 | ||
|
be7b1a1bd4 | ||
|
132a3c6705 | ||
|
5e73257557 | ||
|
e83346fbbb | ||
|
f56839ec6b |
@@ -91,3 +91,4 @@ packages/abi-gen/test-cli/fixtures/artifacts/AbiGenDummy.json
|
||||
packages/abi-gen/test-cli/fixtures/artifacts/LibDummy.json
|
||||
packages/abi-gen/test-cli/fixtures/artifacts/TestLibDummy.json
|
||||
packages/*/docs
|
||||
*.sol
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "3.2.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582837861,
|
||||
"version": "3.2.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "3.2.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582623685,
|
||||
"version": "3.2.2",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.2.5 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.2.4 - _February 27, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.2.3 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.2.2 - _February 25, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -3,6 +3,7 @@
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"shouldSaveStandardInput": true,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "istanbul",
|
||||
"optimizer": {
|
||||
|
@@ -35,7 +35,7 @@ contract ChaiBridge is
|
||||
/// @param from Address to transfer asset from.
|
||||
/// @param to Address to transfer asset to.
|
||||
/// @param amount Amount of asset to transfer.
|
||||
/// @return success The magic bytes `0x37708e9b` if successful.
|
||||
/// @return success The magic bytes `0xdc1600f3` if successful.
|
||||
function bridgeTransferFrom(
|
||||
address /* tokenAddress */,
|
||||
address from,
|
||||
|
@@ -30,7 +30,7 @@ contract IERC20Bridge {
|
||||
/// @param to Address to transfer asset to.
|
||||
/// @param amount Amount of asset to transfer.
|
||||
/// @param bridgeData Arbitrary asset data needed by the bridge contract.
|
||||
/// @return success The magic bytes `0x37708e9b` if successful.
|
||||
/// @return success The magic bytes `0xdc1600f3` if successful.
|
||||
function bridgeTransferFrom(
|
||||
address tokenAddress,
|
||||
address from,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-asset-proxy",
|
||||
"version": "3.2.2",
|
||||
"version": "3.2.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -51,10 +51,10 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.2.1",
|
||||
"@0x/abi-gen": "^5.2.2",
|
||||
"@0x/contracts-gen": "^2.0.8",
|
||||
"@0x/contracts-test-utils": "^5.3.0",
|
||||
"@0x/contracts-utils": "^4.4.0",
|
||||
"@0x/contracts-test-utils": "^5.3.2",
|
||||
"@0x/contracts-utils": "^4.4.3",
|
||||
"@0x/dev-utils": "^3.2.1",
|
||||
"@0x/sol-compiler": "^4.0.8",
|
||||
"@0x/ts-doc-gen": "^0.0.22",
|
||||
@@ -79,11 +79,11 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.1",
|
||||
"@0x/contracts-erc1155": "^2.1.2",
|
||||
"@0x/contracts-erc20": "^3.1.2",
|
||||
"@0x/contracts-erc721": "^3.1.2",
|
||||
"@0x/contracts-exchange-libs": "^4.3.2",
|
||||
"@0x/order-utils": "^10.2.2",
|
||||
"@0x/contracts-erc1155": "^2.1.5",
|
||||
"@0x/contracts-erc20": "^3.1.5",
|
||||
"@0x/contracts-erc721": "^3.1.5",
|
||||
"@0x/contracts-exchange-libs": "^4.3.5",
|
||||
"@0x/order-utils": "^10.2.4",
|
||||
"@0x/types": "^3.1.2",
|
||||
"@0x/typescript-typings": "^5.0.2",
|
||||
"@0x/utils": "^5.4.1",
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "1.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582837861,
|
||||
"version": "1.1.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "1.1.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582623685,
|
||||
"version": "1.1.1",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.1.4 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.3 - _February 27, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.2 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.1 - _February 25, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -3,6 +3,7 @@
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"shouldSaveStandardInput": true,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "istanbul",
|
||||
"optimizer": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-broker",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.4",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -51,15 +51,15 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.2.1",
|
||||
"@0x/contracts-asset-proxy": "^3.2.2",
|
||||
"@0x/contracts-erc20": "^3.1.2",
|
||||
"@0x/contracts-erc721": "^3.1.2",
|
||||
"@0x/contracts-exchange": "^3.2.2",
|
||||
"@0x/contracts-exchange-libs": "^4.3.2",
|
||||
"@0x/abi-gen": "^5.2.2",
|
||||
"@0x/contracts-asset-proxy": "^3.2.5",
|
||||
"@0x/contracts-erc20": "^3.1.5",
|
||||
"@0x/contracts-erc721": "^3.1.5",
|
||||
"@0x/contracts-exchange": "^3.2.5",
|
||||
"@0x/contracts-exchange-libs": "^4.3.5",
|
||||
"@0x/contracts-gen": "^2.0.8",
|
||||
"@0x/contracts-test-utils": "^5.3.0",
|
||||
"@0x/contracts-utils": "^4.4.0",
|
||||
"@0x/contracts-test-utils": "^5.3.2",
|
||||
"@0x/contracts-utils": "^4.4.3",
|
||||
"@0x/sol-compiler": "^4.0.8",
|
||||
"@0x/ts-doc-gen": "^0.0.22",
|
||||
"@0x/tslint-config": "^4.0.0",
|
||||
@@ -85,7 +85,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.1",
|
||||
"@0x/order-utils": "^10.2.2",
|
||||
"@0x/order-utils": "^10.2.4",
|
||||
"@0x/typescript-typings": "^5.0.2",
|
||||
"@0x/utils": "^5.4.1",
|
||||
"ethereum-types": "^3.1.0"
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "3.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582837861,
|
||||
"version": "3.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "3.1.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582623685,
|
||||
"version": "3.1.2",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.5 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.4 - _February 27, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.3 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.2 - _February 25, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -2,6 +2,7 @@
|
||||
"artifactsDir": "./test/generated-artifacts",
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": false,
|
||||
"shouldSaveStandardInput": true,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "istanbul",
|
||||
"optimizer": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-coordinator",
|
||||
"version": "3.1.2",
|
||||
"version": "3.1.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -52,15 +52,15 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.2.1",
|
||||
"@0x/contracts-asset-proxy": "^3.2.2",
|
||||
"@0x/contracts-dev-utils": "^1.3.0",
|
||||
"@0x/contracts-erc20": "^3.1.2",
|
||||
"@0x/contracts-exchange": "^3.2.2",
|
||||
"@0x/abi-gen": "^5.2.2",
|
||||
"@0x/contracts-asset-proxy": "^3.2.5",
|
||||
"@0x/contracts-dev-utils": "^1.3.3",
|
||||
"@0x/contracts-erc20": "^3.1.5",
|
||||
"@0x/contracts-exchange": "^3.2.5",
|
||||
"@0x/contracts-gen": "^2.0.8",
|
||||
"@0x/contracts-test-utils": "^5.3.0",
|
||||
"@0x/contracts-test-utils": "^5.3.2",
|
||||
"@0x/dev-utils": "^3.2.1",
|
||||
"@0x/order-utils": "^10.2.2",
|
||||
"@0x/order-utils": "^10.2.4",
|
||||
"@0x/sol-compiler": "^4.0.8",
|
||||
"@0x/ts-doc-gen": "^0.0.22",
|
||||
"@0x/tslint-config": "^4.0.0",
|
||||
@@ -86,8 +86,8 @@
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.7",
|
||||
"@0x/base-contract": "^6.2.1",
|
||||
"@0x/contract-addresses": "^4.7.0",
|
||||
"@0x/contracts-utils": "^4.4.0",
|
||||
"@0x/contract-addresses": "^4.9.0",
|
||||
"@0x/contracts-utils": "^4.4.3",
|
||||
"@0x/json-schemas": "^5.0.7",
|
||||
"@0x/types": "^3.1.2",
|
||||
"@0x/typescript-typings": "^5.0.2",
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "1.3.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582837861,
|
||||
"version": "1.3.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "1.3.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.3.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.3.3 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.3.2 - _February 27, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.3.1 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.3.0 - _February 25, 2020_
|
||||
|
||||
* Update `DevUtils` addresses in `DeploymentConstants` (#2493)
|
||||
|
@@ -3,6 +3,7 @@
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"shouldSaveStandardInput": true,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "istanbul",
|
||||
"optimizer": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-dev-utils",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.3",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -41,12 +41,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/dev-utils/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.2.1",
|
||||
"@0x/abi-gen": "^5.2.2",
|
||||
"@0x/assert": "^3.0.7",
|
||||
"@0x/contracts-asset-proxy": "^3.2.2",
|
||||
"@0x/contracts-erc20": "^3.1.2",
|
||||
"@0x/contracts-asset-proxy": "^3.2.5",
|
||||
"@0x/contracts-erc20": "^3.1.5",
|
||||
"@0x/contracts-gen": "^2.0.8",
|
||||
"@0x/contracts-test-utils": "^5.3.0",
|
||||
"@0x/contracts-test-utils": "^5.3.2",
|
||||
"@0x/sol-compiler": "^4.0.8",
|
||||
"@0x/ts-doc-gen": "^0.0.22",
|
||||
"@0x/tslint-config": "^4.0.0",
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "2.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582837861,
|
||||
"version": "2.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "2.1.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582623685,
|
||||
"version": "2.1.2",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.5 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.4 - _February 27, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.3 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.2 - _February 25, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -3,6 +3,7 @@
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"shouldSaveStandardInput": true,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "istanbul",
|
||||
"optimizer": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc1155",
|
||||
"version": "2.1.2",
|
||||
"version": "2.1.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -52,9 +52,9 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.2.1",
|
||||
"@0x/abi-gen": "^5.2.2",
|
||||
"@0x/contracts-gen": "^2.0.8",
|
||||
"@0x/contracts-utils": "^4.4.0",
|
||||
"@0x/contracts-utils": "^4.4.3",
|
||||
"@0x/dev-utils": "^3.2.1",
|
||||
"@0x/sol-compiler": "^4.0.8",
|
||||
"@0x/ts-doc-gen": "^0.0.22",
|
||||
@@ -81,7 +81,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.1",
|
||||
"@0x/contracts-test-utils": "^5.3.0",
|
||||
"@0x/contracts-test-utils": "^5.3.2",
|
||||
"@0x/utils": "^5.4.1",
|
||||
"@0x/web3-wrapper": "^7.0.7",
|
||||
"lodash": "^4.17.11"
|
||||
|
@@ -1,4 +1,36 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "1.5.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.5.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Add generic liquidity provider sampling",
|
||||
"pr": 2487
|
||||
},
|
||||
{
|
||||
"note": "Use liquidity provider registry in sampler",
|
||||
"pr": 2499
|
||||
}
|
||||
],
|
||||
"timestamp": 1582837861
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "1.4.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582623685,
|
||||
"version": "1.4.1",
|
||||
|
@@ -5,6 +5,19 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.5.1 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.5.0 - _February 27, 2020_
|
||||
|
||||
* Add generic liquidity provider sampling (#2487)
|
||||
* Use liquidity provider registry in sampler (#2499)
|
||||
|
||||
## v1.4.2 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.4.1 - _February 25, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -3,6 +3,7 @@
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"shouldSaveStandardInput": true,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "istanbul",
|
||||
"optimizer": {
|
||||
|
@@ -24,12 +24,15 @@ import "@0x/contracts-erc20/contracts/src/LibERC20Token.sol";
|
||||
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";
|
||||
import "@0x/contracts-exchange-libs/contracts/src/LibMath.sol";
|
||||
import "@0x/contracts-utils/contracts/src/DeploymentConstants.sol";
|
||||
import "@0x/contracts-utils/contracts/src/LibBytes.sol";
|
||||
import "./IDevUtils.sol";
|
||||
import "./IERC20BridgeSampler.sol";
|
||||
import "./IEth2Dai.sol";
|
||||
import "./IKyberNetwork.sol";
|
||||
import "./IUniswapExchangeQuotes.sol";
|
||||
import "./ICurve.sol";
|
||||
import "./ILiquidityProvider.sol";
|
||||
import "./ILiquidityProviderRegistry.sol";
|
||||
|
||||
|
||||
contract ERC20BridgeSampler is
|
||||
@@ -47,6 +50,8 @@ contract ERC20BridgeSampler is
|
||||
/// @dev Base gas limit for Curve calls. Some Curves have multiple tokens
|
||||
/// So a reasonable ceil is 150k per token. Biggest Curve has 4 tokens.
|
||||
uint256 constant internal CURVE_CALL_GAS = 600e3; // 600k
|
||||
/// @dev Default gas limit for liquidity provider calls.
|
||||
uint256 constant internal DEFAULT_CALL_GAS = 200e3; // 200k
|
||||
|
||||
/// @dev Call multiple public functions on this contract in a single transaction.
|
||||
/// @param callDatas ABI-encoded call data for each function call.
|
||||
@@ -431,6 +436,137 @@ contract ERC20BridgeSampler is
|
||||
}
|
||||
}
|
||||
|
||||
/// @dev Sample sell quotes from an arbitrary on-chain liquidity provider.
|
||||
/// @param registryAddress Address of the liquidity provider registry contract.
|
||||
/// @param takerToken Address of the taker token (what to sell).
|
||||
/// @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 sampleSellsFromLiquidityProviderRegistry(
|
||||
address registryAddress,
|
||||
address takerToken,
|
||||
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);
|
||||
|
||||
// Query registry for provider address.
|
||||
address providerAddress = getLiquidityProviderFromRegistry(
|
||||
registryAddress,
|
||||
takerToken,
|
||||
makerToken
|
||||
);
|
||||
// If provider doesn't exist, return all zeros.
|
||||
if (providerAddress == address(0)) {
|
||||
return makerTokenAmounts;
|
||||
}
|
||||
|
||||
for (uint256 i = 0; i < numSamples; i++) {
|
||||
(bool didSucceed, bytes memory resultData) =
|
||||
providerAddress.staticcall.gas(DEFAULT_CALL_GAS)(
|
||||
abi.encodeWithSelector(
|
||||
ILiquidityProvider(0).getSellQuote.selector,
|
||||
takerToken,
|
||||
makerToken,
|
||||
takerTokenAmounts[i]
|
||||
));
|
||||
uint256 buyAmount = 0;
|
||||
if (didSucceed) {
|
||||
buyAmount = abi.decode(resultData, (uint256));
|
||||
} else {
|
||||
// Exit early if the amount is too high for the liquidity provider to serve
|
||||
break;
|
||||
}
|
||||
makerTokenAmounts[i] = buyAmount;
|
||||
}
|
||||
}
|
||||
|
||||
/// @dev Sample buy quotes from an arbitrary on-chain liquidity provider.
|
||||
/// @param registryAddress Address of the liquidity provider registry contract.
|
||||
/// @param takerToken Address of the taker token (what to sell).
|
||||
/// @param makerToken Address of the maker token (what to buy).
|
||||
/// @param makerTokenAmounts Maker token buy amount for each sample.
|
||||
/// @return takerTokenAmounts Taker amounts sold at each maker token
|
||||
/// amount.
|
||||
function sampleBuysFromLiquidityProviderRegistry(
|
||||
address registryAddress,
|
||||
address takerToken,
|
||||
address makerToken,
|
||||
uint256[] memory makerTokenAmounts
|
||||
)
|
||||
public
|
||||
view
|
||||
returns (uint256[] memory takerTokenAmounts)
|
||||
{
|
||||
// Initialize array of taker token amounts.
|
||||
uint256 numSamples = makerTokenAmounts.length;
|
||||
takerTokenAmounts = new uint256[](numSamples);
|
||||
|
||||
// Query registry for provider address.
|
||||
address providerAddress = getLiquidityProviderFromRegistry(
|
||||
registryAddress,
|
||||
takerToken,
|
||||
makerToken
|
||||
);
|
||||
// If provider doesn't exist, return all zeros.
|
||||
if (providerAddress == address(0)) {
|
||||
return takerTokenAmounts;
|
||||
}
|
||||
|
||||
// Otherwise, query liquidity provider for quotes.
|
||||
for (uint256 i = 0; i < numSamples; i++) {
|
||||
(bool didSucceed, bytes memory resultData) =
|
||||
providerAddress.staticcall.gas(DEFAULT_CALL_GAS)(
|
||||
abi.encodeWithSelector(
|
||||
ILiquidityProvider(0).getBuyQuote.selector,
|
||||
takerToken,
|
||||
makerToken,
|
||||
makerTokenAmounts[i]
|
||||
));
|
||||
uint256 sellAmount = 0;
|
||||
if (didSucceed) {
|
||||
sellAmount = abi.decode(resultData, (uint256));
|
||||
} else {
|
||||
// Exit early if the amount is too high for the liquidity provider to serve
|
||||
break;
|
||||
}
|
||||
takerTokenAmounts[i] = sellAmount;
|
||||
}
|
||||
}
|
||||
|
||||
/// @dev Returns the address of a liquidity provider for the given market
|
||||
/// (takerToken, makerToken), from a registry of liquidity providers.
|
||||
/// Returns address(0) if no such provider exists in the registry.
|
||||
/// @param takerToken Taker asset managed by liquidity provider.
|
||||
/// @param makerToken Maker asset managed by liquidity provider.
|
||||
/// @return providerAddress Address of the liquidity provider.
|
||||
function getLiquidityProviderFromRegistry(
|
||||
address registryAddress,
|
||||
address takerToken,
|
||||
address makerToken
|
||||
)
|
||||
public
|
||||
view
|
||||
returns (address providerAddress)
|
||||
{
|
||||
bytes memory callData = abi.encodeWithSelector(
|
||||
ILiquidityProviderRegistry(0).getLiquidityProviderForMarket.selector,
|
||||
takerToken,
|
||||
makerToken
|
||||
);
|
||||
(bool didSucceed, bytes memory returnData) = registryAddress.staticcall(callData);
|
||||
if (didSucceed && returnData.length == 32) {
|
||||
return LibBytes.readAddress(returnData, 12);
|
||||
}
|
||||
}
|
||||
|
||||
/// @dev Overridable way to get token decimals.
|
||||
/// @param tokenAddress Address of the token.
|
||||
/// @return decimals The decimal places for the token.
|
||||
|
@@ -149,4 +149,53 @@ interface IERC20BridgeSampler {
|
||||
external
|
||||
view
|
||||
returns (uint256[] memory makerTokenAmounts);
|
||||
|
||||
/// @dev Sample sell quotes from an arbitrary on-chain liquidity provider.
|
||||
/// @param registryAddress Address of the liquidity provider registry contract.
|
||||
/// @param takerToken Address of the taker token (what to sell).
|
||||
/// @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 sampleSellsFromLiquidityProviderRegistry(
|
||||
address registryAddress,
|
||||
address takerToken,
|
||||
address makerToken,
|
||||
uint256[] calldata takerTokenAmounts
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (uint256[] memory makerTokenAmounts);
|
||||
|
||||
/// @dev Sample buy quotes from an arbitrary on-chain liquidity provider.
|
||||
/// @param registryAddress Address of the liquidity provider registry contract.
|
||||
/// @param takerToken Address of the taker token (what to sell).
|
||||
/// @param makerToken Address of the maker token (what to buy).
|
||||
/// @param makerTokenAmounts Maker token buy amount for each sample.
|
||||
/// @return takerTokenAmounts Taker amounts sold at each maker token
|
||||
/// amount.
|
||||
function sampleBuysFromLiquidityProviderRegistry(
|
||||
address registryAddress,
|
||||
address takerToken,
|
||||
address makerToken,
|
||||
uint256[] calldata makerTokenAmounts
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (uint256[] memory takerTokenAmounts);
|
||||
|
||||
/// @dev Returns the address of a liquidity provider for the given market
|
||||
/// (takerToken, makerToken), from a registry of liquidity providers.
|
||||
/// Returns address(0) if no such provider exists in the registry.
|
||||
/// @param takerToken Taker asset managed by liquidity provider.
|
||||
/// @param makerToken Maker asset managed by liquidity provider.
|
||||
/// @return providerAddress Address of the liquidity provider.
|
||||
function getLiquidityProviderFromRegistry(
|
||||
address registryAddress,
|
||||
address takerToken,
|
||||
address makerToken
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (address providerAddress);
|
||||
}
|
||||
|
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
|
||||
Copyright 2019 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.5.9;
|
||||
|
||||
|
||||
interface ILiquidityProvider {
|
||||
|
||||
/// @dev Transfers `amount` of the ERC20 `tokenAddress` from `from` to `to`.
|
||||
/// @param tokenAddress The address of the ERC20 token to transfer.
|
||||
/// @param from Address to transfer asset from.
|
||||
/// @param to Address to transfer asset to.
|
||||
/// @param amount Amount of asset to transfer.
|
||||
/// @param bridgeData Arbitrary asset data needed by the bridge contract.
|
||||
/// @return success The magic bytes `0xdc1600f3` if successful.
|
||||
function bridgeTransferFrom(
|
||||
address tokenAddress,
|
||||
address from,
|
||||
address to,
|
||||
uint256 amount,
|
||||
bytes calldata bridgeData
|
||||
)
|
||||
external
|
||||
returns (bytes4 success);
|
||||
|
||||
/// @dev Quotes the amount of `makerToken` that would be obtained by
|
||||
/// selling `sellAmount` of `takerToken`.
|
||||
/// @param takerToken Address of the taker token (what to sell).
|
||||
/// @param makerToken Address of the maker token (what to buy).
|
||||
/// @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);
|
||||
|
||||
/// @dev Quotes the amount of `takerToken` that would need to be sold in
|
||||
/// order to obtain `buyAmount` of `makerToken`.
|
||||
/// @param takerToken Address of the taker token (what to sell).
|
||||
/// @param makerToken Address of the maker token (what to buy).
|
||||
/// @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);
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
|
||||
Copyright 2019 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.5.9;
|
||||
|
||||
|
||||
interface ILiquidityProviderRegistry {
|
||||
|
||||
/// @dev Returns the address of a liquidity provider for the given market
|
||||
/// (takerToken, makerToken), reverting if the pool does not exist.
|
||||
/// @param takerToken Taker asset managed by liquidity provider.
|
||||
/// @param makerToken Maker asset managed by liquidity provider.
|
||||
/// @return Address of the liquidity provider.
|
||||
function getLiquidityProviderForMarket(
|
||||
address takerToken,
|
||||
address makerToken
|
||||
)
|
||||
external
|
||||
view
|
||||
returns (address providerAddress);
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc20-bridge-sampler",
|
||||
"version": "1.4.1",
|
||||
"version": "1.5.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -36,9 +36,9 @@
|
||||
"compile:truffle": "truffle compile"
|
||||
},
|
||||
"config": {
|
||||
"publicInterfaceContracts": "ERC20BridgeSampler,IERC20BridgeSampler",
|
||||
"publicInterfaceContracts": "ERC20BridgeSampler,IERC20BridgeSampler,ILiquidityProvider,ILiquidityProviderRegistry",
|
||||
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually.",
|
||||
"abis": "./test/generated-artifacts/@(ERC20BridgeSampler|ICurve|IDevUtils|IERC20BridgeSampler|IEth2Dai|IKyberNetwork|IUniswapExchangeQuotes|TestERC20BridgeSampler).json"
|
||||
"abis": "./test/generated-artifacts/@(ERC20BridgeSampler|ICurve|IDevUtils|IERC20BridgeSampler|IEth2Dai|IKyberNetwork|ILiquidityProvider|ILiquidityProviderRegistry|IUniswapExchangeQuotes|TestERC20BridgeSampler).json"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -50,14 +50,14 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.2.1",
|
||||
"@0x/contracts-asset-proxy": "^3.2.2",
|
||||
"@0x/contracts-erc20": "^3.1.2",
|
||||
"@0x/contracts-exchange": "^3.2.2",
|
||||
"@0x/contracts-exchange-libs": "^4.3.2",
|
||||
"@0x/abi-gen": "^5.2.2",
|
||||
"@0x/contracts-asset-proxy": "^3.2.5",
|
||||
"@0x/contracts-erc20": "^3.1.5",
|
||||
"@0x/contracts-exchange": "^3.2.5",
|
||||
"@0x/contracts-exchange-libs": "^4.3.5",
|
||||
"@0x/contracts-gen": "^2.0.8",
|
||||
"@0x/contracts-test-utils": "^5.3.0",
|
||||
"@0x/contracts-utils": "^4.4.0",
|
||||
"@0x/contracts-test-utils": "^5.3.2",
|
||||
"@0x/contracts-utils": "^4.4.3",
|
||||
"@0x/dev-utils": "^3.2.1",
|
||||
"@0x/sol-compiler": "^4.0.8",
|
||||
"@0x/tslint-config": "^4.0.0",
|
||||
|
@@ -7,7 +7,11 @@ import { ContractArtifact } from 'ethereum-types';
|
||||
|
||||
import * as ERC20BridgeSampler from '../generated-artifacts/ERC20BridgeSampler.json';
|
||||
import * as IERC20BridgeSampler from '../generated-artifacts/IERC20BridgeSampler.json';
|
||||
import * as ILiquidityProvider from '../generated-artifacts/ILiquidityProvider.json';
|
||||
import * as ILiquidityProviderRegistry from '../generated-artifacts/ILiquidityProviderRegistry.json';
|
||||
export const artifacts = {
|
||||
ERC20BridgeSampler: ERC20BridgeSampler as ContractArtifact,
|
||||
IERC20BridgeSampler: IERC20BridgeSampler as ContractArtifact,
|
||||
ILiquidityProvider: ILiquidityProvider as ContractArtifact,
|
||||
ILiquidityProviderRegistry: ILiquidityProviderRegistry as ContractArtifact,
|
||||
};
|
||||
|
@@ -5,3 +5,5 @@
|
||||
*/
|
||||
export * from '../generated-wrappers/erc20_bridge_sampler';
|
||||
export * from '../generated-wrappers/i_erc20_bridge_sampler';
|
||||
export * from '../generated-wrappers/i_liquidity_provider';
|
||||
export * from '../generated-wrappers/i_liquidity_provider_registry';
|
||||
|
@@ -11,6 +11,8 @@ import * as IDevUtils from '../test/generated-artifacts/IDevUtils.json';
|
||||
import * as IERC20BridgeSampler from '../test/generated-artifacts/IERC20BridgeSampler.json';
|
||||
import * as IEth2Dai from '../test/generated-artifacts/IEth2Dai.json';
|
||||
import * as IKyberNetwork from '../test/generated-artifacts/IKyberNetwork.json';
|
||||
import * as ILiquidityProvider from '../test/generated-artifacts/ILiquidityProvider.json';
|
||||
import * as ILiquidityProviderRegistry from '../test/generated-artifacts/ILiquidityProviderRegistry.json';
|
||||
import * as IUniswapExchangeQuotes from '../test/generated-artifacts/IUniswapExchangeQuotes.json';
|
||||
import * as TestERC20BridgeSampler from '../test/generated-artifacts/TestERC20BridgeSampler.json';
|
||||
export const artifacts = {
|
||||
@@ -20,6 +22,8 @@ export const artifacts = {
|
||||
IERC20BridgeSampler: IERC20BridgeSampler as ContractArtifact,
|
||||
IEth2Dai: IEth2Dai as ContractArtifact,
|
||||
IKyberNetwork: IKyberNetwork as ContractArtifact,
|
||||
ILiquidityProvider: ILiquidityProvider as ContractArtifact,
|
||||
ILiquidityProviderRegistry: ILiquidityProviderRegistry as ContractArtifact,
|
||||
IUniswapExchangeQuotes: IUniswapExchangeQuotes as ContractArtifact,
|
||||
TestERC20BridgeSampler: TestERC20BridgeSampler as ContractArtifact,
|
||||
};
|
||||
|
@@ -9,5 +9,7 @@ export * from '../test/generated-wrappers/i_dev_utils';
|
||||
export * from '../test/generated-wrappers/i_erc20_bridge_sampler';
|
||||
export * from '../test/generated-wrappers/i_eth2_dai';
|
||||
export * from '../test/generated-wrappers/i_kyber_network';
|
||||
export * from '../test/generated-wrappers/i_liquidity_provider';
|
||||
export * from '../test/generated-wrappers/i_liquidity_provider_registry';
|
||||
export * from '../test/generated-wrappers/i_uniswap_exchange_quotes';
|
||||
export * from '../test/generated-wrappers/test_erc20_bridge_sampler';
|
||||
|
@@ -5,12 +5,16 @@
|
||||
"files": [
|
||||
"generated-artifacts/ERC20BridgeSampler.json",
|
||||
"generated-artifacts/IERC20BridgeSampler.json",
|
||||
"generated-artifacts/ILiquidityProvider.json",
|
||||
"generated-artifacts/ILiquidityProviderRegistry.json",
|
||||
"test/generated-artifacts/ERC20BridgeSampler.json",
|
||||
"test/generated-artifacts/ICurve.json",
|
||||
"test/generated-artifacts/IDevUtils.json",
|
||||
"test/generated-artifacts/IERC20BridgeSampler.json",
|
||||
"test/generated-artifacts/IEth2Dai.json",
|
||||
"test/generated-artifacts/IKyberNetwork.json",
|
||||
"test/generated-artifacts/ILiquidityProvider.json",
|
||||
"test/generated-artifacts/ILiquidityProviderRegistry.json",
|
||||
"test/generated-artifacts/IUniswapExchangeQuotes.json",
|
||||
"test/generated-artifacts/TestERC20BridgeSampler.json"
|
||||
],
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "3.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582837861,
|
||||
"version": "3.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "3.1.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582623685,
|
||||
"version": "3.1.2",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.5 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.4 - _February 27, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.3 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.2 - _February 25, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -3,6 +3,7 @@
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"shouldSaveStandardInput": true,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "istanbul",
|
||||
"optimizer": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc20",
|
||||
"version": "3.1.2",
|
||||
"version": "3.1.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -51,10 +51,10 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.2.1",
|
||||
"@0x/abi-gen": "^5.2.2",
|
||||
"@0x/contracts-gen": "^2.0.8",
|
||||
"@0x/contracts-test-utils": "^5.3.0",
|
||||
"@0x/contracts-utils": "^4.4.0",
|
||||
"@0x/contracts-test-utils": "^5.3.2",
|
||||
"@0x/contracts-utils": "^4.4.3",
|
||||
"@0x/dev-utils": "^3.2.1",
|
||||
"@0x/sol-compiler": "^4.0.8",
|
||||
"@0x/ts-doc-gen": "^0.0.22",
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "3.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582837861,
|
||||
"version": "3.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "3.1.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582623685,
|
||||
"version": "3.1.2",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.5 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.4 - _February 27, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.3 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.2 - _February 25, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -3,6 +3,7 @@
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"shouldSaveStandardInput": true,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "istanbul",
|
||||
"optimizer": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc721",
|
||||
"version": "3.1.2",
|
||||
"version": "3.1.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -52,10 +52,10 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.2.1",
|
||||
"@0x/abi-gen": "^5.2.2",
|
||||
"@0x/contracts-gen": "^2.0.8",
|
||||
"@0x/contracts-test-utils": "^5.3.0",
|
||||
"@0x/contracts-utils": "^4.4.0",
|
||||
"@0x/contracts-test-utils": "^5.3.2",
|
||||
"@0x/contracts-utils": "^4.4.3",
|
||||
"@0x/dev-utils": "^3.2.1",
|
||||
"@0x/sol-compiler": "^4.0.8",
|
||||
"@0x/ts-doc-gen": "^0.0.22",
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "4.2.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582837861,
|
||||
"version": "4.2.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "4.2.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582623685,
|
||||
"version": "4.2.2",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.2.5 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.2.4 - _February 27, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.2.3 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.2.2 - _February 25, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -3,6 +3,7 @@
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"shouldSaveStandardInput": true,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "istanbul",
|
||||
"optimizer": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange-forwarder",
|
||||
"version": "4.2.2",
|
||||
"version": "4.2.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -52,19 +52,19 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.2.1",
|
||||
"@0x/contracts-asset-proxy": "^3.2.2",
|
||||
"@0x/contracts-dev-utils": "^1.3.0",
|
||||
"@0x/contracts-erc1155": "^2.1.2",
|
||||
"@0x/contracts-erc20": "^3.1.2",
|
||||
"@0x/contracts-erc721": "^3.1.2",
|
||||
"@0x/contracts-exchange": "^3.2.2",
|
||||
"@0x/contracts-exchange-libs": "^4.3.2",
|
||||
"@0x/abi-gen": "^5.2.2",
|
||||
"@0x/contracts-asset-proxy": "^3.2.5",
|
||||
"@0x/contracts-dev-utils": "^1.3.3",
|
||||
"@0x/contracts-erc1155": "^2.1.5",
|
||||
"@0x/contracts-erc20": "^3.1.5",
|
||||
"@0x/contracts-erc721": "^3.1.5",
|
||||
"@0x/contracts-exchange": "^3.2.5",
|
||||
"@0x/contracts-exchange-libs": "^4.3.5",
|
||||
"@0x/contracts-gen": "^2.0.8",
|
||||
"@0x/contracts-test-utils": "^5.3.0",
|
||||
"@0x/contracts-utils": "^4.4.0",
|
||||
"@0x/contracts-test-utils": "^5.3.2",
|
||||
"@0x/contracts-utils": "^4.4.3",
|
||||
"@0x/dev-utils": "^3.2.1",
|
||||
"@0x/order-utils": "^10.2.2",
|
||||
"@0x/order-utils": "^10.2.4",
|
||||
"@0x/sol-compiler": "^4.0.8",
|
||||
"@0x/ts-doc-gen": "^0.0.22",
|
||||
"@0x/tslint-config": "^4.0.0",
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "4.3.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582837861,
|
||||
"version": "4.3.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "4.3.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582623685,
|
||||
"version": "4.3.2",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.3.5 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.3.4 - _February 27, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.3.3 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.3.2 - _February 25, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -3,6 +3,7 @@
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"shouldSaveStandardInput": true,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "istanbul",
|
||||
"optimizer": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange-libs",
|
||||
"version": "4.3.2",
|
||||
"version": "4.3.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -52,7 +52,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/libs/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.2.1",
|
||||
"@0x/abi-gen": "^5.2.2",
|
||||
"@0x/contracts-gen": "^2.0.8",
|
||||
"@0x/dev-utils": "^3.2.1",
|
||||
"@0x/sol-compiler": "^4.0.8",
|
||||
@@ -81,9 +81,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.1",
|
||||
"@0x/contracts-test-utils": "^5.3.0",
|
||||
"@0x/contracts-utils": "^4.4.0",
|
||||
"@0x/order-utils": "^10.2.2",
|
||||
"@0x/contracts-test-utils": "^5.3.2",
|
||||
"@0x/contracts-utils": "^4.4.3",
|
||||
"@0x/order-utils": "^10.2.4",
|
||||
"@0x/types": "^3.1.2",
|
||||
"@0x/typescript-typings": "^5.0.2",
|
||||
"@0x/utils": "^5.4.1",
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "3.2.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582837861,
|
||||
"version": "3.2.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "3.2.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582623685,
|
||||
"version": "3.2.2",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.2.5 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.2.4 - _February 27, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.2.3 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.2.2 - _February 25, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -3,6 +3,7 @@
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"shouldSaveStandardInput": true,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "istanbul",
|
||||
"optimizer": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange",
|
||||
"version": "3.2.2",
|
||||
"version": "3.2.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -52,14 +52,14 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/protocol/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.2.1",
|
||||
"@0x/contracts-asset-proxy": "^3.2.2",
|
||||
"@0x/contracts-exchange-libs": "^4.3.2",
|
||||
"@0x/abi-gen": "^5.2.2",
|
||||
"@0x/contracts-asset-proxy": "^3.2.5",
|
||||
"@0x/contracts-exchange-libs": "^4.3.5",
|
||||
"@0x/contracts-gen": "^2.0.8",
|
||||
"@0x/contracts-multisig": "^4.1.2",
|
||||
"@0x/contracts-staking": "^2.0.9",
|
||||
"@0x/contracts-test-utils": "^5.3.0",
|
||||
"@0x/contracts-utils": "^4.4.0",
|
||||
"@0x/contracts-multisig": "^4.1.5",
|
||||
"@0x/contracts-staking": "^2.0.12",
|
||||
"@0x/contracts-test-utils": "^5.3.2",
|
||||
"@0x/contracts-utils": "^4.4.3",
|
||||
"@0x/dev-utils": "^3.2.1",
|
||||
"@0x/sol-compiler": "^4.0.8",
|
||||
"@0x/ts-doc-gen": "^0.0.22",
|
||||
@@ -89,11 +89,11 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.1",
|
||||
"@0x/contracts-dev-utils": "^1.3.0",
|
||||
"@0x/contracts-erc1155": "^2.1.2",
|
||||
"@0x/contracts-erc20": "^3.1.2",
|
||||
"@0x/contracts-erc721": "^3.1.2",
|
||||
"@0x/order-utils": "^10.2.2",
|
||||
"@0x/contracts-dev-utils": "^1.3.3",
|
||||
"@0x/contracts-erc1155": "^2.1.5",
|
||||
"@0x/contracts-erc20": "^3.1.5",
|
||||
"@0x/contracts-erc721": "^3.1.5",
|
||||
"@0x/order-utils": "^10.2.4",
|
||||
"@0x/utils": "^5.4.1",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "6.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582837861,
|
||||
"version": "6.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "6.1.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582623685,
|
||||
"version": "6.1.2",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v6.1.5 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v6.1.4 - _February 27, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v6.1.3 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v6.1.2 - _February 25, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -3,6 +3,7 @@
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"shouldSaveStandardInput": true,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "istanbul",
|
||||
"optimizer": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-extensions",
|
||||
"version": "6.1.2",
|
||||
"version": "6.1.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -51,18 +51,18 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.2.1",
|
||||
"@0x/contracts-asset-proxy": "^3.2.2",
|
||||
"@0x/contracts-dev-utils": "^1.3.0",
|
||||
"@0x/contracts-erc20": "^3.1.2",
|
||||
"@0x/contracts-erc721": "^3.1.2",
|
||||
"@0x/contracts-exchange": "^3.2.2",
|
||||
"@0x/contracts-exchange-libs": "^4.3.2",
|
||||
"@0x/abi-gen": "^5.2.2",
|
||||
"@0x/contracts-asset-proxy": "^3.2.5",
|
||||
"@0x/contracts-dev-utils": "^1.3.3",
|
||||
"@0x/contracts-erc20": "^3.1.5",
|
||||
"@0x/contracts-erc721": "^3.1.5",
|
||||
"@0x/contracts-exchange": "^3.2.5",
|
||||
"@0x/contracts-exchange-libs": "^4.3.5",
|
||||
"@0x/contracts-gen": "^2.0.8",
|
||||
"@0x/contracts-test-utils": "^5.3.0",
|
||||
"@0x/contracts-utils": "^4.4.0",
|
||||
"@0x/contracts-test-utils": "^5.3.2",
|
||||
"@0x/contracts-utils": "^4.4.3",
|
||||
"@0x/dev-utils": "^3.2.1",
|
||||
"@0x/order-utils": "^10.2.2",
|
||||
"@0x/order-utils": "^10.2.4",
|
||||
"@0x/sol-compiler": "^4.0.8",
|
||||
"@0x/ts-doc-gen": "^0.0.22",
|
||||
"@0x/tslint-config": "^4.0.0",
|
||||
|
@@ -1,4 +1,32 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "2.5.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.5.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Add `ChaiBridge` and `DydxBridge` gas benchmark tests.",
|
||||
"pr": 2478
|
||||
}
|
||||
],
|
||||
"timestamp": 1582837861
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "2.4.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582623685,
|
||||
"version": "2.4.1",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.5.1 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.5.0 - _February 27, 2020_
|
||||
|
||||
* Add `ChaiBridge` and `DydxBridge` gas benchmark tests. (#2478)
|
||||
|
||||
## v2.4.2 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.4.1 - _February 25, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -3,6 +3,7 @@
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"shouldSaveStandardInput": true,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "istanbul",
|
||||
"optimizer": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-integrations",
|
||||
"version": "2.4.1",
|
||||
"version": "2.5.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -51,22 +51,22 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/extensions/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.2.1",
|
||||
"@0x/contract-addresses": "^4.7.0",
|
||||
"@0x/contract-wrappers": "^13.6.1",
|
||||
"@0x/contracts-broker": "^1.1.1",
|
||||
"@0x/contracts-coordinator": "^3.1.2",
|
||||
"@0x/contracts-dev-utils": "^1.3.0",
|
||||
"@0x/contracts-erc20-bridge-sampler": "^1.4.1",
|
||||
"@0x/contracts-exchange-forwarder": "^4.2.2",
|
||||
"@0x/contracts-exchange-libs": "^4.3.2",
|
||||
"@0x/contracts-extensions": "^6.1.2",
|
||||
"@0x/abi-gen": "^5.2.2",
|
||||
"@0x/contract-addresses": "^4.9.0",
|
||||
"@0x/contract-wrappers": "^13.6.3",
|
||||
"@0x/contracts-broker": "^1.1.4",
|
||||
"@0x/contracts-coordinator": "^3.1.5",
|
||||
"@0x/contracts-dev-utils": "^1.3.3",
|
||||
"@0x/contracts-erc20-bridge-sampler": "^1.5.1",
|
||||
"@0x/contracts-exchange-forwarder": "^4.2.5",
|
||||
"@0x/contracts-exchange-libs": "^4.3.5",
|
||||
"@0x/contracts-extensions": "^6.1.5",
|
||||
"@0x/contracts-gen": "^2.0.8",
|
||||
"@0x/contracts-utils": "^4.4.0",
|
||||
"@0x/contracts-utils": "^4.4.3",
|
||||
"@0x/coordinator-server": "^1.0.5",
|
||||
"@0x/dev-utils": "^3.2.1",
|
||||
"@0x/migrations": "^6.2.1",
|
||||
"@0x/order-utils": "^10.2.2",
|
||||
"@0x/migrations": "^6.2.4",
|
||||
"@0x/order-utils": "^10.2.4",
|
||||
"@0x/sol-compiler": "^4.0.8",
|
||||
"@0x/tslint-config": "^4.0.0",
|
||||
"@0x/web3-wrapper": "^7.0.7",
|
||||
@@ -92,16 +92,16 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/asset-swapper": "^4.3.0",
|
||||
"@0x/asset-swapper": "^4.4.0",
|
||||
"@0x/base-contract": "^6.2.1",
|
||||
"@0x/contracts-asset-proxy": "^3.2.2",
|
||||
"@0x/contracts-erc1155": "^2.1.2",
|
||||
"@0x/contracts-erc20": "^3.1.2",
|
||||
"@0x/contracts-erc721": "^3.1.2",
|
||||
"@0x/contracts-exchange": "^3.2.2",
|
||||
"@0x/contracts-multisig": "^4.1.2",
|
||||
"@0x/contracts-staking": "^2.0.9",
|
||||
"@0x/contracts-test-utils": "^5.3.0",
|
||||
"@0x/contracts-asset-proxy": "^3.2.5",
|
||||
"@0x/contracts-erc1155": "^2.1.5",
|
||||
"@0x/contracts-erc20": "^3.1.5",
|
||||
"@0x/contracts-erc721": "^3.1.5",
|
||||
"@0x/contracts-exchange": "^3.2.5",
|
||||
"@0x/contracts-multisig": "^4.1.5",
|
||||
"@0x/contracts-staking": "^2.0.12",
|
||||
"@0x/contracts-test-utils": "^5.3.2",
|
||||
"@0x/types": "^3.1.2",
|
||||
"@0x/typescript-typings": "^5.0.2",
|
||||
"@0x/utils": "^5.4.1",
|
||||
|
199
contracts/integrations/test/benchmarks/chai_bridge_test.ts
Normal file
199
contracts/integrations/test/benchmarks/chai_bridge_test.ts
Normal file
@@ -0,0 +1,199 @@
|
||||
import { encodeERC20AssetData, encodeERC20BridgeAssetData } from '@0x/contracts-asset-proxy';
|
||||
import { ERC20TokenContract } from '@0x/contracts-erc20';
|
||||
import { ExchangeContract } from '@0x/contracts-exchange';
|
||||
import { blockchainTests, constants, expect, FillEventArgs, getRandomInteger } from '@0x/contracts-test-utils';
|
||||
import { orderHashUtils } from '@0x/order-utils';
|
||||
import { Order } from '@0x/types';
|
||||
import { BigNumber, logUtils } from '@0x/utils';
|
||||
import { DecodedLogEntry } from 'ethereum-types';
|
||||
|
||||
import { contractAddresses } from '../mainnet_fork_utils';
|
||||
|
||||
const CHONKY_DAI_WALLET = '0xe235AAa27428E32cA14089b03F532c571C7ab3c8';
|
||||
const CHONKY_CHAI_WALLET = '0xfc64382c9ce89ba1c21692a68000366a35ff0336';
|
||||
const CHONKY_WETH_WALLET = '0x4abB24590606f5bf4645185e20C4E7B97596cA3B';
|
||||
blockchainTests.configure({
|
||||
fork: {
|
||||
unlockedAccounts: [CHONKY_CHAI_WALLET, CHONKY_WETH_WALLET, CHONKY_DAI_WALLET],
|
||||
},
|
||||
});
|
||||
|
||||
blockchainTests.fork.skip('ChaiBridge fill benchmarks', env => {
|
||||
let exchange: ExchangeContract;
|
||||
|
||||
before(async () => {
|
||||
exchange = new ExchangeContract(contractAddresses.exchange, env.provider, env.txDefaults);
|
||||
});
|
||||
|
||||
const DAI_ADDRESS = '0x6B175474E89094C44Da98b954EedeAC495271d0F';
|
||||
const CHAI_ADDRESS = '0x06AF07097C9Eeb7fD685c692751D5C66dB49c215';
|
||||
const CHAI_BRIDGE_ASSET_DATA = encodeERC20BridgeAssetData(
|
||||
DAI_ADDRESS,
|
||||
contractAddresses.chaiBridge,
|
||||
constants.NULL_BYTES,
|
||||
);
|
||||
const DAI_ASSET_DATA = encodeERC20AssetData(DAI_ADDRESS);
|
||||
const WETH_ASSET_DATA = encodeERC20AssetData(contractAddresses.etherToken);
|
||||
const SIGNATURE_PRESIGN = '0x06';
|
||||
const PROTOCOL_FEE = 150e3;
|
||||
const ONE_DAY = 60 * 60 * 24;
|
||||
const ORDER_DEFAULTS: Order = {
|
||||
chainId: 1,
|
||||
exchangeAddress: contractAddresses.exchange,
|
||||
expirationTimeSeconds: new BigNumber(Math.floor(Date.now() / 1e3) + ONE_DAY),
|
||||
salt: getRandomInteger(0, constants.MAX_UINT256),
|
||||
makerAddress: CHONKY_CHAI_WALLET,
|
||||
feeRecipientAddress: constants.NULL_ADDRESS,
|
||||
senderAddress: constants.NULL_ADDRESS,
|
||||
takerAddress: constants.NULL_ADDRESS,
|
||||
makerAssetAmount: new BigNumber(1e18),
|
||||
takerAssetAmount: new BigNumber(1e18),
|
||||
makerFee: constants.ZERO_AMOUNT,
|
||||
takerFee: constants.ZERO_AMOUNT,
|
||||
makerAssetData: CHAI_BRIDGE_ASSET_DATA,
|
||||
takerAssetData: WETH_ASSET_DATA,
|
||||
makerFeeAssetData: constants.NULL_BYTES,
|
||||
takerFeeAssetData: constants.NULL_BYTES,
|
||||
};
|
||||
|
||||
async function approveSpenderAsync(
|
||||
ownerAddress: string,
|
||||
spenderAddress: string,
|
||||
tokenAddress: string,
|
||||
): Promise<void> {
|
||||
const token = new ERC20TokenContract(tokenAddress, env.provider, env.txDefaults);
|
||||
await token.approve(spenderAddress, constants.MAX_UINT256).awaitTransactionSuccessAsync(
|
||||
{
|
||||
from: ownerAddress,
|
||||
},
|
||||
{ shouldValidate: false },
|
||||
);
|
||||
}
|
||||
|
||||
describe('chai gas usage', () => {
|
||||
before(async () => {
|
||||
await approveSpenderAsync(CHONKY_CHAI_WALLET, contractAddresses.chaiBridge, CHAI_ADDRESS);
|
||||
await approveSpenderAsync(CHONKY_WETH_WALLET, contractAddresses.erc20Proxy, contractAddresses.etherToken);
|
||||
});
|
||||
|
||||
async function prepareOrderAsync(fields: Partial<Order> = {}): Promise<Order> {
|
||||
const order = {
|
||||
...ORDER_DEFAULTS,
|
||||
...fields,
|
||||
};
|
||||
const orderHash = orderHashUtils.getOrderHash(order);
|
||||
await exchange.preSign(orderHash).awaitTransactionSuccessAsync(
|
||||
{
|
||||
from: order.makerAddress,
|
||||
},
|
||||
{ shouldValidate: false },
|
||||
);
|
||||
return order;
|
||||
}
|
||||
|
||||
// Last run: 282194
|
||||
it('filling one chai maker asset', async () => {
|
||||
const order = await prepareOrderAsync();
|
||||
const receipt = await exchange
|
||||
.fillOrder(order, order.takerAssetAmount, SIGNATURE_PRESIGN)
|
||||
.awaitTransactionSuccessAsync(
|
||||
{
|
||||
from: CHONKY_WETH_WALLET,
|
||||
value: PROTOCOL_FEE,
|
||||
gasPrice: 1,
|
||||
},
|
||||
{ shouldValidate: false },
|
||||
);
|
||||
const fillEvent = (receipt.logs as Array<DecodedLogEntry<FillEventArgs>>).find(log => log.event === 'Fill');
|
||||
expect(fillEvent).to.exist('');
|
||||
logUtils.log(`gas used: ${receipt.gasUsed}`);
|
||||
});
|
||||
|
||||
// Last run: 292707
|
||||
it('filling one chai taker asset', async () => {
|
||||
const order = await prepareOrderAsync({
|
||||
makerAddress: CHONKY_WETH_WALLET,
|
||||
takerAssetData: CHAI_BRIDGE_ASSET_DATA,
|
||||
makerAssetData: WETH_ASSET_DATA,
|
||||
});
|
||||
const receipt = await exchange
|
||||
.fillOrder(order, order.takerAssetAmount, SIGNATURE_PRESIGN)
|
||||
.awaitTransactionSuccessAsync(
|
||||
{
|
||||
from: CHONKY_CHAI_WALLET,
|
||||
value: PROTOCOL_FEE,
|
||||
gasPrice: 1,
|
||||
},
|
||||
{ shouldValidate: false },
|
||||
);
|
||||
const fillEvent = (receipt.logs as Array<DecodedLogEntry<FillEventArgs>>).find(log => log.event === 'Fill');
|
||||
expect(fillEvent).to.exist('');
|
||||
logUtils.log(`gas used: ${receipt.gasUsed}`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('dai gas usage', () => {
|
||||
before(async () => {
|
||||
await approveSpenderAsync(CHONKY_DAI_WALLET, contractAddresses.erc20Proxy, DAI_ADDRESS);
|
||||
await approveSpenderAsync(CHONKY_WETH_WALLET, contractAddresses.erc20Proxy, contractAddresses.etherToken);
|
||||
});
|
||||
|
||||
async function prepareOrderAsync(fields: Partial<Order> = {}): Promise<Order> {
|
||||
const order = {
|
||||
...ORDER_DEFAULTS,
|
||||
...fields,
|
||||
};
|
||||
const orderHash = orderHashUtils.getOrderHash(order);
|
||||
await exchange.preSign(orderHash).awaitTransactionSuccessAsync(
|
||||
{
|
||||
from: order.makerAddress,
|
||||
},
|
||||
{ shouldValidate: false },
|
||||
);
|
||||
return order;
|
||||
}
|
||||
|
||||
// Last run: 124665
|
||||
it('filling one dai maker asset', async () => {
|
||||
const order = await prepareOrderAsync({
|
||||
makerAddress: CHONKY_DAI_WALLET,
|
||||
makerAssetData: DAI_ASSET_DATA,
|
||||
});
|
||||
const receipt = await exchange
|
||||
.fillOrder(order, order.takerAssetAmount, SIGNATURE_PRESIGN)
|
||||
.awaitTransactionSuccessAsync(
|
||||
{
|
||||
from: CHONKY_WETH_WALLET,
|
||||
value: PROTOCOL_FEE,
|
||||
gasPrice: 1,
|
||||
},
|
||||
{ shouldValidate: false },
|
||||
);
|
||||
const fillEvent = (receipt.logs as Array<DecodedLogEntry<FillEventArgs>>).find(log => log.event === 'Fill');
|
||||
expect(fillEvent).to.exist('');
|
||||
logUtils.log(`gas used: ${receipt.gasUsed}`);
|
||||
});
|
||||
|
||||
// Last run: 124665
|
||||
it('filling one dai taker asset', async () => {
|
||||
const order = await prepareOrderAsync({
|
||||
makerAddress: CHONKY_WETH_WALLET,
|
||||
takerAssetData: DAI_ASSET_DATA,
|
||||
makerAssetData: WETH_ASSET_DATA,
|
||||
});
|
||||
const receipt = await exchange
|
||||
.fillOrder(order, order.takerAssetAmount, SIGNATURE_PRESIGN)
|
||||
.awaitTransactionSuccessAsync(
|
||||
{
|
||||
from: CHONKY_DAI_WALLET,
|
||||
value: PROTOCOL_FEE,
|
||||
gasPrice: 1,
|
||||
},
|
||||
{ shouldValidate: false },
|
||||
);
|
||||
const fillEvent = (receipt.logs as Array<DecodedLogEntry<FillEventArgs>>).find(log => log.event === 'Fill');
|
||||
expect(fillEvent).to.exist('');
|
||||
logUtils.log(`gas used: ${receipt.gasUsed}`);
|
||||
});
|
||||
});
|
||||
});
|
267
contracts/integrations/test/benchmarks/dydx_bridge_test.ts
Normal file
267
contracts/integrations/test/benchmarks/dydx_bridge_test.ts
Normal file
@@ -0,0 +1,267 @@
|
||||
import {
|
||||
DydxBridgeActionType,
|
||||
DydxBridgeData,
|
||||
dydxBridgeDataEncoder,
|
||||
encodeERC20AssetData,
|
||||
encodeERC20BridgeAssetData,
|
||||
IDydxContract,
|
||||
} from '@0x/contracts-asset-proxy';
|
||||
import { ERC20TokenContract } from '@0x/contracts-erc20';
|
||||
import { ExchangeContract } from '@0x/contracts-exchange';
|
||||
import {
|
||||
blockchainTests,
|
||||
constants,
|
||||
expect,
|
||||
FillEventArgs,
|
||||
getRandomInteger,
|
||||
Numberish,
|
||||
} from '@0x/contracts-test-utils';
|
||||
import { orderHashUtils } from '@0x/order-utils';
|
||||
import { Order } from '@0x/types';
|
||||
import { BigNumber, fromTokenUnitAmount, logUtils } from '@0x/utils';
|
||||
import { DecodedLogEntry } from 'ethereum-types';
|
||||
|
||||
import { contractAddresses } from '../mainnet_fork_utils';
|
||||
|
||||
// A chonky dai wallet.
|
||||
const MAKER_ADDRESS = '0xe235AAa27428E32cA14089b03F532c571C7ab3c8';
|
||||
// Also a chonky dai wallet.
|
||||
const TAKER_ADDRESS = '0x66c57bf505a85a74609d2c83e94aabb26d691e1f';
|
||||
blockchainTests.configure({
|
||||
fork: {
|
||||
unlockedAccounts: [TAKER_ADDRESS, MAKER_ADDRESS],
|
||||
},
|
||||
});
|
||||
|
||||
blockchainTests.fork.skip('DydxBridge fill benchmarks', env => {
|
||||
let exchange: ExchangeContract;
|
||||
let dydx: IDydxContract;
|
||||
|
||||
before(async () => {
|
||||
exchange = new ExchangeContract(contractAddresses.exchange, env.provider, env.txDefaults);
|
||||
dydx = new IDydxContract(DYDX_ADDRESS, env.provider, env.txDefaults);
|
||||
// Initialize a dydx account with some Dai collateral and USDC borrowed.
|
||||
await approveSpenderAsync(MAKER_ADDRESS, BRIDGE_ADDRESS, DAI_ADDRESS);
|
||||
await approveSpenderAsync(MAKER_ADDRESS, DYDX_ADDRESS, DAI_ADDRESS);
|
||||
await dydx
|
||||
.setOperators([{ operator: BRIDGE_ADDRESS, trusted: true }])
|
||||
.awaitTransactionSuccessAsync({ from: MAKER_ADDRESS }, { shouldValidate: false });
|
||||
await depositAndWithdrawAsync(100, 1);
|
||||
});
|
||||
|
||||
async function approveSpenderAsync(
|
||||
ownerAddress: string,
|
||||
spenderAddress: string,
|
||||
tokenAddress: string,
|
||||
): Promise<void> {
|
||||
const token = new ERC20TokenContract(tokenAddress, env.provider, env.txDefaults);
|
||||
await token.approve(spenderAddress, constants.MAX_UINT256).awaitTransactionSuccessAsync(
|
||||
{
|
||||
from: ownerAddress,
|
||||
},
|
||||
{ shouldValidate: false },
|
||||
);
|
||||
}
|
||||
|
||||
const ZERO = constants.ZERO_AMOUNT;
|
||||
const BRIDGE_ADDRESS = contractAddresses.dydxBridge;
|
||||
const DYDX_ACCOUNT_ID = getRandomInteger(0, constants.MAX_UINT256);
|
||||
const DYDX_ADDRESS = '0x1E0447b19BB6EcFdAe1e4AE1694b0C3659614e4e';
|
||||
const DAI_ADDRESS = '0x6B175474E89094C44Da98b954EedeAC495271d0F';
|
||||
const USDC_ADDRESS = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48';
|
||||
const TOKEN_INFO: { [addr: string]: { decimals: number; marketId: number } } = {
|
||||
[DAI_ADDRESS]: {
|
||||
decimals: 18,
|
||||
marketId: 3,
|
||||
},
|
||||
[USDC_ADDRESS]: {
|
||||
decimals: 6,
|
||||
marketId: 2,
|
||||
},
|
||||
};
|
||||
|
||||
function encodeDydxBridgeAssetData(fromToken: string, toToken: string, depositRate: number = 1): string {
|
||||
const fromTokenMarketId = new BigNumber(TOKEN_INFO[fromToken].marketId);
|
||||
const toTokenMarketId = new BigNumber(TOKEN_INFO[toToken].marketId);
|
||||
const bridgeData: DydxBridgeData = {
|
||||
accountNumbers: [DYDX_ACCOUNT_ID],
|
||||
actions: [
|
||||
...(depositRate > 0
|
||||
? [
|
||||
{
|
||||
actionType: DydxBridgeActionType.Deposit,
|
||||
accountIdx: ZERO,
|
||||
marketId: fromTokenMarketId,
|
||||
...createConversionFraction(toToken, fromToken, depositRate),
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{
|
||||
actionType: DydxBridgeActionType.Withdraw,
|
||||
accountIdx: ZERO,
|
||||
marketId: toTokenMarketId,
|
||||
...createConversionFraction(toToken, toToken, 1),
|
||||
},
|
||||
],
|
||||
};
|
||||
return encodeERC20BridgeAssetData(
|
||||
toToken,
|
||||
contractAddresses.dydxBridge,
|
||||
dydxBridgeDataEncoder.encode({ bridgeData }),
|
||||
);
|
||||
}
|
||||
|
||||
// Create fraction with default 18 decimal precision.
|
||||
function createConversionFraction(
|
||||
fromToken: string,
|
||||
toToken: string,
|
||||
rate: number,
|
||||
): {
|
||||
conversionRateNumerator: BigNumber;
|
||||
conversionRateDenominator: BigNumber;
|
||||
} {
|
||||
const fromDecimals = TOKEN_INFO[fromToken].decimals;
|
||||
const toDecimals = TOKEN_INFO[toToken].decimals;
|
||||
return {
|
||||
conversionRateNumerator: fromTokenUnitAmount(rate, toDecimals),
|
||||
conversionRateDenominator: fromTokenUnitAmount(1, fromDecimals),
|
||||
};
|
||||
}
|
||||
|
||||
enum DydxActionType {
|
||||
Deposit = 0,
|
||||
Withdraw = 1,
|
||||
}
|
||||
|
||||
enum DydxAssetDenomination {
|
||||
Wei = 0,
|
||||
Par = 1,
|
||||
}
|
||||
|
||||
enum DydxAssetReference {
|
||||
Delta = 0,
|
||||
Target = 1,
|
||||
}
|
||||
|
||||
async function depositAndWithdrawAsync(depositSize: Numberish, withdrawSize: Numberish): Promise<void> {
|
||||
const dai = TOKEN_INFO[DAI_ADDRESS];
|
||||
const usdc = TOKEN_INFO[USDC_ADDRESS];
|
||||
await dydx
|
||||
.operate(
|
||||
[{ owner: MAKER_ADDRESS, number: DYDX_ACCOUNT_ID }],
|
||||
[
|
||||
{
|
||||
actionType: DydxActionType.Deposit,
|
||||
accountIdx: ZERO,
|
||||
amount: {
|
||||
sign: true,
|
||||
denomination: DydxAssetDenomination.Wei,
|
||||
ref: DydxAssetReference.Delta,
|
||||
value: fromTokenUnitAmount(depositSize, dai.decimals),
|
||||
},
|
||||
primaryMarketId: new BigNumber(dai.marketId),
|
||||
secondaryMarketId: new BigNumber(constants.NULL_ADDRESS),
|
||||
otherAddress: MAKER_ADDRESS,
|
||||
otherAccountIdx: ZERO,
|
||||
data: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
actionType: DydxActionType.Withdraw,
|
||||
accountIdx: ZERO,
|
||||
amount: {
|
||||
sign: false,
|
||||
denomination: DydxAssetDenomination.Wei,
|
||||
ref: DydxAssetReference.Delta,
|
||||
value: fromTokenUnitAmount(withdrawSize, usdc.decimals),
|
||||
},
|
||||
primaryMarketId: new BigNumber(usdc.marketId),
|
||||
secondaryMarketId: new BigNumber(constants.NULL_ADDRESS),
|
||||
otherAddress: MAKER_ADDRESS,
|
||||
otherAccountIdx: ZERO,
|
||||
data: constants.NULL_BYTES,
|
||||
},
|
||||
],
|
||||
)
|
||||
.awaitTransactionSuccessAsync({ from: MAKER_ADDRESS }, { shouldValidate: false });
|
||||
}
|
||||
|
||||
const DYDX_ASSET_DATA = encodeDydxBridgeAssetData(DAI_ADDRESS, USDC_ADDRESS);
|
||||
const DAI_ASSET_DATA = encodeERC20AssetData(DAI_ADDRESS);
|
||||
const SIGNATURE_PRESIGN = '0x06';
|
||||
const PROTOCOL_FEE = 150e3;
|
||||
const ONE_DAY = 60 * 60 * 24;
|
||||
const ORDER_DEFAULTS: Order = {
|
||||
chainId: 1,
|
||||
exchangeAddress: contractAddresses.exchange,
|
||||
expirationTimeSeconds: new BigNumber(Math.floor(Date.now() / 1e3) + ONE_DAY),
|
||||
salt: getRandomInteger(0, constants.MAX_UINT256),
|
||||
makerAddress: MAKER_ADDRESS,
|
||||
feeRecipientAddress: constants.NULL_ADDRESS,
|
||||
senderAddress: constants.NULL_ADDRESS,
|
||||
takerAddress: constants.NULL_ADDRESS,
|
||||
makerAssetAmount: fromTokenUnitAmount(50, TOKEN_INFO[USDC_ADDRESS].decimals),
|
||||
takerAssetAmount: fromTokenUnitAmount(100, TOKEN_INFO[USDC_ADDRESS].decimals),
|
||||
makerFee: constants.ZERO_AMOUNT,
|
||||
takerFee: constants.ZERO_AMOUNT,
|
||||
makerAssetData: DYDX_ASSET_DATA,
|
||||
takerAssetData: DAI_ASSET_DATA,
|
||||
makerFeeAssetData: constants.NULL_BYTES,
|
||||
takerFeeAssetData: constants.NULL_BYTES,
|
||||
};
|
||||
|
||||
describe('gas usage', () => {
|
||||
async function prepareOrderAsync(fields: Partial<Order> = {}): Promise<Order> {
|
||||
const order = {
|
||||
...ORDER_DEFAULTS,
|
||||
...fields,
|
||||
};
|
||||
const orderHash = orderHashUtils.getOrderHash(order);
|
||||
await exchange.preSign(orderHash).awaitTransactionSuccessAsync(
|
||||
{
|
||||
from: order.makerAddress,
|
||||
},
|
||||
{ shouldValidate: false },
|
||||
);
|
||||
await approveSpenderAsync(TAKER_ADDRESS, contractAddresses.erc20Proxy, DAI_ADDRESS);
|
||||
return order;
|
||||
}
|
||||
|
||||
// Last run: 375066
|
||||
it('filling a DAI->USDC dydx order with a deposit action', async () => {
|
||||
const order = await prepareOrderAsync();
|
||||
const receipt = await exchange
|
||||
.fillOrder(order, order.takerAssetAmount, SIGNATURE_PRESIGN)
|
||||
.awaitTransactionSuccessAsync(
|
||||
{
|
||||
from: TAKER_ADDRESS,
|
||||
value: PROTOCOL_FEE,
|
||||
gasPrice: 1,
|
||||
},
|
||||
{ shouldValidate: false },
|
||||
);
|
||||
const fillEvent = (receipt.logs as Array<DecodedLogEntry<FillEventArgs>>).find(log => log.event === 'Fill');
|
||||
expect(fillEvent).to.exist('');
|
||||
logUtils.log(`gas used: ${receipt.gasUsed}`);
|
||||
});
|
||||
|
||||
// Last run: 315896
|
||||
it('filling a DAI->USDC dydx order with no deposit action', async () => {
|
||||
const order = await prepareOrderAsync({
|
||||
makerAssetData: encodeDydxBridgeAssetData(DAI_ADDRESS, USDC_ADDRESS, 0),
|
||||
});
|
||||
const receipt = await exchange
|
||||
.fillOrder(order, order.takerAssetAmount, SIGNATURE_PRESIGN)
|
||||
.awaitTransactionSuccessAsync(
|
||||
{
|
||||
from: TAKER_ADDRESS,
|
||||
value: PROTOCOL_FEE,
|
||||
gasPrice: 1,
|
||||
},
|
||||
{ shouldValidate: false },
|
||||
);
|
||||
const fillEvent = (receipt.logs as Array<DecodedLogEntry<FillEventArgs>>).find(log => log.event === 'Fill');
|
||||
expect(fillEvent).to.exist('');
|
||||
logUtils.log(`gas used: ${receipt.gasUsed}`);
|
||||
});
|
||||
});
|
||||
});
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "4.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582837861,
|
||||
"version": "4.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "4.1.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582623685,
|
||||
"version": "4.1.2",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.1.5 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.1.4 - _February 27, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.1.3 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.1.2 - _February 25, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -3,6 +3,7 @@
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"shouldSaveStandardInput": true,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "istanbul",
|
||||
"optimizer": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-multisig",
|
||||
"version": "4.1.2",
|
||||
"version": "4.1.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -49,12 +49,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/multisig/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.2.1",
|
||||
"@0x/contracts-asset-proxy": "^3.2.2",
|
||||
"@0x/contracts-erc20": "^3.1.2",
|
||||
"@0x/abi-gen": "^5.2.2",
|
||||
"@0x/contracts-asset-proxy": "^3.2.5",
|
||||
"@0x/contracts-erc20": "^3.1.5",
|
||||
"@0x/contracts-gen": "^2.0.8",
|
||||
"@0x/contracts-test-utils": "^5.3.0",
|
||||
"@0x/contracts-utils": "^4.4.0",
|
||||
"@0x/contracts-test-utils": "^5.3.2",
|
||||
"@0x/contracts-utils": "^4.4.3",
|
||||
"@0x/dev-utils": "^3.2.1",
|
||||
"@0x/sol-compiler": "^4.0.8",
|
||||
"@0x/tslint-config": "^4.0.0",
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "2.0.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582837861,
|
||||
"version": "2.0.11",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "2.0.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582623685,
|
||||
"version": "2.0.9",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.12 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.11 - _February 27, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.10 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.9 - _February 25, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -3,6 +3,7 @@
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": true,
|
||||
"shouldSaveStandardInput": true,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "istanbul",
|
||||
"optimizer": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-staking",
|
||||
"version": "2.0.9",
|
||||
"version": "2.0.12",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -53,15 +53,15 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.2.1",
|
||||
"@0x/contracts-asset-proxy": "^3.2.2",
|
||||
"@0x/contracts-dev-utils": "^1.3.0",
|
||||
"@0x/contracts-erc20": "^3.1.2",
|
||||
"@0x/contracts-exchange-libs": "^4.3.2",
|
||||
"@0x/abi-gen": "^5.2.2",
|
||||
"@0x/contracts-asset-proxy": "^3.2.5",
|
||||
"@0x/contracts-dev-utils": "^1.3.3",
|
||||
"@0x/contracts-erc20": "^3.1.5",
|
||||
"@0x/contracts-exchange-libs": "^4.3.5",
|
||||
"@0x/contracts-gen": "^2.0.8",
|
||||
"@0x/contracts-utils": "^4.4.0",
|
||||
"@0x/contracts-utils": "^4.4.3",
|
||||
"@0x/dev-utils": "^3.2.1",
|
||||
"@0x/order-utils": "^10.2.2",
|
||||
"@0x/order-utils": "^10.2.4",
|
||||
"@0x/sol-compiler": "^4.0.8",
|
||||
"@0x/ts-doc-gen": "^0.0.22",
|
||||
"@0x/tslint-config": "^4.0.0",
|
||||
@@ -88,7 +88,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.1",
|
||||
"@0x/contracts-test-utils": "^5.3.0",
|
||||
"@0x/contracts-test-utils": "^5.3.2",
|
||||
"@0x/typescript-typings": "^5.0.2",
|
||||
"@0x/utils": "^5.4.1",
|
||||
"ethereum-types": "^3.1.0",
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "5.3.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582837861,
|
||||
"version": "5.3.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "5.3.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v5.3.2 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v5.3.1 - _February 27, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v5.3.0 - _February 25, 2020_
|
||||
|
||||
* Add `blockchainTests.config` (#2466)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-test-utils",
|
||||
"version": "5.3.0",
|
||||
"version": "5.3.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,10 +44,10 @@
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.7",
|
||||
"@0x/base-contract": "^6.2.1",
|
||||
"@0x/contract-addresses": "^4.7.0",
|
||||
"@0x/contract-addresses": "^4.9.0",
|
||||
"@0x/dev-utils": "^3.2.1",
|
||||
"@0x/json-schemas": "^5.0.7",
|
||||
"@0x/order-utils": "^10.2.2",
|
||||
"@0x/order-utils": "^10.2.4",
|
||||
"@0x/sol-coverage": "^4.0.8",
|
||||
"@0x/sol-profiler": "^4.0.8",
|
||||
"@0x/sol-trace": "^3.0.8",
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "4.4.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582837861,
|
||||
"version": "4.4.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "4.4.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "4.4.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.4.3 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.4.2 - _February 27, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.4.1 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.4.0 - _February 25, 2020_
|
||||
|
||||
* Add `D18` library (#2466)
|
||||
|
@@ -3,6 +3,7 @@
|
||||
"contractsDir": "./contracts",
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"shouldSaveStandardInput": true,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "istanbul",
|
||||
"optimizer": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-utils",
|
||||
"version": "4.4.0",
|
||||
"version": "4.4.3",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -50,11 +50,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/utils/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.2.1",
|
||||
"@0x/abi-gen": "^5.2.2",
|
||||
"@0x/contracts-gen": "^2.0.8",
|
||||
"@0x/contracts-test-utils": "^5.3.0",
|
||||
"@0x/contracts-test-utils": "^5.3.2",
|
||||
"@0x/dev-utils": "^3.2.1",
|
||||
"@0x/order-utils": "^10.2.2",
|
||||
"@0x/order-utils": "^10.2.4",
|
||||
"@0x/sol-compiler": "^4.0.8",
|
||||
"@0x/tslint-config": "^4.0.0",
|
||||
"@0x/types": "^3.1.2",
|
||||
|
@@ -1,4 +1,31 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1583220306,
|
||||
"version": "9.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582837861,
|
||||
"version": "9.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "9.1.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1582623685,
|
||||
"version": "9.1.2",
|
||||
|
@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v9.1.5 - _March 3, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v9.1.4 - _February 27, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v9.1.3 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v9.1.2 - _February 25, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "0x.js",
|
||||
"version": "9.1.2",
|
||||
"version": "9.1.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -46,9 +46,9 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@0x/contract-addresses": "^4.7.0",
|
||||
"@0x/contract-addresses": "^4.9.0",
|
||||
"@0x/dev-utils": "^3.2.1",
|
||||
"@0x/migrations": "^6.2.1",
|
||||
"@0x/migrations": "^6.2.4",
|
||||
"@0x/ts-doc-gen": "^0.0.22",
|
||||
"@0x/tslint-config": "^4.0.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
@@ -79,10 +79,10 @@
|
||||
"dependencies": {
|
||||
"@0x/abi-gen-wrappers": "^5.4.0-beta.3",
|
||||
"@0x/assert": "^3.0.7",
|
||||
"@0x/asset-swapper": "^4.3.0",
|
||||
"@0x/asset-swapper": "^4.4.0",
|
||||
"@0x/base-contract": "^6.2.1",
|
||||
"@0x/contract-wrappers": "^13.6.1",
|
||||
"@0x/order-utils": "^10.2.2",
|
||||
"@0x/contract-wrappers": "^13.6.3",
|
||||
"@0x/order-utils": "^10.2.4",
|
||||
"@0x/subproviders": "^6.0.8",
|
||||
"@0x/types": "^3.1.2",
|
||||
"@0x/typescript-typings": "^5.0.2",
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"version": "5.2.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Include `bin` files"
|
||||
}
|
||||
],
|
||||
"timestamp": 1582677073
|
||||
},
|
||||
{
|
||||
"timestamp": 1582623685,
|
||||
"version": "5.2.1",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v5.2.2 - _February 26, 2020_
|
||||
|
||||
* Include `bin` files
|
||||
|
||||
## v5.2.1 - _February 25, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -3,6 +3,7 @@
|
||||
"contractsDir": "./test-cli/fixtures/contracts",
|
||||
"useDockerisedSolc": false,
|
||||
"isOfflineMode": false,
|
||||
"shouldSaveStandardInput": true,
|
||||
"compilerSettings": {
|
||||
"evmVersion": "constantinople",
|
||||
"optimizer": {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/abi-gen",
|
||||
"version": "5.2.1",
|
||||
"version": "5.2.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -113,6 +113,7 @@
|
||||
"access": "public"
|
||||
},
|
||||
"files": [
|
||||
"bin/*",
|
||||
"templates/*",
|
||||
"*.js",
|
||||
"*.ts",
|
||||
|
@@ -1,4 +1,45 @@
|
||||
[
|
||||
{
|
||||
"version": "4.4.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Add support for ERC721 assets",
|
||||
"pr": 2491
|
||||
},
|
||||
{
|
||||
"note": "Add destroy for gas heartbeat",
|
||||
"pr": 2492
|
||||
},
|
||||
{
|
||||
"note": "Added `BUSD` Curve",
|
||||
"pr": 2506
|
||||
},
|
||||
{
|
||||
"note": "Updated `Compound` Curve address",
|
||||
"pr": 2506
|
||||
}
|
||||
],
|
||||
"timestamp": 1583220306
|
||||
},
|
||||
{
|
||||
"version": "4.3.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Fix order native pruning by fill amount",
|
||||
"pr": 2500
|
||||
}
|
||||
],
|
||||
"timestamp": 1582837861
|
||||
},
|
||||
{
|
||||
"timestamp": 1582677073,
|
||||
"version": "4.3.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "4.3.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,21 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.4.0 - _March 3, 2020_
|
||||
|
||||
* Add support for ERC721 assets (#2491)
|
||||
* Add destroy for gas heartbeat (#2492)
|
||||
* Added `BUSD` Curve (#2506)
|
||||
* Updated `Compound` Curve address (#2506)
|
||||
|
||||
## v4.3.2 - _February 27, 2020_
|
||||
|
||||
* Fix order native pruning by fill amount (#2500)
|
||||
|
||||
## v4.3.1 - _February 26, 2020_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.3.0 - _February 25, 2020_
|
||||
|
||||
* Add `fees` to `GetMarketOrdersOpts` (#2481)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/asset-swapper",
|
||||
"version": "4.3.0",
|
||||
"version": "4.4.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -42,11 +42,11 @@
|
||||
"homepage": "https://0x.org/asset-swapper",
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.7",
|
||||
"@0x/contract-addresses": "^4.7.0",
|
||||
"@0x/contract-wrappers": "^13.6.1",
|
||||
"@0x/contract-addresses": "^4.9.0",
|
||||
"@0x/contract-wrappers": "^13.6.3",
|
||||
"@0x/json-schemas": "^5.0.7",
|
||||
"@0x/order-utils": "^10.2.2",
|
||||
"@0x/orderbook": "^2.2.2",
|
||||
"@0x/order-utils": "^10.2.4",
|
||||
"@0x/orderbook": "^2.2.5",
|
||||
"@0x/utils": "^5.4.1",
|
||||
"@0x/web3-wrapper": "^7.0.7",
|
||||
"heartbeats": "^5.0.1",
|
||||
@@ -54,10 +54,10 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/base-contract": "^6.2.1",
|
||||
"@0x/contracts-test-utils": "^5.3.0",
|
||||
"@0x/contracts-test-utils": "^5.3.2",
|
||||
"@0x/dev-utils": "^3.2.1",
|
||||
"@0x/mesh-rpc-client": "^7.0.4-beta-0xv3",
|
||||
"@0x/migrations": "^6.2.1",
|
||||
"@0x/migrations": "^6.2.4",
|
||||
"@0x/subproviders": "^6.0.8",
|
||||
"@0x/ts-doc-gen": "^0.0.22",
|
||||
"@0x/tslint-config": "^4.0.0",
|
||||
|
@@ -68,8 +68,8 @@ const DEFAULT_SWAP_QUOTE_REQUEST_OPTS: SwapQuoteRequestOpts = {
|
||||
// Mainnet Curve configuration
|
||||
const DEFAULT_CURVE_OPTS: { [source: string]: { version: number; curveAddress: string; tokens: string[] } } = {
|
||||
[ERC20BridgeSource.CurveUsdcDai]: {
|
||||
version: 0,
|
||||
curveAddress: '0x2e60cf74d81ac34eb21eeff58db4d385920ef419',
|
||||
version: 1,
|
||||
curveAddress: '0xa2b47e3d5c44877cca798226b7b8118f9bfb7a56',
|
||||
tokens: ['0x6b175474e89094c44da98b954eedeac495271d0f', '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'],
|
||||
},
|
||||
[ERC20BridgeSource.CurveUsdcDaiUsdt]: {
|
||||
@@ -91,6 +91,16 @@ const DEFAULT_CURVE_OPTS: { [source: string]: { version: number; curveAddress: s
|
||||
'0x0000000000085d4780b73119b644ae5ecd22b376',
|
||||
],
|
||||
},
|
||||
[ERC20BridgeSource.CurveUsdcDaiUsdtBusd]: {
|
||||
version: 1,
|
||||
curveAddress: '0x79a8c46dea5ada233abaffd40f3a0a2b1e5a4f27',
|
||||
tokens: [
|
||||
'0x6b175474e89094c44da98b954eedeac495271d0f',
|
||||
'0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
||||
'0xdac17f958d2ee523a2206206994597c13d831ec7',
|
||||
'0x4fabb145d64652a948d72533023f6e7a623c7c53',
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const constants = {
|
||||
|
@@ -466,7 +466,8 @@ export class SwapQuoter {
|
||||
* Destroys any subscriptions or connections.
|
||||
*/
|
||||
public async destroyAsync(): Promise<void> {
|
||||
return this.orderbook.destroyAsync();
|
||||
await this._protocolFeeUtils.destroyAsync();
|
||||
await this.orderbook.destroyAsync();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -234,6 +234,7 @@ export enum SwapQuoterError {
|
||||
InsufficientAssetLiquidity = 'INSUFFICIENT_ASSET_LIQUIDITY',
|
||||
AssetUnavailable = 'ASSET_UNAVAILABLE',
|
||||
NoGasPriceProvidedOrEstimated = 'NO_GAS_PRICE_PROVIDED_OR_ESTIMATED',
|
||||
AssetDataUnsupported = 'ASSET_DATA_UNSUPPORTED',
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -11,9 +11,11 @@ export const SELL_SOURCES = [
|
||||
ERC20BridgeSource.Uniswap,
|
||||
ERC20BridgeSource.Eth2Dai,
|
||||
ERC20BridgeSource.Kyber,
|
||||
// All Curve Sources
|
||||
ERC20BridgeSource.CurveUsdcDai,
|
||||
ERC20BridgeSource.CurveUsdcDaiUsdt,
|
||||
ERC20BridgeSource.CurveUsdcDaiUsdtTusd,
|
||||
ERC20BridgeSource.CurveUsdcDaiUsdtBusd,
|
||||
];
|
||||
|
||||
/**
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import { ContractAddresses } from '@0x/contract-addresses';
|
||||
import { assetDataUtils, generatePseudoRandomSalt } from '@0x/order-utils';
|
||||
import { SignedOrder } from '@0x/types';
|
||||
import { AbiEncoder, BigNumber } from '@0x/utils';
|
||||
|
||||
import { constants } from '../../constants';
|
||||
@@ -20,6 +21,22 @@ const { INFINITE_TIMESTAMP_SEC, WALLET_SIGNATURE } = marketOperationUtilConstant
|
||||
export class CreateOrderUtils {
|
||||
private readonly _contractAddress: ContractAddresses;
|
||||
|
||||
// utility function for asset-swapper to ignore market operation utils for specific asset types
|
||||
public static convertNativeOrderToFullyFillableOptimizedOrders(order: SignedOrder): OptimizedMarketOrder {
|
||||
return {
|
||||
...order,
|
||||
fillableMakerAssetAmount: order.makerAssetAmount,
|
||||
fillableTakerAssetAmount: order.takerAssetAmount,
|
||||
fillableTakerFeeAmount: order.takerFee,
|
||||
fill: {
|
||||
source: ERC20BridgeSource.Native,
|
||||
totalMakerAssetAmount: order.makerAssetAmount,
|
||||
totalTakerAssetAmount: order.takerAssetAmount,
|
||||
subFills: [],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
constructor(contractAddress: ContractAddresses) {
|
||||
this._contractAddress = contractAddress;
|
||||
}
|
||||
@@ -92,6 +109,7 @@ export class CreateOrderUtils {
|
||||
case ERC20BridgeSource.CurveUsdcDai:
|
||||
case ERC20BridgeSource.CurveUsdcDaiUsdt:
|
||||
case ERC20BridgeSource.CurveUsdcDaiUsdtTusd:
|
||||
case ERC20BridgeSource.CurveUsdcDaiUsdtBusd:
|
||||
return this._contractAddress.curveBridge;
|
||||
default:
|
||||
break;
|
||||
@@ -110,11 +128,7 @@ function createBridgeOrder(
|
||||
isBuy: boolean = false,
|
||||
): OptimizedMarketOrder {
|
||||
let makerAssetData;
|
||||
if (
|
||||
fill.source === ERC20BridgeSource.CurveUsdcDai ||
|
||||
fill.source === ERC20BridgeSource.CurveUsdcDaiUsdt ||
|
||||
fill.source === ERC20BridgeSource.CurveUsdcDaiUsdtTusd
|
||||
) {
|
||||
if (Object.keys(constants.DEFAULT_CURVE_OPTS).includes(fill.source)) {
|
||||
const { curveAddress, tokens, version } = constants.DEFAULT_CURVE_OPTS[fill.source];
|
||||
const fromTokenIdx = tokens.indexOf(takerToken);
|
||||
const toTokenIdx = tokens.indexOf(makerToken);
|
||||
|
@@ -386,8 +386,8 @@ function createBuyPathFromNativeOrders(
|
||||
|
||||
function pruneNativeFills(fills: Fill[], fillAmount: BigNumber, dustFractionThreshold: number): Fill[] {
|
||||
const minInput = fillAmount.times(dustFractionThreshold);
|
||||
const totalInput = ZERO_AMOUNT;
|
||||
const pruned = [];
|
||||
let totalInput = ZERO_AMOUNT;
|
||||
for (const fill of fills) {
|
||||
if (totalInput.gte(fillAmount)) {
|
||||
break;
|
||||
@@ -395,6 +395,7 @@ function pruneNativeFills(fills: Fill[], fillAmount: BigNumber, dustFractionThre
|
||||
if (fill.input.lt(minInput)) {
|
||||
continue;
|
||||
}
|
||||
totalInput = totalInput.plus(fill.input);
|
||||
pruned.push(fill);
|
||||
}
|
||||
return pruned;
|
||||
|
@@ -199,11 +199,7 @@ const samplerOperations = {
|
||||
batchedOperation = samplerOperations.getUniswapSellQuotes(makerToken, takerToken, takerFillAmounts);
|
||||
} else if (source === ERC20BridgeSource.Kyber) {
|
||||
batchedOperation = samplerOperations.getKyberSellQuotes(makerToken, takerToken, takerFillAmounts);
|
||||
} else if (
|
||||
source === ERC20BridgeSource.CurveUsdcDai ||
|
||||
source === ERC20BridgeSource.CurveUsdcDaiUsdt ||
|
||||
source === ERC20BridgeSource.CurveUsdcDaiUsdtTusd
|
||||
) {
|
||||
} else if (Object.keys(constants.DEFAULT_CURVE_OPTS).includes(source)) {
|
||||
const { curveAddress, tokens } = constants.DEFAULT_CURVE_OPTS[source];
|
||||
const fromTokenIdx = tokens.indexOf(takerToken);
|
||||
const toTokenIdx = tokens.indexOf(makerToken);
|
||||
|
@@ -31,6 +31,7 @@ export enum ERC20BridgeSource {
|
||||
CurveUsdcDai = 'Curve_USDC_DAI',
|
||||
CurveUsdcDaiUsdt = 'Curve_USDC_DAI_USDT',
|
||||
CurveUsdcDaiUsdtTusd = 'Curve_USDC_DAI_USDT_TUSD',
|
||||
CurveUsdcDaiUsdtBusd = 'Curve_USDC_DAI_USDT_BUSD',
|
||||
}
|
||||
|
||||
// Internal `fillData` field for `Fill` objects.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user