Compare commits
10 Commits
@0x/asset-
...
@0x/contra
Author | SHA1 | Date | |
---|---|---|---|
|
dbc5a5293e | ||
|
f4bd2bd0d8 | ||
|
f1782a83ba | ||
|
cbade0d558 | ||
|
fe0c26387c | ||
|
c03a014740 | ||
|
84e6d788aa | ||
|
cd296b8767 | ||
|
5946d32a7d | ||
|
842dd8572b |
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1619596077,
|
||||
"version": "3.7.10",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1617311315,
|
||||
"version": "3.7.9",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.7.10 - _April 28, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.7.9 - _April 1, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-asset-proxy",
|
||||
"version": "3.7.9",
|
||||
"version": "3.7.10",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -51,15 +51,15 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/protocol",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.4.21",
|
||||
"@0x/contract-wrappers": "^13.15.0",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/contracts-utils": "^4.7.6",
|
||||
"@0x/dev-utils": "^4.2.1",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/abi-gen": "^5.5.2",
|
||||
"@0x/contract-wrappers": "^13.16.0",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/contracts-utils": "^4.7.7",
|
||||
"@0x/dev-utils": "^4.2.6",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "12.12.54",
|
||||
@@ -67,7 +67,7 @@
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"ethereumjs-util": "^7.0.10",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
@@ -79,17 +79,17 @@
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/contracts-erc1155": "^2.1.27",
|
||||
"@0x/contracts-erc20": "^3.3.6",
|
||||
"@0x/contracts-erc721": "^3.1.27",
|
||||
"@0x/contracts-exchange-libs": "^4.3.27",
|
||||
"@0x/order-utils": "^10.4.19",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"ethereum-types": "^3.4.0",
|
||||
"@0x/base-contract": "^6.3.2",
|
||||
"@0x/contracts-erc1155": "^2.1.28",
|
||||
"@0x/contracts-erc20": "^3.3.7",
|
||||
"@0x/contracts-erc721": "^3.1.28",
|
||||
"@0x/contracts-exchange-libs": "^4.3.28",
|
||||
"@0x/order-utils": "^10.4.20",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"ethereum-types": "^3.5.0",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -168,7 +168,7 @@ describe('StaticCallProxy', () => {
|
||||
it('should revert if the hash of the output is different than expected expected', async () => {
|
||||
const staticCallData = staticCallTarget.isOddNumber(new BigNumber(0)).getABIEncodedTransactionData();
|
||||
const trueAsBuffer = ethUtil.toBuffer('0x0000000000000000000000000000000000000000000000000000000000000001');
|
||||
const expectedResultHash = ethUtil.bufferToHex(ethUtil.sha3(trueAsBuffer));
|
||||
const expectedResultHash = ethUtil.bufferToHex(ethUtil.keccak256(trueAsBuffer));
|
||||
const assetData = assetDataInterface
|
||||
.StaticCall(staticCallTarget.address, staticCallData, expectedResultHash)
|
||||
.getABIEncodedTransactionData();
|
||||
@@ -199,7 +199,7 @@ describe('StaticCallProxy', () => {
|
||||
it('should be successful if a function call with one static input returns the correct value', async () => {
|
||||
const staticCallData = staticCallTarget.isOddNumber(new BigNumber(1)).getABIEncodedTransactionData();
|
||||
const trueAsBuffer = ethUtil.toBuffer('0x0000000000000000000000000000000000000000000000000000000000000001');
|
||||
const expectedResultHash = ethUtil.bufferToHex(ethUtil.sha3(trueAsBuffer));
|
||||
const expectedResultHash = ethUtil.bufferToHex(ethUtil.keccak256(trueAsBuffer));
|
||||
const assetData = assetDataInterface
|
||||
.StaticCall(staticCallTarget.address, staticCallData, expectedResultHash)
|
||||
.getABIEncodedTransactionData();
|
||||
@@ -232,7 +232,7 @@ describe('StaticCallProxy', () => {
|
||||
const offset = '0000000000000000000000000000000000000000000000000000000000000020';
|
||||
const encodedExpectedResultWithOffset = `0x${offset}${abiEncoder.encode(expectedResults).slice(2)}`;
|
||||
const expectedResultHash = ethUtil.bufferToHex(
|
||||
ethUtil.sha3(ethUtil.toBuffer(encodedExpectedResultWithOffset)),
|
||||
ethUtil.keccak256(ethUtil.toBuffer(encodedExpectedResultWithOffset)),
|
||||
);
|
||||
const assetData = assetDataInterface
|
||||
.StaticCall(staticCallTarget.address, staticCallData, expectedResultHash)
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1619596077,
|
||||
"version": "1.1.28",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1617311315,
|
||||
"version": "1.1.27",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.1.28 - _April 28, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.27 - _April 1, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-broker",
|
||||
"version": "1.1.27",
|
||||
"version": "1.1.28",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -51,20 +51,20 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/extensions",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.4.21",
|
||||
"@0x/contracts-asset-proxy": "^3.7.9",
|
||||
"@0x/contracts-erc20": "^3.3.6",
|
||||
"@0x/contracts-erc721": "^3.1.27",
|
||||
"@0x/contracts-exchange": "^3.2.28",
|
||||
"@0x/contracts-exchange-libs": "^4.3.27",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/contracts-utils": "^4.7.6",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/abi-gen": "^5.5.2",
|
||||
"@0x/contracts-asset-proxy": "^3.7.10",
|
||||
"@0x/contracts-erc20": "^3.3.7",
|
||||
"@0x/contracts-erc721": "^3.1.28",
|
||||
"@0x/contracts-exchange": "^3.2.29",
|
||||
"@0x/contracts-exchange-libs": "^4.3.28",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/contracts-utils": "^4.7.7",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "12.12.54",
|
||||
@@ -84,11 +84,11 @@
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/order-utils": "^10.4.19",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"ethereum-types": "^3.4.0"
|
||||
"@0x/base-contract": "^6.3.2",
|
||||
"@0x/order-utils": "^10.4.20",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"ethereum-types": "^3.5.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1619596077,
|
||||
"version": "3.1.29",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1617311315,
|
||||
"version": "3.1.28",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.29 - _April 28, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.28 - _April 1, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-coordinator",
|
||||
"version": "3.1.28",
|
||||
"version": "3.1.29",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -52,17 +52,17 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/extensions",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.4.21",
|
||||
"@0x/contracts-asset-proxy": "^3.7.9",
|
||||
"@0x/contracts-dev-utils": "^1.3.26",
|
||||
"@0x/contracts-erc20": "^3.3.6",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/dev-utils": "^4.2.1",
|
||||
"@0x/order-utils": "^10.4.19",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/abi-gen": "^5.5.2",
|
||||
"@0x/contracts-asset-proxy": "^3.7.10",
|
||||
"@0x/contracts-dev-utils": "^1.3.27",
|
||||
"@0x/contracts-erc20": "^3.3.7",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/dev-utils": "^4.2.6",
|
||||
"@0x/order-utils": "^10.4.20",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "12.12.54",
|
||||
@@ -82,17 +82,17 @@
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.21",
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/assert": "^3.0.26",
|
||||
"@0x/base-contract": "^6.3.2",
|
||||
"@0x/contract-addresses": "^6.0.0",
|
||||
"@0x/contracts-exchange": "^3.2.28",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/contracts-utils": "^4.7.6",
|
||||
"@0x/json-schemas": "^5.4.1",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"ethereum-types": "^3.4.0",
|
||||
"@0x/contracts-exchange": "^3.2.29",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/contracts-utils": "^4.7.7",
|
||||
"@0x/json-schemas": "^6.1.2",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"ethereum-types": "^3.5.0",
|
||||
"http-status-codes": "^1.3.2"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -1,8 +1,4 @@
|
||||
import { assert as sharedAssert } from '@0x/assert';
|
||||
// HACK: We need those two unused imports because they're actually used by sharedAssert which gets injected here
|
||||
import { Schema } from '@0x/json-schemas'; // tslint:disable-line:no-unused-variable
|
||||
import { Order } from '@0x/types'; // tslint:disable-line:no-unused-variable
|
||||
import { BigNumber } from '@0x/utils'; // tslint:disable-line:no-unused-variable
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
|
||||
export const assert = {
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1619596077,
|
||||
"version": "1.3.27",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1617311315,
|
||||
"version": "1.3.26",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.3.27 - _April 28, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.3.26 - _April 1, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-dev-utils",
|
||||
"version": "1.3.26",
|
||||
"version": "1.3.27",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -41,18 +41,18 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/dev-utils",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.4.21",
|
||||
"@0x/assert": "^3.0.21",
|
||||
"@0x/contracts-asset-proxy": "^3.7.9",
|
||||
"@0x/contracts-erc20": "^3.3.6",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/abi-gen": "^5.5.2",
|
||||
"@0x/assert": "^3.0.26",
|
||||
"@0x/contracts-asset-proxy": "^3.7.10",
|
||||
"@0x/contracts-erc20": "^3.3.7",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"ethereum-types": "^3.4.0",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"ethereum-types": "^3.5.0",
|
||||
"ethers": "~4.0.4",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
@@ -63,7 +63,7 @@
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/base-contract": "^6.3.2",
|
||||
"@types/node": "12.12.54"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1619596077,
|
||||
"version": "2.1.28",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1617311315,
|
||||
"version": "2.1.27",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.28 - _April 28, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.27 - _April 1, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc1155",
|
||||
"version": "2.1.27",
|
||||
"version": "2.1.28",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -52,15 +52,15 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/tokens",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.4.21",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/contracts-utils": "^4.7.6",
|
||||
"@0x/dev-utils": "^4.2.1",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/abi-gen": "^5.5.2",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/contracts-utils": "^4.7.7",
|
||||
"@0x/dev-utils": "^4.2.6",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "12.12.54",
|
||||
@@ -68,7 +68,7 @@
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"ethereum-types": "^3.4.0",
|
||||
"ethereum-types": "^3.5.0",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
@@ -80,10 +80,10 @@
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"@0x/base-contract": "^6.3.2",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1619596077,
|
||||
"version": "3.3.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1617311315,
|
||||
"version": "3.3.6",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.3.7 - _April 28, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.3.6 - _April 1, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc20",
|
||||
"version": "3.3.6",
|
||||
"version": "3.3.7",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -51,18 +51,18 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/tokens",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.4.21",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/contracts-utils": "^4.7.6",
|
||||
"@0x/dev-utils": "^4.2.1",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/abi-gen": "^5.5.2",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/contracts-utils": "^4.7.7",
|
||||
"@0x/dev-utils": "^4.2.6",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"@0x/web3-wrapper": "^7.5.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.4.0",
|
||||
"ethereum-types": "^3.5.0",
|
||||
"lodash": "^4.17.11",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
@@ -82,7 +82,7 @@
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.18"
|
||||
"@0x/base-contract": "^6.3.2"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1619596077,
|
||||
"version": "3.1.28",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1617311315,
|
||||
"version": "3.1.27",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.1.28 - _April 28, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.1.27 - _April 1, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-erc721",
|
||||
"version": "3.1.27",
|
||||
"version": "3.1.28",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -52,18 +52,18 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/tokens",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.4.21",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/contracts-utils": "^4.7.6",
|
||||
"@0x/dev-utils": "^4.2.1",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/abi-gen": "^5.5.2",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/contracts-utils": "^4.7.7",
|
||||
"@0x/dev-utils": "^4.2.6",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "12.12.54",
|
||||
@@ -71,7 +71,7 @@
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"ethereum-types": "^3.4.0",
|
||||
"ethereum-types": "^3.5.0",
|
||||
"lodash": "^4.17.11",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
@@ -84,7 +84,7 @@
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.18"
|
||||
"@0x/base-contract": "^6.3.2"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1619596077,
|
||||
"version": "4.2.29",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1617311315,
|
||||
"version": "4.2.28",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.2.29 - _April 28, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.2.28 - _April 1, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange-forwarder",
|
||||
"version": "4.2.28",
|
||||
"version": "4.2.29",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -52,25 +52,25 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/extensions",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.4.21",
|
||||
"@0x/contracts-asset-proxy": "^3.7.9",
|
||||
"@0x/contracts-dev-utils": "^1.3.26",
|
||||
"@0x/contracts-erc1155": "^2.1.27",
|
||||
"@0x/contracts-erc20": "^3.3.6",
|
||||
"@0x/contracts-erc721": "^3.1.27",
|
||||
"@0x/contracts-exchange": "^3.2.28",
|
||||
"@0x/contracts-exchange-libs": "^4.3.27",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/contracts-utils": "^4.7.6",
|
||||
"@0x/dev-utils": "^4.2.1",
|
||||
"@0x/order-utils": "^10.4.19",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/abi-gen": "^5.5.2",
|
||||
"@0x/contracts-asset-proxy": "^3.7.10",
|
||||
"@0x/contracts-dev-utils": "^1.3.27",
|
||||
"@0x/contracts-erc1155": "^2.1.28",
|
||||
"@0x/contracts-erc20": "^3.3.7",
|
||||
"@0x/contracts-erc721": "^3.1.28",
|
||||
"@0x/contracts-exchange": "^3.2.29",
|
||||
"@0x/contracts-exchange-libs": "^4.3.28",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/contracts-utils": "^4.7.7",
|
||||
"@0x/dev-utils": "^4.2.6",
|
||||
"@0x/order-utils": "^10.4.20",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "12.12.54",
|
||||
@@ -90,9 +90,9 @@
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"ethereum-types": "^3.4.0"
|
||||
"@0x/base-contract": "^6.3.2",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"ethereum-types": "^3.5.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1619596077,
|
||||
"version": "4.3.28",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1617311315,
|
||||
"version": "4.3.27",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.3.28 - _April 28, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.3.27 - _April 1, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange-libs",
|
||||
"version": "4.3.27",
|
||||
"version": "4.3.28",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -52,14 +52,14 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/libs",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.4.21",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/dev-utils": "^4.2.1",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/subproviders": "^6.4.1",
|
||||
"@0x/abi-gen": "^5.5.2",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/dev-utils": "^4.2.6",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/subproviders": "^6.5.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "12.12.54",
|
||||
@@ -67,7 +67,7 @@
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"ethereumjs-util": "^7.0.10",
|
||||
"lodash": "^4.17.11",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
@@ -80,14 +80,14 @@
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/contracts-utils": "^4.7.6",
|
||||
"@0x/order-utils": "^10.4.19",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"ethereum-types": "^3.4.0"
|
||||
"@0x/base-contract": "^6.3.2",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/contracts-utils": "^4.7.7",
|
||||
"@0x/order-utils": "^10.4.20",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"ethereum-types": "^3.5.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1619596077,
|
||||
"version": "3.2.29",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1617311315,
|
||||
"version": "3.2.28",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.2.29 - _April 28, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.2.28 - _April 1, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-exchange",
|
||||
"version": "3.2.28",
|
||||
"version": "3.2.29",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -52,21 +52,21 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/protocol",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.4.21",
|
||||
"@0x/contracts-asset-proxy": "^3.7.9",
|
||||
"@0x/contracts-exchange-libs": "^4.3.27",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/contracts-multisig": "^4.1.28",
|
||||
"@0x/contracts-staking": "^2.0.35",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/contracts-utils": "^4.7.6",
|
||||
"@0x/dev-utils": "^4.2.1",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/abi-gen": "^5.5.2",
|
||||
"@0x/contracts-asset-proxy": "^3.7.10",
|
||||
"@0x/contracts-exchange-libs": "^4.3.28",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/contracts-multisig": "^4.1.29",
|
||||
"@0x/contracts-staking": "^2.0.36",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/contracts-utils": "^4.7.7",
|
||||
"@0x/dev-utils": "^4.2.6",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "12.12.54",
|
||||
@@ -74,8 +74,8 @@
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"ethereum-types": "^3.4.0",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"ethereum-types": "^3.5.0",
|
||||
"ethereumjs-util": "^7.0.10",
|
||||
"js-combinatorics": "^0.5.3",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
@@ -88,13 +88,13 @@
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/contracts-dev-utils": "^1.3.26",
|
||||
"@0x/contracts-erc1155": "^2.1.27",
|
||||
"@0x/contracts-erc20": "^3.3.6",
|
||||
"@0x/contracts-erc721": "^3.1.27",
|
||||
"@0x/order-utils": "^10.4.19",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"@0x/base-contract": "^6.3.2",
|
||||
"@0x/contracts-dev-utils": "^1.3.27",
|
||||
"@0x/contracts-erc1155": "^2.1.28",
|
||||
"@0x/contracts-erc20": "^3.3.7",
|
||||
"@0x/contracts-erc721": "^3.1.28",
|
||||
"@0x/order-utils": "^10.4.20",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -86,7 +86,7 @@ blockchainTests.resets('MixinSignatureValidator', env => {
|
||||
|
||||
const SIGNATURE_LENGTH = 65;
|
||||
const generateRandomSignature = (): string => hexUtils.random(SIGNATURE_LENGTH);
|
||||
const hashBytes = (bytesHex: string): string => ethUtil.bufferToHex(ethUtil.sha3(ethUtil.toBuffer(bytesHex)));
|
||||
const hashBytes = (bytesHex: string): string => hexUtils.hash(bytesHex);
|
||||
const signDataHex = (dataHex: string, privateKey: Buffer): string => {
|
||||
const ecSignature = ethUtil.ecsign(ethUtil.toBuffer(dataHex), privateKey);
|
||||
return hexUtils.concat(ecSignature.v, ecSignature.r, ecSignature.s);
|
||||
|
@@ -12,7 +12,6 @@ import { ReferenceFunctions as UtilReferenceFunctions, SafeMathRevertErrors } fr
|
||||
import { FillResults, Order } from '@0x/types';
|
||||
import { AnyRevertError, BigNumber, ExchangeRevertErrors, hexUtils, StringRevertError } from '@0x/utils';
|
||||
import { LogEntry, LogWithDecodedArgs } from 'ethereum-types';
|
||||
import * as ethjs from 'ethereumjs-util';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { artifacts } from './artifacts';
|
||||
@@ -104,7 +103,7 @@ blockchainTests('Exchange wrapper functions unit tests.', env => {
|
||||
// Creates a deterministic order signature, even though no signature validation
|
||||
// actually occurs in the test contract.
|
||||
function createOrderSignature(order: Order): string {
|
||||
return ethjs.bufferToHex(ethjs.sha3(ethjs.toBuffer(orderHashUtils.getOrderHashHex(order))));
|
||||
return hexUtils.hash(orderHashUtils.getOrderHashHex(order));
|
||||
}
|
||||
|
||||
// Asserts that `_fillOrder()` was called in the same order and with the same
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1619596077,
|
||||
"version": "6.2.23",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1617311315,
|
||||
"version": "6.2.22",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v6.2.23 - _April 28, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v6.2.22 - _April 1, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-extensions",
|
||||
"version": "6.2.22",
|
||||
"version": "6.2.23",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -52,23 +52,23 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/extensions",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.4.21",
|
||||
"@0x/contracts-asset-proxy": "^3.7.9",
|
||||
"@0x/contracts-dev-utils": "^1.3.26",
|
||||
"@0x/contracts-erc20": "^3.3.6",
|
||||
"@0x/contracts-erc721": "^3.1.27",
|
||||
"@0x/contracts-exchange": "^3.2.28",
|
||||
"@0x/contracts-exchange-libs": "^4.3.27",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/contracts-utils": "^4.7.6",
|
||||
"@0x/dev-utils": "^4.2.1",
|
||||
"@0x/order-utils": "^10.4.19",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/abi-gen": "^5.5.2",
|
||||
"@0x/contracts-asset-proxy": "^3.7.10",
|
||||
"@0x/contracts-dev-utils": "^1.3.27",
|
||||
"@0x/contracts-erc20": "^3.3.7",
|
||||
"@0x/contracts-erc721": "^3.1.28",
|
||||
"@0x/contracts-exchange": "^3.2.29",
|
||||
"@0x/contracts-exchange-libs": "^4.3.28",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/contracts-utils": "^4.7.7",
|
||||
"@0x/dev-utils": "^4.2.6",
|
||||
"@0x/order-utils": "^10.4.20",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "12.12.54",
|
||||
@@ -77,7 +77,7 @@
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"ethereumjs-abi": "0.6.5",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"ethereumjs-util": "^7.0.10",
|
||||
"lodash": "^4.17.11",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
@@ -90,10 +90,10 @@
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"ethereum-types": "^3.4.0"
|
||||
"@0x/base-contract": "^6.3.2",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"ethereum-types": "^3.5.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-integrations",
|
||||
"version": "2.7.36",
|
||||
"version": "2.7.38",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
@@ -52,25 +52,25 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/extensions",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.4.21",
|
||||
"@0x/abi-gen": "^5.5.2",
|
||||
"@0x/contract-addresses": "^6.0.0",
|
||||
"@0x/contract-wrappers": "^13.15.0",
|
||||
"@0x/contracts-broker": "^1.1.27",
|
||||
"@0x/contracts-coordinator": "^3.1.28",
|
||||
"@0x/contracts-dev-utils": "^1.3.26",
|
||||
"@0x/contracts-exchange-forwarder": "^4.2.28",
|
||||
"@0x/contracts-exchange-libs": "^4.3.27",
|
||||
"@0x/contracts-extensions": "^6.2.22",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/contracts-utils": "^4.7.6",
|
||||
"@0x/contract-wrappers": "^13.16.0",
|
||||
"@0x/contracts-broker": "^1.1.28",
|
||||
"@0x/contracts-coordinator": "^3.1.29",
|
||||
"@0x/contracts-dev-utils": "^1.3.27",
|
||||
"@0x/contracts-exchange-forwarder": "^4.2.29",
|
||||
"@0x/contracts-exchange-libs": "^4.3.28",
|
||||
"@0x/contracts-extensions": "^6.2.23",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/contracts-utils": "^4.7.7",
|
||||
"@0x/coordinator-server": "^1.0.5",
|
||||
"@0x/dev-utils": "^4.2.1",
|
||||
"@0x/migrations": "^8.0.2",
|
||||
"@0x/order-utils": "^10.4.19",
|
||||
"@0x/protocol-utils": "^1.5.0",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"@0x/dev-utils": "^4.2.6",
|
||||
"@0x/migrations": "^8.0.4",
|
||||
"@0x/order-utils": "^10.4.20",
|
||||
"@0x/protocol-utils": "^1.5.1",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"@azure/core-asynciterator-polyfill": "^1.0.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
@@ -93,23 +93,23 @@
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/asset-swapper": "^6.7.0",
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/contracts-asset-proxy": "^3.7.9",
|
||||
"@0x/contracts-erc1155": "^2.1.27",
|
||||
"@0x/contracts-erc20": "^3.3.6",
|
||||
"@0x/contracts-erc721": "^3.1.27",
|
||||
"@0x/contracts-exchange": "^3.2.28",
|
||||
"@0x/contracts-multisig": "^4.1.28",
|
||||
"@0x/contracts-staking": "^2.0.35",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/contracts-zero-ex": "^0.22.0",
|
||||
"@0x/subproviders": "^6.4.1",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"ethereum-types": "^3.4.0",
|
||||
"ethereumjs-util": "^6.2.0",
|
||||
"@0x/asset-swapper": "^6.9.0",
|
||||
"@0x/base-contract": "^6.3.2",
|
||||
"@0x/contracts-asset-proxy": "^3.7.10",
|
||||
"@0x/contracts-erc1155": "^2.1.28",
|
||||
"@0x/contracts-erc20": "^3.3.7",
|
||||
"@0x/contracts-erc721": "^3.1.28",
|
||||
"@0x/contracts-exchange": "^3.2.29",
|
||||
"@0x/contracts-multisig": "^4.1.29",
|
||||
"@0x/contracts-staking": "^2.0.36",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/contracts-zero-ex": "^0.22.2",
|
||||
"@0x/subproviders": "^6.5.2",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"ethereum-types": "^3.5.0",
|
||||
"ethereumjs-util": "^7.0.10",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1619596077,
|
||||
"version": "4.1.29",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1617311315,
|
||||
"version": "4.1.28",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.1.29 - _April 28, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.1.28 - _April 1, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-multisig",
|
||||
"version": "4.1.28",
|
||||
"version": "4.1.29",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -49,18 +49,18 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/multisig",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.4.21",
|
||||
"@0x/contracts-asset-proxy": "^3.7.9",
|
||||
"@0x/contracts-erc20": "^3.3.6",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/contracts-utils": "^4.7.6",
|
||||
"@0x/dev-utils": "^4.2.1",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"@0x/abi-gen": "^5.5.2",
|
||||
"@0x/contracts-asset-proxy": "^3.7.10",
|
||||
"@0x/contracts-erc20": "^3.3.7",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/contracts-utils": "^4.7.7",
|
||||
"@0x/dev-utils": "^4.2.6",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "12.12.54",
|
||||
@@ -78,9 +78,9 @@
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"ethereum-types": "^3.4.0"
|
||||
"@0x/base-contract": "^6.3.2",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"ethereum-types": "^3.5.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1619596077,
|
||||
"version": "2.0.36",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1617311315,
|
||||
"version": "2.0.35",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.36 - _April 28, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.35 - _April 1, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-staking",
|
||||
"version": "2.0.35",
|
||||
"version": "2.0.36",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -53,20 +53,20 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/tokens",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.4.21",
|
||||
"@0x/contracts-asset-proxy": "^3.7.9",
|
||||
"@0x/contracts-dev-utils": "^1.3.26",
|
||||
"@0x/contracts-erc20": "^3.3.6",
|
||||
"@0x/contracts-exchange-libs": "^4.3.27",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/contracts-utils": "^4.7.6",
|
||||
"@0x/dev-utils": "^4.2.1",
|
||||
"@0x/order-utils": "^10.4.19",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/abi-gen": "^5.5.2",
|
||||
"@0x/contracts-asset-proxy": "^3.7.10",
|
||||
"@0x/contracts-dev-utils": "^1.3.27",
|
||||
"@0x/contracts-erc20": "^3.3.7",
|
||||
"@0x/contracts-exchange-libs": "^4.3.28",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/contracts-utils": "^4.7.7",
|
||||
"@0x/dev-utils": "^4.2.6",
|
||||
"@0x/order-utils": "^10.4.20",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/node": "12.12.54",
|
||||
"chai": "^4.0.1",
|
||||
@@ -87,12 +87,12 @@
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"ethereum-types": "^3.4.0",
|
||||
"ethereumjs-util": "^5.1.1"
|
||||
"@0x/base-contract": "^6.3.2",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"ethereum-types": "^3.5.0",
|
||||
"ethereumjs-util": "^7.0.10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1619596077,
|
||||
"version": "5.3.25",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1617311315,
|
||||
"version": "5.3.24",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v5.3.25 - _April 28, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v5.3.24 - _April 1, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-test-utils",
|
||||
"version": "5.3.24",
|
||||
"version": "5.3.25",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -34,28 +34,28 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/test-utils",
|
||||
"devDependencies": {
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"tslint": "5.11.0",
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.21",
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/assert": "^3.0.26",
|
||||
"@0x/base-contract": "^6.3.2",
|
||||
"@0x/contract-addresses": "^6.0.0",
|
||||
"@0x/dev-utils": "^4.2.1",
|
||||
"@0x/json-schemas": "^5.4.1",
|
||||
"@0x/order-utils": "^10.4.19",
|
||||
"@0x/sol-coverage": "^4.0.31",
|
||||
"@0x/sol-profiler": "^4.1.21",
|
||||
"@0x/sol-trace": "^3.0.31",
|
||||
"@0x/subproviders": "^6.4.1",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"@0x/dev-utils": "^4.2.6",
|
||||
"@0x/json-schemas": "^6.1.2",
|
||||
"@0x/order-utils": "^10.4.20",
|
||||
"@0x/sol-coverage": "^4.0.36",
|
||||
"@0x/sol-profiler": "^4.1.26",
|
||||
"@0x/sol-trace": "^3.0.36",
|
||||
"@0x/subproviders": "^6.5.2",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/js-combinatorics": "^0.5.29",
|
||||
"@types/lodash": "4.14.104",
|
||||
@@ -67,8 +67,8 @@
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"decimal.js": "^10.2.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"ethereum-types": "^3.4.0",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"ethereum-types": "^3.5.0",
|
||||
"ethereumjs-util": "^7.0.10",
|
||||
"ethers": "~4.0.4",
|
||||
"js-combinatorics": "^0.5.3",
|
||||
"lodash": "^4.17.11",
|
||||
|
@@ -77,7 +77,7 @@ export const constants = {
|
||||
ZERO_AMOUNT: new BigNumber(0),
|
||||
PERCENTAGE_DENOMINATOR: new BigNumber(10).pow(18),
|
||||
TIME_BUFFER: new BigNumber(1000),
|
||||
KECCAK256_NULL: ethUtil.addHexPrefix(ethUtil.bufferToHex(ethUtil.SHA3_NULL)),
|
||||
KECCAK256_NULL: ethUtil.bufferToHex(ethUtil.keccak256(Buffer.alloc(0))),
|
||||
MAX_UINT256_ROOT: new BigNumber('340282366920938463463374607431768211456'),
|
||||
ONE_ETHER: new BigNumber(1e18),
|
||||
EIP712_DOMAIN_NAME: '0x Protocol',
|
||||
|
@@ -57,9 +57,7 @@ describe('Order hashing', () => {
|
||||
...order,
|
||||
takerAddress: (null as any) as string,
|
||||
};
|
||||
const expectedErrorMessage = `Order taker must be of type string. If you want anyone to be able to fill an order - pass ${
|
||||
constants.NULL_ADDRESS
|
||||
}`;
|
||||
const expectedErrorMessage = `Expected order to conform to schema`;
|
||||
expect(() => orderHashUtils.getOrderHashHex(orderWithInvalidtakerFormat)).to.throw(expectedErrorMessage);
|
||||
});
|
||||
});
|
||||
|
@@ -1,4 +1,23 @@
|
||||
[
|
||||
{
|
||||
"version": "1.1.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Patched votingPower logic",
|
||||
"pr": 214
|
||||
}
|
||||
],
|
||||
"timestamp": 1619825976
|
||||
},
|
||||
{
|
||||
"timestamp": 1619596077,
|
||||
"version": "1.1.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1619481586,
|
||||
"version": "1.1.3",
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.1.5 - _April 30, 2021_
|
||||
|
||||
* Patched votingPower logic (#214)
|
||||
|
||||
## v1.1.4 - _April 28, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.1.3 - _April 26, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -30,6 +30,7 @@ interface IZrxTreasury {
|
||||
uint256 votingPeriod;
|
||||
uint256 proposalThreshold;
|
||||
uint256 quorumThreshold;
|
||||
bytes32 defaultPoolId;
|
||||
}
|
||||
|
||||
struct ProposedAction {
|
||||
|
@@ -20,8 +20,6 @@
|
||||
pragma solidity ^0.6.12;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol";
|
||||
import "@0x/contracts-erc20/contracts/src/v06/LibERC20TokenV06.sol";
|
||||
import "@0x/contracts-utils/contracts/src/v06/LibBytesV06.sol";
|
||||
import "@0x/contracts-utils/contracts/src/v06/LibSafeMathV06.sol";
|
||||
import "@0x/contracts-utils/contracts/src/v06/errors/LibRichErrorsV06.sol";
|
||||
@@ -32,7 +30,6 @@ import "./IZrxTreasury.sol";
|
||||
contract ZrxTreasury is
|
||||
IZrxTreasury
|
||||
{
|
||||
using LibERC20TokenV06 for IERC20TokenV06;
|
||||
using LibSafeMathV06 for uint256;
|
||||
using LibRichErrorsV06 for bytes;
|
||||
using LibBytesV06 for bytes;
|
||||
@@ -52,11 +49,9 @@ contract ZrxTreasury is
|
||||
/// @dev Initializes the ZRX treasury and creates the default
|
||||
/// staking pool.
|
||||
/// @param stakingProxy_ The 0x staking proxy contract.
|
||||
/// @param weth_ The WETH token contract.
|
||||
/// @param params Immutable treasury parameters.
|
||||
constructor(
|
||||
IStaking stakingProxy_,
|
||||
IERC20TokenV06 weth_,
|
||||
TreasuryParameters memory params
|
||||
)
|
||||
public
|
||||
@@ -66,15 +61,12 @@ contract ZrxTreasury is
|
||||
"VOTING_PERIOD_TOO_LONG"
|
||||
);
|
||||
stakingProxy = stakingProxy_;
|
||||
DefaultPoolOperator defaultPoolOperator_ = new DefaultPoolOperator(
|
||||
stakingProxy_,
|
||||
weth_
|
||||
);
|
||||
defaultPoolOperator = defaultPoolOperator_;
|
||||
defaultPoolId = defaultPoolOperator_.poolId();
|
||||
votingPeriod = params.votingPeriod;
|
||||
proposalThreshold = params.proposalThreshold;
|
||||
quorumThreshold = params.quorumThreshold;
|
||||
defaultPoolId = params.defaultPoolId;
|
||||
IStaking.Pool memory defaultPool = stakingProxy_.getStakingPool(params.defaultPoolId);
|
||||
defaultPoolOperator = DefaultPoolOperator(defaultPool.operator);
|
||||
}
|
||||
|
||||
// solhint-disable
|
||||
@@ -286,6 +278,12 @@ contract ZrxTreasury is
|
||||
|
||||
// Add voting power for operated staking pools.
|
||||
for (uint256 i = 0; i != operatedPoolIds.length; i++) {
|
||||
for (uint256 j = 0; j != i; j++) {
|
||||
require(
|
||||
operatedPoolIds[i] != operatedPoolIds[j],
|
||||
"getVotingPower/DUPLICATE_POOL_ID"
|
||||
);
|
||||
}
|
||||
IStaking.Pool memory pool = stakingProxy.getStakingPool(operatedPoolIds[i]);
|
||||
require(
|
||||
pool.operator == account,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-treasury",
|
||||
"version": "1.1.3",
|
||||
"version": "1.1.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -46,16 +46,16 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/treasury",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.4.21",
|
||||
"@0x/abi-gen": "^5.5.2",
|
||||
"@0x/contract-addresses": "^6.0.0",
|
||||
"@0x/contracts-asset-proxy": "^3.7.9",
|
||||
"@0x/contracts-erc20": "^3.3.6",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/contracts-staking": "^2.0.35",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/contracts-asset-proxy": "^3.7.10",
|
||||
"@0x/contracts-erc20": "^3.3.7",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/contracts-staking": "^2.0.36",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@types/isomorphic-fetch": "^0.0.35",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
@@ -72,15 +72,15 @@
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/protocol-utils": "^1.5.0",
|
||||
"@0x/subproviders": "^6.4.1",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"ethereum-types": "^3.4.0",
|
||||
"ethereumjs-util": "^5.1.1"
|
||||
"@0x/base-contract": "^6.3.2",
|
||||
"@0x/protocol-utils": "^1.5.1",
|
||||
"@0x/subproviders": "^6.5.2",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"ethereum-types": "^3.5.0",
|
||||
"ethereumjs-util": "^7.0.10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -28,6 +28,7 @@ blockchainTests.resets('Treasury governance', env => {
|
||||
votingPeriod: new BigNumber(3).times(stakingConstants.ONE_DAY_IN_SECONDS),
|
||||
proposalThreshold: new BigNumber(100),
|
||||
quorumThreshold: new BigNumber(1000),
|
||||
defaultPoolId: stakingConstants.INITIAL_POOL_ID,
|
||||
};
|
||||
const PROPOSAL_DESCRIPTION = 'A very compelling proposal!';
|
||||
const TREASURY_BALANCE = constants.INITIAL_ERC20_BALANCE;
|
||||
@@ -135,6 +136,16 @@ blockchainTests.resets('Treasury governance', env => {
|
||||
.approve(erc20ProxyContract.address, constants.INITIAL_ERC20_ALLOWANCE)
|
||||
.awaitTransactionSuccessAsync({ from: delegator });
|
||||
|
||||
defaultPoolOperator = await DefaultPoolOperatorContract.deployFrom0xArtifactAsync(
|
||||
artifacts.DefaultPoolOperator,
|
||||
env.provider,
|
||||
env.txDefaults,
|
||||
{ ...artifacts, ...erc20Artifacts },
|
||||
staking.address,
|
||||
weth.address,
|
||||
);
|
||||
defaultPoolId = stakingConstants.INITIAL_POOL_ID;
|
||||
|
||||
const createStakingPoolTx = staking.createStakingPool(stakingConstants.PPM, false);
|
||||
nonDefaultPoolId = await createStakingPoolTx.callAsync({ from: poolOperator });
|
||||
await createStakingPoolTx.awaitTransactionSuccessAsync({ from: poolOperator });
|
||||
@@ -145,9 +156,9 @@ blockchainTests.resets('Treasury governance', env => {
|
||||
env.txDefaults,
|
||||
{ ...artifacts, ...erc20Artifacts },
|
||||
staking.address,
|
||||
weth.address,
|
||||
TREASURY_PARAMS,
|
||||
);
|
||||
|
||||
await zrx.mint(TREASURY_BALANCE).awaitTransactionSuccessAsync();
|
||||
await zrx.transfer(treasury.address, TREASURY_BALANCE).awaitTransactionSuccessAsync();
|
||||
actions = [
|
||||
@@ -166,10 +177,6 @@ blockchainTests.resets('Treasury governance', env => {
|
||||
value: constants.ZERO_AMOUNT,
|
||||
},
|
||||
];
|
||||
|
||||
defaultPoolId = await treasury.defaultPoolId().callAsync();
|
||||
const defaultPoolOperatorAddress = await treasury.defaultPoolOperator().callAsync();
|
||||
defaultPoolOperator = new DefaultPoolOperatorContract(defaultPoolOperatorAddress, env.provider, env.txDefaults);
|
||||
});
|
||||
describe('getVotingPower()', () => {
|
||||
it('Unstaked ZRX has no voting power', async () => {
|
||||
@@ -222,6 +229,19 @@ blockchainTests.resets('Treasury governance', env => {
|
||||
const operatorVotingPower = await treasury.getVotingPower(poolOperator, [nonDefaultPoolId]).callAsync();
|
||||
expect(operatorVotingPower).to.bignumber.equal(TREASURY_PARAMS.proposalThreshold.dividedBy(2));
|
||||
});
|
||||
it('Reverts if given duplicate pool IDs', async () => {
|
||||
await staking.stake(TREASURY_PARAMS.proposalThreshold).awaitTransactionSuccessAsync({ from: delegator });
|
||||
await staking
|
||||
.moveStake(
|
||||
new StakeInfo(StakeStatus.Undelegated),
|
||||
new StakeInfo(StakeStatus.Delegated, nonDefaultPoolId),
|
||||
TREASURY_PARAMS.proposalThreshold,
|
||||
)
|
||||
.awaitTransactionSuccessAsync({ from: delegator });
|
||||
await fastForwardToNextEpochAsync();
|
||||
const tx = treasury.getVotingPower(poolOperator, [nonDefaultPoolId, nonDefaultPoolId]).callAsync();
|
||||
return expect(tx).to.revertWith('getVotingPower/DUPLICATE_POOL_ID');
|
||||
});
|
||||
it('Correctly sums voting power delegated to multiple pools', async () => {
|
||||
await staking
|
||||
.stake(TREASURY_PARAMS.proposalThreshold.times(2))
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1619596077,
|
||||
"version": "4.7.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1617311315,
|
||||
"version": "4.7.6",
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.7.7 - _April 28, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.7.6 - _April 1, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-utils",
|
||||
"version": "4.7.6",
|
||||
"version": "4.7.7",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -50,15 +50,15 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/utils",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.4.21",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/dev-utils": "^4.2.1",
|
||||
"@0x/order-utils": "^10.4.19",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"@0x/abi-gen": "^5.5.2",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/dev-utils": "^4.2.6",
|
||||
"@0x/order-utils": "^10.4.20",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
@@ -67,7 +67,7 @@
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^3.0.0",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"ethereumjs-util": "^7.0.10",
|
||||
"lodash": "^4.17.11",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"mocha": "^6.2.0",
|
||||
@@ -79,11 +79,11 @@
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"@0x/base-contract": "^6.3.2",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"bn.js": "^4.11.8",
|
||||
"ethereum-types": "^3.4.0"
|
||||
"ethereum-types": "^3.5.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -2,7 +2,6 @@ import { chaiSetup, constants, provider, txDefaults, web3Wrapper } from '@0x/con
|
||||
import { BlockchainLifecycle } from '@0x/dev-utils';
|
||||
import { BigNumber, hexUtils, signTypedDataUtils } from '@0x/utils';
|
||||
import * as chai from 'chai';
|
||||
import * as ethUtil from 'ethereumjs-util';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { artifacts } from './artifacts';
|
||||
@@ -78,7 +77,7 @@ describe('LibEIP712', () => {
|
||||
|
||||
// Hash the provided input to get the expected hash
|
||||
const input = '0x1901'.concat(unprefixedDomainHash.concat(unprefixedHashStruct));
|
||||
const expectedHash = '0x'.concat(ethUtil.sha3(input).toString('hex'));
|
||||
const expectedHash = hexUtils.hash(input);
|
||||
|
||||
// Get the actual hash by calling the smart contract
|
||||
const actualHash = await lib.externalHashEIP712Message(domainHash, hashStruct).callAsync();
|
||||
|
@@ -1,4 +1,23 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1619825976,
|
||||
"version": "0.22.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "0.22.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "bump feature version to 1.2",
|
||||
"pr": 213
|
||||
}
|
||||
],
|
||||
"timestamp": 1619596077
|
||||
},
|
||||
{
|
||||
"version": "0.22.0",
|
||||
"changes": [
|
||||
@@ -15,6 +34,10 @@
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
},
|
||||
{
|
||||
"note": "BSC Uniswap clones (ApeSwap, CafeSwap, CheeseSwap, JulSwap)",
|
||||
"pr": 208
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v0.22.2 - _April 30, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v0.22.1 - _April 28, 2021_
|
||||
|
||||
* bump feature version to 1.2 (#213)
|
||||
|
||||
## v0.22.0 - _April 26, 2021_
|
||||
|
||||
* Add order signer registry to NativeOrdersFeature (#195)
|
||||
@@ -12,6 +20,7 @@ CHANGELOG
|
||||
## v0.21.1 - _April 12, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
* BSC Uniswap clones (ApeSwap, CafeSwap, CheeseSwap, JulSwap) (#208)
|
||||
|
||||
## v0.21.0 - _April 1, 2021_
|
||||
|
||||
|
@@ -34,7 +34,7 @@ contract NativeOrdersFeature is
|
||||
/// @dev Name of this feature.
|
||||
string public constant override FEATURE_NAME = "LimitOrders";
|
||||
/// @dev Version of this feature.
|
||||
uint256 public immutable override FEATURE_VERSION = _encodeVersion(1, 1, 0);
|
||||
uint256 public immutable override FEATURE_VERSION = _encodeVersion(1, 2, 0);
|
||||
|
||||
constructor(
|
||||
address zeroExAddress,
|
||||
|
@@ -37,22 +37,44 @@ contract PancakeSwapFeature is
|
||||
/// @dev Name of this feature.
|
||||
string public constant override FEATURE_NAME = "PancakeSwapFeature";
|
||||
/// @dev Version of this feature.
|
||||
uint256 public immutable override FEATURE_VERSION = _encodeVersion(1, 0, 1);
|
||||
uint256 public immutable override FEATURE_VERSION = _encodeVersion(1, 0, 2);
|
||||
/// @dev WBNB contract.
|
||||
IEtherTokenV06 private immutable WBNB;
|
||||
|
||||
// 0xFF + address of the PancakeSwap factory contract.
|
||||
uint256 constant private FF_PANCAKESWAP_FACTORY = 0xffbcfccbde45ce874adcb698cc183debcf179528120000000000000000000000;
|
||||
// 0xFF + address of the PancakeSwapV2 factory contract.
|
||||
uint256 constant private FF_PANCAKESWAPV2_FACTORY = 0xffca143ce32fe78f1f7019d7d551a6402fc5350c730000000000000000000000;
|
||||
// 0xFF + address of the BakerySwap factory contract.
|
||||
uint256 constant private FF_BAKERYSWAP_FACTORY = 0xff01bf7c66c6bd861915cdaae475042d3c4bae16a70000000000000000000000;
|
||||
// 0xFF + address of the SushiSwap factory contract.
|
||||
uint256 constant private FF_SUSHISWAP_FACTORY = 0xffc35DADB65012eC5796536bD9864eD8773aBc74C40000000000000000000000;
|
||||
// 0xFF + address of the ApeSwap factory contract.
|
||||
uint256 constant private FF_APESWAP_FACTORY = 0xff0841bd0b734e4f5853f0dd8d7ea041c241fb0da60000000000000000000000;
|
||||
// 0xFF + address of the CafeSwap factory contract.
|
||||
uint256 constant private FF_CAFESWAP_FACTORY = 0xff3e708fdbe3ada63fc94f8f61811196f1302137ad0000000000000000000000;
|
||||
// 0xFF + address of the CheeseSwap factory contract.
|
||||
uint256 constant private FF_CHEESESWAP_FACTORY = 0xffdd538e4fd1b69b7863e1f741213276a6cf1efb3b0000000000000000000000;
|
||||
// 0xFF + address of the JulSwap factory contract.
|
||||
uint256 constant private FF_JULSWAP_FACTORY = 0xff553990f2cba90272390f62c5bdb1681ffc8996750000000000000000000000;
|
||||
|
||||
// Init code hash of the PancakeSwap pair contract.
|
||||
uint256 constant private PANCAKESWAP_PAIR_INIT_CODE_HASH = 0xd0d4c4cd0848c93cb4fd1f498d7013ee6bfb25783ea21593d5834f5d250ece66;
|
||||
// Init code hash of the PancakeSwapV2 pair contract.
|
||||
uint256 constant private PANCAKESWAPV2_PAIR_INIT_CODE_HASH = 0x00fb7f630766e6a796048ea87d01acd3068e8ff67d078148a3fa3f4a84f69bd5;
|
||||
// Init code hash of the BakerySwap pair contract.
|
||||
uint256 constant private BAKERYSWAP_PAIR_INIT_CODE_HASH = 0xe2e87433120e32c4738a7d8f3271f3d872cbe16241d67537139158d90bac61d3;
|
||||
// Init code hash of the SushiSwap pair contract.
|
||||
uint256 constant private SUSHISWAP_PAIR_INIT_CODE_HASH = 0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303;
|
||||
// Init code hash of the ApeSwap pair contract.
|
||||
uint256 constant private APESWAP_PAIR_INIT_CODE_HASH = 0xf4ccce374816856d11f00e4069e7cada164065686fbef53c6167a63ec2fd8c5b;
|
||||
// Init code hash of the CafeSwap pair contract.
|
||||
uint256 constant private CAFESWAP_PAIR_INIT_CODE_HASH = 0x90bcdb5d0bf0e8db3852b0b7d7e05cc8f7c6eb6d511213c5ba02d1d1dbeda8d3;
|
||||
// Init code hash of the CheeseSwap pair contract.
|
||||
uint256 constant private CHEESESWAP_PAIR_INIT_CODE_HASH = 0xf52c5189a89e7ca2ef4f19f2798e3900fba7a316de7cef6c5a9446621ba86286;
|
||||
// Init code hash of the JulSwap pair contract.
|
||||
uint256 constant private JULSWAP_PAIR_INIT_CODE_HASH = 0xb1e98e21a5335633815a8cfb3b580071c2e4561c50afd57a8746def9ed890b18;
|
||||
|
||||
// Mask of the lower 20 bytes of a bytes32.
|
||||
uint256 constant private ADDRESS_MASK = 0x000000000000000000000000ffffffffffffffffffffffffffffffffffffffff;
|
||||
// BNB pseudo-token address.
|
||||
@@ -352,15 +374,40 @@ contract PancakeSwapFeature is
|
||||
mstore(0xB35, PANCAKESWAP_PAIR_INIT_CODE_HASH)
|
||||
}
|
||||
case 1 {
|
||||
mstore(0xB00, FF_PANCAKESWAPV2_FACTORY)
|
||||
mstore(0xB15, salt)
|
||||
mstore(0xB35, PANCAKESWAPV2_PAIR_INIT_CODE_HASH)
|
||||
}
|
||||
case 2 {
|
||||
mstore(0xB00, FF_BAKERYSWAP_FACTORY)
|
||||
mstore(0xB15, salt)
|
||||
mstore(0xB35, BAKERYSWAP_PAIR_INIT_CODE_HASH)
|
||||
}
|
||||
default {
|
||||
case 3 {
|
||||
mstore(0xB00, FF_SUSHISWAP_FACTORY)
|
||||
mstore(0xB15, salt)
|
||||
mstore(0xB35, SUSHISWAP_PAIR_INIT_CODE_HASH)
|
||||
}
|
||||
case 4 {
|
||||
mstore(0xB00, FF_APESWAP_FACTORY)
|
||||
mstore(0xB15, salt)
|
||||
mstore(0xB35, APESWAP_PAIR_INIT_CODE_HASH)
|
||||
}
|
||||
case 5 {
|
||||
mstore(0xB00, FF_CAFESWAP_FACTORY)
|
||||
mstore(0xB15, salt)
|
||||
mstore(0xB35, CAFESWAP_PAIR_INIT_CODE_HASH)
|
||||
}
|
||||
case 6 {
|
||||
mstore(0xB00, FF_CHEESESWAP_FACTORY)
|
||||
mstore(0xB15, salt)
|
||||
mstore(0xB35, CHEESESWAP_PAIR_INIT_CODE_HASH)
|
||||
}
|
||||
default {
|
||||
mstore(0xB00, FF_JULSWAP_FACTORY)
|
||||
mstore(0xB15, salt)
|
||||
mstore(0xB35, JULSWAP_PAIR_INIT_CODE_HASH)
|
||||
}
|
||||
pair := and(ADDRESS_MASK, keccak256(0xB00, 0x55))
|
||||
}
|
||||
|
||||
|
@@ -23,16 +23,21 @@ pragma experimental ABIEncoderV2;
|
||||
import "@0x/contracts-erc20/contracts/src/v06/IERC20TokenV06.sol";
|
||||
|
||||
|
||||
/// @dev VIP PancakeSwap/BakerySwap/SushiSwap fill functions.
|
||||
/// @dev VIP PancakeSwap (and forks) fill functions.
|
||||
interface IPancakeSwapFeature {
|
||||
|
||||
enum ProtocolFork {
|
||||
PancakeSwap,
|
||||
PancakeSwapV2,
|
||||
BakerySwap,
|
||||
SushiSwap
|
||||
SushiSwap,
|
||||
ApeSwap,
|
||||
CafeSwap,
|
||||
CheeseSwap,
|
||||
JulSwap
|
||||
}
|
||||
|
||||
/// @dev Efficiently sell directly to PancakeSwap/BakerySwap/Sushiswap.
|
||||
/// @dev Efficiently sell directly to PancakeSwap (and forks).
|
||||
/// @param tokens Sell path.
|
||||
/// @param sellAmount of `tokens[0]` Amount to sell.
|
||||
/// @param minBuyAmount Minimum amount of `tokens[-1]` to buy.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contracts-zero-ex",
|
||||
"version": "0.22.0",
|
||||
"version": "0.22.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -55,16 +55,16 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/zero-ex",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^5.4.21",
|
||||
"@0x/abi-gen": "^5.5.2",
|
||||
"@0x/contract-addresses": "^6.0.0",
|
||||
"@0x/contracts-erc20": "^3.3.6",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/dev-utils": "^4.2.1",
|
||||
"@0x/order-utils": "^10.4.19",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/contracts-erc20": "^3.3.7",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/dev-utils": "^4.2.6",
|
||||
"@0x/order-utils": "^10.4.20",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@types/isomorphic-fetch": "^0.0.35",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
@@ -82,15 +82,15 @@
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/protocol-utils": "^1.5.0",
|
||||
"@0x/subproviders": "^6.4.1",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"ethereum-types": "^3.4.0",
|
||||
"ethereumjs-util": "^5.1.1"
|
||||
"@0x/base-contract": "^6.3.2",
|
||||
"@0x/protocol-utils": "^1.5.1",
|
||||
"@0x/subproviders": "^6.5.2",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"ethereum-types": "^3.5.0",
|
||||
"ethereumjs-util": "^7.0.10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
@@ -20,6 +20,7 @@ export function rlpEncodeNonce(nonce: number): string {
|
||||
return ethjs.bufferToHex(ethjs.toBuffer(nonce));
|
||||
} else {
|
||||
const rlpNonce = ethjs.toBuffer(nonce);
|
||||
// tslint:disable-next-line: restrict-plus-operands
|
||||
return hexUtils.concat(rlpNonce.length + 0x80, ethjs.bufferToHex(rlpNonce));
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
import { blockchainTests, expect, verifyEventsFromLogs } from '@0x/contracts-test-utils';
|
||||
import { BigNumber, hexUtils } from '@0x/utils';
|
||||
import * as ethjs from 'ethereumjs-util';
|
||||
|
||||
import { artifacts } from './artifacts';
|
||||
import {
|
||||
@@ -41,9 +40,9 @@ blockchainTests.resets('PermissionlessTransformerDeployer', env => {
|
||||
it('deploys at predictable address', async () => {
|
||||
const salt = hexUtils.random();
|
||||
const targetAddress = await deployer.deploy(deployBytes, salt).callAsync();
|
||||
const initCodeHash = hexUtils.toHex(ethjs.sha3(deployBytes));
|
||||
const initCodeHash = hexUtils.hash(deployBytes);
|
||||
const expectedAddress = hexUtils.slice(
|
||||
hexUtils.toHex(ethjs.sha3(hexUtils.concat('0xFF', deployer.address, salt, initCodeHash))),
|
||||
hexUtils.hash(hexUtils.concat('0xFF', deployer.address, salt, initCodeHash)),
|
||||
12,
|
||||
);
|
||||
|
||||
@@ -94,7 +93,7 @@ blockchainTests.resets('PermissionlessTransformerDeployer', env => {
|
||||
const targetAddress = await deployer.deploy(deployBytes, salt).callAsync({ from: sender });
|
||||
await deployer.deploy(deployBytes, salt).awaitTransactionSuccessAsync({ from: sender });
|
||||
expect(hexUtils.toHex(await deployer.toInitCodeHash(targetAddress).callAsync())).to.eq(
|
||||
hexUtils.toHex(ethjs.sha3(deployBytes)),
|
||||
hexUtils.hash(deployBytes),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@@ -66,7 +66,7 @@
|
||||
"ignoreDependencyVersionsForPackage": "contract-wrappers"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/monorepo-scripts": "^3.1.1",
|
||||
"@0x/monorepo-scripts": "^3.1.6",
|
||||
"@0x-lerna-fork/lerna": "3.16.10",
|
||||
"@0xproject/npm-cli-login": "^0.0.11",
|
||||
"async-child-process": "^1.1.1",
|
||||
|
@@ -1,4 +1,28 @@
|
||||
[
|
||||
{
|
||||
"version": "6.9.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Remove conflicting Kyber reserve",
|
||||
"pr": 216
|
||||
}
|
||||
],
|
||||
"timestamp": 1619825976
|
||||
},
|
||||
{
|
||||
"version": "6.8.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Prune paths which cannot improve the best path",
|
||||
"pr": 183
|
||||
},
|
||||
{
|
||||
"note": "Use FastABI for Sampler ABI encoding and decoding",
|
||||
"pr": 183
|
||||
}
|
||||
],
|
||||
"timestamp": 1619596077
|
||||
},
|
||||
{
|
||||
"version": "6.7.0",
|
||||
"changes": [
|
||||
@@ -24,6 +48,10 @@
|
||||
{
|
||||
"note": "Support `Ropsten` network",
|
||||
"pr": 203
|
||||
},
|
||||
{
|
||||
"note": "BSC Uniswap clones (ApeSwap, CafeSwap, CheeseSwap, JulSwap), Saddle BTC pool, Curve gas schedule",
|
||||
"pr": 208
|
||||
}
|
||||
],
|
||||
"timestamp": 1618592834
|
||||
|
@@ -5,6 +5,15 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v6.9.0 - _April 30, 2021_
|
||||
|
||||
* Remove conflicting Kyber reserve (#216)
|
||||
|
||||
## v6.8.0 - _April 28, 2021_
|
||||
|
||||
* Prune paths which cannot improve the best path (#183)
|
||||
* Use FastABI for Sampler ABI encoding and decoding (#183)
|
||||
|
||||
## v6.7.0 - _April 26, 2021_
|
||||
|
||||
* Support PancakeSwap V2 (#211)
|
||||
@@ -16,6 +25,7 @@ CHANGELOG
|
||||
## v6.6.0 - _April 16, 2021_
|
||||
|
||||
* Support `Ropsten` network (#203)
|
||||
* BSC Uniswap clones (ApeSwap, CafeSwap, CheeseSwap, JulSwap), Saddle BTC pool, Curve gas schedule (#208)
|
||||
|
||||
## v6.5.3 - _April 14, 2021_
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/asset-swapper",
|
||||
"version": "6.7.0",
|
||||
"version": "6.9.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -57,20 +57,20 @@
|
||||
"registry": "git@github.com:0xProject/gitpkg-registry.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.21",
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/assert": "^3.0.26",
|
||||
"@0x/base-contract": "^6.4.0",
|
||||
"@0x/contract-addresses": "^6.0.0",
|
||||
"@0x/contract-wrappers": "^13.15.0",
|
||||
"@0x/contracts-erc20": "^3.3.6",
|
||||
"@0x/contracts-zero-ex": "^0.22.0",
|
||||
"@0x/dev-utils": "^4.2.1",
|
||||
"@0x/json-schemas": "^5.4.1",
|
||||
"@0x/protocol-utils": "^1.5.0",
|
||||
"@0x/contract-wrappers": "^13.16.0",
|
||||
"@0x/contracts-erc20": "^3.3.7",
|
||||
"@0x/contracts-zero-ex": "^0.22.2",
|
||||
"@0x/dev-utils": "^4.2.6",
|
||||
"@0x/json-schemas": "^6.1.2",
|
||||
"@0x/protocol-utils": "^1.5.1",
|
||||
"@0x/quote-server": "^5.0.0",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/typescript-typings": "^5.1.6",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/typescript-typings": "^5.2.0",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"@balancer-labs/sor": "0.3.2",
|
||||
"@bancor/sdk": "0.2.9",
|
||||
"@ethersproject/abi": "^5.0.1",
|
||||
@@ -82,26 +82,27 @@
|
||||
"axios-mock-adapter": "^1.19.0",
|
||||
"cream-sor": "^0.3.3",
|
||||
"decimal.js": "^10.2.0",
|
||||
"ethereum-types": "^3.4.0",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
"ethereum-types": "^3.5.0",
|
||||
"ethereumjs-util": "^7.0.10",
|
||||
"fast-abi": "^0.0.2",
|
||||
"heartbeats": "^5.0.1",
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/contracts-asset-proxy": "^3.7.9",
|
||||
"@0x/contracts-exchange": "^3.2.28",
|
||||
"@0x/contracts-exchange-libs": "^4.3.27",
|
||||
"@0x/contracts-gen": "^2.0.32",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/contracts-utils": "^4.7.6",
|
||||
"@0x/abi-gen": "^5.6.0",
|
||||
"@0x/contracts-asset-proxy": "^3.7.10",
|
||||
"@0x/contracts-exchange": "^3.2.29",
|
||||
"@0x/contracts-exchange-libs": "^4.3.28",
|
||||
"@0x/contracts-gen": "^2.0.37",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/contracts-utils": "^4.7.7",
|
||||
"@0x/mesh-rpc-client": "^9.4.2",
|
||||
"@0x/migrations": "^8.0.2",
|
||||
"@0x/sol-compiler": "^4.6.1",
|
||||
"@0x/subproviders": "^6.4.1",
|
||||
"@0x/migrations": "^8.0.4",
|
||||
"@0x/sol-compiler": "^4.7.2",
|
||||
"@0x/subproviders": "^6.5.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "12.12.54",
|
||||
|
@@ -65,7 +65,18 @@ import {
|
||||
// tslint:disable-next-line:custom-no-magic-numbers
|
||||
const MAX_UINT256 = new BigNumber(2).pow(256).minus(1);
|
||||
const { NULL_ADDRESS, NULL_BYTES, ZERO_AMOUNT } = constants;
|
||||
const PANCAKE_SWAP_FORKS = [ERC20BridgeSource.PancakeSwap, ERC20BridgeSource.BakerySwap, ERC20BridgeSource.SushiSwap];
|
||||
|
||||
// use the same order in IPancakeSwapFeature.sol
|
||||
const PANCAKE_SWAP_FORKS = [
|
||||
ERC20BridgeSource.PancakeSwap,
|
||||
ERC20BridgeSource.PancakeSwapV2,
|
||||
ERC20BridgeSource.BakerySwap,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.ApeSwap,
|
||||
ERC20BridgeSource.CafeSwap,
|
||||
ERC20BridgeSource.CheeseSwap,
|
||||
ERC20BridgeSource.JulSwap,
|
||||
];
|
||||
const DUMMY_WETH_CONTRACT = new WETH9Contract(NULL_ADDRESS, {
|
||||
sendAsync(): void {
|
||||
return;
|
||||
@@ -186,8 +197,13 @@ export class ExchangeProxySwapQuoteConsumer implements SwapQuoteConsumerBase {
|
||||
this.chainId === ChainId.BSC &&
|
||||
isDirectSwapCompatible(quote, optsWithDefaults, [
|
||||
ERC20BridgeSource.PancakeSwap,
|
||||
ERC20BridgeSource.PancakeSwapV2,
|
||||
ERC20BridgeSource.BakerySwap,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.ApeSwap,
|
||||
ERC20BridgeSource.CafeSwap,
|
||||
ERC20BridgeSource.CheeseSwap,
|
||||
ERC20BridgeSource.JulSwap,
|
||||
])
|
||||
) {
|
||||
const source = slippedOrders[0].source;
|
||||
|
@@ -2,7 +2,8 @@ import { ChainId, getContractAddressesForChainOrThrow } from '@0x/contract-addre
|
||||
import { FillQuoteTransformerOrderType, LimitOrder } from '@0x/protocol-utils';
|
||||
import { BigNumber, providerUtils } from '@0x/utils';
|
||||
import Axios, { AxiosInstance } from 'axios';
|
||||
import { BlockParamLiteral, SupportedProvider, ZeroExProvider } from 'ethereum-types';
|
||||
import { BlockParamLiteral, MethodAbi, SupportedProvider, ZeroExProvider } from 'ethereum-types';
|
||||
import { FastABI } from 'fast-abi';
|
||||
import { Agent as HttpAgent } from 'http';
|
||||
import { Agent as HttpsAgent } from 'https';
|
||||
import * as _ from 'lodash';
|
||||
@@ -122,12 +123,19 @@ export class SwapQuoter {
|
||||
{ block: BlockParamLiteral.Latest, overrides: defaultCodeOverrides },
|
||||
options.samplerOverrides,
|
||||
);
|
||||
const fastAbi = new FastABI(ERC20BridgeSamplerContract.ABI() as MethodAbi[]);
|
||||
const samplerContract = new ERC20BridgeSamplerContract(
|
||||
this._contractAddresses.erc20BridgeSampler,
|
||||
this.provider,
|
||||
{
|
||||
gas: samplerGasLimit,
|
||||
},
|
||||
{},
|
||||
undefined,
|
||||
{
|
||||
encodeInput: (fnName: string, values: any) => fastAbi.encodeInput(fnName, values),
|
||||
decodeOutput: (fnName: string, data: string) => fastAbi.decodeOutput(fnName, data),
|
||||
},
|
||||
);
|
||||
|
||||
this._marketOperationUtils = new MarketOperationUtils(
|
||||
|
@@ -2,12 +2,17 @@ import { ChainId } from '@0x/contract-addresses';
|
||||
import { BigNumber, NULL_BYTES } from '@0x/utils';
|
||||
|
||||
import {
|
||||
APESWAP_ROUTER_BY_CHAIN_ID,
|
||||
BAKERYSWAP_ROUTER_BY_CHAIN_ID,
|
||||
BELT_BSC_INFOS,
|
||||
CAFESWAP_ROUTER_BY_CHAIN_ID,
|
||||
CHEESESWAP_ROUTER_BY_CHAIN_ID,
|
||||
COMPONENT_POOLS_BY_CHAIN_ID,
|
||||
CRYPTO_COM_ROUTER_BY_CHAIN_ID,
|
||||
CURVE_MAINNET_INFOS,
|
||||
ELLIPSIS_BSC_INFOS,
|
||||
JULSWAP_ROUTER_BY_CHAIN_ID,
|
||||
KYBER_BANNED_RESERVES,
|
||||
KYBER_BRIDGED_LIQUIDITY_PREFIX,
|
||||
KYBER_DMM_ROUTER_BY_CHAIN_ID,
|
||||
MAX_DODOV2_POOLS_QUERIED,
|
||||
@@ -15,7 +20,7 @@ import {
|
||||
NERVE_BSC_INFOS,
|
||||
NULL_ADDRESS,
|
||||
PANCAKESWAP_ROUTER_BY_CHAIN_ID,
|
||||
PANCAKESWAP_V2_ROUTER_BY_CHAIN_ID,
|
||||
PANCAKESWAPV2_ROUTER_BY_CHAIN_ID,
|
||||
SADDLE_MAINNET_INFOS,
|
||||
SHELL_POOLS_BY_CHAIN_ID,
|
||||
SMOOTHY_BSC_INFOS,
|
||||
@@ -32,7 +37,11 @@ import { CurveInfo, ERC20BridgeSource } from './types';
|
||||
* @param reserveId Kyber reserveId
|
||||
*/
|
||||
export function isAllowedKyberReserveId(reserveId: string): boolean {
|
||||
return reserveId !== NULL_BYTES && !reserveId.startsWith(KYBER_BRIDGED_LIQUIDITY_PREFIX);
|
||||
return (
|
||||
reserveId !== NULL_BYTES &&
|
||||
!reserveId.startsWith(KYBER_BRIDGED_LIQUIDITY_PREFIX) &&
|
||||
!KYBER_BANNED_RESERVES.includes(reserveId)
|
||||
);
|
||||
}
|
||||
|
||||
// tslint:disable-next-line: completed-docs ban-types
|
||||
@@ -253,9 +262,13 @@ export function uniswapV2LikeRouterAddress(
|
||||
| ERC20BridgeSource.SushiSwap
|
||||
| ERC20BridgeSource.CryptoCom
|
||||
| ERC20BridgeSource.PancakeSwap
|
||||
| ERC20BridgeSource.PancakeSwapV2
|
||||
| ERC20BridgeSource.BakerySwap
|
||||
| ERC20BridgeSource.KyberDmm
|
||||
| ERC20BridgeSource.PancakeSwapV2,
|
||||
| ERC20BridgeSource.ApeSwap
|
||||
| ERC20BridgeSource.CafeSwap
|
||||
| ERC20BridgeSource.CheeseSwap
|
||||
| ERC20BridgeSource.JulSwap,
|
||||
): string {
|
||||
switch (source) {
|
||||
case ERC20BridgeSource.UniswapV2:
|
||||
@@ -266,12 +279,20 @@ export function uniswapV2LikeRouterAddress(
|
||||
return CRYPTO_COM_ROUTER_BY_CHAIN_ID[chainId];
|
||||
case ERC20BridgeSource.PancakeSwap:
|
||||
return PANCAKESWAP_ROUTER_BY_CHAIN_ID[chainId];
|
||||
case ERC20BridgeSource.PancakeSwapV2:
|
||||
return PANCAKESWAPV2_ROUTER_BY_CHAIN_ID[chainId];
|
||||
case ERC20BridgeSource.BakerySwap:
|
||||
return BAKERYSWAP_ROUTER_BY_CHAIN_ID[chainId];
|
||||
case ERC20BridgeSource.KyberDmm:
|
||||
return KYBER_DMM_ROUTER_BY_CHAIN_ID[chainId];
|
||||
case ERC20BridgeSource.PancakeSwapV2:
|
||||
return PANCAKESWAP_V2_ROUTER_BY_CHAIN_ID[chainId];
|
||||
case ERC20BridgeSource.ApeSwap:
|
||||
return APESWAP_ROUTER_BY_CHAIN_ID[chainId];
|
||||
case ERC20BridgeSource.CafeSwap:
|
||||
return CAFESWAP_ROUTER_BY_CHAIN_ID[chainId];
|
||||
case ERC20BridgeSource.CheeseSwap:
|
||||
return CHEESESWAP_ROUTER_BY_CHAIN_ID[chainId];
|
||||
case ERC20BridgeSource.JulSwap:
|
||||
return JULSWAP_ROUTER_BY_CHAIN_ID[chainId];
|
||||
default:
|
||||
throw new Error(`Unknown UniswapV2 like source ${source}`);
|
||||
}
|
||||
|
@@ -107,9 +107,13 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
ERC20BridgeSource.MultiHop,
|
||||
ERC20BridgeSource.Nerve,
|
||||
ERC20BridgeSource.PancakeSwap,
|
||||
ERC20BridgeSource.PancakeSwapV2,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.Smoothy,
|
||||
ERC20BridgeSource.PancakeSwapV2,
|
||||
ERC20BridgeSource.ApeSwap,
|
||||
ERC20BridgeSource.CafeSwap,
|
||||
ERC20BridgeSource.CheeseSwap,
|
||||
ERC20BridgeSource.JulSwap,
|
||||
]),
|
||||
},
|
||||
|
||||
@@ -169,9 +173,13 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
|
||||
ERC20BridgeSource.MultiHop,
|
||||
ERC20BridgeSource.Nerve,
|
||||
ERC20BridgeSource.PancakeSwap,
|
||||
ERC20BridgeSource.PancakeSwapV2,
|
||||
ERC20BridgeSource.SushiSwap,
|
||||
ERC20BridgeSource.Smoothy,
|
||||
ERC20BridgeSource.PancakeSwapV2,
|
||||
ERC20BridgeSource.ApeSwap,
|
||||
ERC20BridgeSource.CafeSwap,
|
||||
ERC20BridgeSource.CheeseSwap,
|
||||
ERC20BridgeSource.JulSwap,
|
||||
]),
|
||||
},
|
||||
new SourceFilters([]),
|
||||
@@ -478,147 +486,147 @@ export const CURVE_MAINNET_INFOS: { [name: string]: CurveInfo } = {
|
||||
[CURVE_POOLS.compound]: createCurveExchangeUnderlyingPool({
|
||||
tokens: [MAINNET_TOKENS.DAI, MAINNET_TOKENS.USDC],
|
||||
pool: CURVE_POOLS.compound,
|
||||
gasSchedule: 597e3,
|
||||
gasSchedule: 587e3,
|
||||
}),
|
||||
[CURVE_POOLS.PAX]: createCurveExchangeUnderlyingPool({
|
||||
tokens: [MAINNET_TOKENS.DAI, MAINNET_TOKENS.USDC, MAINNET_TOKENS.USDT, MAINNET_TOKENS.PAX],
|
||||
pool: CURVE_POOLS.PAX,
|
||||
gasSchedule: 752e3,
|
||||
gasSchedule: 742e3,
|
||||
}),
|
||||
[CURVE_POOLS.sUSD]: createCurveExchangeUnderlyingPool({
|
||||
tokens: [MAINNET_TOKENS.DAI, MAINNET_TOKENS.USDC, MAINNET_TOKENS.USDT, MAINNET_TOKENS.sUSD],
|
||||
pool: CURVE_POOLS.sUSD,
|
||||
gasSchedule: 312e3,
|
||||
gasSchedule: 302e3,
|
||||
}),
|
||||
[CURVE_POOLS.renBTC]: createCurveExchangePool({
|
||||
tokens: [MAINNET_TOKENS.RenBTC, MAINNET_TOKENS.WBTC],
|
||||
pool: CURVE_POOLS.renBTC,
|
||||
gasSchedule: 181e3,
|
||||
gasSchedule: 171e3,
|
||||
}),
|
||||
[CURVE_POOLS.sBTC]: createCurveExchangePool({
|
||||
tokens: [MAINNET_TOKENS.RenBTC, MAINNET_TOKENS.WBTC, MAINNET_TOKENS.sBTC],
|
||||
pool: CURVE_POOLS.sBTC,
|
||||
gasSchedule: 337e3,
|
||||
gasSchedule: 327e3,
|
||||
}),
|
||||
[CURVE_POOLS.HBTC]: createCurveExchangePool({
|
||||
tokens: [MAINNET_TOKENS.hBTC, MAINNET_TOKENS.WBTC],
|
||||
pool: CURVE_POOLS.HBTC,
|
||||
gasSchedule: 220e3,
|
||||
gasSchedule: 210e3,
|
||||
}),
|
||||
[CURVE_POOLS.TRI]: createCurveExchangePool({
|
||||
tokens: [MAINNET_TOKENS.DAI, MAINNET_TOKENS.USDC, MAINNET_TOKENS.USDT],
|
||||
pool: CURVE_POOLS.TRI,
|
||||
gasSchedule: 186e3,
|
||||
gasSchedule: 176e3,
|
||||
}),
|
||||
[CURVE_POOLS.GUSD]: createCurveMetaTriPool({
|
||||
token: MAINNET_TOKENS.GUSD,
|
||||
pool: CURVE_POOLS.GUSD,
|
||||
gasSchedule: 421e3,
|
||||
gasSchedule: 411e3,
|
||||
}),
|
||||
[CURVE_POOLS.HUSD]: createCurveMetaTriPool({
|
||||
token: MAINNET_TOKENS.HUSD,
|
||||
pool: CURVE_POOLS.HUSD,
|
||||
gasSchedule: 406e3,
|
||||
gasSchedule: 396e3,
|
||||
}),
|
||||
[CURVE_POOLS.USDN]: createCurveMetaTriPool({
|
||||
token: MAINNET_TOKENS.USDN,
|
||||
pool: CURVE_POOLS.USDN,
|
||||
gasSchedule: 408e3,
|
||||
gasSchedule: 398e3,
|
||||
}),
|
||||
[CURVE_POOLS.mUSD]: createCurveMetaTriPool({
|
||||
token: MAINNET_TOKENS.mUSD,
|
||||
pool: CURVE_POOLS.mUSD,
|
||||
gasSchedule: 395e3,
|
||||
gasSchedule: 385e3,
|
||||
}),
|
||||
[CURVE_POOLS.dUSD]: createCurveMetaTriPool({
|
||||
token: MAINNET_TOKENS.dUSD,
|
||||
pool: CURVE_POOLS.dUSD,
|
||||
gasSchedule: 381e3,
|
||||
gasSchedule: 371e3,
|
||||
}),
|
||||
[CURVE_POOLS.tBTC]: createCurveMetaTriBtcPool({
|
||||
token: MAINNET_TOKENS.tBTC,
|
||||
pool: CURVE_POOLS.tBTC,
|
||||
gasSchedule: 492e3,
|
||||
gasSchedule: 482e3,
|
||||
}),
|
||||
[CURVE_POOLS.pBTC]: createCurveMetaTriBtcPool({
|
||||
token: MAINNET_TOKENS.pBTC,
|
||||
pool: CURVE_POOLS.pBTC,
|
||||
gasSchedule: 513e3,
|
||||
gasSchedule: 503e3,
|
||||
}),
|
||||
[CURVE_POOLS.bBTC]: createCurveMetaTriBtcPool({
|
||||
token: MAINNET_TOKENS.bBTC,
|
||||
pool: CURVE_POOLS.bBTC,
|
||||
gasSchedule: 507e3,
|
||||
gasSchedule: 497e3,
|
||||
}),
|
||||
[CURVE_POOLS.oBTC]: createCurveMetaTriBtcPool({
|
||||
token: MAINNET_TOKENS.oBTC,
|
||||
pool: CURVE_POOLS.oBTC,
|
||||
gasSchedule: 498e3,
|
||||
gasSchedule: 488e3,
|
||||
}),
|
||||
[CURVE_POOLS.UST]: createCurveMetaTriPool({
|
||||
token: MAINNET_TOKENS.UST,
|
||||
pool: CURVE_POOLS.UST,
|
||||
gasSchedule: 350e3,
|
||||
gasSchedule: 340e3,
|
||||
}),
|
||||
[CURVE_POOLS.eurs]: createCurveExchangePool({
|
||||
tokens: [MAINNET_TOKENS.EURS, MAINNET_TOKENS.sEUR],
|
||||
pool: CURVE_POOLS.eurs,
|
||||
gasSchedule: 330e3,
|
||||
gasSchedule: 320e3,
|
||||
}),
|
||||
[CURVE_POOLS.aave]: createCurveExchangeUnderlyingPool({
|
||||
tokens: [MAINNET_TOKENS.DAI, MAINNET_TOKENS.USDC, MAINNET_TOKENS.USDT],
|
||||
pool: CURVE_POOLS.aave,
|
||||
gasSchedule: 590e3,
|
||||
gasSchedule: 580e3,
|
||||
}),
|
||||
[CURVE_POOLS.aave]: createCurveExchangePool({
|
||||
tokens: [MAINNET_TOKENS.aDAI, MAINNET_TOKENS.aUSDC, MAINNET_TOKENS.aUSDT],
|
||||
pool: CURVE_POOLS.aave,
|
||||
gasSchedule: 590e3,
|
||||
gasSchedule: 580e3,
|
||||
}),
|
||||
[CURVE_POOLS.saave]: createCurveExchangeUnderlyingPool({
|
||||
tokens: [MAINNET_TOKENS.DAI, MAINNET_TOKENS.sUSD],
|
||||
pool: CURVE_POOLS.saave,
|
||||
gasSchedule: 590e3,
|
||||
gasSchedule: 580e3,
|
||||
}),
|
||||
[CURVE_POOLS.saave]: createCurveExchangePool({
|
||||
tokens: [MAINNET_TOKENS.aDAI, MAINNET_TOKENS.aSUSD],
|
||||
pool: CURVE_POOLS.saave,
|
||||
gasSchedule: 590e3,
|
||||
gasSchedule: 580e3,
|
||||
}),
|
||||
[CURVE_POOLS.USDP]: createCurveMetaTriPool({
|
||||
token: MAINNET_TOKENS.USDP,
|
||||
pool: CURVE_POOLS.USDP,
|
||||
gasSchedule: 384e3,
|
||||
gasSchedule: 374e3,
|
||||
}),
|
||||
[CURVE_POOLS.ib]: createCurveExchangeUnderlyingPool({
|
||||
tokens: [MAINNET_TOKENS.DAI, MAINNET_TOKENS.USDC, MAINNET_TOKENS.USDT],
|
||||
pool: CURVE_POOLS.ib,
|
||||
gasSchedule: 656e3,
|
||||
gasSchedule: 646e3,
|
||||
}),
|
||||
[CURVE_POOLS.link]: createCurveExchangePool({
|
||||
tokens: [MAINNET_TOKENS.LINK, MAINNET_TOKENS.sLINK],
|
||||
pool: CURVE_POOLS.link,
|
||||
gasSchedule: 329e3,
|
||||
gasSchedule: 319e3,
|
||||
}),
|
||||
[CURVE_POOLS.TUSD]: createCurveMetaTriPool({
|
||||
token: MAINNET_TOKENS.TUSD,
|
||||
pool: CURVE_POOLS.TUSD,
|
||||
gasSchedule: 414e3,
|
||||
gasSchedule: 404e3,
|
||||
}),
|
||||
[CURVE_POOLS.STABLEx]: createCurveMetaTriPool({
|
||||
token: MAINNET_TOKENS.STABLEx,
|
||||
pool: CURVE_POOLS.STABLEx,
|
||||
gasSchedule: 407e3,
|
||||
gasSchedule: 397e3,
|
||||
}),
|
||||
[CURVE_POOLS.alUSD]: createCurveMetaTriPool({
|
||||
token: MAINNET_TOKENS.alUSD,
|
||||
pool: CURVE_POOLS.alUSD,
|
||||
gasSchedule: 397e3,
|
||||
gasSchedule: 387e3,
|
||||
}),
|
||||
[CURVE_POOLS.FRAX]: createCurveMetaTriPool({
|
||||
token: MAINNET_TOKENS.FRAX,
|
||||
pool: CURVE_POOLS.FRAX,
|
||||
gasSchedule: 397e3,
|
||||
gasSchedule: 387e3,
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -626,7 +634,7 @@ export const SWERVE_MAINNET_INFOS: { [name: string]: CurveInfo } = {
|
||||
[SWERVE_POOLS.y]: createCurveExchangePool({
|
||||
tokens: [MAINNET_TOKENS.DAI, MAINNET_TOKENS.USDC, MAINNET_TOKENS.USDT, MAINNET_TOKENS.TUSD],
|
||||
pool: SWERVE_POOLS.y,
|
||||
gasSchedule: 150e3,
|
||||
gasSchedule: 140e3,
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -634,22 +642,22 @@ export const SNOWSWAP_MAINNET_INFOS: { [name: string]: CurveInfo } = {
|
||||
[SNOWSWAP_POOLS.yUSD]: createCurveExchangePool({
|
||||
tokens: [MAINNET_TOKENS.yUSD, MAINNET_TOKENS.ybCRV],
|
||||
pool: SNOWSWAP_POOLS.yUSD,
|
||||
gasSchedule: 1000e3,
|
||||
gasSchedule: 990e3,
|
||||
}),
|
||||
[SNOWSWAP_POOLS.yUSD]: createCurveExchangeUnderlyingPool({
|
||||
tokens: [MAINNET_TOKENS.yCRV, MAINNET_TOKENS.bCRV],
|
||||
pool: SNOWSWAP_POOLS.yUSD,
|
||||
gasSchedule: 1000e3,
|
||||
gasSchedule: 990e3,
|
||||
}),
|
||||
[SNOWSWAP_POOLS.yVault]: createCurveExchangePool({
|
||||
tokens: [MAINNET_TOKENS.yDAI, MAINNET_TOKENS.yUSDC, MAINNET_TOKENS.yUSDT, MAINNET_TOKENS.yTUSD],
|
||||
pool: SNOWSWAP_POOLS.yVault,
|
||||
gasSchedule: 1500e3,
|
||||
gasSchedule: 1490e3,
|
||||
}),
|
||||
[SNOWSWAP_POOLS.eth]: createCurveExchangePool({
|
||||
tokens: [MAINNET_TOKENS.WETH, MAINNET_TOKENS.vETH, MAINNET_TOKENS.ankrETH, MAINNET_TOKENS.crETH],
|
||||
pool: SNOWSWAP_POOLS.eth,
|
||||
gasSchedule: 1000e3,
|
||||
gasSchedule: 990e3,
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -657,7 +665,7 @@ export const BELT_BSC_INFOS: { [name: string]: CurveInfo } = {
|
||||
[BELT_POOLS.vPool]: createCurveExchangeUnderlyingPool({
|
||||
tokens: [BSC_TOKENS.DAI, BSC_TOKENS.USDC, BSC_TOKENS.USDT, BSC_TOKENS.BUSD],
|
||||
pool: BELT_POOLS.vPool,
|
||||
gasSchedule: 4500e3,
|
||||
gasSchedule: 4490e3,
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -665,7 +673,7 @@ export const ELLIPSIS_BSC_INFOS: { [name: string]: CurveInfo } = {
|
||||
[ELLIPSIS_POOLS.threePool]: createCurveExchangePool({
|
||||
tokens: [BSC_TOKENS.BUSD, BSC_TOKENS.USDC, BSC_TOKENS.USDT],
|
||||
pool: ELLIPSIS_POOLS.threePool,
|
||||
gasSchedule: 150e3,
|
||||
gasSchedule: 140e3,
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -678,18 +686,17 @@ export const SADDLE_MAINNET_INFOS: { [name: string]: CurveInfo } = {
|
||||
poolAddress: SADDLE_POOLS.stables,
|
||||
tokens: [MAINNET_TOKENS.DAI, MAINNET_TOKENS.USDC, MAINNET_TOKENS.USDT],
|
||||
metaToken: undefined,
|
||||
gasSchedule: 220e3,
|
||||
gasSchedule: 150e3,
|
||||
},
|
||||
[SADDLE_POOLS.bitcoins]: {
|
||||
exchangeFunctionSelector: CurveFunctionSelectors.swap,
|
||||
sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
|
||||
buyQuoteFunctionSelector: CurveFunctionSelectors.None,
|
||||
poolAddress: SADDLE_POOLS.bitcoins,
|
||||
tokens: [MAINNET_TOKENS.tBTC, MAINNET_TOKENS.WBTC, MAINNET_TOKENS.RenBTC, MAINNET_TOKENS.sBTC],
|
||||
metaToken: undefined,
|
||||
gasSchedule: 150e3,
|
||||
},
|
||||
// TODO:Romain having "Cannot swap more than you own" error when running simbot
|
||||
// [SADDLE_POOLS.bitcoins]: {
|
||||
// exchangeFunctionSelector: CurveFunctionSelectors.swap,
|
||||
// sellQuoteFunctionSelector: CurveFunctionSelectors.calculateSwap,
|
||||
// buyQuoteFunctionSelector: CurveFunctionSelectors.None,
|
||||
// poolAddress: SADDLE_POOLS.stables,
|
||||
// tokens: [MAINNET_TOKENS.tBTC, MAINNET_TOKENS.WBTC, MAINNET_TOKENS.RenBTC, MAINNET_TOKENS.sBTC],
|
||||
// metaToken: undefined,
|
||||
// gasSchedule: 220e3,
|
||||
// },
|
||||
};
|
||||
|
||||
export const SMOOTHY_MAINNET_INFOS: { [name: string]: CurveInfo } = {
|
||||
@@ -709,7 +716,7 @@ export const SMOOTHY_MAINNET_INFOS: { [name: string]: CurveInfo } = {
|
||||
MAINNET_TOKENS.GUSD,
|
||||
],
|
||||
metaToken: undefined,
|
||||
gasSchedule: 200e3,
|
||||
gasSchedule: 190e3,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -721,7 +728,7 @@ export const SMOOTHY_BSC_INFOS: { [name: string]: CurveInfo } = {
|
||||
poolAddress: SMOOTHY_POOLS.syUSD,
|
||||
tokens: [BSC_TOKENS.BUSD, BSC_TOKENS.USDT, BSC_TOKENS.USDC, BSC_TOKENS.DAI, BSC_TOKENS.PAX, BSC_TOKENS.UST],
|
||||
metaToken: undefined,
|
||||
gasSchedule: 100e3,
|
||||
gasSchedule: 90e3,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -733,7 +740,7 @@ export const NERVE_BSC_INFOS: { [name: string]: CurveInfo } = {
|
||||
poolAddress: NERVE_POOLS.threePool,
|
||||
tokens: [BSC_TOKENS.BUSD, BSC_TOKENS.USDT, BSC_TOKENS.USDC],
|
||||
metaToken: undefined,
|
||||
gasSchedule: 150e3,
|
||||
gasSchedule: 140e3,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -744,6 +751,7 @@ export const NERVE_BSC_INFOS: { [name: string]: CurveInfo } = {
|
||||
* 0xbb Bridged price reserve (i.e Uniswap/Curve)
|
||||
*/
|
||||
export const KYBER_BRIDGED_LIQUIDITY_PREFIX = '0xbb';
|
||||
export const KYBER_BANNED_RESERVES = ['0xff4f6e65426974205175616e7400000000000000000000000000000000000000'];
|
||||
export const MAX_KYBER_RESERVES_QUERIED = 5;
|
||||
export const KYBER_CONFIG_BY_CHAIN_ID = valueByChainId<KyberSamplerOpts>(
|
||||
{
|
||||
@@ -992,7 +1000,7 @@ export const PANCAKESWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||
NULL_ADDRESS,
|
||||
);
|
||||
|
||||
export const PANCAKESWAP_V2_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||
export const PANCAKESWAPV2_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||
{
|
||||
[ChainId.BSC]: '0x10ed43c718714eb63d5aa57b78b54704e256024e',
|
||||
},
|
||||
@@ -1006,6 +1014,34 @@ export const BAKERYSWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||
NULL_ADDRESS,
|
||||
);
|
||||
|
||||
export const APESWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||
{
|
||||
[ChainId.BSC]: '0xc0788a3ad43d79aa53b09c2eacc313a787d1d607',
|
||||
},
|
||||
NULL_ADDRESS,
|
||||
);
|
||||
|
||||
export const CAFESWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||
{
|
||||
[ChainId.BSC]: '0x933daea3a5995fb94b14a7696a5f3ffd7b1e385a',
|
||||
},
|
||||
NULL_ADDRESS,
|
||||
);
|
||||
|
||||
export const CHEESESWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||
{
|
||||
[ChainId.BSC]: '0x3047799262d8d2ef41ed2a222205968bc9b0d895',
|
||||
},
|
||||
NULL_ADDRESS,
|
||||
);
|
||||
|
||||
export const JULSWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
|
||||
{
|
||||
[ChainId.BSC]: '0xbd67d157502a23309db761c41965600c2ec788b2',
|
||||
},
|
||||
NULL_ADDRESS,
|
||||
);
|
||||
|
||||
/**
|
||||
* Calculated gross gas cost of the underlying exchange.
|
||||
* The cost of switching from one source to another, assuming
|
||||
@@ -1025,7 +1061,7 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
|
||||
},
|
||||
[ERC20BridgeSource.Uniswap]: () => 90e3,
|
||||
[ERC20BridgeSource.LiquidityProvider]: fillData => {
|
||||
return (fillData as LiquidityProviderFillData).gasCost;
|
||||
return (fillData as LiquidityProviderFillData).gasCost || 100e3;
|
||||
},
|
||||
[ERC20BridgeSource.Eth2Dai]: () => 400e3,
|
||||
[ERC20BridgeSource.Kyber]: () => 450e3,
|
||||
@@ -1136,6 +1172,15 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
|
||||
}
|
||||
return gas;
|
||||
},
|
||||
[ERC20BridgeSource.PancakeSwapV2]: (fillData?: FillData) => {
|
||||
// TODO: Different base cost if to/from ETH.
|
||||
let gas = 90e3;
|
||||
const path = (fillData as UniswapV2FillData).tokenAddressPath;
|
||||
if (path.length > 2) {
|
||||
gas += (path.length - 2) * 60e3; // +60k for each hop.
|
||||
}
|
||||
return gas;
|
||||
},
|
||||
[ERC20BridgeSource.BakerySwap]: (fillData?: FillData) => {
|
||||
// TODO: Different base cost if to/from ETH.
|
||||
let gas = 90e3;
|
||||
@@ -1145,7 +1190,34 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
|
||||
}
|
||||
return gas;
|
||||
},
|
||||
[ERC20BridgeSource.PancakeSwapV2]: (fillData?: FillData) => {
|
||||
[ERC20BridgeSource.ApeSwap]: (fillData?: FillData) => {
|
||||
// TODO: Different base cost if to/from ETH.
|
||||
let gas = 90e3;
|
||||
const path = (fillData as UniswapV2FillData).tokenAddressPath;
|
||||
if (path.length > 2) {
|
||||
gas += (path.length - 2) * 60e3; // +60k for each hop.
|
||||
}
|
||||
return gas;
|
||||
},
|
||||
[ERC20BridgeSource.CafeSwap]: (fillData?: FillData) => {
|
||||
// TODO: Different base cost if to/from ETH.
|
||||
let gas = 90e3;
|
||||
const path = (fillData as UniswapV2FillData).tokenAddressPath;
|
||||
if (path.length > 2) {
|
||||
gas += (path.length - 2) * 60e3; // +60k for each hop.
|
||||
}
|
||||
return gas;
|
||||
},
|
||||
[ERC20BridgeSource.CheeseSwap]: (fillData?: FillData) => {
|
||||
// TODO: Different base cost if to/from ETH.
|
||||
let gas = 90e3;
|
||||
const path = (fillData as UniswapV2FillData).tokenAddressPath;
|
||||
if (path.length > 2) {
|
||||
gas += (path.length - 2) * 60e3; // +60k for each hop.
|
||||
}
|
||||
return gas;
|
||||
},
|
||||
[ERC20BridgeSource.JulSwap]: (fillData?: FillData) => {
|
||||
// TODO: Different base cost if to/from ETH.
|
||||
let gas = 90e3;
|
||||
const path = (fillData as UniswapV2FillData).tokenAddressPath;
|
||||
|
@@ -152,7 +152,7 @@ function dexSamplesToFills(
|
||||
const { source, fillData } = sample;
|
||||
const input = sample.input.minus(prevSample ? prevSample.input : 0);
|
||||
const output = sample.output.minus(prevSample ? prevSample.output : 0);
|
||||
const fee = fees[source] === undefined ? 0 : fees[source]!(sample.fillData);
|
||||
const fee = fees[source] === undefined ? 0 : fees[source]!(sample.fillData) || 0;
|
||||
let penalty = ZERO_AMOUNT;
|
||||
if (i === 0) {
|
||||
// Only the first fill in a DEX path incurs a penalty.
|
||||
|
@@ -120,6 +120,8 @@ export function getErc20BridgeSourceToBridgeSource(source: ERC20BridgeSource): s
|
||||
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'Linkswap');
|
||||
case ERC20BridgeSource.PancakeSwap:
|
||||
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'PancakeSwap');
|
||||
case ERC20BridgeSource.PancakeSwapV2:
|
||||
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'PancakeSwapV2');
|
||||
case ERC20BridgeSource.BakerySwap:
|
||||
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'BakerySwap');
|
||||
case ERC20BridgeSource.Nerve:
|
||||
@@ -134,8 +136,14 @@ export function getErc20BridgeSourceToBridgeSource(source: ERC20BridgeSource): s
|
||||
return encodeBridgeSourceId(BridgeProtocol.Curve, 'Smoothy');
|
||||
case ERC20BridgeSource.Saddle:
|
||||
return encodeBridgeSourceId(BridgeProtocol.Nerve, 'Saddle');
|
||||
case ERC20BridgeSource.PancakeSwapV2:
|
||||
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'PancakeSwapV2');
|
||||
case ERC20BridgeSource.ApeSwap:
|
||||
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'ApeSwap');
|
||||
case ERC20BridgeSource.CafeSwap:
|
||||
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'CafeSwap');
|
||||
case ERC20BridgeSource.CheeseSwap:
|
||||
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'CheeseSwap');
|
||||
case ERC20BridgeSource.JulSwap:
|
||||
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'JulSwap');
|
||||
default:
|
||||
throw new Error(AggregationError.NoBridgeForSource);
|
||||
}
|
||||
@@ -187,9 +195,13 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder
|
||||
case ERC20BridgeSource.CryptoCom:
|
||||
case ERC20BridgeSource.Linkswap:
|
||||
case ERC20BridgeSource.PancakeSwap:
|
||||
case ERC20BridgeSource.PancakeSwapV2:
|
||||
case ERC20BridgeSource.BakerySwap:
|
||||
case ERC20BridgeSource.KyberDmm:
|
||||
case ERC20BridgeSource.PancakeSwapV2:
|
||||
case ERC20BridgeSource.ApeSwap:
|
||||
case ERC20BridgeSource.CafeSwap:
|
||||
case ERC20BridgeSource.CheeseSwap:
|
||||
case ERC20BridgeSource.JulSwap:
|
||||
const uniswapV2FillData = (order as OptimizedMarketBridgeOrder<UniswapV2FillData>).fillData;
|
||||
bridgeData = encoder.encode([uniswapV2FillData.router, uniswapV2FillData.tokenAddressPath]);
|
||||
break;
|
||||
@@ -323,6 +335,14 @@ export const BRIDGE_ENCODERS: {
|
||||
[ERC20BridgeSource.CryptoCom]: routerAddressPathEncoder,
|
||||
[ERC20BridgeSource.Linkswap]: routerAddressPathEncoder,
|
||||
[ERC20BridgeSource.KyberDmm]: routerAddressPathEncoder,
|
||||
// BSC
|
||||
[ERC20BridgeSource.PancakeSwap]: routerAddressPathEncoder,
|
||||
[ERC20BridgeSource.PancakeSwapV2]: routerAddressPathEncoder,
|
||||
[ERC20BridgeSource.BakerySwap]: routerAddressPathEncoder,
|
||||
[ERC20BridgeSource.ApeSwap]: routerAddressPathEncoder,
|
||||
[ERC20BridgeSource.CafeSwap]: routerAddressPathEncoder,
|
||||
[ERC20BridgeSource.CheeseSwap]: routerAddressPathEncoder,
|
||||
[ERC20BridgeSource.JulSwap]: routerAddressPathEncoder,
|
||||
// Generic pools
|
||||
[ERC20BridgeSource.Shell]: poolEncoder,
|
||||
[ERC20BridgeSource.Component]: poolEncoder,
|
||||
@@ -334,10 +354,6 @@ export const BRIDGE_ENCODERS: {
|
||||
[ERC20BridgeSource.Uniswap]: poolEncoder,
|
||||
// Custom integrations
|
||||
[ERC20BridgeSource.MakerPsm]: makerPsmEncoder,
|
||||
// BSC
|
||||
[ERC20BridgeSource.PancakeSwap]: routerAddressPathEncoder,
|
||||
[ERC20BridgeSource.BakerySwap]: routerAddressPathEncoder,
|
||||
[ERC20BridgeSource.PancakeSwapV2]: routerAddressPathEncoder,
|
||||
};
|
||||
|
||||
function getFillTokenAmounts(fill: CollapsedFill, side: MarketOperation): [BigNumber, BigNumber] {
|
||||
|
@@ -152,6 +152,17 @@ export class Path {
|
||||
return getRate(this.side, input, output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the best possible rate this path can offer, given the fills.
|
||||
*/
|
||||
public bestRate(): BigNumber {
|
||||
const best = this.fills.reduce((prevRate, curr) => {
|
||||
const currRate = getRate(this.side, curr.input, curr.output);
|
||||
return prevRate.isLessThan(currRate) ? currRate : prevRate;
|
||||
}, new BigNumber(0));
|
||||
return best;
|
||||
}
|
||||
|
||||
public adjustedSlippage(maxRate: BigNumber): number {
|
||||
if (maxRate.eq(0)) {
|
||||
return 0;
|
||||
|
@@ -4,7 +4,7 @@ import * as _ from 'lodash';
|
||||
import { MarketOperation } from '../../types';
|
||||
|
||||
import { DEFAULT_PATH_PENALTY_OPTS, Path, PathPenaltyOpts } from './path';
|
||||
import { Fill } from './types';
|
||||
import { ERC20BridgeSource, Fill } from './types';
|
||||
|
||||
// tslint:disable: prefer-for-of custom-no-magic-numbers completed-docs no-bitwise
|
||||
|
||||
@@ -22,12 +22,13 @@ export async function findOptimalPathAsync(
|
||||
opts: PathPenaltyOpts = DEFAULT_PATH_PENALTY_OPTS,
|
||||
): Promise<Path | undefined> {
|
||||
// Sort fill arrays by descending adjusted completed rate.
|
||||
const sortedPaths = fillsToSortedPaths(fills, side, targetInput, opts);
|
||||
// Remove any paths which cannot impact the optimal path
|
||||
const sortedPaths = reducePaths(fillsToSortedPaths(fills, side, targetInput, opts), side);
|
||||
if (sortedPaths.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
const rates = rateBySourcePathId(sortedPaths);
|
||||
let optimalPath = sortedPaths[0];
|
||||
const rates = rateBySourcePathId(side, fills, targetInput);
|
||||
for (const [i, path] of sortedPaths.slice(1).entries()) {
|
||||
optimalPath = mixPaths(side, optimalPath, path, targetInput, runLimit * RUN_LIMIT_DECAY_FACTOR ** i, rates);
|
||||
// Yield to event loop.
|
||||
@@ -44,10 +45,47 @@ export function fillsToSortedPaths(
|
||||
opts: PathPenaltyOpts,
|
||||
): Path[] {
|
||||
const paths = fills.map(singleSourceFills => Path.create(side, singleSourceFills, targetInput, opts));
|
||||
const sortedPaths = paths.sort((a, b) => b.adjustedCompleteRate().comparedTo(a.adjustedCompleteRate()));
|
||||
const sortedPaths = paths.sort((a, b) => {
|
||||
const aRate = a.adjustedCompleteRate();
|
||||
const bRate = b.adjustedCompleteRate();
|
||||
// There is a case where the adjusted completed rate isn't sufficient for the desired amount
|
||||
// resulting in a NaN div by 0 (output)
|
||||
if (bRate.isNaN()) {
|
||||
return -1;
|
||||
}
|
||||
if (aRate.isNaN()) {
|
||||
return 1;
|
||||
}
|
||||
return bRate.comparedTo(aRate);
|
||||
});
|
||||
return sortedPaths;
|
||||
}
|
||||
|
||||
// Remove paths which have no impact on the optimal path
|
||||
export function reducePaths(sortedPaths: Path[], side: MarketOperation): Path[] {
|
||||
// Any path which has a min rate that is less than the best adjusted completed rate has no chance of improving
|
||||
// the overall route.
|
||||
const bestNonNativeCompletePath = sortedPaths.filter(
|
||||
p => p.isComplete() && p.fills[0].source !== ERC20BridgeSource.Native,
|
||||
)[0];
|
||||
|
||||
// If there is no complete path then just go ahead with the sorted paths
|
||||
// I.e if the token only exists on sources which cannot sell to infinity
|
||||
// or buys where X is greater than all the tokens available in the pools
|
||||
if (!bestNonNativeCompletePath) {
|
||||
return sortedPaths;
|
||||
}
|
||||
const bestNonNativeCompletePathAdjustedRate = bestNonNativeCompletePath.adjustedCompleteRate();
|
||||
if (!bestNonNativeCompletePathAdjustedRate.isGreaterThan(0)) {
|
||||
return sortedPaths;
|
||||
}
|
||||
|
||||
const filteredPaths = sortedPaths.filter(p =>
|
||||
p.bestRate().isGreaterThanOrEqualTo(bestNonNativeCompletePathAdjustedRate),
|
||||
);
|
||||
return filteredPaths;
|
||||
}
|
||||
|
||||
function mixPaths(
|
||||
side: MarketOperation,
|
||||
pathA: Path,
|
||||
@@ -98,17 +136,6 @@ function mixPaths(
|
||||
return bestPath;
|
||||
}
|
||||
|
||||
function rateBySourcePathId(
|
||||
side: MarketOperation,
|
||||
fills: Fill[][],
|
||||
targetInput: BigNumber,
|
||||
): { [id: string]: BigNumber } {
|
||||
const flattenedFills = _.flatten(fills);
|
||||
const sourcePathIds = flattenedFills.filter(f => f.index === 0).map(f => f.sourcePathId);
|
||||
return Object.assign(
|
||||
{},
|
||||
...sourcePathIds.map(s => ({
|
||||
[s]: Path.create(side, flattenedFills.filter(f => f.sourcePathId === s), targetInput).adjustedRate(),
|
||||
})),
|
||||
);
|
||||
function rateBySourcePathId(paths: Path[]): { [id: string]: BigNumber } {
|
||||
return _.fromPairs(paths.map(p => [p.fills[0].sourcePathId, p.adjustedRate()]));
|
||||
}
|
||||
|
@@ -141,6 +141,13 @@ export class SamplerOperations {
|
||||
orders: SignedNativeOrder[],
|
||||
exchangeAddress: string,
|
||||
): BatchedOperation<BigNumber[]> {
|
||||
// Skip checking empty or invalid orders on-chain, returning a constant
|
||||
if (orders.length === 0) {
|
||||
return SamplerOperations.constant<BigNumber[]>([]);
|
||||
}
|
||||
if (orders.length === 1 && orders[0].order.maker === NULL_ADDRESS) {
|
||||
return SamplerOperations.constant<BigNumber[]>([ZERO_AMOUNT]);
|
||||
}
|
||||
return new SamplerContractOperation({
|
||||
source: ERC20BridgeSource.Native,
|
||||
contract: this._samplerContract,
|
||||
@@ -154,6 +161,13 @@ export class SamplerOperations {
|
||||
orders: SignedNativeOrder[],
|
||||
exchangeAddress: string,
|
||||
): BatchedOperation<BigNumber[]> {
|
||||
// Skip checking empty or invalid orders on-chain, returning a constant
|
||||
if (orders.length === 0) {
|
||||
return SamplerOperations.constant<BigNumber[]>([]);
|
||||
}
|
||||
if (orders.length === 1 && orders[0].order.maker === NULL_ADDRESS) {
|
||||
return SamplerOperations.constant<BigNumber[]>([ZERO_AMOUNT]);
|
||||
}
|
||||
return new SamplerContractOperation({
|
||||
source: ERC20BridgeSource.Native,
|
||||
contract: this._samplerContract,
|
||||
@@ -1086,9 +1100,13 @@ export class SamplerOperations {
|
||||
case ERC20BridgeSource.SushiSwap:
|
||||
case ERC20BridgeSource.CryptoCom:
|
||||
case ERC20BridgeSource.PancakeSwap:
|
||||
case ERC20BridgeSource.PancakeSwapV2:
|
||||
case ERC20BridgeSource.BakerySwap:
|
||||
case ERC20BridgeSource.KyberDmm:
|
||||
case ERC20BridgeSource.PancakeSwapV2:
|
||||
case ERC20BridgeSource.ApeSwap:
|
||||
case ERC20BridgeSource.CafeSwap:
|
||||
case ERC20BridgeSource.CheeseSwap:
|
||||
case ERC20BridgeSource.JulSwap:
|
||||
const uniLikeRouter = uniswapV2LikeRouterAddress(this.chainId, source);
|
||||
if (!isValidAddress(uniLikeRouter)) {
|
||||
return [];
|
||||
@@ -1296,9 +1314,13 @@ export class SamplerOperations {
|
||||
case ERC20BridgeSource.SushiSwap:
|
||||
case ERC20BridgeSource.CryptoCom:
|
||||
case ERC20BridgeSource.PancakeSwap:
|
||||
case ERC20BridgeSource.PancakeSwapV2:
|
||||
case ERC20BridgeSource.BakerySwap:
|
||||
case ERC20BridgeSource.KyberDmm:
|
||||
case ERC20BridgeSource.PancakeSwapV2:
|
||||
case ERC20BridgeSource.ApeSwap:
|
||||
case ERC20BridgeSource.CafeSwap:
|
||||
case ERC20BridgeSource.CheeseSwap:
|
||||
case ERC20BridgeSource.JulSwap:
|
||||
const uniLikeRouter = uniswapV2LikeRouterAddress(this.chainId, source);
|
||||
if (!isValidAddress(uniLikeRouter)) {
|
||||
return [];
|
||||
|
@@ -65,11 +65,15 @@ export enum ERC20BridgeSource {
|
||||
Saddle = 'Saddle',
|
||||
// BSC only
|
||||
PancakeSwap = 'PancakeSwap',
|
||||
PancakeSwapV2 = 'PancakeSwap_V2',
|
||||
BakerySwap = 'BakerySwap',
|
||||
Nerve = 'Nerve',
|
||||
Belt = 'Belt',
|
||||
Ellipsis = 'Ellipsis',
|
||||
PancakeSwapV2 = 'PancakeSwap_V2',
|
||||
ApeSwap = 'ApeSwap',
|
||||
CafeSwap = 'CafeSwap',
|
||||
CheeseSwap = 'CheeseSwap',
|
||||
JulSwap = 'JulSwap',
|
||||
}
|
||||
|
||||
// tslint:disable: enum-naming
|
||||
|
@@ -299,6 +299,7 @@ describe('MarketOperationUtils tests', () => {
|
||||
[ERC20BridgeSource.Native]: createDecreasingRates(NUM_SAMPLES),
|
||||
[ERC20BridgeSource.Eth2Dai]: createDecreasingRates(NUM_SAMPLES),
|
||||
[ERC20BridgeSource.Uniswap]: createDecreasingRates(NUM_SAMPLES),
|
||||
[ERC20BridgeSource.Kyber]: createDecreasingRates(NUM_SAMPLES),
|
||||
};
|
||||
|
||||
interface FillDataBySource {
|
||||
|
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1619596077,
|
||||
"version": "3.14.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.14.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.14.1 - _April 28, 2021_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.14.0 - _April 1, 2021_
|
||||
|
||||
* Update artifacts (#164)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contract-artifacts",
|
||||
"version": "3.14.0",
|
||||
"version": "3.14.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -30,7 +30,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/packages/contract-artifacts",
|
||||
"devDependencies": {
|
||||
"@0x/utils": "^6.2.0",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"chai": "^4.0.1",
|
||||
"lodash": "^4.17.11",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contract-wrappers-test",
|
||||
"version": "12.2.41",
|
||||
"version": "12.2.43",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -31,17 +31,17 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/packages/contract-wrappers-test",
|
||||
"devDependencies": {
|
||||
"@0x/contract-wrappers": "^13.15.0",
|
||||
"@0x/contracts-test-utils": "^5.3.24",
|
||||
"@0x/dev-utils": "^4.2.1",
|
||||
"@0x/migrations": "^8.0.2",
|
||||
"@0x/order-utils": "^10.4.19",
|
||||
"@0x/subproviders": "^6.4.1",
|
||||
"@0x/contract-wrappers": "^13.16.0",
|
||||
"@0x/contracts-test-utils": "^5.3.25",
|
||||
"@0x/dev-utils": "^4.2.6",
|
||||
"@0x/migrations": "^8.0.4",
|
||||
"@0x/order-utils": "^10.4.20",
|
||||
"@0x/subproviders": "^6.5.2",
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"@types/nock": "^10.0.3",
|
||||
"chai": "^4.0.1",
|
||||
"dirty-chai": "^2.0.1",
|
||||
|
@@ -1,4 +1,14 @@
|
||||
[
|
||||
{
|
||||
"version": "13.16.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Regenerate wrappers with new abi-gen",
|
||||
"pr": 212
|
||||
}
|
||||
],
|
||||
"timestamp": 1619596077
|
||||
},
|
||||
{
|
||||
"version": "13.15.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v13.16.0 - _April 28, 2021_
|
||||
|
||||
* Regenerate wrappers with new abi-gen (#212)
|
||||
|
||||
## v13.15.0 - _April 1, 2021_
|
||||
|
||||
* Regenerate wrappers (#164)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contract-wrappers",
|
||||
"version": "13.15.0",
|
||||
"version": "13.16.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -48,21 +48,21 @@
|
||||
"homepage": "https://github.com/0xProject/protocol/tree/main/packages/contract-wrappers",
|
||||
"devDependencies": {
|
||||
"@0x/ts-doc-gen": "^0.0.28",
|
||||
"@0x/tslint-config": "^4.1.3",
|
||||
"@0x/tslint-config": "^4.1.4",
|
||||
"gitpkg": "https://github.com/0xProject/gitpkg.git",
|
||||
"tslint": "5.11.0",
|
||||
"typedoc": "~0.16.11",
|
||||
"typescript": "4.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/assert": "^3.0.21",
|
||||
"@0x/base-contract": "^6.2.18",
|
||||
"@0x/assert": "^3.0.26",
|
||||
"@0x/base-contract": "^6.3.2",
|
||||
"@0x/contract-addresses": "^6.0.0",
|
||||
"@0x/json-schemas": "^5.4.1",
|
||||
"@0x/types": "^3.3.1",
|
||||
"@0x/utils": "^6.2.0",
|
||||
"@0x/web3-wrapper": "^7.4.1",
|
||||
"ethereum-types": "^3.4.0",
|
||||
"@0x/json-schemas": "^6.1.2",
|
||||
"@0x/types": "^3.3.3",
|
||||
"@0x/utils": "^6.4.2",
|
||||
"@0x/web3-wrapper": "^7.5.2",
|
||||
"ethereum-types": "^3.5.0",
|
||||
"ethers": "~4.0.4"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@@ -3,6 +3,7 @@
|
||||
// tslint:disable:no-unused-variable
|
||||
import {
|
||||
AwaitTransactionSuccessOpts,
|
||||
EncoderOverrides,
|
||||
ContractFunctionObj,
|
||||
ContractTxFunctionObj,
|
||||
SendTransactionOpts,
|
||||
@@ -24,9 +25,10 @@ import {
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
TxAccessListWithGas,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { AbiEncoder, BigNumber, classUtils, EncodingRules, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { EventCallback, IndexedFilterValues, SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { assert } from '@0x/assert';
|
||||
@@ -52,11 +54,7 @@ export class BrokerContract extends BaseContract {
|
||||
exchange: string,
|
||||
weth: string,
|
||||
): Promise<BrokerContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -89,11 +87,7 @@ export class BrokerContract extends BaseContract {
|
||||
exchange: string,
|
||||
weth: string,
|
||||
): Promise<BrokerContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -133,11 +127,7 @@ export class BrokerContract extends BaseContract {
|
||||
weth: string,
|
||||
): Promise<BrokerContract> {
|
||||
assert.isHexString('bytecode', bytecode);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[exchange, weth] = BaseContract._formatABIDataItemList(
|
||||
@@ -539,6 +529,9 @@ export class BrokerContract extends BaseContract {
|
||||
}
|
||||
|
||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||
if (this._encoderOverrides.decodeOutput) {
|
||||
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||
}
|
||||
const functionSignature = this.getFunctionSignature(methodName);
|
||||
const self = (this as any) as BrokerContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
@@ -645,6 +638,16 @@ export class BrokerContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -777,6 +780,16 @@ export class BrokerContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -867,6 +880,16 @@ export class BrokerContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -895,6 +918,7 @@ export class BrokerContract extends BaseContract {
|
||||
txDefaults?: Partial<TxData>,
|
||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||
deployedBytecode: string | undefined = BrokerContract.deployedBytecode,
|
||||
encoderOverrides?: Partial<EncoderOverrides>,
|
||||
) {
|
||||
super(
|
||||
'Broker',
|
||||
@@ -904,6 +928,7 @@ export class BrokerContract extends BaseContract {
|
||||
txDefaults,
|
||||
logDecodeDependencies,
|
||||
deployedBytecode,
|
||||
encoderOverrides,
|
||||
);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||
BrokerContract.ABI().forEach((item, index) => {
|
||||
|
@@ -3,6 +3,7 @@
|
||||
// tslint:disable:no-unused-variable
|
||||
import {
|
||||
AwaitTransactionSuccessOpts,
|
||||
EncoderOverrides,
|
||||
ContractFunctionObj,
|
||||
ContractTxFunctionObj,
|
||||
SendTransactionOpts,
|
||||
@@ -24,9 +25,10 @@ import {
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
TxAccessListWithGas,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { AbiEncoder, BigNumber, classUtils, EncodingRules, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { EventCallback, IndexedFilterValues, SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { assert } from '@0x/assert';
|
||||
@@ -53,11 +55,7 @@ export class CoordinatorContract extends BaseContract {
|
||||
exchange: string,
|
||||
chainId: BigNumber,
|
||||
): Promise<CoordinatorContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -90,11 +88,7 @@ export class CoordinatorContract extends BaseContract {
|
||||
exchange: string,
|
||||
chainId: BigNumber,
|
||||
): Promise<CoordinatorContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -134,11 +128,7 @@ export class CoordinatorContract extends BaseContract {
|
||||
chainId: BigNumber,
|
||||
): Promise<CoordinatorContract> {
|
||||
assert.isHexString('bytecode', bytecode);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[exchange, chainId] = BaseContract._formatABIDataItemList(
|
||||
@@ -563,6 +553,9 @@ export class CoordinatorContract extends BaseContract {
|
||||
}
|
||||
|
||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||
if (this._encoderOverrides.decodeOutput) {
|
||||
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||
}
|
||||
const functionSignature = this.getFunctionSignature(methodName);
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
@@ -875,6 +868,16 @@ export class CoordinatorContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -967,6 +970,7 @@ export class CoordinatorContract extends BaseContract {
|
||||
txDefaults?: Partial<TxData>,
|
||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||
deployedBytecode: string | undefined = CoordinatorContract.deployedBytecode,
|
||||
encoderOverrides?: Partial<EncoderOverrides>,
|
||||
) {
|
||||
super(
|
||||
'Coordinator',
|
||||
@@ -976,6 +980,7 @@ export class CoordinatorContract extends BaseContract {
|
||||
txDefaults,
|
||||
logDecodeDependencies,
|
||||
deployedBytecode,
|
||||
encoderOverrides,
|
||||
);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||
CoordinatorContract.ABI().forEach((item, index) => {
|
||||
|
@@ -3,6 +3,7 @@
|
||||
// tslint:disable:no-unused-variable
|
||||
import {
|
||||
AwaitTransactionSuccessOpts,
|
||||
EncoderOverrides,
|
||||
ContractFunctionObj,
|
||||
ContractTxFunctionObj,
|
||||
SendTransactionOpts,
|
||||
@@ -24,9 +25,10 @@ import {
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
TxAccessListWithGas,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { AbiEncoder, BigNumber, classUtils, EncodingRules, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { EventCallback, IndexedFilterValues, SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { assert } from '@0x/assert';
|
||||
@@ -54,11 +56,7 @@ export class DevUtilsContract extends BaseContract {
|
||||
chaiBridge_: string,
|
||||
dydxBridge_: string,
|
||||
): Promise<DevUtilsContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -93,11 +91,7 @@ export class DevUtilsContract extends BaseContract {
|
||||
chaiBridge_: string,
|
||||
dydxBridge_: string,
|
||||
): Promise<DevUtilsContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -139,11 +133,7 @@ export class DevUtilsContract extends BaseContract {
|
||||
dydxBridge_: string,
|
||||
): Promise<DevUtilsContract> {
|
||||
assert.isHexString('bytecode', bytecode);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[exchange_, chaiBridge_, dydxBridge_] = BaseContract._formatABIDataItemList(
|
||||
@@ -1580,6 +1570,9 @@ export class DevUtilsContract extends BaseContract {
|
||||
}
|
||||
|
||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||
if (this._encoderOverrides.decodeOutput) {
|
||||
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||
}
|
||||
const functionSignature = this.getFunctionSignature(methodName);
|
||||
const self = (this as any) as DevUtilsContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
@@ -2312,6 +2305,16 @@ export class DevUtilsContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -2367,6 +2370,16 @@ export class DevUtilsContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -2425,6 +2438,16 @@ export class DevUtilsContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -2483,6 +2506,16 @@ export class DevUtilsContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber[]> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -2538,6 +2571,16 @@ export class DevUtilsContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber[]> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -2596,6 +2639,16 @@ export class DevUtilsContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -2750,6 +2803,16 @@ export class DevUtilsContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -2842,6 +2905,16 @@ export class DevUtilsContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -2934,6 +3007,16 @@ export class DevUtilsContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<number> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -3015,6 +3098,16 @@ export class DevUtilsContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<number> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -3097,6 +3190,16 @@ export class DevUtilsContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<number[]> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -3190,6 +3293,16 @@ export class DevUtilsContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -3262,6 +3375,7 @@ export class DevUtilsContract extends BaseContract {
|
||||
txDefaults?: Partial<TxData>,
|
||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||
deployedBytecode: string | undefined = DevUtilsContract.deployedBytecode,
|
||||
encoderOverrides?: Partial<EncoderOverrides>,
|
||||
) {
|
||||
super(
|
||||
'DevUtils',
|
||||
@@ -3271,6 +3385,7 @@ export class DevUtilsContract extends BaseContract {
|
||||
txDefaults,
|
||||
logDecodeDependencies,
|
||||
deployedBytecode,
|
||||
encoderOverrides,
|
||||
);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||
DevUtilsContract.ABI().forEach((item, index) => {
|
||||
|
@@ -3,6 +3,7 @@
|
||||
// tslint:disable:no-unused-variable
|
||||
import {
|
||||
AwaitTransactionSuccessOpts,
|
||||
EncoderOverrides,
|
||||
ContractFunctionObj,
|
||||
ContractTxFunctionObj,
|
||||
SendTransactionOpts,
|
||||
@@ -26,9 +27,10 @@ import {
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
TxAccessListWithGas,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { AbiEncoder, BigNumber, classUtils, EncodingRules, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { EventCallback, IndexedFilterValues, SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { assert } from '@0x/assert';
|
||||
@@ -72,11 +74,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
txDefaults: Partial<TxData>,
|
||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||
): Promise<ERC20TokenContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -99,11 +97,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
txDefaults: Partial<TxData>,
|
||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||
): Promise<ERC20TokenContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -133,11 +127,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||
): Promise<ERC20TokenContract> {
|
||||
assert.isHexString('bytecode', bytecode);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||
@@ -411,6 +401,9 @@ export class ERC20TokenContract extends BaseContract {
|
||||
}
|
||||
|
||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||
if (this._encoderOverrides.decodeOutput) {
|
||||
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||
}
|
||||
const functionSignature = this.getFunctionSignature(methodName);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
@@ -486,6 +479,16 @@ export class ERC20TokenContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<boolean> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -590,6 +593,16 @@ export class ERC20TokenContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<boolean> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -646,6 +659,16 @@ export class ERC20TokenContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<boolean> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -740,6 +763,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
txDefaults?: Partial<TxData>,
|
||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||
deployedBytecode: string | undefined = ERC20TokenContract.deployedBytecode,
|
||||
encoderOverrides?: Partial<EncoderOverrides>,
|
||||
) {
|
||||
super(
|
||||
'ERC20Token',
|
||||
@@ -749,6 +773,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
txDefaults,
|
||||
logDecodeDependencies,
|
||||
deployedBytecode,
|
||||
encoderOverrides,
|
||||
);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||
this._subscriptionManager = new SubscriptionManager<ERC20TokenEventArgs, ERC20TokenEvents>(
|
||||
|
@@ -3,6 +3,7 @@
|
||||
// tslint:disable:no-unused-variable
|
||||
import {
|
||||
AwaitTransactionSuccessOpts,
|
||||
EncoderOverrides,
|
||||
ContractFunctionObj,
|
||||
ContractTxFunctionObj,
|
||||
SendTransactionOpts,
|
||||
@@ -26,9 +27,10 @@ import {
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
TxAccessListWithGas,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { AbiEncoder, BigNumber, classUtils, EncodingRules, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { EventCallback, IndexedFilterValues, SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { assert } from '@0x/assert';
|
||||
@@ -82,11 +84,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
txDefaults: Partial<TxData>,
|
||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||
): Promise<ERC721TokenContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -109,11 +107,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
txDefaults: Partial<TxData>,
|
||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||
): Promise<ERC721TokenContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -143,11 +137,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||
): Promise<ERC721TokenContract> {
|
||||
assert.isHexString('bytecode', bytecode);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||
@@ -501,6 +491,9 @@ export class ERC721TokenContract extends BaseContract {
|
||||
}
|
||||
|
||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||
if (this._encoderOverrides.decodeOutput) {
|
||||
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||
}
|
||||
const functionSignature = this.getFunctionSignature(methodName);
|
||||
const self = (this as any) as ERC721TokenContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
@@ -555,6 +548,16 @@ export class ERC721TokenContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -713,6 +716,16 @@ export class ERC721TokenContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -785,6 +798,16 @@ export class ERC721TokenContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -844,6 +867,16 @@ export class ERC721TokenContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -902,6 +935,16 @@ export class ERC721TokenContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -1000,6 +1043,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
txDefaults?: Partial<TxData>,
|
||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||
deployedBytecode: string | undefined = ERC721TokenContract.deployedBytecode,
|
||||
encoderOverrides?: Partial<EncoderOverrides>,
|
||||
) {
|
||||
super(
|
||||
'ERC721Token',
|
||||
@@ -1009,6 +1053,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
txDefaults,
|
||||
logDecodeDependencies,
|
||||
deployedBytecode,
|
||||
encoderOverrides,
|
||||
);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||
this._subscriptionManager = new SubscriptionManager<ERC721TokenEventArgs, ERC721TokenEvents>(
|
||||
|
@@ -3,6 +3,7 @@
|
||||
// tslint:disable:no-unused-variable
|
||||
import {
|
||||
AwaitTransactionSuccessOpts,
|
||||
EncoderOverrides,
|
||||
ContractFunctionObj,
|
||||
ContractTxFunctionObj,
|
||||
SendTransactionOpts,
|
||||
@@ -26,9 +27,10 @@ import {
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
TxAccessListWithGas,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { AbiEncoder, BigNumber, classUtils, EncodingRules, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { EventCallback, IndexedFilterValues, SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { assert } from '@0x/assert';
|
||||
@@ -139,11 +141,7 @@ export class ExchangeContract extends BaseContract {
|
||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||
chainId: BigNumber,
|
||||
): Promise<ExchangeContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -167,11 +165,7 @@ export class ExchangeContract extends BaseContract {
|
||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||
chainId: BigNumber,
|
||||
): Promise<ExchangeContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -202,11 +196,7 @@ export class ExchangeContract extends BaseContract {
|
||||
chainId: BigNumber,
|
||||
): Promise<ExchangeContract> {
|
||||
assert.isHexString('bytecode', bytecode);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[chainId] = BaseContract._formatABIDataItemList(
|
||||
@@ -3211,6 +3201,9 @@ export class ExchangeContract extends BaseContract {
|
||||
}
|
||||
|
||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||
if (this._encoderOverrides.decodeOutput) {
|
||||
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||
}
|
||||
const functionSignature = this.getFunctionSignature(methodName);
|
||||
const self = (this as any) as ExchangeContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
@@ -3341,6 +3334,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -3405,6 +3408,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string[]> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -3490,6 +3503,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -3594,6 +3617,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -3698,6 +3731,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -3832,6 +3875,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -3990,6 +4043,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -4099,6 +4162,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -4152,6 +4225,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -4243,6 +4326,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -4306,6 +4399,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -4388,6 +4491,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -4485,6 +4598,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -4793,6 +4916,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -4892,6 +5025,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -4990,6 +5133,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -5089,6 +5242,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -5217,6 +5380,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -5372,6 +5545,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -5508,6 +5691,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -5622,6 +5815,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -5674,6 +5877,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -5725,6 +5938,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -5779,6 +6002,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -5846,6 +6079,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -5918,6 +6161,16 @@ export class ExchangeContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -6012,6 +6265,7 @@ export class ExchangeContract extends BaseContract {
|
||||
txDefaults?: Partial<TxData>,
|
||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||
deployedBytecode: string | undefined = ExchangeContract.deployedBytecode,
|
||||
encoderOverrides?: Partial<EncoderOverrides>,
|
||||
) {
|
||||
super(
|
||||
'Exchange',
|
||||
@@ -6021,6 +6275,7 @@ export class ExchangeContract extends BaseContract {
|
||||
txDefaults,
|
||||
logDecodeDependencies,
|
||||
deployedBytecode,
|
||||
encoderOverrides,
|
||||
);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||
this._subscriptionManager = new SubscriptionManager<ExchangeEventArgs, ExchangeEvents>(
|
||||
|
@@ -3,6 +3,7 @@
|
||||
// tslint:disable:no-unused-variable
|
||||
import {
|
||||
AwaitTransactionSuccessOpts,
|
||||
EncoderOverrides,
|
||||
ContractFunctionObj,
|
||||
ContractTxFunctionObj,
|
||||
SendTransactionOpts,
|
||||
@@ -26,9 +27,10 @@ import {
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
TxAccessListWithGas,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { AbiEncoder, BigNumber, classUtils, EncodingRules, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { EventCallback, IndexedFilterValues, SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { assert } from '@0x/assert';
|
||||
@@ -67,11 +69,7 @@ export class ForwarderContract extends BaseContract {
|
||||
_exchangeV2: string,
|
||||
_weth: string,
|
||||
): Promise<ForwarderContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -106,11 +104,7 @@ export class ForwarderContract extends BaseContract {
|
||||
_exchangeV2: string,
|
||||
_weth: string,
|
||||
): Promise<ForwarderContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -152,11 +146,7 @@ export class ForwarderContract extends BaseContract {
|
||||
_weth: string,
|
||||
): Promise<ForwarderContract> {
|
||||
assert.isHexString('bytecode', bytecode);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[_exchange, _exchangeV2, _weth] = BaseContract._formatABIDataItemList(
|
||||
@@ -763,6 +753,9 @@ export class ForwarderContract extends BaseContract {
|
||||
}
|
||||
|
||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||
if (this._encoderOverrides.decodeOutput) {
|
||||
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||
}
|
||||
const functionSignature = this.getFunctionSignature(methodName);
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
@@ -877,6 +870,16 @@ export class ForwarderContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -964,6 +967,16 @@ export class ForwarderContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -1058,6 +1071,16 @@ export class ForwarderContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -1149,6 +1172,16 @@ export class ForwarderContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
@@ -1223,6 +1256,16 @@ export class ForwarderContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -1295,6 +1338,16 @@ export class ForwarderContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -1372,6 +1425,16 @@ export class ForwarderContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -1426,6 +1489,16 @@ export class ForwarderContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -1520,6 +1593,7 @@ export class ForwarderContract extends BaseContract {
|
||||
txDefaults?: Partial<TxData>,
|
||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||
deployedBytecode: string | undefined = ForwarderContract.deployedBytecode,
|
||||
encoderOverrides?: Partial<EncoderOverrides>,
|
||||
) {
|
||||
super(
|
||||
'Forwarder',
|
||||
@@ -1529,6 +1603,7 @@ export class ForwarderContract extends BaseContract {
|
||||
txDefaults,
|
||||
logDecodeDependencies,
|
||||
deployedBytecode,
|
||||
encoderOverrides,
|
||||
);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||
this._subscriptionManager = new SubscriptionManager<ForwarderEventArgs, ForwarderEvents>(
|
||||
|
@@ -3,6 +3,7 @@
|
||||
// tslint:disable:no-unused-variable
|
||||
import {
|
||||
AwaitTransactionSuccessOpts,
|
||||
EncoderOverrides,
|
||||
ContractFunctionObj,
|
||||
ContractTxFunctionObj,
|
||||
SendTransactionOpts,
|
||||
@@ -24,9 +25,10 @@ import {
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
TxAccessListWithGas,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { AbiEncoder, BigNumber, classUtils, EncodingRules, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { EventCallback, IndexedFilterValues, SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { assert } from '@0x/assert';
|
||||
@@ -51,11 +53,7 @@ export class GodsUnchainedValidatorContract extends BaseContract {
|
||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||
_godsUnchained: string,
|
||||
): Promise<GodsUnchainedValidatorContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -86,11 +84,7 @@ export class GodsUnchainedValidatorContract extends BaseContract {
|
||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||
_godsUnchained: string,
|
||||
): Promise<GodsUnchainedValidatorContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -128,11 +122,7 @@ export class GodsUnchainedValidatorContract extends BaseContract {
|
||||
_godsUnchained: string,
|
||||
): Promise<GodsUnchainedValidatorContract> {
|
||||
assert.isHexString('bytecode', bytecode);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[_godsUnchained] = BaseContract._formatABIDataItemList(
|
||||
@@ -265,6 +255,9 @@ export class GodsUnchainedValidatorContract extends BaseContract {
|
||||
}
|
||||
|
||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||
if (this._encoderOverrides.decodeOutput) {
|
||||
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||
}
|
||||
const functionSignature = this.getFunctionSignature(methodName);
|
||||
const self = (this as any) as GodsUnchainedValidatorContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
@@ -315,6 +308,7 @@ export class GodsUnchainedValidatorContract extends BaseContract {
|
||||
txDefaults?: Partial<TxData>,
|
||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||
deployedBytecode: string | undefined = GodsUnchainedValidatorContract.deployedBytecode,
|
||||
encoderOverrides?: Partial<EncoderOverrides>,
|
||||
) {
|
||||
super(
|
||||
'GodsUnchainedValidator',
|
||||
@@ -324,6 +318,7 @@ export class GodsUnchainedValidatorContract extends BaseContract {
|
||||
txDefaults,
|
||||
logDecodeDependencies,
|
||||
deployedBytecode,
|
||||
encoderOverrides,
|
||||
);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||
GodsUnchainedValidatorContract.ABI().forEach((item, index) => {
|
||||
|
@@ -3,6 +3,7 @@
|
||||
// tslint:disable:no-unused-variable
|
||||
import {
|
||||
AwaitTransactionSuccessOpts,
|
||||
EncoderOverrides,
|
||||
ContractFunctionObj,
|
||||
ContractTxFunctionObj,
|
||||
SendTransactionOpts,
|
||||
@@ -24,9 +25,10 @@ import {
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
TxAccessListWithGas,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { AbiEncoder, BigNumber, classUtils, EncodingRules, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { EventCallback, IndexedFilterValues, SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { assert } from '@0x/assert';
|
||||
@@ -50,11 +52,7 @@ export class IAssetDataContract extends BaseContract {
|
||||
txDefaults: Partial<TxData>,
|
||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||
): Promise<IAssetDataContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -77,11 +75,7 @@ export class IAssetDataContract extends BaseContract {
|
||||
txDefaults: Partial<TxData>,
|
||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||
): Promise<IAssetDataContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -111,11 +105,7 @@ export class IAssetDataContract extends BaseContract {
|
||||
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||
): Promise<IAssetDataContract> {
|
||||
assert.isHexString('bytecode', bytecode);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||
@@ -334,6 +324,9 @@ export class IAssetDataContract extends BaseContract {
|
||||
}
|
||||
|
||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||
if (this._encoderOverrides.decodeOutput) {
|
||||
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||
}
|
||||
const functionSignature = this.getFunctionSignature(methodName);
|
||||
const self = (this as any) as IAssetDataContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
@@ -398,6 +391,16 @@ export class IAssetDataContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -458,6 +461,16 @@ export class IAssetDataContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -513,6 +526,16 @@ export class IAssetDataContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -566,6 +589,16 @@ export class IAssetDataContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -622,6 +655,16 @@ export class IAssetDataContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -683,6 +726,16 @@ export class IAssetDataContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -709,6 +762,7 @@ export class IAssetDataContract extends BaseContract {
|
||||
txDefaults?: Partial<TxData>,
|
||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||
deployedBytecode: string | undefined = IAssetDataContract.deployedBytecode,
|
||||
encoderOverrides?: Partial<EncoderOverrides>,
|
||||
) {
|
||||
super(
|
||||
'IAssetData',
|
||||
@@ -718,6 +772,7 @@ export class IAssetDataContract extends BaseContract {
|
||||
txDefaults,
|
||||
logDecodeDependencies,
|
||||
deployedBytecode,
|
||||
encoderOverrides,
|
||||
);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||
IAssetDataContract.ABI().forEach((item, index) => {
|
||||
|
@@ -3,6 +3,7 @@
|
||||
// tslint:disable:no-unused-variable
|
||||
import {
|
||||
AwaitTransactionSuccessOpts,
|
||||
EncoderOverrides,
|
||||
ContractFunctionObj,
|
||||
ContractTxFunctionObj,
|
||||
SendTransactionOpts,
|
||||
@@ -24,9 +25,10 @@ import {
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
TxAccessListWithGas,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { AbiEncoder, BigNumber, classUtils, EncodingRules, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { EventCallback, IndexedFilterValues, SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { assert } from '@0x/assert';
|
||||
@@ -50,11 +52,7 @@ export class ILiquidityProviderContract extends BaseContract {
|
||||
txDefaults: Partial<TxData>,
|
||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||
): Promise<ILiquidityProviderContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -83,11 +81,7 @@ export class ILiquidityProviderContract extends BaseContract {
|
||||
txDefaults: Partial<TxData>,
|
||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||
): Promise<ILiquidityProviderContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -123,11 +117,7 @@ export class ILiquidityProviderContract extends BaseContract {
|
||||
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||
): Promise<ILiquidityProviderContract> {
|
||||
assert.isHexString('bytecode', bytecode);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||
@@ -315,6 +305,9 @@ export class ILiquidityProviderContract extends BaseContract {
|
||||
}
|
||||
|
||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||
if (this._encoderOverrides.decodeOutput) {
|
||||
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||
}
|
||||
const functionSignature = this.getFunctionSignature(methodName);
|
||||
const self = (this as any) as ILiquidityProviderContract;
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
@@ -380,6 +373,16 @@ export class ILiquidityProviderContract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -478,6 +481,7 @@ export class ILiquidityProviderContract extends BaseContract {
|
||||
txDefaults?: Partial<TxData>,
|
||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||
deployedBytecode: string | undefined = ILiquidityProviderContract.deployedBytecode,
|
||||
encoderOverrides?: Partial<EncoderOverrides>,
|
||||
) {
|
||||
super(
|
||||
'ILiquidityProvider',
|
||||
@@ -487,6 +491,7 @@ export class ILiquidityProviderContract extends BaseContract {
|
||||
txDefaults,
|
||||
logDecodeDependencies,
|
||||
deployedBytecode,
|
||||
encoderOverrides,
|
||||
);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||
ILiquidityProviderContract.ABI().forEach((item, index) => {
|
||||
|
@@ -3,6 +3,7 @@
|
||||
// tslint:disable:no-unused-variable
|
||||
import {
|
||||
AwaitTransactionSuccessOpts,
|
||||
EncoderOverrides,
|
||||
ContractFunctionObj,
|
||||
ContractTxFunctionObj,
|
||||
SendTransactionOpts,
|
||||
@@ -26,9 +27,10 @@ import {
|
||||
TransactionReceiptWithDecodedLogs,
|
||||
TxData,
|
||||
TxDataPayable,
|
||||
TxAccessListWithGas,
|
||||
SupportedProvider,
|
||||
} from 'ethereum-types';
|
||||
import { BigNumber, classUtils, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { AbiEncoder, BigNumber, classUtils, EncodingRules, hexUtils, logUtils, providerUtils } from '@0x/utils';
|
||||
import { EventCallback, IndexedFilterValues, SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { assert } from '@0x/assert';
|
||||
@@ -80,11 +82,7 @@ export class ITransformERC20Contract extends BaseContract {
|
||||
txDefaults: Partial<TxData>,
|
||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||
): Promise<ITransformERC20Contract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -107,11 +105,7 @@ export class ITransformERC20Contract extends BaseContract {
|
||||
txDefaults: Partial<TxData>,
|
||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||
): Promise<ITransformERC20Contract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
if (artifact.compilerOutput === undefined) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
@@ -141,11 +135,7 @@ export class ITransformERC20Contract extends BaseContract {
|
||||
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||
): Promise<ITransformERC20Contract> {
|
||||
assert.isHexString('bytecode', bytecode);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
schemas.jsNumber,
|
||||
]);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||
@@ -479,6 +469,9 @@ export class ITransformERC20Contract extends BaseContract {
|
||||
}
|
||||
|
||||
public getABIDecodedReturnData<T>(methodName: string, callData: string): T {
|
||||
if (this._encoderOverrides.decodeOutput) {
|
||||
return this._encoderOverrides.decodeOutput(methodName, callData);
|
||||
}
|
||||
const functionSignature = this.getFunctionSignature(methodName);
|
||||
const self = (this as any) as ITransformERC20Contract;
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
@@ -539,6 +532,16 @@ export class ITransformERC20Contract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -590,6 +593,16 @@ export class ITransformERC20Contract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -639,6 +652,16 @@ export class ITransformERC20Contract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -689,6 +712,16 @@ export class ITransformERC20Contract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -738,6 +771,16 @@ export class ITransformERC20Contract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -790,6 +833,16 @@ export class ITransformERC20Contract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -843,6 +896,16 @@ export class ITransformERC20Contract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -913,6 +976,16 @@ export class ITransformERC20Contract extends BaseContract {
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async createAccessListAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<TxAccessListWithGas> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
...txData,
|
||||
});
|
||||
return self._web3Wrapper.createAccessListAsync(txDataWithDefaults, defaultBlock);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
@@ -1013,6 +1086,7 @@ export class ITransformERC20Contract extends BaseContract {
|
||||
txDefaults?: Partial<TxData>,
|
||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||
deployedBytecode: string | undefined = ITransformERC20Contract.deployedBytecode,
|
||||
encoderOverrides?: Partial<EncoderOverrides>,
|
||||
) {
|
||||
super(
|
||||
'ITransformERC20',
|
||||
@@ -1022,6 +1096,7 @@ export class ITransformERC20Contract extends BaseContract {
|
||||
txDefaults,
|
||||
logDecodeDependencies,
|
||||
deployedBytecode,
|
||||
encoderOverrides,
|
||||
);
|
||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||
this._subscriptionManager = new SubscriptionManager<ITransformERC20EventArgs, ITransformERC20Events>(
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user