Merge pull request #1995 from 0xProject/feature/ContractWrappers/decodeLogArgs
Decode log arguments in `awaitTransactionSuccessAsync`
This commit is contained in:
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "2.2.4",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563957393,
|
"timestamp": 1563957393,
|
||||||
"version": "2.2.3",
|
"version": "2.2.3",
|
||||||
|
@@ -37,6 +37,7 @@ describe('Authorizable', () => {
|
|||||||
artifacts.MixinAuthorizable,
|
artifacts.MixinAuthorizable,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
@@ -23,7 +23,7 @@ import { LogWithDecodedArgs } from 'ethereum-types';
|
|||||||
import * as ethUtil from 'ethereumjs-util';
|
import * as ethUtil from 'ethereumjs-util';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import { ERC1155ProxyContract, ERC1155ProxyWrapper } from '../src';
|
import { artifacts, ERC1155ProxyContract, ERC1155ProxyWrapper } from '../src';
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
@@ -89,6 +89,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
erc1155Artifacts.DummyERC1155Receiver,
|
erc1155Artifacts.DummyERC1155Receiver,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
receiverContract = erc1155Receiver.address;
|
receiverContract = erc1155Receiver.address;
|
||||||
await erc1155ProxyWrapper.setBalancesAndAllowancesAsync();
|
await erc1155ProxyWrapper.setBalancesAndAllowancesAsync();
|
||||||
|
@@ -101,6 +101,7 @@ describe('Asset Transfer Proxies', () => {
|
|||||||
artifacts.MultiAssetProxy,
|
artifacts.MultiAssetProxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Configure ERC20Proxy
|
// Configure ERC20Proxy
|
||||||
@@ -173,6 +174,7 @@ describe('Asset Transfer Proxies', () => {
|
|||||||
erc20Artifacts.DummyNoReturnERC20Token,
|
erc20Artifacts.DummyNoReturnERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
constants.DUMMY_TOKEN_DECIMALS,
|
constants.DUMMY_TOKEN_DECIMALS,
|
||||||
@@ -182,6 +184,7 @@ describe('Asset Transfer Proxies', () => {
|
|||||||
erc20Artifacts.DummyMultipleReturnERC20Token,
|
erc20Artifacts.DummyMultipleReturnERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
constants.DUMMY_TOKEN_DECIMALS,
|
constants.DUMMY_TOKEN_DECIMALS,
|
||||||
@@ -224,6 +227,7 @@ describe('Asset Transfer Proxies', () => {
|
|||||||
erc721Artifacts.DummyERC721Receiver,
|
erc721Artifacts.DummyERC721Receiver,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
await erc721Wrapper.setBalancesAndAllowancesAsync();
|
await erc721Wrapper.setBalancesAndAllowancesAsync();
|
||||||
|
@@ -41,12 +41,14 @@ describe('StaticCallProxy', () => {
|
|||||||
artifacts.StaticCallProxy,
|
artifacts.StaticCallProxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
staticCallProxy = new IAssetProxyContract(staticCallProxyWithoutTransferFrom.address, provider, txDefaults);
|
staticCallProxy = new IAssetProxyContract(staticCallProxyWithoutTransferFrom.address, provider, txDefaults);
|
||||||
staticCallTarget = await TestStaticCallTargetContract.deployFrom0xArtifactAsync(
|
staticCallTarget = await TestStaticCallTargetContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.TestStaticCallTarget,
|
artifacts.TestStaticCallTarget,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
@@ -54,6 +54,7 @@ export class ERC1155ProxyWrapper {
|
|||||||
erc1155Artifacts.ERC1155Mintable,
|
erc1155Artifacts.ERC1155Mintable,
|
||||||
this._provider,
|
this._provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
const erc1155Wrapper = new Erc1155Wrapper(erc1155Contract, this._provider, this._contractOwnerAddress);
|
const erc1155Wrapper = new Erc1155Wrapper(erc1155Contract, this._provider, this._contractOwnerAddress);
|
||||||
this._dummyTokenWrappers.push(erc1155Wrapper);
|
this._dummyTokenWrappers.push(erc1155Wrapper);
|
||||||
@@ -69,6 +70,7 @@ export class ERC1155ProxyWrapper {
|
|||||||
artifacts.ERC1155Proxy,
|
artifacts.ERC1155Proxy,
|
||||||
this._provider,
|
this._provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
|
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
|
||||||
return this._proxyContract;
|
return this._proxyContract;
|
||||||
|
@@ -37,6 +37,7 @@ export class ERC20Wrapper {
|
|||||||
erc20Artifacts.DummyERC20Token,
|
erc20Artifacts.DummyERC20Token,
|
||||||
this._provider,
|
this._provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
decimals,
|
decimals,
|
||||||
@@ -51,6 +52,7 @@ export class ERC20Wrapper {
|
|||||||
artifacts.ERC20Proxy,
|
artifacts.ERC20Proxy,
|
||||||
this._provider,
|
this._provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
|
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
|
||||||
return this._proxyContract;
|
return this._proxyContract;
|
||||||
|
@@ -29,6 +29,7 @@ export class ERC721Wrapper {
|
|||||||
erc721Artifacts.DummyERC721Token,
|
erc721Artifacts.DummyERC721Token,
|
||||||
this._provider,
|
this._provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
),
|
),
|
||||||
@@ -41,6 +42,7 @@ export class ERC721Wrapper {
|
|||||||
artifacts.ERC721Proxy,
|
artifacts.ERC721Proxy,
|
||||||
this._provider,
|
this._provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
|
this._proxyIdIfExists = await this._proxyContract.getProxyId.callAsync();
|
||||||
return this._proxyContract;
|
return this._proxyContract;
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "2.0.9",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563957393,
|
"timestamp": 1563957393,
|
||||||
"version": "2.0.8",
|
"version": "2.0.8",
|
||||||
|
@@ -74,6 +74,7 @@ describe('Coordinator tests', () => {
|
|||||||
exchangeArtifacts.Exchange,
|
exchangeArtifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -91,6 +92,7 @@ describe('Coordinator tests', () => {
|
|||||||
artifacts.Coordinator,
|
artifacts.Coordinator,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -25,6 +25,7 @@ describe('Libs tests', () => {
|
|||||||
artifacts.Coordinator,
|
artifacts.Coordinator,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchangeAddress,
|
exchangeAddress,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@@ -44,6 +44,7 @@ describe('Mixins tests', () => {
|
|||||||
artifacts.Coordinator,
|
artifacts.Coordinator,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchangeAddress,
|
exchangeAddress,
|
||||||
);
|
);
|
||||||
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||||
|
@@ -24,6 +24,7 @@ export class CoordinatorRegistryWrapper {
|
|||||||
artifacts.CoordinatorRegistry,
|
artifacts.CoordinatorRegistry,
|
||||||
this._provider,
|
this._provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
if (this._coordinatorRegistryContract === undefined) {
|
if (this._coordinatorRegistryContract === undefined) {
|
||||||
throw new Error(`Failed to deploy Coordinator Registry contract.`);
|
throw new Error(`Failed to deploy Coordinator Registry contract.`);
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "0.0.6",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563957393,
|
"timestamp": 1563957393,
|
||||||
"version": "0.0.5",
|
"version": "0.0.5",
|
||||||
|
@@ -92,6 +92,7 @@ describe('LibAssetData', () => {
|
|||||||
exchangeArtifacts.Exchange,
|
exchangeArtifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.NULL_BYTES,
|
constants.NULL_BYTES,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -99,26 +100,31 @@ describe('LibAssetData', () => {
|
|||||||
proxyArtifacts.ERC20Proxy,
|
proxyArtifacts.ERC20Proxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
erc721Proxy = await ERC721ProxyContract.deployFrom0xArtifactAsync(
|
erc721Proxy = await ERC721ProxyContract.deployFrom0xArtifactAsync(
|
||||||
proxyArtifacts.ERC721Proxy,
|
proxyArtifacts.ERC721Proxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
erc1155Proxy = await ERC1155ProxyContract.deployFrom0xArtifactAsync(
|
erc1155Proxy = await ERC1155ProxyContract.deployFrom0xArtifactAsync(
|
||||||
proxyArtifacts.ERC1155Proxy,
|
proxyArtifacts.ERC1155Proxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
multiAssetProxy = await MultiAssetProxyContract.deployFrom0xArtifactAsync(
|
multiAssetProxy = await MultiAssetProxyContract.deployFrom0xArtifactAsync(
|
||||||
proxyArtifacts.MultiAssetProxy,
|
proxyArtifacts.MultiAssetProxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
staticCallProxy = await StaticCallProxyContract.deployFrom0xArtifactAsync(
|
staticCallProxy = await StaticCallProxyContract.deployFrom0xArtifactAsync(
|
||||||
proxyArtifacts.StaticCallProxy,
|
proxyArtifacts.StaticCallProxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
await exchange.registerAssetProxy.awaitTransactionSuccessAsync(erc20Proxy.address);
|
await exchange.registerAssetProxy.awaitTransactionSuccessAsync(erc20Proxy.address);
|
||||||
@@ -131,6 +137,7 @@ describe('LibAssetData', () => {
|
|||||||
artifacts.LibAssetData,
|
artifacts.LibAssetData,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -138,6 +145,7 @@ describe('LibAssetData', () => {
|
|||||||
proxyArtifacts.TestStaticCallTarget,
|
proxyArtifacts.TestStaticCallTarget,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
[tokenOwnerAddress] = await web3Wrapper.getAvailableAddressesAsync();
|
[tokenOwnerAddress] = await web3Wrapper.getAvailableAddressesAsync();
|
||||||
@@ -146,6 +154,7 @@ describe('LibAssetData', () => {
|
|||||||
erc20Artifacts.DummyERC20Token,
|
erc20Artifacts.DummyERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
'Dummy',
|
'Dummy',
|
||||||
'DUM',
|
'DUM',
|
||||||
new BigNumber(1),
|
new BigNumber(1),
|
||||||
@@ -156,6 +165,7 @@ describe('LibAssetData', () => {
|
|||||||
erc721Artifacts.DummyERC721Token,
|
erc721Artifacts.DummyERC721Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
'Dummy',
|
'Dummy',
|
||||||
'DUM',
|
'DUM',
|
||||||
);
|
);
|
||||||
@@ -172,6 +182,7 @@ describe('LibAssetData', () => {
|
|||||||
erc1155Artifacts.ERC1155Mintable,
|
erc1155Artifacts.ERC1155Mintable,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
const logDecoder = new LogDecoder(web3Wrapper, erc1155Artifacts);
|
const logDecoder = new LogDecoder(web3Wrapper, erc1155Artifacts);
|
||||||
|
@@ -37,6 +37,7 @@ describe('LibTransactionDecoder', () => {
|
|||||||
artifacts.LibTransactionDecoder,
|
artifacts.LibTransactionDecoder,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@@ -83,6 +83,7 @@ describe('OrderValidationUtils', () => {
|
|||||||
exchangeArtifacts.Exchange,
|
exchangeArtifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -90,6 +91,7 @@ describe('OrderValidationUtils', () => {
|
|||||||
proxyArtifacts.MultiAssetProxy,
|
proxyArtifacts.MultiAssetProxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
const exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
const exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
||||||
await exchangeWrapper.registerAssetProxyAsync(erc20Proxy.address, owner);
|
await exchangeWrapper.registerAssetProxyAsync(erc20Proxy.address, owner);
|
||||||
@@ -102,6 +104,7 @@ describe('OrderValidationUtils', () => {
|
|||||||
artifacts.DevUtils,
|
artifacts.DevUtils,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
);
|
);
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "1.1.11",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563957393,
|
"timestamp": 1563957393,
|
||||||
"version": "1.1.10",
|
"version": "1.1.10",
|
||||||
|
@@ -60,11 +60,13 @@ describe('ERC1155Token', () => {
|
|||||||
artifacts.ERC1155Mintable,
|
artifacts.ERC1155Mintable,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
erc1155Receiver = await DummyERC1155ReceiverContract.deployFrom0xArtifactAsync(
|
erc1155Receiver = await DummyERC1155ReceiverContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.DummyERC1155Receiver,
|
artifacts.DummyERC1155Receiver,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
receiver = erc1155Receiver.address;
|
receiver = erc1155Receiver.address;
|
||||||
// create wrapper & mint erc1155 tokens
|
// create wrapper & mint erc1155 tokens
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "2.2.10",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563957393,
|
"timestamp": 1563957393,
|
||||||
"version": "2.2.9",
|
"version": "2.2.9",
|
||||||
|
@@ -37,6 +37,7 @@ describe('UnlimitedAllowanceToken', () => {
|
|||||||
artifacts.DummyERC20Token,
|
artifacts.DummyERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
constants.DUMMY_TOKEN_DECIMALS,
|
constants.DUMMY_TOKEN_DECIMALS,
|
||||||
|
@@ -33,10 +33,15 @@ describe('EtherToken', () => {
|
|||||||
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||||
account = accounts[0];
|
account = accounts[0];
|
||||||
|
|
||||||
etherToken = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, {
|
etherToken = await WETH9Contract.deployFrom0xArtifactAsync(
|
||||||
gasPrice,
|
artifacts.WETH9,
|
||||||
...txDefaults,
|
provider,
|
||||||
});
|
{
|
||||||
|
gasPrice,
|
||||||
|
...txDefaults,
|
||||||
|
},
|
||||||
|
artifacts,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await blockchainLifecycle.startAsync();
|
await blockchainLifecycle.startAsync();
|
||||||
|
@@ -26,7 +26,12 @@ describe('ZRXToken', () => {
|
|||||||
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||||
owner = accounts[0];
|
owner = accounts[0];
|
||||||
spender = accounts[1];
|
spender = accounts[1];
|
||||||
zrxToken = await ZRXTokenContract.deployFrom0xArtifactAsync(artifacts.ZRXToken, provider, txDefaults);
|
zrxToken = await ZRXTokenContract.deployFrom0xArtifactAsync(
|
||||||
|
artifacts.ZRXToken,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
|
);
|
||||||
MAX_UINT = constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS;
|
MAX_UINT = constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS;
|
||||||
});
|
});
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "2.1.11",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563957393,
|
"timestamp": 1563957393,
|
||||||
"version": "2.1.10",
|
"version": "2.1.10",
|
||||||
|
@@ -48,6 +48,7 @@ describe('ERC721Token', () => {
|
|||||||
artifacts.DummyERC721Token,
|
artifacts.DummyERC721Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
);
|
);
|
||||||
@@ -55,6 +56,7 @@ describe('ERC721Token', () => {
|
|||||||
artifacts.DummyERC721Receiver,
|
artifacts.DummyERC721Receiver,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
logDecoder = new LogDecoder(web3Wrapper, artifacts);
|
logDecoder = new LogDecoder(web3Wrapper, artifacts);
|
||||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||||
@@ -176,6 +178,7 @@ describe('ERC721Token', () => {
|
|||||||
artifacts.DummyERC721Token,
|
artifacts.DummyERC721Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
);
|
);
|
||||||
@@ -190,6 +193,7 @@ describe('ERC721Token', () => {
|
|||||||
artifacts.InvalidERC721Receiver,
|
artifacts.InvalidERC721Receiver,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
const from = owner;
|
const from = owner;
|
||||||
const to = invalidErc721Receiver.address;
|
const to = invalidErc721Receiver.address;
|
||||||
@@ -237,6 +241,7 @@ describe('ERC721Token', () => {
|
|||||||
artifacts.DummyERC721Token,
|
artifacts.DummyERC721Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
);
|
);
|
||||||
@@ -251,6 +256,7 @@ describe('ERC721Token', () => {
|
|||||||
artifacts.InvalidERC721Receiver,
|
artifacts.InvalidERC721Receiver,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
const from = owner;
|
const from = owner;
|
||||||
const to = invalidErc721Receiver.address;
|
const to = invalidErc721Receiver.address;
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "3.0.8",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563957393,
|
"timestamp": 1563957393,
|
||||||
"version": "3.0.7",
|
"version": "3.0.7",
|
||||||
|
@@ -32,6 +32,7 @@ const DECIMALS_DEFAULT = 18;
|
|||||||
const MAX_WETH_FILL_PERCENTAGE = 95;
|
const MAX_WETH_FILL_PERCENTAGE = 95;
|
||||||
|
|
||||||
describe(ContractName.Forwarder, () => {
|
describe(ContractName.Forwarder, () => {
|
||||||
|
const dependencyArtifacts = { ...artifacts, ...erc20Artifacts, ...exchangeArtifacts };
|
||||||
let makerAddress: string;
|
let makerAddress: string;
|
||||||
let owner: string;
|
let owner: string;
|
||||||
let takerAddress: string;
|
let takerAddress: string;
|
||||||
@@ -88,7 +89,12 @@ describe(ContractName.Forwarder, () => {
|
|||||||
const erc721Balances = await erc721Wrapper.getBalancesAsync();
|
const erc721Balances = await erc721Wrapper.getBalancesAsync();
|
||||||
erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address];
|
erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address];
|
||||||
|
|
||||||
wethContract = await WETH9Contract.deployFrom0xArtifactAsync(erc20Artifacts.WETH9, provider, txDefaults);
|
wethContract = await WETH9Contract.deployFrom0xArtifactAsync(
|
||||||
|
erc20Artifacts.WETH9,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
|
);
|
||||||
weth = new DummyERC20TokenContract(wethContract.address, provider);
|
weth = new DummyERC20TokenContract(wethContract.address, provider);
|
||||||
erc20Wrapper.addDummyTokenContract(weth);
|
erc20Wrapper.addDummyTokenContract(weth);
|
||||||
|
|
||||||
@@ -98,6 +104,7 @@ describe(ContractName.Forwarder, () => {
|
|||||||
exchangeArtifacts.Exchange,
|
exchangeArtifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
);
|
);
|
||||||
exchangeWrapper = new ExchangeWrapper(exchangeInstance, provider);
|
exchangeWrapper = new ExchangeWrapper(exchangeInstance, provider);
|
||||||
@@ -131,6 +138,7 @@ describe(ContractName.Forwarder, () => {
|
|||||||
artifacts.Forwarder,
|
artifacts.Forwarder,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
exchangeInstance.address,
|
exchangeInstance.address,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
wethAssetData,
|
wethAssetData,
|
||||||
@@ -169,6 +177,7 @@ describe(ContractName.Forwarder, () => {
|
|||||||
exchangeArtifacts.Exchange,
|
exchangeArtifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
);
|
);
|
||||||
return expectContractCreationFailedAsync(
|
return expectContractCreationFailedAsync(
|
||||||
@@ -176,6 +185,7 @@ describe(ContractName.Forwarder, () => {
|
|||||||
artifacts.Forwarder,
|
artifacts.Forwarder,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
exchangeInstance.address,
|
exchangeInstance.address,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
wethAssetData,
|
wethAssetData,
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "3.0.4",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563957393,
|
"timestamp": 1563957393,
|
||||||
"version": "3.0.3",
|
"version": "3.0.3",
|
||||||
|
@@ -35,7 +35,7 @@ describe('Exchange libs', () => {
|
|||||||
before(async () => {
|
before(async () => {
|
||||||
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||||
const makerAddress = accounts[0];
|
const makerAddress = accounts[0];
|
||||||
libs = await TestLibsContract.deployFrom0xArtifactAsync(artifacts.TestLibs, provider, txDefaults);
|
libs = await TestLibsContract.deployFrom0xArtifactAsync(artifacts.TestLibs, provider, txDefaults, artifacts);
|
||||||
|
|
||||||
const defaultOrderParams = {
|
const defaultOrderParams = {
|
||||||
...constants.STATIC_ORDER_PARAMS,
|
...constants.STATIC_ORDER_PARAMS,
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "2.1.10",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563957393,
|
"timestamp": 1563957393,
|
||||||
"version": "2.1.9",
|
"version": "2.1.9",
|
||||||
|
@@ -51,6 +51,8 @@ import {
|
|||||||
TestStaticCallReceiverContract,
|
TestStaticCallReceiverContract,
|
||||||
} from '../src';
|
} from '../src';
|
||||||
|
|
||||||
|
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||||
@@ -117,11 +119,13 @@ describe('Exchange core', () => {
|
|||||||
proxyArtifacts.MultiAssetProxy,
|
proxyArtifacts.MultiAssetProxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
staticCallProxy = await StaticCallProxyContract.deployFrom0xArtifactAsync(
|
staticCallProxy = await StaticCallProxyContract.deployFrom0xArtifactAsync(
|
||||||
proxyArtifacts.StaticCallProxy,
|
proxyArtifacts.StaticCallProxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
const numDummyErc20ToDeploy = 3;
|
const numDummyErc20ToDeploy = 3;
|
||||||
[erc20TokenA, erc20TokenB, zrxToken] = await erc20Wrapper.deployDummyTokensAsync(
|
[erc20TokenA, erc20TokenB, zrxToken] = await erc20Wrapper.deployDummyTokensAsync(
|
||||||
@@ -136,17 +140,20 @@ describe('Exchange core', () => {
|
|||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||||
);
|
);
|
||||||
maliciousWallet = maliciousValidator = await TestStaticCallReceiverContract.deployFrom0xArtifactAsync(
|
maliciousWallet = maliciousValidator = await TestStaticCallReceiverContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.TestStaticCallReceiver,
|
artifacts.TestStaticCallReceiver,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
reentrantErc20Token = await ReentrantERC20TokenContract.deployFrom0xArtifactAsync(
|
reentrantErc20Token = await ReentrantERC20TokenContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.ReentrantERC20Token,
|
artifacts.ReentrantERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -349,6 +356,7 @@ describe('Exchange core', () => {
|
|||||||
erc20Artifacts.DummyNoReturnERC20Token,
|
erc20Artifacts.DummyNoReturnERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
constants.DUMMY_TOKEN_DECIMALS,
|
constants.DUMMY_TOKEN_DECIMALS,
|
||||||
@@ -1474,6 +1482,7 @@ describe('Exchange core', () => {
|
|||||||
proxyArtifacts.TestStaticCallTarget,
|
proxyArtifacts.TestStaticCallTarget,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should revert if the staticcall is unsuccessful', async () => {
|
it('should revert if the staticcall is unsuccessful', async () => {
|
||||||
|
@@ -29,6 +29,8 @@ import {
|
|||||||
TestAssetProxyDispatcherContract,
|
TestAssetProxyDispatcherContract,
|
||||||
} from '../src';
|
} from '../src';
|
||||||
|
|
||||||
|
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||||
@@ -72,6 +74,7 @@ describe('AssetProxyDispatcher', () => {
|
|||||||
artifacts.TestAssetProxyDispatcher,
|
artifacts.TestAssetProxyDispatcher,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||||
await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(assetProxyDispatcher.address, {
|
await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(assetProxyDispatcher.address, {
|
||||||
@@ -134,6 +137,7 @@ describe('AssetProxyDispatcher', () => {
|
|||||||
proxyArtifacts.ERC20Proxy,
|
proxyArtifacts.ERC20Proxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
// Register new ERC20 Transfer Proxy contract
|
// Register new ERC20 Transfer Proxy contract
|
||||||
return expectTransactionFailedAsync(
|
return expectTransactionFailedAsync(
|
||||||
|
@@ -18,6 +18,8 @@ import * as _ from 'lodash';
|
|||||||
|
|
||||||
import { artifacts, TestExchangeInternalsContract } from '../src';
|
import { artifacts, TestExchangeInternalsContract } from '../src';
|
||||||
|
|
||||||
|
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
|
|
||||||
@@ -65,6 +67,7 @@ describe('Exchange core internal functions', () => {
|
|||||||
artifacts.TestExchangeInternals,
|
artifacts.TestExchangeInternals,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
overflowErrorForSendTransaction = new Error(
|
overflowErrorForSendTransaction = new Error(
|
||||||
await getRevertReasonOrErrorMessageForSendTransactionAsync(RevertReason.Uint256Overflow),
|
await getRevertReasonOrErrorMessageForSendTransactionAsync(RevertReason.Uint256Overflow),
|
||||||
|
@@ -29,6 +29,8 @@ import {
|
|||||||
TestExchangeInternalsContract,
|
TestExchangeInternalsContract,
|
||||||
} from '../src';
|
} from '../src';
|
||||||
|
|
||||||
|
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||||
|
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
@@ -118,6 +120,7 @@ describe('matchOrders', () => {
|
|||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||||
);
|
);
|
||||||
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
||||||
@@ -141,6 +144,7 @@ describe('matchOrders', () => {
|
|||||||
artifacts.ReentrantERC20Token,
|
artifacts.ReentrantERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -175,6 +179,7 @@ describe('matchOrders', () => {
|
|||||||
artifacts.TestExchangeInternals,
|
artifacts.TestExchangeInternals,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
@@ -25,6 +25,8 @@ import {
|
|||||||
WalletContract,
|
WalletContract,
|
||||||
} from '../src';
|
} from '../src';
|
||||||
|
|
||||||
|
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
|
|
||||||
@@ -59,23 +61,27 @@ describe('MixinSignatureValidator', () => {
|
|||||||
artifacts.TestSignatureValidator,
|
artifacts.TestSignatureValidator,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
testWallet = await WalletContract.deployFrom0xArtifactAsync(
|
testWallet = await WalletContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.Wallet,
|
artifacts.Wallet,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
signerAddress,
|
signerAddress,
|
||||||
);
|
);
|
||||||
testValidator = await ValidatorContract.deployFrom0xArtifactAsync(
|
testValidator = await ValidatorContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.Validator,
|
artifacts.Validator,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
signerAddress,
|
signerAddress,
|
||||||
);
|
);
|
||||||
maliciousWallet = maliciousValidator = await TestStaticCallReceiverContract.deployFrom0xArtifactAsync(
|
maliciousWallet = maliciousValidator = await TestStaticCallReceiverContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.TestStaticCallReceiver,
|
artifacts.TestStaticCallReceiver,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
signatureValidatorLogDecoder = new LogDecoder(web3Wrapper, artifacts);
|
signatureValidatorLogDecoder = new LogDecoder(web3Wrapper, artifacts);
|
||||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||||
|
@@ -21,6 +21,8 @@ import * as _ from 'lodash';
|
|||||||
|
|
||||||
import { artifacts, ExchangeContract, ExchangeWrapper, ExchangeWrapperContract, WhitelistContract } from '../src/';
|
import { artifacts, ExchangeContract, ExchangeWrapper, ExchangeWrapperContract, WhitelistContract } from '../src/';
|
||||||
|
|
||||||
|
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||||
@@ -87,6 +89,7 @@ describe('Exchange transactions', () => {
|
|||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||||
);
|
);
|
||||||
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
||||||
@@ -219,6 +222,7 @@ describe('Exchange transactions', () => {
|
|||||||
artifacts.ExchangeWrapper,
|
artifacts.ExchangeWrapper,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -333,6 +337,7 @@ describe('Exchange transactions', () => {
|
|||||||
artifacts.Whitelist,
|
artifacts.Whitelist,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
const isApproved = true;
|
const isApproved = true;
|
||||||
|
9
contracts/exchange/test/utils/dependency_artifacts.ts
Normal file
9
contracts/exchange/test/utils/dependency_artifacts.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { artifacts as erc1155Artifacts } from '@0x/contracts-erc1155';
|
||||||
|
import { artifacts as erc20Artifacts } from '@0x/contracts-erc20';
|
||||||
|
import { artifacts as erc721Artifacts } from '@0x/contracts-erc721';
|
||||||
|
|
||||||
|
export const dependencyArtifacts = {
|
||||||
|
...erc20Artifacts,
|
||||||
|
...erc721Artifacts,
|
||||||
|
...erc1155Artifacts,
|
||||||
|
};
|
@@ -1,37 +1,21 @@
|
|||||||
import { artifacts as erc1155Artifacts } from '@0x/contracts-erc1155';
|
import { FillResults, formatters, OrderInfo, orderUtils, Web3ProviderEngine } from '@0x/contracts-test-utils';
|
||||||
import { artifacts as erc20Artifacts } from '@0x/contracts-erc20';
|
|
||||||
import { artifacts as erc721Artifacts } from '@0x/contracts-erc721';
|
|
||||||
import {
|
|
||||||
FillResults,
|
|
||||||
formatters,
|
|
||||||
LogDecoder,
|
|
||||||
OrderInfo,
|
|
||||||
orderUtils,
|
|
||||||
Web3ProviderEngine,
|
|
||||||
} from '@0x/contracts-test-utils';
|
|
||||||
import { SignedOrder, SignedZeroExTransaction } from '@0x/types';
|
import { SignedOrder, SignedZeroExTransaction } from '@0x/types';
|
||||||
import { AbiEncoder, BigNumber } from '@0x/utils';
|
import { AbiEncoder, BigNumber } from '@0x/utils';
|
||||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||||
import { MethodAbi, TransactionReceiptWithDecodedLogs, ZeroExProvider } from 'ethereum-types';
|
import { MethodAbi, TransactionReceiptWithDecodedLogs, ZeroExProvider } from 'ethereum-types';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import { artifacts, ExchangeContract } from '../../src';
|
import { ExchangeContract } from '../../src';
|
||||||
|
|
||||||
import { AbiDecodedFillOrderData } from './types';
|
import { AbiDecodedFillOrderData } from './types';
|
||||||
|
|
||||||
export class ExchangeWrapper {
|
export class ExchangeWrapper {
|
||||||
private readonly _exchange: ExchangeContract;
|
private readonly _exchange: ExchangeContract;
|
||||||
|
// tslint:disable no-unused-variable
|
||||||
private readonly _web3Wrapper: Web3Wrapper;
|
private readonly _web3Wrapper: Web3Wrapper;
|
||||||
private readonly _logDecoder: LogDecoder;
|
|
||||||
constructor(exchangeContract: ExchangeContract, provider: Web3ProviderEngine | ZeroExProvider) {
|
constructor(exchangeContract: ExchangeContract, provider: Web3ProviderEngine | ZeroExProvider) {
|
||||||
this._exchange = exchangeContract;
|
this._exchange = exchangeContract;
|
||||||
this._web3Wrapper = new Web3Wrapper(provider);
|
this._web3Wrapper = new Web3Wrapper(provider);
|
||||||
this._logDecoder = new LogDecoder(this._web3Wrapper, {
|
|
||||||
...artifacts,
|
|
||||||
...erc20Artifacts,
|
|
||||||
...erc721Artifacts,
|
|
||||||
...erc1155Artifacts,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
public async fillOrderAsync(
|
public async fillOrderAsync(
|
||||||
signedOrder: SignedOrder,
|
signedOrder: SignedOrder,
|
||||||
@@ -39,20 +23,18 @@ export class ExchangeWrapper {
|
|||||||
opts: { takerAssetFillAmount?: BigNumber } = {},
|
opts: { takerAssetFillAmount?: BigNumber } = {},
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
|
const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
|
||||||
const txHash = await this._exchange.fillOrder.sendTransactionAsync(
|
const txReceipt = await this._exchange.fillOrder.awaitTransactionSuccessAsync(
|
||||||
params.order,
|
params.order,
|
||||||
params.takerAssetFillAmount,
|
params.takerAssetFillAmount,
|
||||||
params.signature,
|
params.signature,
|
||||||
{ from },
|
{ from },
|
||||||
);
|
);
|
||||||
const txReceipt = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
|
||||||
return txReceipt;
|
return txReceipt;
|
||||||
}
|
}
|
||||||
public async cancelOrderAsync(signedOrder: SignedOrder, from: string): Promise<TransactionReceiptWithDecodedLogs> {
|
public async cancelOrderAsync(signedOrder: SignedOrder, from: string): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = orderUtils.createCancel(signedOrder);
|
const params = orderUtils.createCancel(signedOrder);
|
||||||
const txHash = await this._exchange.cancelOrder.sendTransactionAsync(params.order, { from });
|
const txReceipt = await this._exchange.cancelOrder.awaitTransactionSuccessAsync(params.order, { from });
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async fillOrKillOrderAsync(
|
public async fillOrKillOrderAsync(
|
||||||
signedOrder: SignedOrder,
|
signedOrder: SignedOrder,
|
||||||
@@ -60,14 +42,13 @@ export class ExchangeWrapper {
|
|||||||
opts: { takerAssetFillAmount?: BigNumber } = {},
|
opts: { takerAssetFillAmount?: BigNumber } = {},
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
|
const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
|
||||||
const txHash = await this._exchange.fillOrKillOrder.sendTransactionAsync(
|
const txReceipt = await this._exchange.fillOrKillOrder.awaitTransactionSuccessAsync(
|
||||||
params.order,
|
params.order,
|
||||||
params.takerAssetFillAmount,
|
params.takerAssetFillAmount,
|
||||||
params.signature,
|
params.signature,
|
||||||
{ from },
|
{ from },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async fillOrderNoThrowAsync(
|
public async fillOrderNoThrowAsync(
|
||||||
signedOrder: SignedOrder,
|
signedOrder: SignedOrder,
|
||||||
@@ -75,14 +56,13 @@ export class ExchangeWrapper {
|
|||||||
opts: { takerAssetFillAmount?: BigNumber; gas?: number } = {},
|
opts: { takerAssetFillAmount?: BigNumber; gas?: number } = {},
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
|
const params = orderUtils.createFill(signedOrder, opts.takerAssetFillAmount);
|
||||||
const txHash = await this._exchange.fillOrderNoThrow.sendTransactionAsync(
|
const txReceipt = await this._exchange.fillOrderNoThrow.awaitTransactionSuccessAsync(
|
||||||
params.order,
|
params.order,
|
||||||
params.takerAssetFillAmount,
|
params.takerAssetFillAmount,
|
||||||
params.signature,
|
params.signature,
|
||||||
{ from, gas: opts.gas },
|
{ from, gas: opts.gas },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async batchFillOrdersAsync(
|
public async batchFillOrdersAsync(
|
||||||
orders: SignedOrder[],
|
orders: SignedOrder[],
|
||||||
@@ -90,14 +70,13 @@ export class ExchangeWrapper {
|
|||||||
opts: { takerAssetFillAmounts?: BigNumber[] } = {},
|
opts: { takerAssetFillAmounts?: BigNumber[] } = {},
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
|
const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
|
||||||
const txHash = await this._exchange.batchFillOrders.sendTransactionAsync(
|
const txReceipt = await this._exchange.batchFillOrders.awaitTransactionSuccessAsync(
|
||||||
params.orders,
|
params.orders,
|
||||||
params.takerAssetFillAmounts,
|
params.takerAssetFillAmounts,
|
||||||
params.signatures,
|
params.signatures,
|
||||||
{ from },
|
{ from },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async batchFillOrKillOrdersAsync(
|
public async batchFillOrKillOrdersAsync(
|
||||||
orders: SignedOrder[],
|
orders: SignedOrder[],
|
||||||
@@ -105,14 +84,13 @@ export class ExchangeWrapper {
|
|||||||
opts: { takerAssetFillAmounts?: BigNumber[] } = {},
|
opts: { takerAssetFillAmounts?: BigNumber[] } = {},
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
|
const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
|
||||||
const txHash = await this._exchange.batchFillOrKillOrders.sendTransactionAsync(
|
const txReceipt = await this._exchange.batchFillOrKillOrders.awaitTransactionSuccessAsync(
|
||||||
params.orders,
|
params.orders,
|
||||||
params.takerAssetFillAmounts,
|
params.takerAssetFillAmounts,
|
||||||
params.signatures,
|
params.signatures,
|
||||||
{ from },
|
{ from },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async batchFillOrdersNoThrowAsync(
|
public async batchFillOrdersNoThrowAsync(
|
||||||
orders: SignedOrder[],
|
orders: SignedOrder[],
|
||||||
@@ -120,14 +98,13 @@ export class ExchangeWrapper {
|
|||||||
opts: { takerAssetFillAmounts?: BigNumber[]; gas?: number } = {},
|
opts: { takerAssetFillAmounts?: BigNumber[]; gas?: number } = {},
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
|
const params = formatters.createBatchFill(orders, opts.takerAssetFillAmounts);
|
||||||
const txHash = await this._exchange.batchFillOrdersNoThrow.sendTransactionAsync(
|
const txReceipt = await this._exchange.batchFillOrdersNoThrow.awaitTransactionSuccessAsync(
|
||||||
params.orders,
|
params.orders,
|
||||||
params.takerAssetFillAmounts,
|
params.takerAssetFillAmounts,
|
||||||
params.signatures,
|
params.signatures,
|
||||||
{ from, gas: opts.gas },
|
{ from, gas: opts.gas },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async marketSellOrdersAsync(
|
public async marketSellOrdersAsync(
|
||||||
orders: SignedOrder[],
|
orders: SignedOrder[],
|
||||||
@@ -135,14 +112,13 @@ export class ExchangeWrapper {
|
|||||||
opts: { takerAssetFillAmount: BigNumber },
|
opts: { takerAssetFillAmount: BigNumber },
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = formatters.createMarketSellOrders(orders, opts.takerAssetFillAmount);
|
const params = formatters.createMarketSellOrders(orders, opts.takerAssetFillAmount);
|
||||||
const txHash = await this._exchange.marketSellOrders.sendTransactionAsync(
|
const txReceipt = await this._exchange.marketSellOrders.awaitTransactionSuccessAsync(
|
||||||
params.orders,
|
params.orders,
|
||||||
params.takerAssetFillAmount,
|
params.takerAssetFillAmount,
|
||||||
params.signatures,
|
params.signatures,
|
||||||
{ from },
|
{ from },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async marketSellOrdersNoThrowAsync(
|
public async marketSellOrdersNoThrowAsync(
|
||||||
orders: SignedOrder[],
|
orders: SignedOrder[],
|
||||||
@@ -150,14 +126,13 @@ export class ExchangeWrapper {
|
|||||||
opts: { takerAssetFillAmount: BigNumber; gas?: number },
|
opts: { takerAssetFillAmount: BigNumber; gas?: number },
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = formatters.createMarketSellOrders(orders, opts.takerAssetFillAmount);
|
const params = formatters.createMarketSellOrders(orders, opts.takerAssetFillAmount);
|
||||||
const txHash = await this._exchange.marketSellOrdersNoThrow.sendTransactionAsync(
|
const txReceipt = await this._exchange.marketSellOrdersNoThrow.awaitTransactionSuccessAsync(
|
||||||
params.orders,
|
params.orders,
|
||||||
params.takerAssetFillAmount,
|
params.takerAssetFillAmount,
|
||||||
params.signatures,
|
params.signatures,
|
||||||
{ from, gas: opts.gas },
|
{ from, gas: opts.gas },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async marketBuyOrdersAsync(
|
public async marketBuyOrdersAsync(
|
||||||
orders: SignedOrder[],
|
orders: SignedOrder[],
|
||||||
@@ -165,14 +140,13 @@ export class ExchangeWrapper {
|
|||||||
opts: { makerAssetFillAmount: BigNumber },
|
opts: { makerAssetFillAmount: BigNumber },
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = formatters.createMarketBuyOrders(orders, opts.makerAssetFillAmount);
|
const params = formatters.createMarketBuyOrders(orders, opts.makerAssetFillAmount);
|
||||||
const txHash = await this._exchange.marketBuyOrders.sendTransactionAsync(
|
const txReceipt = await this._exchange.marketBuyOrders.awaitTransactionSuccessAsync(
|
||||||
params.orders,
|
params.orders,
|
||||||
params.makerAssetFillAmount,
|
params.makerAssetFillAmount,
|
||||||
params.signatures,
|
params.signatures,
|
||||||
{ from },
|
{ from },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async marketBuyOrdersNoThrowAsync(
|
public async marketBuyOrdersNoThrowAsync(
|
||||||
orders: SignedOrder[],
|
orders: SignedOrder[],
|
||||||
@@ -180,50 +154,47 @@ export class ExchangeWrapper {
|
|||||||
opts: { makerAssetFillAmount: BigNumber; gas?: number },
|
opts: { makerAssetFillAmount: BigNumber; gas?: number },
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = formatters.createMarketBuyOrders(orders, opts.makerAssetFillAmount);
|
const params = formatters.createMarketBuyOrders(orders, opts.makerAssetFillAmount);
|
||||||
const txHash = await this._exchange.marketBuyOrdersNoThrow.sendTransactionAsync(
|
const txReceipt = await this._exchange.marketBuyOrdersNoThrow.awaitTransactionSuccessAsync(
|
||||||
params.orders,
|
params.orders,
|
||||||
params.makerAssetFillAmount,
|
params.makerAssetFillAmount,
|
||||||
params.signatures,
|
params.signatures,
|
||||||
{ from, gas: opts.gas },
|
{ from, gas: opts.gas },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async batchCancelOrdersAsync(
|
public async batchCancelOrdersAsync(
|
||||||
orders: SignedOrder[],
|
orders: SignedOrder[],
|
||||||
from: string,
|
from: string,
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = formatters.createBatchCancel(orders);
|
const params = formatters.createBatchCancel(orders);
|
||||||
const txHash = await this._exchange.batchCancelOrders.sendTransactionAsync(params.orders, { from });
|
const txReceipt = await this._exchange.batchCancelOrders.awaitTransactionSuccessAsync(params.orders, { from });
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async cancelOrdersUpToAsync(salt: BigNumber, from: string): Promise<TransactionReceiptWithDecodedLogs> {
|
public async cancelOrdersUpToAsync(salt: BigNumber, from: string): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const txHash = await this._exchange.cancelOrdersUpTo.sendTransactionAsync(salt, { from });
|
const txReceipt = await this._exchange.cancelOrdersUpTo.awaitTransactionSuccessAsync(salt, { from });
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async registerAssetProxyAsync(
|
public async registerAssetProxyAsync(
|
||||||
assetProxyAddress: string,
|
assetProxyAddress: string,
|
||||||
from: string,
|
from: string,
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const txHash = await this._exchange.registerAssetProxy.sendTransactionAsync(assetProxyAddress, { from });
|
const txReceipt = await this._exchange.registerAssetProxy.awaitTransactionSuccessAsync(assetProxyAddress, {
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
from,
|
||||||
return tx;
|
});
|
||||||
|
return txReceipt;
|
||||||
}
|
}
|
||||||
public async executeTransactionAsync(
|
public async executeTransactionAsync(
|
||||||
signedTx: SignedZeroExTransaction,
|
signedTx: SignedZeroExTransaction,
|
||||||
from: string,
|
from: string,
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const txHash = await this._exchange.executeTransaction.sendTransactionAsync(
|
const txReceipt = await this._exchange.executeTransaction.awaitTransactionSuccessAsync(
|
||||||
signedTx.salt,
|
signedTx.salt,
|
||||||
signedTx.signerAddress,
|
signedTx.signerAddress,
|
||||||
signedTx.data,
|
signedTx.data,
|
||||||
signedTx.signature,
|
signedTx.signature,
|
||||||
{ from },
|
{ from },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async getTakerAssetFilledAmountAsync(orderHashHex: string): Promise<BigNumber> {
|
public async getTakerAssetFilledAmountAsync(orderHashHex: string): Promise<BigNumber> {
|
||||||
const filledAmount = await this._exchange.filled.callAsync(orderHashHex);
|
const filledAmount = await this._exchange.filled.callAsync(orderHashHex);
|
||||||
@@ -251,15 +222,14 @@ export class ExchangeWrapper {
|
|||||||
from: string,
|
from: string,
|
||||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||||
const params = orderUtils.createMatchOrders(signedOrderLeft, signedOrderRight);
|
const params = orderUtils.createMatchOrders(signedOrderLeft, signedOrderRight);
|
||||||
const txHash = await this._exchange.matchOrders.sendTransactionAsync(
|
const txReceipt = await this._exchange.matchOrders.awaitTransactionSuccessAsync(
|
||||||
params.left,
|
params.left,
|
||||||
params.right,
|
params.right,
|
||||||
params.leftSignature,
|
params.leftSignature,
|
||||||
params.rightSignature,
|
params.rightSignature,
|
||||||
{ from },
|
{ from },
|
||||||
);
|
);
|
||||||
const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash);
|
return txReceipt;
|
||||||
return tx;
|
|
||||||
}
|
}
|
||||||
public async getFillOrderResultsAsync(
|
public async getFillOrderResultsAsync(
|
||||||
signedOrder: SignedOrder,
|
signedOrder: SignedOrder,
|
||||||
|
@@ -37,6 +37,7 @@ import 'make-promises-safe';
|
|||||||
import { artifacts, ExchangeContract, ExchangeFillEventArgs } from '../../src';
|
import { artifacts, ExchangeContract, ExchangeFillEventArgs } from '../../src';
|
||||||
|
|
||||||
import { AssetWrapper } from './asset_wrapper';
|
import { AssetWrapper } from './asset_wrapper';
|
||||||
|
import { dependencyArtifacts } from './dependency_artifacts';
|
||||||
import { ExchangeWrapper } from './exchange_wrapper';
|
import { ExchangeWrapper } from './exchange_wrapper';
|
||||||
import { OrderFactoryFromScenario } from './order_factory_from_scenario';
|
import { OrderFactoryFromScenario } from './order_factory_from_scenario';
|
||||||
import { SimpleAssetBalanceAndProxyAllowanceFetcher } from './simple_asset_balance_and_proxy_allowance_fetcher';
|
import { SimpleAssetBalanceAndProxyAllowanceFetcher } from './simple_asset_balance_and_proxy_allowance_fetcher';
|
||||||
@@ -101,6 +102,7 @@ export async function fillOrderCombinatorialUtilsFactoryAsync(
|
|||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
);
|
);
|
||||||
const exchangeWrapper = new ExchangeWrapper(exchangeContract, provider);
|
const exchangeWrapper = new ExchangeWrapper(exchangeContract, provider);
|
||||||
@@ -135,6 +137,7 @@ export async function fillOrderCombinatorialUtilsFactoryAsync(
|
|||||||
libsArtifacts.TestLibs,
|
libsArtifacts.TestLibs,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
const fillOrderCombinatorialUtils = new FillOrderCombinatorialUtils(
|
const fillOrderCombinatorialUtils = new FillOrderCombinatorialUtils(
|
||||||
|
@@ -24,6 +24,8 @@ import * as _ from 'lodash';
|
|||||||
|
|
||||||
import { artifacts, ExchangeContract, ExchangeWrapper, ReentrantERC20TokenContract } from '../src';
|
import { artifacts, ExchangeContract, ExchangeWrapper, ReentrantERC20TokenContract } from '../src';
|
||||||
|
|
||||||
|
import { dependencyArtifacts } from './utils/dependency_artifacts';
|
||||||
|
|
||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||||
@@ -87,6 +89,7 @@ describe('Exchange wrappers', () => {
|
|||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||||
);
|
);
|
||||||
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
||||||
@@ -110,6 +113,7 @@ describe('Exchange wrappers', () => {
|
|||||||
artifacts.ReentrantERC20Token,
|
artifacts.ReentrantERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
dependencyArtifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "4.0.4",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563957393,
|
"timestamp": 1563957393,
|
||||||
"version": "4.0.3",
|
"version": "4.0.3",
|
||||||
|
@@ -130,6 +130,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
|||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
);
|
);
|
||||||
exchangeWrapper = new ExchangeWrapper(exchangeInstance, provider);
|
exchangeWrapper = new ExchangeWrapper(exchangeInstance, provider);
|
||||||
@@ -148,6 +149,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
|||||||
artifacts.BalanceThresholdFilter,
|
artifacts.BalanceThresholdFilter,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchangeInstance.address,
|
exchangeInstance.address,
|
||||||
erc721BalanceThresholdAsset.address,
|
erc721BalanceThresholdAsset.address,
|
||||||
erc721alanceThreshold,
|
erc721alanceThreshold,
|
||||||
@@ -157,6 +159,7 @@ describe(ContractName.BalanceThresholdFilter, () => {
|
|||||||
artifacts.BalanceThresholdFilter,
|
artifacts.BalanceThresholdFilter,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchangeInstance.address,
|
exchangeInstance.address,
|
||||||
erc20BalanceThresholdAsset.address,
|
erc20BalanceThresholdAsset.address,
|
||||||
erc20BalanceThreshold,
|
erc20BalanceThreshold,
|
||||||
|
@@ -82,7 +82,7 @@ describe(ContractName.DutchAuction, () => {
|
|||||||
const erc721Balances = await erc721Wrapper.getBalancesAsync();
|
const erc721Balances = await erc721Wrapper.getBalancesAsync();
|
||||||
erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address];
|
erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address];
|
||||||
|
|
||||||
wethContract = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, txDefaults);
|
wethContract = await WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, txDefaults, artifacts);
|
||||||
erc20Wrapper.addDummyTokenContract(wethContract as any);
|
erc20Wrapper.addDummyTokenContract(wethContract as any);
|
||||||
|
|
||||||
const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address);
|
const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address);
|
||||||
@@ -90,6 +90,7 @@ describe(ContractName.DutchAuction, () => {
|
|||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
);
|
);
|
||||||
const exchangeWrapper = new ExchangeWrapper(exchangeInstance, provider);
|
const exchangeWrapper = new ExchangeWrapper(exchangeInstance, provider);
|
||||||
@@ -107,6 +108,7 @@ describe(ContractName.DutchAuction, () => {
|
|||||||
artifacts.DutchAuction,
|
artifacts.DutchAuction,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchangeInstance.address,
|
exchangeInstance.address,
|
||||||
);
|
);
|
||||||
dutchAuctionContract = new DutchAuctionContract(dutchAuctionInstance.address, provider);
|
dutchAuctionContract = new DutchAuctionContract(dutchAuctionInstance.address, provider);
|
||||||
|
@@ -103,12 +103,14 @@ describe('OrderMatcher', () => {
|
|||||||
proxyArtifacts.ERC721Proxy,
|
proxyArtifacts.ERC721Proxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
// Depoy exchange
|
// Depoy exchange
|
||||||
exchange = await ExchangeContract.deployFrom0xArtifactAsync(
|
exchange = await ExchangeContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||||
);
|
);
|
||||||
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
exchangeWrapper = new ExchangeWrapper(exchange, provider);
|
||||||
@@ -126,6 +128,7 @@ describe('OrderMatcher', () => {
|
|||||||
artifacts.OrderMatcher,
|
artifacts.OrderMatcher,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
// Set default addresses
|
// Set default addresses
|
||||||
@@ -198,6 +201,7 @@ describe('OrderMatcher', () => {
|
|||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.NULL_BYTES,
|
constants.NULL_BYTES,
|
||||||
);
|
);
|
||||||
return expectContractCreationFailedAsync(
|
return expectContractCreationFailedAsync(
|
||||||
@@ -205,6 +209,7 @@ describe('OrderMatcher', () => {
|
|||||||
artifacts.OrderMatcher,
|
artifacts.OrderMatcher,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchangeInstance.address,
|
exchangeInstance.address,
|
||||||
) as any) as sendTransactionResult,
|
) as any) as sendTransactionResult,
|
||||||
RevertReason.UnregisteredAssetProxy,
|
RevertReason.UnregisteredAssetProxy,
|
||||||
@@ -727,6 +732,7 @@ describe('OrderMatcher', () => {
|
|||||||
erc721Artifacts.DummyERC721Token,
|
erc721Artifacts.DummyERC721Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
);
|
);
|
||||||
@@ -772,6 +778,7 @@ describe('OrderMatcher', () => {
|
|||||||
erc721Artifacts.DummyERC721Token,
|
erc721Artifacts.DummyERC721Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
);
|
);
|
||||||
@@ -789,6 +796,7 @@ describe('OrderMatcher', () => {
|
|||||||
erc721Artifacts.DummyERC721Token,
|
erc721Artifacts.DummyERC721Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
constants.DUMMY_TOKEN_NAME,
|
constants.DUMMY_TOKEN_NAME,
|
||||||
constants.DUMMY_TOKEN_SYMBOL,
|
constants.DUMMY_TOKEN_SYMBOL,
|
||||||
);
|
);
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "3.1.10",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563957393,
|
"timestamp": 1563957393,
|
||||||
"version": "3.1.9",
|
"version": "3.1.9",
|
||||||
|
@@ -61,17 +61,20 @@ describe('AssetProxyOwner', () => {
|
|||||||
proxyArtifacts.MixinAuthorizable,
|
proxyArtifacts.MixinAuthorizable,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
erc721Proxy = await MixinAuthorizableContract.deployFrom0xArtifactAsync(
|
erc721Proxy = await MixinAuthorizableContract.deployFrom0xArtifactAsync(
|
||||||
proxyArtifacts.MixinAuthorizable,
|
proxyArtifacts.MixinAuthorizable,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
const defaultAssetProxyContractAddresses: string[] = [];
|
const defaultAssetProxyContractAddresses: string[] = [];
|
||||||
testAssetProxyOwner = await TestAssetProxyOwnerContract.deployFrom0xArtifactAsync(
|
testAssetProxyOwner = await TestAssetProxyOwnerContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.TestAssetProxyOwner,
|
artifacts.TestAssetProxyOwner,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
owners,
|
owners,
|
||||||
defaultAssetProxyContractAddresses,
|
defaultAssetProxyContractAddresses,
|
||||||
REQUIRED_APPROVALS,
|
REQUIRED_APPROVALS,
|
||||||
@@ -105,6 +108,7 @@ describe('AssetProxyOwner', () => {
|
|||||||
artifacts.AssetProxyOwner,
|
artifacts.AssetProxyOwner,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
owners,
|
owners,
|
||||||
assetProxyContractAddresses,
|
assetProxyContractAddresses,
|
||||||
REQUIRED_APPROVALS,
|
REQUIRED_APPROVALS,
|
||||||
@@ -122,6 +126,7 @@ describe('AssetProxyOwner', () => {
|
|||||||
artifacts.AssetProxyOwner,
|
artifacts.AssetProxyOwner,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
owners,
|
owners,
|
||||||
assetProxyContractAddresses,
|
assetProxyContractAddresses,
|
||||||
REQUIRED_APPROVALS,
|
REQUIRED_APPROVALS,
|
||||||
|
@@ -66,6 +66,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
|||||||
artifacts.MultiSigWalletWithTimeLock,
|
artifacts.MultiSigWalletWithTimeLock,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
owners,
|
owners,
|
||||||
REQUIRED_APPROVALS,
|
REQUIRED_APPROVALS,
|
||||||
secondsTimeLocked,
|
secondsTimeLocked,
|
||||||
@@ -81,6 +82,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
|||||||
artifacts.MultiSigWalletWithTimeLock,
|
artifacts.MultiSigWalletWithTimeLock,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
owners,
|
owners,
|
||||||
REQUIRED_APPROVALS,
|
REQUIRED_APPROVALS,
|
||||||
secondsTimeLocked,
|
secondsTimeLocked,
|
||||||
@@ -135,6 +137,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
|||||||
artifacts.MultiSigWalletWithTimeLock,
|
artifacts.MultiSigWalletWithTimeLock,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
owners,
|
owners,
|
||||||
REQUIRED_APPROVALS,
|
REQUIRED_APPROVALS,
|
||||||
secondsTimeLocked,
|
secondsTimeLocked,
|
||||||
@@ -198,6 +201,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
|||||||
artifacts.TestRejectEther,
|
artifacts.TestRejectEther,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
const data = constants.NULL_BYTES;
|
const data = constants.NULL_BYTES;
|
||||||
const value = new BigNumber(10);
|
const value = new BigNumber(10);
|
||||||
@@ -234,6 +238,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
|||||||
artifacts.MultiSigWalletWithTimeLock,
|
artifacts.MultiSigWalletWithTimeLock,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
owners,
|
owners,
|
||||||
REQUIRED_APPROVALS,
|
REQUIRED_APPROVALS,
|
||||||
secondsTimeLocked,
|
secondsTimeLocked,
|
||||||
@@ -308,6 +313,7 @@ describe('MultiSigWalletWithTimeLock', () => {
|
|||||||
artifacts.MultiSigWalletWithTimeLock,
|
artifacts.MultiSigWalletWithTimeLock,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
owners,
|
owners,
|
||||||
REQUIRED_APPROVALS,
|
REQUIRED_APPROVALS,
|
||||||
SECONDS_TIME_LOCKED,
|
SECONDS_TIME_LOCKED,
|
||||||
|
@@ -1,4 +1,17 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "3.2.0",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deployFrom0xArtifactAsync to include artifact dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Added tests for decoding log arguments when artifact dependencies are included/excluded.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563957393,
|
"timestamp": 1563957393,
|
||||||
"version": "3.1.10",
|
"version": "3.1.10",
|
||||||
|
@@ -32,6 +32,8 @@
|
|||||||
"src/interfaces/IOwnable.sol",
|
"src/interfaces/IOwnable.sol",
|
||||||
"test/TestConstants.sol",
|
"test/TestConstants.sol",
|
||||||
"test/TestLibAddressArray.sol",
|
"test/TestLibAddressArray.sol",
|
||||||
"test/TestLibBytes.sol"
|
"test/TestLibBytes.sol",
|
||||||
|
"test/TestLogDecoding.sol",
|
||||||
|
"test/TestLogDecodingDownstream.sol"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
55
contracts/utils/contracts/test/TestLogDecoding.sol
Normal file
55
contracts/utils/contracts/test/TestLogDecoding.sol
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright 2018 ZeroEx Intl.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
pragma solidity ^0.5.5;
|
||||||
|
|
||||||
|
import "./TestLogDecodingDownstream.sol";
|
||||||
|
|
||||||
|
|
||||||
|
contract TestLogDecoding {
|
||||||
|
|
||||||
|
/// @dev arbitrary event; fields to not matter.
|
||||||
|
event TestEvent(
|
||||||
|
uint256 foo,
|
||||||
|
bytes bar,
|
||||||
|
string car
|
||||||
|
);
|
||||||
|
|
||||||
|
/// @dev Emits a local event
|
||||||
|
function emitEvent()
|
||||||
|
public
|
||||||
|
{
|
||||||
|
emit TestEvent(256, hex'1234', "4321");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @dev Emits an event in a downstream contract
|
||||||
|
function emitEventDownstream()
|
||||||
|
public
|
||||||
|
{
|
||||||
|
TestLogDecodingDownstream testLogDecodingDownstream = new TestLogDecodingDownstream();
|
||||||
|
ITestLogDecodingDownstream(testLogDecodingDownstream).emitEvent();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @dev Emits a local event and a downstream event
|
||||||
|
function emitEventsLocalAndDownstream()
|
||||||
|
public
|
||||||
|
{
|
||||||
|
emitEvent();
|
||||||
|
emitEventDownstream();
|
||||||
|
}
|
||||||
|
}
|
48
contracts/utils/contracts/test/TestLogDecodingDownstream.sol
Normal file
48
contracts/utils/contracts/test/TestLogDecodingDownstream.sol
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright 2018 ZeroEx Intl.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
pragma solidity ^0.5.5;
|
||||||
|
|
||||||
|
|
||||||
|
contract ITestLogDecodingDownstream {
|
||||||
|
|
||||||
|
/// @dev Emits a local event
|
||||||
|
function emitEvent() external;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
contract TestLogDecodingDownstream is
|
||||||
|
ITestLogDecodingDownstream
|
||||||
|
{
|
||||||
|
|
||||||
|
/// @dev event with fields different than those in `TestLogDecoding.TestEvent`
|
||||||
|
/// Note: do not include this in the interface
|
||||||
|
/// For testing, we want to emit an event that is
|
||||||
|
/// not known by the calling contract.
|
||||||
|
event TestEvent2(
|
||||||
|
uint256 lorem,
|
||||||
|
string ipsum
|
||||||
|
);
|
||||||
|
|
||||||
|
/// @dev Emits a local event
|
||||||
|
function emitEvent()
|
||||||
|
external
|
||||||
|
{
|
||||||
|
emit TestEvent2(256, "4321");
|
||||||
|
}
|
||||||
|
}
|
@@ -34,7 +34,7 @@
|
|||||||
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
|
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"abis": "./generated-artifacts/@(Address|IOwnable|LibBytes|Ownable|ReentrancyGuard|SafeMath|TestConstants|TestLibAddressArray|TestLibBytes).json",
|
"abis": "./generated-artifacts/@(Address|IOwnable|LibBytes|Ownable|ReentrancyGuard|SafeMath|TestConstants|TestLibAddressArray|TestLibBytes|TestLogDecoding|TestLogDecodingDownstream).json",
|
||||||
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
|
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@@ -14,6 +14,8 @@ import * as SafeMath from '../generated-artifacts/SafeMath.json';
|
|||||||
import * as TestConstants from '../generated-artifacts/TestConstants.json';
|
import * as TestConstants from '../generated-artifacts/TestConstants.json';
|
||||||
import * as TestLibAddressArray from '../generated-artifacts/TestLibAddressArray.json';
|
import * as TestLibAddressArray from '../generated-artifacts/TestLibAddressArray.json';
|
||||||
import * as TestLibBytes from '../generated-artifacts/TestLibBytes.json';
|
import * as TestLibBytes from '../generated-artifacts/TestLibBytes.json';
|
||||||
|
import * as TestLogDecoding from '../generated-artifacts/TestLogDecoding.json';
|
||||||
|
import * as TestLogDecodingDownstream from '../generated-artifacts/TestLogDecodingDownstream.json';
|
||||||
export const artifacts = {
|
export const artifacts = {
|
||||||
Address: Address as ContractArtifact,
|
Address: Address as ContractArtifact,
|
||||||
LibBytes: LibBytes as ContractArtifact,
|
LibBytes: LibBytes as ContractArtifact,
|
||||||
@@ -22,6 +24,8 @@ export const artifacts = {
|
|||||||
SafeMath: SafeMath as ContractArtifact,
|
SafeMath: SafeMath as ContractArtifact,
|
||||||
IOwnable: IOwnable as ContractArtifact,
|
IOwnable: IOwnable as ContractArtifact,
|
||||||
TestConstants: TestConstants as ContractArtifact,
|
TestConstants: TestConstants as ContractArtifact,
|
||||||
TestLibBytes: TestLibBytes as ContractArtifact,
|
|
||||||
TestLibAddressArray: TestLibAddressArray as ContractArtifact,
|
TestLibAddressArray: TestLibAddressArray as ContractArtifact,
|
||||||
|
TestLibBytes: TestLibBytes as ContractArtifact,
|
||||||
|
TestLogDecoding: TestLogDecoding as ContractArtifact,
|
||||||
|
TestLogDecodingDownstream: TestLogDecodingDownstream as ContractArtifact,
|
||||||
};
|
};
|
||||||
|
@@ -12,3 +12,5 @@ export * from '../generated-wrappers/safe_math';
|
|||||||
export * from '../generated-wrappers/test_constants';
|
export * from '../generated-wrappers/test_constants';
|
||||||
export * from '../generated-wrappers/test_lib_address_array';
|
export * from '../generated-wrappers/test_lib_address_array';
|
||||||
export * from '../generated-wrappers/test_lib_bytes';
|
export * from '../generated-wrappers/test_lib_bytes';
|
||||||
|
export * from '../generated-wrappers/test_log_decoding';
|
||||||
|
export * from '../generated-wrappers/test_log_decoding_downstream';
|
||||||
|
@@ -28,6 +28,7 @@ describe('LibAddressArray', () => {
|
|||||||
artifacts.TestLibAddressArray,
|
artifacts.TestLibAddressArray,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
after(async () => {
|
after(async () => {
|
||||||
|
@@ -68,7 +68,12 @@ describe('LibBytes', () => {
|
|||||||
testAddress = accounts[1];
|
testAddress = accounts[1];
|
||||||
testAddressB = accounts[2];
|
testAddressB = accounts[2];
|
||||||
// Deploy LibBytes
|
// Deploy LibBytes
|
||||||
libBytes = await TestLibBytesContract.deployFrom0xArtifactAsync(artifacts.TestLibBytes, provider, txDefaults);
|
libBytes = await TestLibBytesContract.deployFrom0xArtifactAsync(
|
||||||
|
artifacts.TestLibBytes,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
|
);
|
||||||
// Verify lengths of test data
|
// Verify lengths of test data
|
||||||
const byteArrayShorterThan32BytesLength = ethUtil.toBuffer(byteArrayShorterThan32Bytes).byteLength;
|
const byteArrayShorterThan32BytesLength = ethUtil.toBuffer(byteArrayShorterThan32Bytes).byteLength;
|
||||||
expect(byteArrayShorterThan32BytesLength).to.be.lessThan(32);
|
expect(byteArrayShorterThan32BytesLength).to.be.lessThan(32);
|
||||||
|
@@ -24,6 +24,7 @@ describe('Libs', () => {
|
|||||||
artifacts.TestConstants,
|
artifacts.TestConstants,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
const isValid = await testConstants.assertValidZrxAssetData.callAsync();
|
const isValid = await testConstants.assertValidZrxAssetData.callAsync();
|
||||||
expect(isValid).to.be.equal(true);
|
expect(isValid).to.be.equal(true);
|
||||||
|
95
contracts/utils/test/log_decoding.ts
Normal file
95
contracts/utils/test/log_decoding.ts
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
import { chaiSetup, provider, txDefaults, web3Wrapper } from '@0x/contracts-test-utils';
|
||||||
|
import { BlockchainLifecycle } from '@0x/dev-utils';
|
||||||
|
import { BigNumber } from '@0x/utils';
|
||||||
|
import * as chai from 'chai';
|
||||||
|
import { DecodedLogArgs, LogWithDecodedArgs } from 'ethereum-types';
|
||||||
|
|
||||||
|
import { artifacts, TestLogDecodingContract } from '../src';
|
||||||
|
|
||||||
|
chaiSetup.configure();
|
||||||
|
const expect = chai.expect;
|
||||||
|
|
||||||
|
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||||
|
|
||||||
|
describe('TestLogDecoding', () => {
|
||||||
|
let testLogDecodingWithDependencies: TestLogDecodingContract;
|
||||||
|
let testLogDecodingDeployedWithoutDependencies: TestLogDecodingContract;
|
||||||
|
const expectedEvent = {
|
||||||
|
foo: new BigNumber(256),
|
||||||
|
bar: '0x1234',
|
||||||
|
car: '4321',
|
||||||
|
};
|
||||||
|
const expectedDownstreamEvent = {
|
||||||
|
lorem: new BigNumber(256),
|
||||||
|
ipsum: '4321',
|
||||||
|
};
|
||||||
|
const emptyDependencyList = {};
|
||||||
|
|
||||||
|
before(async () => {
|
||||||
|
testLogDecodingDeployedWithoutDependencies = await TestLogDecodingContract.deployFrom0xArtifactAsync(
|
||||||
|
artifacts.TestLogDecoding,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
emptyDependencyList,
|
||||||
|
);
|
||||||
|
testLogDecodingWithDependencies = await TestLogDecodingContract.deployFrom0xArtifactAsync(
|
||||||
|
artifacts.TestLogDecoding,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
beforeEach(async () => {
|
||||||
|
await blockchainLifecycle.startAsync();
|
||||||
|
});
|
||||||
|
afterEach(async () => {
|
||||||
|
await blockchainLifecycle.revertAsync();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Decoding Log Arguments', () => {
|
||||||
|
it('should decode locally emitted event args when no dependencies are passed into wrapper', async () => {
|
||||||
|
const txReceipt = await testLogDecodingDeployedWithoutDependencies.emitEvent.awaitTransactionSuccessAsync();
|
||||||
|
expect(txReceipt.logs.length).to.be.equal(1);
|
||||||
|
// tslint:disable no-unnecessary-type-assertion
|
||||||
|
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(expectedEvent);
|
||||||
|
});
|
||||||
|
it('should not decode event args when no dependencies are passed into wrapper', async () => {
|
||||||
|
const txReceipt = await testLogDecodingDeployedWithoutDependencies.emitEventDownstream.awaitTransactionSuccessAsync();
|
||||||
|
expect(txReceipt.logs.length).to.be.equal(1);
|
||||||
|
// tslint:disable no-unnecessary-type-assertion
|
||||||
|
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.undefined();
|
||||||
|
});
|
||||||
|
it('should decode args for local but not downstream event when no dependencies are passed into wrapper', async () => {
|
||||||
|
const txReceipt = await testLogDecodingDeployedWithoutDependencies.emitEventsLocalAndDownstream.awaitTransactionSuccessAsync();
|
||||||
|
expect(txReceipt.logs.length).to.be.equal(2);
|
||||||
|
// tslint:disable no-unnecessary-type-assertion
|
||||||
|
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(expectedEvent);
|
||||||
|
// tslint:disable no-unnecessary-type-assertion
|
||||||
|
expect((txReceipt.logs[1] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.undefined();
|
||||||
|
});
|
||||||
|
it('should decode locally emitted event args when dependencies are passed into wrapper', async () => {
|
||||||
|
const txReceipt = await testLogDecodingWithDependencies.emitEvent.awaitTransactionSuccessAsync();
|
||||||
|
expect(txReceipt.logs.length).to.be.equal(1);
|
||||||
|
// tslint:disable no-unnecessary-type-assertion
|
||||||
|
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(expectedEvent);
|
||||||
|
});
|
||||||
|
it('should decode downstream event args when dependencies are passed into wrapper', async () => {
|
||||||
|
const txReceipt = await testLogDecodingWithDependencies.emitEventDownstream.awaitTransactionSuccessAsync();
|
||||||
|
expect(txReceipt.logs.length).to.be.equal(1);
|
||||||
|
// tslint:disable no-unnecessary-type-assertion
|
||||||
|
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(
|
||||||
|
expectedDownstreamEvent,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('should decode args for both local and downstream events when dependencies are passed into wrapper', async () => {
|
||||||
|
const txReceipt = await testLogDecodingWithDependencies.emitEventsLocalAndDownstream.awaitTransactionSuccessAsync();
|
||||||
|
expect(txReceipt.logs.length).to.be.equal(2);
|
||||||
|
// tslint:disable no-unnecessary-type-assertion
|
||||||
|
expect((txReceipt.logs[0] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(expectedEvent);
|
||||||
|
// tslint:disable no-unnecessary-type-assertion
|
||||||
|
expect((txReceipt.logs[1] as LogWithDecodedArgs<DecodedLogArgs>).args).to.be.deep.equal(
|
||||||
|
expectedDownstreamEvent,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
@@ -11,7 +11,9 @@
|
|||||||
"generated-artifacts/SafeMath.json",
|
"generated-artifacts/SafeMath.json",
|
||||||
"generated-artifacts/TestConstants.json",
|
"generated-artifacts/TestConstants.json",
|
||||||
"generated-artifacts/TestLibAddressArray.json",
|
"generated-artifacts/TestLibAddressArray.json",
|
||||||
"generated-artifacts/TestLibBytes.json"
|
"generated-artifacts/TestLibBytes.json",
|
||||||
|
"generated-artifacts/TestLogDecoding.json",
|
||||||
|
"generated-artifacts/TestLogDecodingDownstream.json"
|
||||||
],
|
],
|
||||||
"exclude": ["./deploy/solc/solc_bin"]
|
"exclude": ["./deploy/solc/solc_bin"]
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,17 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "2.4.0",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated interface to `deployFrom0xArtifactAsync` to include log decode dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Updated interface to `deployAsync` to include log decode dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"changes": [
|
"changes": [
|
||||||
|
@@ -63,6 +63,7 @@ export class {{contractName}}Contract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: (ContractArtifact | SimpleContractArtifact) },
|
||||||
{{> typed_params inputs=ctor.inputs}}
|
{{> typed_params inputs=ctor.inputs}}
|
||||||
): Promise<{{contractName}}Contract> {
|
): Promise<{{contractName}}Contract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -76,13 +77,18 @@ export class {{contractName}}Contract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return {{contractName}}Contract.deployAsync(bytecode, abi, provider, txDefaults, {{> params inputs=ctor.inputs}});
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return {{contractName}}Contract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly, {{> params inputs=ctor.inputs}});
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
{{> typed_params inputs=ctor.inputs}}
|
{{> typed_params inputs=ctor.inputs}}
|
||||||
): Promise<{{contractName}}Contract> {
|
): Promise<{{contractName}}Contract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
@@ -111,7 +117,7 @@ export class {{contractName}}Contract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`{{contractName}} successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`{{contractName}} successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new {{contractName}}Contract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new {{contractName}}Contract(txReceipt.contractAddress as string, provider, txDefaults, logDecodeDependencies);
|
||||||
contractInstance.constructorArgs = [{{> params inputs=ctor.inputs}}];
|
contractInstance.constructorArgs = [{{> params inputs=ctor.inputs}}];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -213,8 +219,8 @@ export class {{contractName}}Contract extends BaseContract {
|
|||||||
);
|
);
|
||||||
return logs;
|
return logs;
|
||||||
}{{/if}}
|
}{{/if}}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>, logDecodeDependencies?: { [contractName: string]: ContractAbi }) {
|
||||||
super('{{contractName}}', {{contractName}}Contract.ABI(), address, supportedProvider, txDefaults);
|
super('{{contractName}}', {{contractName}}Contract.ABI(), address, supportedProvider, txDefaults, logDecodeDependencies);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);{{#if events}}
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);{{#if events}}
|
||||||
this._subscriptionManager = new SubscriptionManager<{{contractName}}EventArgs, {{contractName}}Events>(
|
this._subscriptionManager = new SubscriptionManager<{{contractName}}EventArgs, {{contractName}}Events>(
|
||||||
{{contractName}}Contract.ABI(),
|
{{contractName}}Contract.ABI(),
|
||||||
|
@@ -2096,6 +2096,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
_owners: string[],
|
_owners: string[],
|
||||||
_assetProxyContracts: string[],
|
_assetProxyContracts: string[],
|
||||||
_required: BigNumber,
|
_required: BigNumber,
|
||||||
@@ -2112,11 +2113,16 @@ export class AssetProxyOwnerContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
return AssetProxyOwnerContract.deployAsync(
|
return AssetProxyOwnerContract.deployAsync(
|
||||||
bytecode,
|
bytecode,
|
||||||
abi,
|
abi,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
logDecodeDependenciesAbiOnly,
|
||||||
_owners,
|
_owners,
|
||||||
_assetProxyContracts,
|
_assetProxyContracts,
|
||||||
_required,
|
_required,
|
||||||
@@ -2128,6 +2134,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
|||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
_owners: string[],
|
_owners: string[],
|
||||||
_assetProxyContracts: string[],
|
_assetProxyContracts: string[],
|
||||||
_required: BigNumber,
|
_required: BigNumber,
|
||||||
@@ -2159,7 +2166,12 @@ export class AssetProxyOwnerContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`AssetProxyOwner successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`AssetProxyOwner successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new AssetProxyOwnerContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new AssetProxyOwnerContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [_owners, _assetProxyContracts, _required, _secondsTimeLocked];
|
contractInstance.constructorArgs = [_owners, _assetProxyContracts, _required, _secondsTimeLocked];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -2938,8 +2950,20 @@ export class AssetProxyOwnerContract extends BaseContract {
|
|||||||
);
|
);
|
||||||
return logs;
|
return logs;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('AssetProxyOwner', AssetProxyOwnerContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super(
|
||||||
|
'AssetProxyOwner',
|
||||||
|
AssetProxyOwnerContract.ABI(),
|
||||||
|
address,
|
||||||
|
supportedProvider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<AssetProxyOwnerEventArgs, AssetProxyOwnerEvents>(
|
this._subscriptionManager = new SubscriptionManager<AssetProxyOwnerEventArgs, AssetProxyOwnerEvents>(
|
||||||
AssetProxyOwnerContract.ABI(),
|
AssetProxyOwnerContract.ABI(),
|
||||||
|
@@ -615,6 +615,7 @@ export class CoordinatorContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
_exchange: string,
|
_exchange: string,
|
||||||
): Promise<CoordinatorContract> {
|
): Promise<CoordinatorContract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -628,13 +629,25 @@ export class CoordinatorContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return CoordinatorContract.deployAsync(bytecode, abi, provider, txDefaults, _exchange);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return CoordinatorContract.deployAsync(
|
||||||
|
bytecode,
|
||||||
|
abi,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependenciesAbiOnly,
|
||||||
|
_exchange,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
_exchange: string,
|
_exchange: string,
|
||||||
): Promise<CoordinatorContract> {
|
): Promise<CoordinatorContract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
@@ -663,7 +676,12 @@ export class CoordinatorContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`Coordinator successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`Coordinator successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new CoordinatorContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new CoordinatorContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [_exchange];
|
contractInstance.constructorArgs = [_exchange];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -966,8 +984,13 @@ export class CoordinatorContract extends BaseContract {
|
|||||||
] as ContractAbi;
|
] as ContractAbi;
|
||||||
return abi;
|
return abi;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('Coordinator', CoordinatorContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super('Coordinator', CoordinatorContract.ABI(), address, supportedProvider, txDefaults, logDecodeDependencies);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -205,6 +205,7 @@ export class CoordinatorRegistryContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
): Promise<CoordinatorRegistryContract> {
|
): Promise<CoordinatorRegistryContract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@@ -217,13 +218,24 @@ export class CoordinatorRegistryContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return CoordinatorRegistryContract.deployAsync(bytecode, abi, provider, txDefaults);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return CoordinatorRegistryContract.deployAsync(
|
||||||
|
bytecode,
|
||||||
|
abi,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependenciesAbiOnly,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
): Promise<CoordinatorRegistryContract> {
|
): Promise<CoordinatorRegistryContract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -251,6 +263,7 @@ export class CoordinatorRegistryContract extends BaseContract {
|
|||||||
txReceipt.contractAddress as string,
|
txReceipt.contractAddress as string,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
);
|
);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
@@ -390,8 +403,20 @@ export class CoordinatorRegistryContract extends BaseContract {
|
|||||||
);
|
);
|
||||||
return logs;
|
return logs;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('CoordinatorRegistry', CoordinatorRegistryContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super(
|
||||||
|
'CoordinatorRegistry',
|
||||||
|
CoordinatorRegistryContract.ABI(),
|
||||||
|
address,
|
||||||
|
supportedProvider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<CoordinatorRegistryEventArgs, CoordinatorRegistryEvents>(
|
this._subscriptionManager = new SubscriptionManager<CoordinatorRegistryEventArgs, CoordinatorRegistryEvents>(
|
||||||
CoordinatorRegistryContract.ABI(),
|
CoordinatorRegistryContract.ABI(),
|
||||||
|
@@ -1115,6 +1115,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
_name: string,
|
_name: string,
|
||||||
_symbol: string,
|
_symbol: string,
|
||||||
_decimals: BigNumber,
|
_decimals: BigNumber,
|
||||||
@@ -1131,11 +1132,16 @@ export class DummyERC20TokenContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
return DummyERC20TokenContract.deployAsync(
|
return DummyERC20TokenContract.deployAsync(
|
||||||
bytecode,
|
bytecode,
|
||||||
abi,
|
abi,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
logDecodeDependenciesAbiOnly,
|
||||||
_name,
|
_name,
|
||||||
_symbol,
|
_symbol,
|
||||||
_decimals,
|
_decimals,
|
||||||
@@ -1147,6 +1153,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
|||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
_name: string,
|
_name: string,
|
||||||
_symbol: string,
|
_symbol: string,
|
||||||
_decimals: BigNumber,
|
_decimals: BigNumber,
|
||||||
@@ -1178,7 +1185,12 @@ export class DummyERC20TokenContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`DummyERC20Token successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`DummyERC20Token successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new DummyERC20TokenContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new DummyERC20TokenContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [_name, _symbol, _decimals, _totalSupply];
|
contractInstance.constructorArgs = [_name, _symbol, _decimals, _totalSupply];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -1574,8 +1586,20 @@ export class DummyERC20TokenContract extends BaseContract {
|
|||||||
);
|
);
|
||||||
return logs;
|
return logs;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('DummyERC20Token', DummyERC20TokenContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super(
|
||||||
|
'DummyERC20Token',
|
||||||
|
DummyERC20TokenContract.ABI(),
|
||||||
|
address,
|
||||||
|
supportedProvider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<DummyERC20TokenEventArgs, DummyERC20TokenEvents>(
|
this._subscriptionManager = new SubscriptionManager<DummyERC20TokenEventArgs, DummyERC20TokenEvents>(
|
||||||
DummyERC20TokenContract.ABI(),
|
DummyERC20TokenContract.ABI(),
|
||||||
|
@@ -1445,6 +1445,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
_name: string,
|
_name: string,
|
||||||
_symbol: string,
|
_symbol: string,
|
||||||
): Promise<DummyERC721TokenContract> {
|
): Promise<DummyERC721TokenContract> {
|
||||||
@@ -1459,13 +1460,26 @@ export class DummyERC721TokenContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return DummyERC721TokenContract.deployAsync(bytecode, abi, provider, txDefaults, _name, _symbol);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return DummyERC721TokenContract.deployAsync(
|
||||||
|
bytecode,
|
||||||
|
abi,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependenciesAbiOnly,
|
||||||
|
_name,
|
||||||
|
_symbol,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
_name: string,
|
_name: string,
|
||||||
_symbol: string,
|
_symbol: string,
|
||||||
): Promise<DummyERC721TokenContract> {
|
): Promise<DummyERC721TokenContract> {
|
||||||
@@ -1499,6 +1513,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
|||||||
txReceipt.contractAddress as string,
|
txReceipt.contractAddress as string,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
);
|
);
|
||||||
contractInstance.constructorArgs = [_name, _symbol];
|
contractInstance.constructorArgs = [_name, _symbol];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
@@ -1943,8 +1958,20 @@ export class DummyERC721TokenContract extends BaseContract {
|
|||||||
);
|
);
|
||||||
return logs;
|
return logs;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('DummyERC721Token', DummyERC721TokenContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super(
|
||||||
|
'DummyERC721Token',
|
||||||
|
DummyERC721TokenContract.ABI(),
|
||||||
|
address,
|
||||||
|
supportedProvider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<DummyERC721TokenEventArgs, DummyERC721TokenEvents>(
|
this._subscriptionManager = new SubscriptionManager<DummyERC721TokenEventArgs, DummyERC721TokenEvents>(
|
||||||
DummyERC721TokenContract.ABI(),
|
DummyERC721TokenContract.ABI(),
|
||||||
|
@@ -539,6 +539,7 @@ export class DutchAuctionContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
_exchange: string,
|
_exchange: string,
|
||||||
): Promise<DutchAuctionContract> {
|
): Promise<DutchAuctionContract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -552,13 +553,25 @@ export class DutchAuctionContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return DutchAuctionContract.deployAsync(bytecode, abi, provider, txDefaults, _exchange);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return DutchAuctionContract.deployAsync(
|
||||||
|
bytecode,
|
||||||
|
abi,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependenciesAbiOnly,
|
||||||
|
_exchange,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
_exchange: string,
|
_exchange: string,
|
||||||
): Promise<DutchAuctionContract> {
|
): Promise<DutchAuctionContract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
@@ -587,7 +600,12 @@ export class DutchAuctionContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`DutchAuction successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`DutchAuction successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new DutchAuctionContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new DutchAuctionContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [_exchange];
|
contractInstance.constructorArgs = [_exchange];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -888,8 +906,20 @@ export class DutchAuctionContract extends BaseContract {
|
|||||||
] as ContractAbi;
|
] as ContractAbi;
|
||||||
return abi;
|
return abi;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('DutchAuction', DutchAuctionContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super(
|
||||||
|
'DutchAuction',
|
||||||
|
DutchAuctionContract.ABI(),
|
||||||
|
address,
|
||||||
|
supportedProvider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -704,6 +704,7 @@ export class ERC20ProxyContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
): Promise<ERC20ProxyContract> {
|
): Promise<ERC20ProxyContract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@@ -716,13 +717,18 @@ export class ERC20ProxyContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return ERC20ProxyContract.deployAsync(bytecode, abi, provider, txDefaults);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return ERC20ProxyContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
): Promise<ERC20ProxyContract> {
|
): Promise<ERC20ProxyContract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -746,7 +752,12 @@ export class ERC20ProxyContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`ERC20Proxy successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`ERC20Proxy successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new ERC20ProxyContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new ERC20ProxyContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -1010,8 +1021,13 @@ export class ERC20ProxyContract extends BaseContract {
|
|||||||
);
|
);
|
||||||
return logs;
|
return logs;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('ERC20Proxy', ERC20ProxyContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super('ERC20Proxy', ERC20ProxyContract.ABI(), address, supportedProvider, txDefaults, logDecodeDependencies);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<ERC20ProxyEventArgs, ERC20ProxyEvents>(
|
this._subscriptionManager = new SubscriptionManager<ERC20ProxyEventArgs, ERC20ProxyEvents>(
|
||||||
ERC20ProxyContract.ABI(),
|
ERC20ProxyContract.ABI(),
|
||||||
|
@@ -592,6 +592,7 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
): Promise<ERC20TokenContract> {
|
): Promise<ERC20TokenContract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@@ -604,13 +605,18 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return ERC20TokenContract.deployAsync(bytecode, abi, provider, txDefaults);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return ERC20TokenContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
): Promise<ERC20TokenContract> {
|
): Promise<ERC20TokenContract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -634,7 +640,12 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`ERC20Token successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`ERC20Token successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new ERC20TokenContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new ERC20TokenContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -890,8 +901,13 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
);
|
);
|
||||||
return logs;
|
return logs;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('ERC20Token', ERC20TokenContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super('ERC20Token', ERC20TokenContract.ABI(), address, supportedProvider, txDefaults, logDecodeDependencies);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<ERC20TokenEventArgs, ERC20TokenEvents>(
|
this._subscriptionManager = new SubscriptionManager<ERC20TokenEventArgs, ERC20TokenEvents>(
|
||||||
ERC20TokenContract.ABI(),
|
ERC20TokenContract.ABI(),
|
||||||
|
@@ -704,6 +704,7 @@ export class ERC721ProxyContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
): Promise<ERC721ProxyContract> {
|
): Promise<ERC721ProxyContract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@@ -716,13 +717,18 @@ export class ERC721ProxyContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return ERC721ProxyContract.deployAsync(bytecode, abi, provider, txDefaults);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return ERC721ProxyContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
): Promise<ERC721ProxyContract> {
|
): Promise<ERC721ProxyContract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -746,7 +752,12 @@ export class ERC721ProxyContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`ERC721Proxy successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`ERC721Proxy successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new ERC721ProxyContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new ERC721ProxyContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -1010,8 +1021,13 @@ export class ERC721ProxyContract extends BaseContract {
|
|||||||
);
|
);
|
||||||
return logs;
|
return logs;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('ERC721Proxy', ERC721ProxyContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super('ERC721Proxy', ERC721ProxyContract.ABI(), address, supportedProvider, txDefaults, logDecodeDependencies);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<ERC721ProxyEventArgs, ERC721ProxyEvents>(
|
this._subscriptionManager = new SubscriptionManager<ERC721ProxyEventArgs, ERC721ProxyEvents>(
|
||||||
ERC721ProxyContract.ABI(),
|
ERC721ProxyContract.ABI(),
|
||||||
|
@@ -985,6 +985,7 @@ export class ERC721TokenContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
): Promise<ERC721TokenContract> {
|
): Promise<ERC721TokenContract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@@ -997,13 +998,18 @@ export class ERC721TokenContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return ERC721TokenContract.deployAsync(bytecode, abi, provider, txDefaults);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return ERC721TokenContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
): Promise<ERC721TokenContract> {
|
): Promise<ERC721TokenContract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -1027,7 +1033,12 @@ export class ERC721TokenContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`ERC721Token successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`ERC721Token successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new ERC721TokenContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new ERC721TokenContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -1363,8 +1374,13 @@ export class ERC721TokenContract extends BaseContract {
|
|||||||
);
|
);
|
||||||
return logs;
|
return logs;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('ERC721Token', ERC721TokenContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super('ERC721Token', ERC721TokenContract.ABI(), address, supportedProvider, txDefaults, logDecodeDependencies);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<ERC721TokenEventArgs, ERC721TokenEvents>(
|
this._subscriptionManager = new SubscriptionManager<ERC721TokenEventArgs, ERC721TokenEvents>(
|
||||||
ERC721TokenContract.ABI(),
|
ERC721TokenContract.ABI(),
|
||||||
|
@@ -75,6 +75,7 @@ export class EthBalanceCheckerContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
): Promise<EthBalanceCheckerContract> {
|
): Promise<EthBalanceCheckerContract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@@ -87,13 +88,18 @@ export class EthBalanceCheckerContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return EthBalanceCheckerContract.deployAsync(bytecode, abi, provider, txDefaults);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return EthBalanceCheckerContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
): Promise<EthBalanceCheckerContract> {
|
): Promise<EthBalanceCheckerContract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -121,6 +127,7 @@ export class EthBalanceCheckerContract extends BaseContract {
|
|||||||
txReceipt.contractAddress as string,
|
txReceipt.contractAddress as string,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
);
|
);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
@@ -153,8 +160,20 @@ export class EthBalanceCheckerContract extends BaseContract {
|
|||||||
] as ContractAbi;
|
] as ContractAbi;
|
||||||
return abi;
|
return abi;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('EthBalanceChecker', EthBalanceCheckerContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super(
|
||||||
|
'EthBalanceChecker',
|
||||||
|
EthBalanceCheckerContract.ABI(),
|
||||||
|
address,
|
||||||
|
supportedProvider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4568,6 +4568,7 @@ export class ExchangeContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
_zrxAssetData: string,
|
_zrxAssetData: string,
|
||||||
): Promise<ExchangeContract> {
|
): Promise<ExchangeContract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -4581,13 +4582,25 @@ export class ExchangeContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return ExchangeContract.deployAsync(bytecode, abi, provider, txDefaults, _zrxAssetData);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return ExchangeContract.deployAsync(
|
||||||
|
bytecode,
|
||||||
|
abi,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependenciesAbiOnly,
|
||||||
|
_zrxAssetData,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
_zrxAssetData: string,
|
_zrxAssetData: string,
|
||||||
): Promise<ExchangeContract> {
|
): Promise<ExchangeContract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
@@ -4616,7 +4629,12 @@ export class ExchangeContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`Exchange successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`Exchange successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new ExchangeContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new ExchangeContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [_zrxAssetData];
|
contractInstance.constructorArgs = [_zrxAssetData];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -6668,8 +6686,13 @@ export class ExchangeContract extends BaseContract {
|
|||||||
);
|
);
|
||||||
return logs;
|
return logs;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('Exchange', ExchangeContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super('Exchange', ExchangeContract.ABI(), address, supportedProvider, txDefaults, logDecodeDependencies);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<ExchangeEventArgs, ExchangeEvents>(
|
this._subscriptionManager = new SubscriptionManager<ExchangeEventArgs, ExchangeEvents>(
|
||||||
ExchangeContract.ABI(),
|
ExchangeContract.ABI(),
|
||||||
|
@@ -1041,6 +1041,7 @@ export class ForwarderContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
_exchange: string,
|
_exchange: string,
|
||||||
_zrxAssetData: string,
|
_zrxAssetData: string,
|
||||||
_wethAssetData: string,
|
_wethAssetData: string,
|
||||||
@@ -1056,11 +1057,16 @@ export class ForwarderContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
return ForwarderContract.deployAsync(
|
return ForwarderContract.deployAsync(
|
||||||
bytecode,
|
bytecode,
|
||||||
abi,
|
abi,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
logDecodeDependenciesAbiOnly,
|
||||||
_exchange,
|
_exchange,
|
||||||
_zrxAssetData,
|
_zrxAssetData,
|
||||||
_wethAssetData,
|
_wethAssetData,
|
||||||
@@ -1071,6 +1077,7 @@ export class ForwarderContract extends BaseContract {
|
|||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
_exchange: string,
|
_exchange: string,
|
||||||
_zrxAssetData: string,
|
_zrxAssetData: string,
|
||||||
_wethAssetData: string,
|
_wethAssetData: string,
|
||||||
@@ -1101,7 +1108,12 @@ export class ForwarderContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`Forwarder successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`Forwarder successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new ForwarderContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new ForwarderContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [_exchange, _zrxAssetData, _wethAssetData];
|
contractInstance.constructorArgs = [_exchange, _zrxAssetData, _wethAssetData];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -1549,8 +1561,13 @@ export class ForwarderContract extends BaseContract {
|
|||||||
] as ContractAbi;
|
] as ContractAbi;
|
||||||
return abi;
|
return abi;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('Forwarder', ForwarderContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super('Forwarder', ForwarderContract.ABI(), address, supportedProvider, txDefaults, logDecodeDependencies);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -709,6 +709,7 @@ export class IAssetProxyContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
): Promise<IAssetProxyContract> {
|
): Promise<IAssetProxyContract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@@ -721,13 +722,18 @@ export class IAssetProxyContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return IAssetProxyContract.deployAsync(bytecode, abi, provider, txDefaults);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return IAssetProxyContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
): Promise<IAssetProxyContract> {
|
): Promise<IAssetProxyContract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -751,7 +757,12 @@ export class IAssetProxyContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`IAssetProxy successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`IAssetProxy successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new IAssetProxyContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new IAssetProxyContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -878,8 +889,13 @@ export class IAssetProxyContract extends BaseContract {
|
|||||||
] as ContractAbi;
|
] as ContractAbi;
|
||||||
return abi;
|
return abi;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('IAssetProxy', IAssetProxyContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super('IAssetProxy', IAssetProxyContract.ABI(), address, supportedProvider, txDefaults, logDecodeDependencies);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -89,6 +89,7 @@ export class IValidatorContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
): Promise<IValidatorContract> {
|
): Promise<IValidatorContract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@@ -101,13 +102,18 @@ export class IValidatorContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return IValidatorContract.deployAsync(bytecode, abi, provider, txDefaults);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return IValidatorContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
): Promise<IValidatorContract> {
|
): Promise<IValidatorContract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -131,7 +137,12 @@ export class IValidatorContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`IValidator successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`IValidator successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new IValidatorContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new IValidatorContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -171,8 +182,13 @@ export class IValidatorContract extends BaseContract {
|
|||||||
] as ContractAbi;
|
] as ContractAbi;
|
||||||
return abi;
|
return abi;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('IValidator', IValidatorContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super('IValidator', IValidatorContract.ABI(), address, supportedProvider, txDefaults, logDecodeDependencies);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -81,6 +81,7 @@ export class IWalletContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
): Promise<IWalletContract> {
|
): Promise<IWalletContract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@@ -93,13 +94,18 @@ export class IWalletContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return IWalletContract.deployAsync(bytecode, abi, provider, txDefaults);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return IWalletContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
): Promise<IWalletContract> {
|
): Promise<IWalletContract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -123,7 +129,12 @@ export class IWalletContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`IWallet successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`IWallet successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new IWalletContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new IWalletContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -159,8 +170,13 @@ export class IWalletContract extends BaseContract {
|
|||||||
] as ContractAbi;
|
] as ContractAbi;
|
||||||
return abi;
|
return abi;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('IWallet', IWalletContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super('IWallet', IWalletContract.ABI(), address, supportedProvider, txDefaults, logDecodeDependencies);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -901,6 +901,7 @@ export class MultiAssetProxyContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
): Promise<MultiAssetProxyContract> {
|
): Promise<MultiAssetProxyContract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@@ -913,13 +914,18 @@ export class MultiAssetProxyContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return MultiAssetProxyContract.deployAsync(bytecode, abi, provider, txDefaults);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return MultiAssetProxyContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
): Promise<MultiAssetProxyContract> {
|
): Promise<MultiAssetProxyContract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -943,7 +949,12 @@ export class MultiAssetProxyContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`MultiAssetProxy successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`MultiAssetProxy successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new MultiAssetProxyContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new MultiAssetProxyContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -1277,8 +1288,20 @@ export class MultiAssetProxyContract extends BaseContract {
|
|||||||
);
|
);
|
||||||
return logs;
|
return logs;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('MultiAssetProxy', MultiAssetProxyContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super(
|
||||||
|
'MultiAssetProxy',
|
||||||
|
MultiAssetProxyContract.ABI(),
|
||||||
|
address,
|
||||||
|
supportedProvider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<MultiAssetProxyEventArgs, MultiAssetProxyEvents>(
|
this._subscriptionManager = new SubscriptionManager<MultiAssetProxyEventArgs, MultiAssetProxyEvents>(
|
||||||
MultiAssetProxyContract.ABI(),
|
MultiAssetProxyContract.ABI(),
|
||||||
|
@@ -618,6 +618,7 @@ export class OrderValidatorContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
_exchange: string,
|
_exchange: string,
|
||||||
_zrxAssetData: string,
|
_zrxAssetData: string,
|
||||||
): Promise<OrderValidatorContract> {
|
): Promise<OrderValidatorContract> {
|
||||||
@@ -632,13 +633,26 @@ export class OrderValidatorContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return OrderValidatorContract.deployAsync(bytecode, abi, provider, txDefaults, _exchange, _zrxAssetData);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return OrderValidatorContract.deployAsync(
|
||||||
|
bytecode,
|
||||||
|
abi,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependenciesAbiOnly,
|
||||||
|
_exchange,
|
||||||
|
_zrxAssetData,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
_exchange: string,
|
_exchange: string,
|
||||||
_zrxAssetData: string,
|
_zrxAssetData: string,
|
||||||
): Promise<OrderValidatorContract> {
|
): Promise<OrderValidatorContract> {
|
||||||
@@ -668,7 +682,12 @@ export class OrderValidatorContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`OrderValidator successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`OrderValidator successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new OrderValidatorContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new OrderValidatorContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [_exchange, _zrxAssetData];
|
contractInstance.constructorArgs = [_exchange, _zrxAssetData];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -1238,8 +1257,20 @@ export class OrderValidatorContract extends BaseContract {
|
|||||||
] as ContractAbi;
|
] as ContractAbi;
|
||||||
return abi;
|
return abi;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('OrderValidator', OrderValidatorContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super(
|
||||||
|
'OrderValidator',
|
||||||
|
OrderValidatorContract.ABI(),
|
||||||
|
address,
|
||||||
|
supportedProvider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -897,6 +897,7 @@ export class WETH9Contract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
): Promise<WETH9Contract> {
|
): Promise<WETH9Contract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@@ -909,13 +910,18 @@ export class WETH9Contract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return WETH9Contract.deployAsync(bytecode, abi, provider, txDefaults);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return WETH9Contract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
): Promise<WETH9Contract> {
|
): Promise<WETH9Contract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -939,7 +945,12 @@ export class WETH9Contract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`WETH9 successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`WETH9 successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new WETH9Contract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new WETH9Contract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -1303,8 +1314,13 @@ export class WETH9Contract extends BaseContract {
|
|||||||
);
|
);
|
||||||
return logs;
|
return logs;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('WETH9', WETH9Contract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super('WETH9', WETH9Contract.ABI(), address, supportedProvider, txDefaults, logDecodeDependencies);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<WETH9EventArgs, WETH9Events>(
|
this._subscriptionManager = new SubscriptionManager<WETH9EventArgs, WETH9Events>(
|
||||||
WETH9Contract.ABI(),
|
WETH9Contract.ABI(),
|
||||||
|
@@ -706,6 +706,7 @@ export class ZRXTokenContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
): Promise<ZRXTokenContract> {
|
): Promise<ZRXTokenContract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@@ -718,13 +719,18 @@ export class ZRXTokenContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return ZRXTokenContract.deployAsync(bytecode, abi, provider, txDefaults);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return ZRXTokenContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
): Promise<ZRXTokenContract> {
|
): Promise<ZRXTokenContract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -748,7 +754,12 @@ export class ZRXTokenContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`ZRXToken successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`ZRXToken successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new ZRXTokenContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new ZRXTokenContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -1043,8 +1054,13 @@ export class ZRXTokenContract extends BaseContract {
|
|||||||
);
|
);
|
||||||
return logs;
|
return logs;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('ZRXToken', ZRXTokenContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super('ZRXToken', ZRXTokenContract.ABI(), address, supportedProvider, txDefaults, logDecodeDependencies);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<ZRXTokenEventArgs, ZRXTokenEvents>(
|
this._subscriptionManager = new SubscriptionManager<ZRXTokenEventArgs, ZRXTokenEvents>(
|
||||||
ZRXTokenContract.ABI(),
|
ZRXTokenContract.ABI(),
|
||||||
|
@@ -1022,6 +1022,7 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
): Promise<AbiGenDummyContract> {
|
): Promise<AbiGenDummyContract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@@ -1034,13 +1035,18 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return AbiGenDummyContract.deployAsync(bytecode, abi, provider, txDefaults);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return AbiGenDummyContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
): Promise<AbiGenDummyContract> {
|
): Promise<AbiGenDummyContract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -1064,7 +1070,12 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`AbiGenDummy successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`AbiGenDummy successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new AbiGenDummyContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new AbiGenDummyContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -1538,8 +1549,13 @@ export class AbiGenDummyContract extends BaseContract {
|
|||||||
);
|
);
|
||||||
return logs;
|
return logs;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('AbiGenDummy', AbiGenDummyContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super('AbiGenDummy', AbiGenDummyContract.ABI(), address, supportedProvider, txDefaults, logDecodeDependencies);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
this._subscriptionManager = new SubscriptionManager<AbiGenDummyEventArgs, AbiGenDummyEvents>(
|
this._subscriptionManager = new SubscriptionManager<AbiGenDummyEventArgs, AbiGenDummyEvents>(
|
||||||
AbiGenDummyContract.ABI(),
|
AbiGenDummyContract.ABI(),
|
||||||
|
@@ -31,6 +31,7 @@ export class LibDummyContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
): Promise<LibDummyContract> {
|
): Promise<LibDummyContract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@@ -43,13 +44,18 @@ export class LibDummyContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return LibDummyContract.deployAsync(bytecode, abi, provider, txDefaults);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return LibDummyContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
): Promise<LibDummyContract> {
|
): Promise<LibDummyContract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -73,7 +79,12 @@ export class LibDummyContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`LibDummy successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`LibDummy successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new LibDummyContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new LibDummyContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -85,8 +96,13 @@ export class LibDummyContract extends BaseContract {
|
|||||||
const abi = [] as ContractAbi;
|
const abi = [] as ContractAbi;
|
||||||
return abi;
|
return abi;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('LibDummy', LibDummyContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super('LibDummy', LibDummyContract.ABI(), address, supportedProvider, txDefaults, logDecodeDependencies);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -111,6 +111,7 @@ export class TestLibDummyContract extends BaseContract {
|
|||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
artifact: ContractArtifact | SimpleContractArtifact,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||||
): Promise<TestLibDummyContract> {
|
): Promise<TestLibDummyContract> {
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@@ -123,13 +124,18 @@ export class TestLibDummyContract extends BaseContract {
|
|||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||||
const abi = artifact.compilerOutput.abi;
|
const abi = artifact.compilerOutput.abi;
|
||||||
return TestLibDummyContract.deployAsync(bytecode, abi, provider, txDefaults);
|
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
||||||
|
for (const key of Object.keys(logDecodeDependencies)) {
|
||||||
|
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||||
|
}
|
||||||
|
return TestLibDummyContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
txDefaults: Partial<TxData>,
|
txDefaults: Partial<TxData>,
|
||||||
|
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||||
): Promise<TestLibDummyContract> {
|
): Promise<TestLibDummyContract> {
|
||||||
assert.isHexString('bytecode', bytecode);
|
assert.isHexString('bytecode', bytecode);
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||||
@@ -153,7 +159,12 @@ export class TestLibDummyContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`TestLibDummy successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`TestLibDummy successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new TestLibDummyContract(txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new TestLibDummyContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
@@ -204,8 +215,20 @@ export class TestLibDummyContract extends BaseContract {
|
|||||||
] as ContractAbi;
|
] as ContractAbi;
|
||||||
return abi;
|
return abi;
|
||||||
}
|
}
|
||||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
constructor(
|
||||||
super('TestLibDummy', TestLibDummyContract.ABI(), address, supportedProvider, txDefaults);
|
address: string,
|
||||||
|
supportedProvider: SupportedProvider,
|
||||||
|
txDefaults?: Partial<TxData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
|
) {
|
||||||
|
super(
|
||||||
|
'TestLibDummy',
|
||||||
|
TestLibDummyContract.ABI(),
|
||||||
|
address,
|
||||||
|
supportedProvider,
|
||||||
|
txDefaults,
|
||||||
|
logDecodeDependencies,
|
||||||
|
);
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,12 @@ describe('AbiGenDummy Contract', () => {
|
|||||||
let abiGenDummy: AbiGenDummyContract;
|
let abiGenDummy: AbiGenDummyContract;
|
||||||
before(async () => {
|
before(async () => {
|
||||||
providerUtils.startProviderEngine(provider);
|
providerUtils.startProviderEngine(provider);
|
||||||
abiGenDummy = await AbiGenDummyContract.deployFrom0xArtifactAsync(artifacts.AbiGenDummy, provider, txDefaults);
|
abiGenDummy = await AbiGenDummyContract.deployFrom0xArtifactAsync(
|
||||||
|
artifacts.AbiGenDummy,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
|
);
|
||||||
await blockchainLifecycle.startAsync();
|
await blockchainLifecycle.startAsync();
|
||||||
});
|
});
|
||||||
after(async () => {
|
after(async () => {
|
||||||
@@ -146,7 +151,12 @@ describe('Lib dummy contract', () => {
|
|||||||
await blockchainLifecycle.revertAsync();
|
await blockchainLifecycle.revertAsync();
|
||||||
});
|
});
|
||||||
before(async () => {
|
before(async () => {
|
||||||
libDummy = await TestLibDummyContract.deployFrom0xArtifactAsync(artifacts.TestLibDummy, provider, txDefaults);
|
libDummy = await TestLibDummyContract.deployFrom0xArtifactAsync(
|
||||||
|
artifacts.TestLibDummy,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await blockchainLifecycle.startAsync();
|
await blockchainLifecycle.startAsync();
|
||||||
|
@@ -1,4 +1,17 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "5.3.0",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated interface to `deployFrom0xArtifactAsync` to include log decode dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Updated interface to `deployAsync` to include log decode dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "5.2.0",
|
"version": "5.2.0",
|
||||||
"changes": [
|
"changes": [
|
||||||
|
@@ -180,12 +180,20 @@ export class BaseContract {
|
|||||||
const abiEncodedArguments = abiEncoder.encode(functionArguments);
|
const abiEncodedArguments = abiEncoder.encode(functionArguments);
|
||||||
return abiEncodedArguments;
|
return abiEncodedArguments;
|
||||||
}
|
}
|
||||||
|
/// @dev Constructs a contract wrapper.
|
||||||
|
/// @param contractName Name of contract.
|
||||||
|
/// @param abi of the contract.
|
||||||
|
/// @param address of the deployed contract.
|
||||||
|
/// @param supportedProvider for communicating with an ethereum node.
|
||||||
|
/// @param logDecodeDependencies the name and ABI of contracts whose event logs are
|
||||||
|
/// decoded by this wrapper.
|
||||||
constructor(
|
constructor(
|
||||||
contractName: string,
|
contractName: string,
|
||||||
abi: ContractAbi,
|
abi: ContractAbi,
|
||||||
address: string,
|
address: string,
|
||||||
supportedProvider: SupportedProvider,
|
supportedProvider: SupportedProvider,
|
||||||
callAndTxnDefaults?: Partial<CallData>,
|
callAndTxnDefaults?: Partial<CallData>,
|
||||||
|
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
||||||
) {
|
) {
|
||||||
assert.isString('contractName', contractName);
|
assert.isString('contractName', contractName);
|
||||||
assert.isETHAddressHex('address', address);
|
assert.isETHAddressHex('address', address);
|
||||||
@@ -209,6 +217,10 @@ export class BaseContract {
|
|||||||
const abiEncoder = new AbiEncoder.Method(methodAbi);
|
const abiEncoder = new AbiEncoder.Method(methodAbi);
|
||||||
const functionSignature = abiEncoder.getSignature();
|
const functionSignature = abiEncoder.getSignature();
|
||||||
this._abiEncoderByFunctionSignature[functionSignature] = abiEncoder;
|
this._abiEncoderByFunctionSignature[functionSignature] = abiEncoder;
|
||||||
|
this._web3Wrapper.abiDecoder.addABI(abi, contractName);
|
||||||
|
});
|
||||||
|
_.each(logDecodeDependencies, (dependencyAbi, dependencyName) => {
|
||||||
|
this._web3Wrapper.abiDecoder.addABI(dependencyAbi, dependencyName);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,17 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "10.1.0",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated interface to `deployFrom0xArtifactAsync` to include log decode dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Updated interface to `deployAsync` to include log decode dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "10.0.0",
|
"version": "10.0.0",
|
||||||
"changes": [
|
"changes": [
|
||||||
|
@@ -351,10 +351,12 @@ describe('ExchangeWrapper', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('should throw when the ERC20 token has transfer restrictions', async () => {
|
it('should throw when the ERC20 token has transfer restrictions', async () => {
|
||||||
|
const artifactDependencies = {};
|
||||||
const untransferrableToken = await DummyERC20TokenContract.deployFrom0xArtifactAsync(
|
const untransferrableToken = await DummyERC20TokenContract.deployFrom0xArtifactAsync(
|
||||||
UntransferrableDummyERC20Token,
|
UntransferrableDummyERC20Token,
|
||||||
provider,
|
provider,
|
||||||
{ from: userAddresses[0] },
|
{ from: userAddresses[0] },
|
||||||
|
artifactDependencies,
|
||||||
'UntransferrableToken',
|
'UntransferrableToken',
|
||||||
'UTT',
|
'UTT',
|
||||||
new BigNumber(constants.ZRX_DECIMALS),
|
new BigNumber(constants.ZRX_DECIMALS),
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "4.1.11",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deploy0xArtifactAsync to include log decode dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"timestamp": 1563957393,
|
"timestamp": 1563957393,
|
||||||
"version": "4.1.10",
|
"version": "4.1.10",
|
||||||
|
@@ -29,11 +29,13 @@ export async function runMigrationsAsync(
|
|||||||
artifacts.ERC20Proxy,
|
artifacts.ERC20Proxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
const erc721Proxy = await wrappers.ERC721ProxyContract.deployFrom0xArtifactAsync(
|
const erc721Proxy = await wrappers.ERC721ProxyContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.ERC721Proxy,
|
artifacts.ERC721Proxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
// ZRX
|
// ZRX
|
||||||
@@ -41,10 +43,16 @@ export async function runMigrationsAsync(
|
|||||||
artifacts.ZRXToken,
|
artifacts.ZRXToken,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Ether token
|
// Ether token
|
||||||
const etherToken = await wrappers.WETH9Contract.deployFrom0xArtifactAsync(artifacts.WETH9, provider, txDefaults);
|
const etherToken = await wrappers.WETH9Contract.deployFrom0xArtifactAsync(
|
||||||
|
artifacts.WETH9,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
|
);
|
||||||
|
|
||||||
// Exchange
|
// Exchange
|
||||||
const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address);
|
const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address);
|
||||||
@@ -52,6 +60,7 @@ export async function runMigrationsAsync(
|
|||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -63,6 +72,7 @@ export async function runMigrationsAsync(
|
|||||||
artifacts.DummyERC20Token,
|
artifacts.DummyERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
token.name,
|
token.name,
|
||||||
token.symbol,
|
token.symbol,
|
||||||
token.decimals,
|
token.decimals,
|
||||||
@@ -76,6 +86,7 @@ export async function runMigrationsAsync(
|
|||||||
artifacts.DummyERC721Token,
|
artifacts.DummyERC721Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
erc721TokenInfo[0].name,
|
erc721TokenInfo[0].name,
|
||||||
erc721TokenInfo[0].symbol,
|
erc721TokenInfo[0].symbol,
|
||||||
);
|
);
|
||||||
@@ -84,6 +95,7 @@ export async function runMigrationsAsync(
|
|||||||
artifacts.MultiAssetProxy,
|
artifacts.MultiAssetProxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||||
@@ -126,6 +138,7 @@ export async function runMigrationsAsync(
|
|||||||
artifacts.Forwarder,
|
artifacts.Forwarder,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
assetDataUtils.encodeERC20AssetData(zrxToken.address),
|
||||||
assetDataUtils.encodeERC20AssetData(etherToken.address),
|
assetDataUtils.encodeERC20AssetData(etherToken.address),
|
||||||
@@ -136,6 +149,7 @@ export async function runMigrationsAsync(
|
|||||||
artifacts.OrderValidator,
|
artifacts.OrderValidator,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
);
|
);
|
||||||
@@ -145,6 +159,7 @@ export async function runMigrationsAsync(
|
|||||||
artifacts.DutchAuction,
|
artifacts.DutchAuction,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -159,6 +174,7 @@ export async function runMigrationsAsync(
|
|||||||
artifacts.AssetProxyOwner,
|
artifacts.AssetProxyOwner,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
owners,
|
owners,
|
||||||
[erc20Proxy.address, erc721Proxy.address, multiAssetProxy.address],
|
[erc20Proxy.address, erc721Proxy.address, multiAssetProxy.address],
|
||||||
confirmationsRequired,
|
confirmationsRequired,
|
||||||
@@ -188,6 +204,7 @@ export async function runMigrationsAsync(
|
|||||||
artifacts.CoordinatorRegistry,
|
artifacts.CoordinatorRegistry,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Coordinator
|
// Coordinator
|
||||||
@@ -195,6 +212,7 @@ export async function runMigrationsAsync(
|
|||||||
artifacts.Coordinator,
|
artifacts.Coordinator,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "8.2.4",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated calls to <contract wrapper>.deploy0xArtifactAsync to include log decode dependencies.",
|
||||||
|
"pr": 1995
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "8.2.3",
|
"version": "8.2.3",
|
||||||
"changes": [
|
"changes": [
|
||||||
|
@@ -46,6 +46,7 @@ describe('ExchangeTransferSimulator', async () => {
|
|||||||
artifacts.ERC20Proxy,
|
artifacts.ERC20Proxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
);
|
);
|
||||||
erc20ProxyAddress = erc20Proxy.address;
|
erc20ProxyAddress = erc20Proxy.address;
|
||||||
|
|
||||||
@@ -58,6 +59,7 @@ describe('ExchangeTransferSimulator', async () => {
|
|||||||
artifacts.DummyERC20Token,
|
artifacts.DummyERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
|
artifacts,
|
||||||
name,
|
name,
|
||||||
symbol,
|
symbol,
|
||||||
decimals,
|
decimals,
|
||||||
|
Reference in New Issue
Block a user