[Multilang] hardcode ABI into abi-gen-wrappers (#1883)
* Export artifacts and addresses from abi-gen-wrappers * only export addresses, not artifacts * abi-gen-wrappers no longer accept ContractAbi as constructor param ABI is now hardcoded when wrapper is generated * remove unused imports * remove unused import * changes after review * fix method ordering * update constructor args * prettier * statically enumerate ABI properties * remove abi-gen-wrappers generated-wrappers from prettierignore * add template for recursive components * add `indexed` field for EventParameter * prettier * update known-good wrappers with ABIs and fix Python ABI loading * remove generated-artifacts and update gitignore
This commit is contained in:
parent
d9378e9a8f
commit
048f5c2771
4
.gitignore
vendored
4
.gitignore
vendored
@ -95,8 +95,8 @@ contracts/erc1155/generated-artifacts/
|
|||||||
contracts/extensions/generated-artifacts/
|
contracts/extensions/generated-artifacts/
|
||||||
contracts/exchange-forwarder/generated-artifacts/
|
contracts/exchange-forwarder/generated-artifacts/
|
||||||
contracts/dev-utils/generated-artifacts/
|
contracts/dev-utils/generated-artifacts/
|
||||||
/packages/abi-gen/test/generated-test/generated-artifacts
|
packages/abi-gen/test/generated-test/generated-artifacts
|
||||||
/packages/abi-gen/test/generated-test/output
|
packages/abi-gen/test/generated-test/output
|
||||||
packages/sol-tracing-utils/test/fixtures/artifacts/
|
packages/sol-tracing-utils/test/fixtures/artifacts/
|
||||||
packages/metacoin/artifacts/
|
packages/metacoin/artifacts/
|
||||||
python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/
|
python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/
|
||||||
|
@ -44,16 +44,8 @@ import {
|
|||||||
chaiSetup.configure();
|
chaiSetup.configure();
|
||||||
const expect = chai.expect;
|
const expect = chai.expect;
|
||||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||||
const assetProxyInterface = new IAssetProxyContract(
|
const assetProxyInterface = new IAssetProxyContract(constants.NULL_ADDRESS, provider);
|
||||||
artifacts.IAssetProxy.compilerOutput.abi,
|
const assetDataInterface = new IAssetDataContract(constants.NULL_ADDRESS, provider);
|
||||||
constants.NULL_ADDRESS,
|
|
||||||
provider,
|
|
||||||
);
|
|
||||||
const assetDataInterface = new IAssetDataContract(
|
|
||||||
artifacts.IAssetData.compilerOutput.abi,
|
|
||||||
constants.NULL_ADDRESS,
|
|
||||||
provider,
|
|
||||||
);
|
|
||||||
|
|
||||||
// tslint:disable:no-unnecessary-type-assertion
|
// tslint:disable:no-unnecessary-type-assertion
|
||||||
describe('Asset Transfer Proxies', () => {
|
describe('Asset Transfer Proxies', () => {
|
||||||
|
@ -42,12 +42,7 @@ describe('StaticCallProxy', () => {
|
|||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
);
|
);
|
||||||
staticCallProxy = new IAssetProxyContract(
|
staticCallProxy = new IAssetProxyContract(staticCallProxyWithoutTransferFrom.address, provider, txDefaults);
|
||||||
artifacts.IAssetProxy.compilerOutput.abi,
|
|
||||||
staticCallProxyWithoutTransferFrom.address,
|
|
||||||
provider,
|
|
||||||
txDefaults,
|
|
||||||
);
|
|
||||||
staticCallTarget = await TestStaticCallTargetContract.deployFrom0xArtifactAsync(
|
staticCallTarget = await TestStaticCallTargetContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.TestStaticCallTarget,
|
artifacts.TestStaticCallTarget,
|
||||||
provider,
|
provider,
|
||||||
|
@ -36,11 +36,7 @@ export class ERC1155ProxyWrapper {
|
|||||||
const allArtifacts = _.merge(artifacts, erc1155Artifacts);
|
const allArtifacts = _.merge(artifacts, erc1155Artifacts);
|
||||||
this._logDecoder = new LogDecoder(this._web3Wrapper, allArtifacts);
|
this._logDecoder = new LogDecoder(this._web3Wrapper, allArtifacts);
|
||||||
this._dummyTokenWrappers = [];
|
this._dummyTokenWrappers = [];
|
||||||
this._assetProxyInterface = new IAssetProxyContract(
|
this._assetProxyInterface = new IAssetProxyContract(constants.NULL_ADDRESS, provider);
|
||||||
artifacts.IAssetProxy.compilerOutput.abi,
|
|
||||||
constants.NULL_ADDRESS,
|
|
||||||
provider,
|
|
||||||
);
|
|
||||||
this._tokenOwnerAddresses = tokenOwnerAddresses;
|
this._tokenOwnerAddresses = tokenOwnerAddresses;
|
||||||
this._contractOwnerAddress = contractOwnerAddress;
|
this._contractOwnerAddress = contractOwnerAddress;
|
||||||
this._fungibleTokenIds = [];
|
this._fungibleTokenIds = [];
|
||||||
|
@ -71,7 +71,7 @@
|
|||||||
"@0x/base-contract": "^5.1.0",
|
"@0x/base-contract": "^5.1.0",
|
||||||
"@0x/contracts-asset-proxy": "^2.1.5",
|
"@0x/contracts-asset-proxy": "^2.1.5",
|
||||||
"@0x/contracts-erc20": "^2.2.5",
|
"@0x/contracts-erc20": "^2.2.5",
|
||||||
"@0x/contracts-exchange": "1.0.2",
|
"@0x/contracts-exchange": "^2.1.5",
|
||||||
"@0x/contracts-exchange-libs": "^2.1.6",
|
"@0x/contracts-exchange-libs": "^2.1.6",
|
||||||
"@0x/contracts-utils": "^3.1.6",
|
"@0x/contracts-utils": "^3.1.6",
|
||||||
"@0x/order-utils": "^8.1.1",
|
"@0x/order-utils": "^8.1.1",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { artifacts, IExchangeContract } from '@0x/contracts-exchange';
|
import { IExchangeContract } from '@0x/contracts-exchange';
|
||||||
import { constants as devConstants, provider } from '@0x/contracts-test-utils';
|
import { constants as devConstants, provider } from '@0x/contracts-test-utils';
|
||||||
import { SignedOrder } from '@0x/types';
|
import { SignedOrder } from '@0x/types';
|
||||||
|
|
||||||
@ -6,11 +6,7 @@ import { constants } from './index';
|
|||||||
|
|
||||||
export const exchangeDataEncoder = {
|
export const exchangeDataEncoder = {
|
||||||
encodeOrdersToExchangeData(fnName: string, orders: SignedOrder[]): string {
|
encodeOrdersToExchangeData(fnName: string, orders: SignedOrder[]): string {
|
||||||
const exchangeInstance = new IExchangeContract(
|
const exchangeInstance = new IExchangeContract(devConstants.NULL_ADDRESS, provider);
|
||||||
artifacts.IExchange.compilerOutput.abi,
|
|
||||||
devConstants.NULL_ADDRESS,
|
|
||||||
provider,
|
|
||||||
);
|
|
||||||
let data;
|
let data;
|
||||||
if (constants.SINGLE_FILL_FN_NAMES.indexOf(fnName) !== -1) {
|
if (constants.SINGLE_FILL_FN_NAMES.indexOf(fnName) !== -1) {
|
||||||
data = (exchangeInstance as any)[fnName].getABIEncodedTransactionData(
|
data = (exchangeInstance as any)[fnName].getABIEncodedTransactionData(
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { artifacts as exchangeArtifacts, IExchangeContract } from '@0x/contracts-exchange';
|
import { IExchangeContract } from '@0x/contracts-exchange';
|
||||||
import { chaiSetup, constants, provider, txDefaults, web3Wrapper } from '@0x/contracts-test-utils';
|
import { chaiSetup, constants, provider, txDefaults, web3Wrapper } from '@0x/contracts-test-utils';
|
||||||
import { BlockchainLifecycle } from '@0x/dev-utils';
|
import { BlockchainLifecycle } from '@0x/dev-utils';
|
||||||
import { BigNumber } from '@0x/utils';
|
import { BigNumber } from '@0x/utils';
|
||||||
@ -30,12 +30,7 @@ const signature =
|
|||||||
|
|
||||||
describe('LibTransactionDecoder', () => {
|
describe('LibTransactionDecoder', () => {
|
||||||
let libTxDecoder: LibTransactionDecoderContract;
|
let libTxDecoder: LibTransactionDecoderContract;
|
||||||
const exchangeInterface = new IExchangeContract(
|
const exchangeInterface = new IExchangeContract(constants.NULL_ADDRESS, provider, txDefaults);
|
||||||
exchangeArtifacts.Exchange.compilerOutput.abi,
|
|
||||||
constants.NULL_ADDRESS,
|
|
||||||
provider,
|
|
||||||
txDefaults,
|
|
||||||
);
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await blockchainLifecycle.startAsync();
|
await blockchainLifecycle.startAsync();
|
||||||
libTxDecoder = await LibTransactionDecoderContract.deployFrom0xArtifactAsync(
|
libTxDecoder = await LibTransactionDecoderContract.deployFrom0xArtifactAsync(
|
||||||
|
@ -89,7 +89,7 @@ describe(ContractName.Forwarder, () => {
|
|||||||
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);
|
||||||
weth = new DummyERC20TokenContract(wethContract.abi, wethContract.address, provider);
|
weth = new DummyERC20TokenContract(wethContract.address, provider);
|
||||||
erc20Wrapper.addDummyTokenContract(weth);
|
erc20Wrapper.addDummyTokenContract(weth);
|
||||||
|
|
||||||
wethAssetData = assetDataUtils.encodeERC20AssetData(wethContract.address);
|
wethAssetData = assetDataUtils.encodeERC20AssetData(wethContract.address);
|
||||||
@ -135,7 +135,7 @@ describe(ContractName.Forwarder, () => {
|
|||||||
zrxAssetData,
|
zrxAssetData,
|
||||||
wethAssetData,
|
wethAssetData,
|
||||||
);
|
);
|
||||||
forwarderContract = new ForwarderContract(forwarderInstance.abi, forwarderInstance.address, provider);
|
forwarderContract = new ForwarderContract(forwarderInstance.address, provider);
|
||||||
forwarderWrapper = new ForwarderWrapper(forwarderContract, provider);
|
forwarderWrapper = new ForwarderWrapper(forwarderContract, provider);
|
||||||
const zrxDepositAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(10000), 18);
|
const zrxDepositAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(10000), 18);
|
||||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||||
|
@ -109,11 +109,7 @@ describe(ContractName.DutchAuction, () => {
|
|||||||
txDefaults,
|
txDefaults,
|
||||||
exchangeInstance.address,
|
exchangeInstance.address,
|
||||||
);
|
);
|
||||||
dutchAuctionContract = new DutchAuctionContract(
|
dutchAuctionContract = new DutchAuctionContract(dutchAuctionInstance.address, provider);
|
||||||
dutchAuctionInstance.abi,
|
|
||||||
dutchAuctionInstance.address,
|
|
||||||
provider,
|
|
||||||
);
|
|
||||||
dutchAuctionTestWrapper = new DutchAuctionTestWrapper(dutchAuctionInstance, provider);
|
dutchAuctionTestWrapper = new DutchAuctionTestWrapper(dutchAuctionInstance, provider);
|
||||||
|
|
||||||
defaultMakerAssetAddress = erc20TokenA.address;
|
defaultMakerAssetAddress = erc20TokenA.address;
|
||||||
|
@ -53,5 +53,5 @@ class {{contractName}}(BaseContractWrapper):
|
|||||||
def abi():
|
def abi():
|
||||||
"""Return the ABI to the underlying contract."""
|
"""Return the ABI to the underlying contract."""
|
||||||
return json.loads(
|
return json.loads(
|
||||||
'{{{ABI}}}' # noqa: E501 (line-too-long)
|
'{{{ABIString}}}' # noqa: E501 (line-too-long)
|
||||||
)
|
)
|
||||||
|
@ -105,14 +105,46 @@ 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(abi, txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new {{contractName}}Contract(txReceipt.contractAddress as string, provider, txDefaults);
|
||||||
contractInstance.constructorArgs = [{{> params inputs=ctor.inputs}}];
|
contractInstance.constructorArgs = [{{> params inputs=ctor.inputs}}];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
|
||||||
super('{{contractName}}', abi, address, supportedProvider, txDefaults);
|
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
/**
|
||||||
|
* @returns The contract ABI
|
||||||
|
*/
|
||||||
|
public static ABI(): ContractAbi {
|
||||||
|
const abi = [
|
||||||
|
{{#each ABI}}
|
||||||
|
{ {{#if (isDefined this.constant)}}
|
||||||
|
constant: {{constant}},{{/if}}{{#if (isDefined this.anonymous)}}
|
||||||
|
anonymous: {{anonymous}},{{/if}}
|
||||||
|
inputs: [
|
||||||
|
{{#each inputs}}
|
||||||
|
{{> abi_type this}}
|
||||||
|
{{/each}}
|
||||||
|
],{{#this.name}}
|
||||||
|
name: '{{{this}}}',{{/this.name}}
|
||||||
|
outputs: [
|
||||||
|
{{#each outputs}}
|
||||||
|
{{> abi_type this}}
|
||||||
|
{{/each}}
|
||||||
|
],{{#if (isDefined this.payable)}}
|
||||||
|
payable: {{payable}},{{/if}}{{#this.stateMutability}}
|
||||||
|
stateMutability: '{{this}}',{{/this.stateMutability}}
|
||||||
|
type: '{{type}}',
|
||||||
|
},
|
||||||
|
{{/each}}
|
||||||
|
] as ContractAbi;
|
||||||
|
return abi;
|
||||||
}
|
}
|
||||||
} // tslint:disable:max-file-line-count
|
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||||
|
super('{{contractName}}', {{contractName}}Contract.ABI(), address, supportedProvider, txDefaults);
|
||||||
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// tslint:disable:max-file-line-count
|
||||||
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
||||||
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
||||||
|
12
packages/abi-gen-templates/partials/abi_type.handlebars
Normal file
12
packages/abi-gen-templates/partials/abi_type.handlebars
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
name: '{{name}}',
|
||||||
|
type: '{{type}}',
|
||||||
|
{{#if (isDefined indexed)}}indexed: {{indexed}},{{/if}}
|
||||||
|
{{#if components}}
|
||||||
|
components: [
|
||||||
|
{{#each components}}
|
||||||
|
{{> abi_type this}}
|
||||||
|
{{/each}}
|
||||||
|
]
|
||||||
|
{{/if}}
|
||||||
|
},
|
@ -1,7 +1,15 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"version": "4.4.0",
|
"version": "5.0.0",
|
||||||
"changes": [
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Wrappers no longer require passing in the contract ABI at instantiation",
|
||||||
|
"pr": 1883
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Contract addresses now re-exported from @0x/contract-addresses",
|
||||||
|
"pr": 1883
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"note": "Update wrappers to include parameter assertions",
|
"note": "Update wrappers to include parameter assertions",
|
||||||
"pr": 1823
|
"pr": 1823
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
"lint": "tslint --format stylish --project .",
|
"lint": "tslint --format stylish --project .",
|
||||||
"fix": "tslint --fix --format stylish --project .",
|
"fix": "tslint --fix --format stylish --project .",
|
||||||
"pre_build": "yarn generate_contract_wrappers",
|
"pre_build": "yarn generate_contract_wrappers",
|
||||||
|
"prettier": "prettier --write src/**/* --config ../../.prettierrc",
|
||||||
"clean": "shx rm -rf lib src/generated-wrappers",
|
"clean": "shx rm -rf lib src/generated-wrappers",
|
||||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output src/generated-wrappers --backend ethers"
|
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output src/generated-wrappers --backend ethers"
|
||||||
},
|
},
|
||||||
@ -46,6 +47,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/base-contract": "^5.1.0",
|
"@0x/base-contract": "^5.1.0",
|
||||||
|
"@0x/contract-addresses": "^2.3.3",
|
||||||
"@0x/contract-artifacts": "^1.5.1"
|
"@0x/contract-artifacts": "^1.5.1"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -23,8 +23,7 @@ import { assert } from '@0x/assert';
|
|||||||
import * as ethers from 'ethers';
|
import * as ethers from 'ethers';
|
||||||
// tslint:enable:no-unused-variable
|
// tslint:enable:no-unused-variable
|
||||||
|
|
||||||
export type CoordinatorRegistryEventArgs =
|
export type CoordinatorRegistryEventArgs = CoordinatorRegistryCoordinatorEndpointSetEventArgs;
|
||||||
| CoordinatorRegistryCoordinatorEndpointSetEventArgs;
|
|
||||||
|
|
||||||
export enum CoordinatorRegistryEvents {
|
export enum CoordinatorRegistryEvents {
|
||||||
CoordinatorEndpointSet = 'CoordinatorEndpointSet',
|
CoordinatorEndpointSet = 'CoordinatorEndpointSet',
|
||||||
@ -35,34 +34,26 @@ export interface CoordinatorRegistryCoordinatorEndpointSetEventArgs extends Deco
|
|||||||
coordinatorEndpoint: string;
|
coordinatorEndpoint: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
// tslint:disable:no-parameter-reassignment
|
// tslint:disable:no-parameter-reassignment
|
||||||
// tslint:disable-next-line:class-name
|
// tslint:disable-next-line:class-name
|
||||||
export class CoordinatorRegistryContract extends BaseContract {
|
export class CoordinatorRegistryContract extends BaseContract {
|
||||||
public setCoordinatorEndpoint = {
|
public setCoordinatorEndpoint = {
|
||||||
async sendTransactionAsync(
|
async sendTransactionAsync(coordinatorEndpoint: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||||
coordinatorEndpoint: string,
|
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
||||||
txData?: Partial<TxData> | undefined,
|
const self = (this as any) as CoordinatorRegistryContract;
|
||||||
): Promise<string> {
|
const encodedData = self._strictEncodeArguments('setCoordinatorEndpoint(string)', [coordinatorEndpoint]);
|
||||||
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
const self = this as any as CoordinatorRegistryContract;
|
{
|
||||||
const encodedData = self._strictEncodeArguments('setCoordinatorEndpoint(string)', [coordinatorEndpoint
|
to: self.address,
|
||||||
]);
|
...txData,
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
data: encodedData,
|
||||||
{
|
},
|
||||||
to: self.address,
|
self._web3Wrapper.getContractDefaults(),
|
||||||
...txData,
|
self.setCoordinatorEndpoint.estimateGasAsync.bind(self, coordinatorEndpoint),
|
||||||
data: encodedData,
|
);
|
||||||
},
|
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||||
self._web3Wrapper.getContractDefaults(),
|
return txHash;
|
||||||
self.setCoordinatorEndpoint.estimateGasAsync.bind(
|
|
||||||
self,
|
|
||||||
coordinatorEndpoint
|
|
||||||
),
|
|
||||||
);
|
|
||||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
|
||||||
return txHash;
|
|
||||||
},
|
},
|
||||||
awaitTransactionSuccessAsync(
|
awaitTransactionSuccessAsync(
|
||||||
coordinatorEndpoint: string,
|
coordinatorEndpoint: string,
|
||||||
@ -70,47 +61,41 @@ export class CoordinatorRegistryContract extends BaseContract {
|
|||||||
pollingIntervalMs?: number,
|
pollingIntervalMs?: number,
|
||||||
timeoutMs?: number,
|
timeoutMs?: number,
|
||||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||||
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
||||||
const self = this as any as CoordinatorRegistryContract;
|
const self = (this as any) as CoordinatorRegistryContract;
|
||||||
const txHashPromise = self.setCoordinatorEndpoint.sendTransactionAsync(coordinatorEndpoint
|
const txHashPromise = self.setCoordinatorEndpoint.sendTransactionAsync(coordinatorEndpoint, txData);
|
||||||
, txData);
|
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
txHashPromise,
|
||||||
txHashPromise,
|
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
// When the transaction hash resolves, wait for it to be mined.
|
||||||
// When the transaction hash resolves, wait for it to be mined.
|
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
await txHashPromise,
|
||||||
await txHashPromise,
|
pollingIntervalMs,
|
||||||
pollingIntervalMs,
|
timeoutMs,
|
||||||
timeoutMs,
|
);
|
||||||
);
|
})(),
|
||||||
})(),
|
);
|
||||||
);
|
|
||||||
},
|
},
|
||||||
async estimateGasAsync(
|
async estimateGasAsync(coordinatorEndpoint: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||||
coordinatorEndpoint: string,
|
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
||||||
txData?: Partial<TxData> | undefined,
|
const self = (this as any) as CoordinatorRegistryContract;
|
||||||
): Promise<number> {
|
const encodedData = self._strictEncodeArguments('setCoordinatorEndpoint(string)', [coordinatorEndpoint]);
|
||||||
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
const self = this as any as CoordinatorRegistryContract;
|
{
|
||||||
const encodedData = self._strictEncodeArguments('setCoordinatorEndpoint(string)', [coordinatorEndpoint
|
to: self.address,
|
||||||
]);
|
...txData,
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
data: encodedData,
|
||||||
{
|
},
|
||||||
to: self.address,
|
self._web3Wrapper.getContractDefaults(),
|
||||||
...txData,
|
);
|
||||||
data: encodedData,
|
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||||
},
|
return gas;
|
||||||
self._web3Wrapper.getContractDefaults(),
|
|
||||||
);
|
|
||||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
|
||||||
return gas;
|
|
||||||
},
|
},
|
||||||
async callAsync(
|
async callAsync(
|
||||||
coordinatorEndpoint: string,
|
coordinatorEndpoint: string,
|
||||||
callData: Partial<CallData> = {},
|
callData: Partial<CallData> = {},
|
||||||
defaultBlock?: BlockParam,
|
defaultBlock?: BlockParam,
|
||||||
): Promise<void
|
): Promise<void> {
|
||||||
> {
|
|
||||||
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@ -120,9 +105,8 @@ export class CoordinatorRegistryContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as CoordinatorRegistryContract;
|
const self = (this as any) as CoordinatorRegistryContract;
|
||||||
const encodedData = self._strictEncodeArguments('setCoordinatorEndpoint(string)', [coordinatorEndpoint
|
const encodedData = self._strictEncodeArguments('setCoordinatorEndpoint(string)', [coordinatorEndpoint]);
|
||||||
]);
|
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
to: self.address,
|
to: self.address,
|
||||||
@ -135,18 +119,16 @@ export class CoordinatorRegistryContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('setCoordinatorEndpoint(string)');
|
const abiEncoder = self._lookupAbiEncoder('setCoordinatorEndpoint(string)');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<void
|
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(coordinatorEndpoint: string): string {
|
||||||
coordinatorEndpoint: string,
|
|
||||||
): string {
|
|
||||||
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
||||||
const self = this as any as CoordinatorRegistryContract;
|
const self = (this as any) as CoordinatorRegistryContract;
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('setCoordinatorEndpoint(string)', [coordinatorEndpoint
|
const abiEncodedTransactionData = self._strictEncodeArguments('setCoordinatorEndpoint(string)', [
|
||||||
]);
|
coordinatorEndpoint,
|
||||||
|
]);
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -155,8 +137,7 @@ export class CoordinatorRegistryContract extends BaseContract {
|
|||||||
coordinatorOperator: string,
|
coordinatorOperator: string,
|
||||||
callData: Partial<CallData> = {},
|
callData: Partial<CallData> = {},
|
||||||
defaultBlock?: BlockParam,
|
defaultBlock?: BlockParam,
|
||||||
): Promise<string
|
): Promise<string> {
|
||||||
> {
|
|
||||||
assert.isString('coordinatorOperator', coordinatorOperator);
|
assert.isString('coordinatorOperator', coordinatorOperator);
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@ -166,9 +147,8 @@ export class CoordinatorRegistryContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as CoordinatorRegistryContract;
|
const self = (this as any) as CoordinatorRegistryContract;
|
||||||
const encodedData = self._strictEncodeArguments('getCoordinatorEndpoint(address)', [coordinatorOperator
|
const encodedData = self._strictEncodeArguments('getCoordinatorEndpoint(address)', [coordinatorOperator]);
|
||||||
]);
|
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
to: self.address,
|
to: self.address,
|
||||||
@ -181,18 +161,16 @@ export class CoordinatorRegistryContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('getCoordinatorEndpoint(address)');
|
const abiEncoder = self._lookupAbiEncoder('getCoordinatorEndpoint(address)');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<string
|
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(coordinatorOperator: string): string {
|
||||||
coordinatorOperator: string,
|
|
||||||
): string {
|
|
||||||
assert.isString('coordinatorOperator', coordinatorOperator);
|
assert.isString('coordinatorOperator', coordinatorOperator);
|
||||||
const self = this as any as CoordinatorRegistryContract;
|
const self = (this as any) as CoordinatorRegistryContract;
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('getCoordinatorEndpoint(address)', [coordinatorOperator
|
const abiEncodedTransactionData = self._strictEncodeArguments('getCoordinatorEndpoint(address)', [
|
||||||
]);
|
coordinatorOperator,
|
||||||
|
]);
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -212,7 +190,7 @@ 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, );
|
return CoordinatorRegistryContract.deployAsync(bytecode, abi, provider, txDefaults);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
@ -228,17 +206,13 @@ export class CoordinatorRegistryContract extends BaseContract {
|
|||||||
]);
|
]);
|
||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||||
[] = BaseContract._formatABIDataItemList(
|
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||||
constructorAbi.inputs,
|
|
||||||
[],
|
|
||||||
BaseContract._bigNumberToString,
|
|
||||||
);
|
|
||||||
const iface = new ethers.utils.Interface(abi);
|
const iface = new ethers.utils.Interface(abi);
|
||||||
const deployInfo = iface.deployFunction;
|
const deployInfo = iface.deployFunction;
|
||||||
const txData = deployInfo.encode(bytecode, []);
|
const txData = deployInfo.encode(bytecode, []);
|
||||||
const web3Wrapper = new Web3Wrapper(provider);
|
const web3Wrapper = new Web3Wrapper(provider);
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{data: txData},
|
{ data: txData },
|
||||||
txDefaults,
|
txDefaults,
|
||||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||||
);
|
);
|
||||||
@ -246,14 +220,85 @@ export class CoordinatorRegistryContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`CoordinatorRegistry successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`CoordinatorRegistry successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new CoordinatorRegistryContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new CoordinatorRegistryContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
|
||||||
super('CoordinatorRegistry', abi, address, supportedProvider, txDefaults);
|
/**
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
* @returns The contract ABI
|
||||||
|
*/
|
||||||
|
public static ABI(): ContractAbi {
|
||||||
|
const abi = [
|
||||||
|
{
|
||||||
|
constant: false,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: 'coordinatorEndpoint',
|
||||||
|
type: 'string',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'setCoordinatorEndpoint',
|
||||||
|
outputs: [],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'nonpayable',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
constant: true,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: 'coordinatorOperator',
|
||||||
|
type: 'address',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'getCoordinatorEndpoint',
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
name: 'coordinatorEndpoint',
|
||||||
|
type: 'string',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'view',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
inputs: [],
|
||||||
|
outputs: [],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'nonpayable',
|
||||||
|
type: 'constructor',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
anonymous: false,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: 'coordinatorOperator',
|
||||||
|
type: 'address',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'coordinatorEndpoint',
|
||||||
|
type: 'string',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'CoordinatorEndpointSet',
|
||||||
|
outputs: [],
|
||||||
|
type: 'event',
|
||||||
|
},
|
||||||
|
] as ContractAbi;
|
||||||
|
return abi;
|
||||||
}
|
}
|
||||||
} // tslint:disable:max-file-line-count
|
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||||
|
super('CoordinatorRegistry', CoordinatorRegistryContract.ABI(), address, supportedProvider, txDefaults);
|
||||||
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// tslint:disable:max-file-line-count
|
||||||
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
||||||
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -23,9 +23,7 @@ import { assert } from '@0x/assert';
|
|||||||
import * as ethers from 'ethers';
|
import * as ethers from 'ethers';
|
||||||
// tslint:enable:no-unused-variable
|
// tslint:enable:no-unused-variable
|
||||||
|
|
||||||
export type ERC20TokenEventArgs =
|
export type ERC20TokenEventArgs = ERC20TokenTransferEventArgs | ERC20TokenApprovalEventArgs;
|
||||||
| ERC20TokenTransferEventArgs
|
|
||||||
| ERC20TokenApprovalEventArgs;
|
|
||||||
|
|
||||||
export enum ERC20TokenEvents {
|
export enum ERC20TokenEvents {
|
||||||
Transfer = 'Transfer',
|
Transfer = 'Transfer',
|
||||||
@ -44,7 +42,6 @@ export interface ERC20TokenApprovalEventArgs extends DecodedLogArgs {
|
|||||||
_value: BigNumber;
|
_value: BigNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
// tslint:disable:no-parameter-reassignment
|
// tslint:disable:no-parameter-reassignment
|
||||||
// tslint:disable-next-line:class-name
|
// tslint:disable-next-line:class-name
|
||||||
@ -53,29 +50,23 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
async sendTransactionAsync(
|
async sendTransactionAsync(
|
||||||
_spender: string,
|
_spender: string,
|
||||||
_value: BigNumber,
|
_value: BigNumber,
|
||||||
txData?: Partial<TxData> | undefined,
|
txData?: Partial<TxData> | undefined,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
assert.isString('_spender', _spender);
|
assert.isString('_spender', _spender);
|
||||||
assert.isBigNumber('_value', _value);
|
assert.isBigNumber('_value', _value);
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||||
_value
|
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
]);
|
{
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
to: self.address,
|
||||||
{
|
...txData,
|
||||||
to: self.address,
|
data: encodedData,
|
||||||
...txData,
|
},
|
||||||
data: encodedData,
|
self._web3Wrapper.getContractDefaults(),
|
||||||
},
|
self.approve.estimateGasAsync.bind(self, _spender, _value),
|
||||||
self._web3Wrapper.getContractDefaults(),
|
);
|
||||||
self.approve.estimateGasAsync.bind(
|
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||||
self,
|
return txHash;
|
||||||
_spender,
|
|
||||||
_value
|
|
||||||
),
|
|
||||||
);
|
|
||||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
|
||||||
return txHash;
|
|
||||||
},
|
},
|
||||||
awaitTransactionSuccessAsync(
|
awaitTransactionSuccessAsync(
|
||||||
_spender: string,
|
_spender: string,
|
||||||
@ -84,53 +75,48 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
pollingIntervalMs?: number,
|
pollingIntervalMs?: number,
|
||||||
timeoutMs?: number,
|
timeoutMs?: number,
|
||||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||||
assert.isString('_spender', _spender);
|
assert.isString('_spender', _spender);
|
||||||
assert.isBigNumber('_value', _value);
|
assert.isBigNumber('_value', _value);
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const txHashPromise = self.approve.sendTransactionAsync(_spender,
|
const txHashPromise = self.approve.sendTransactionAsync(_spender, _value, txData);
|
||||||
_value
|
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||||
, txData);
|
txHashPromise,
|
||||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||||
txHashPromise,
|
// When the transaction hash resolves, wait for it to be mined.
|
||||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||||
// When the transaction hash resolves, wait for it to be mined.
|
await txHashPromise,
|
||||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
pollingIntervalMs,
|
||||||
await txHashPromise,
|
timeoutMs,
|
||||||
pollingIntervalMs,
|
);
|
||||||
timeoutMs,
|
})(),
|
||||||
);
|
);
|
||||||
})(),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
async estimateGasAsync(
|
async estimateGasAsync(
|
||||||
_spender: string,
|
_spender: string,
|
||||||
_value: BigNumber,
|
_value: BigNumber,
|
||||||
txData?: Partial<TxData> | undefined,
|
txData?: Partial<TxData> | undefined,
|
||||||
): Promise<number> {
|
): Promise<number> {
|
||||||
assert.isString('_spender', _spender);
|
assert.isString('_spender', _spender);
|
||||||
assert.isBigNumber('_value', _value);
|
assert.isBigNumber('_value', _value);
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||||
_value
|
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
]);
|
{
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
to: self.address,
|
||||||
{
|
...txData,
|
||||||
to: self.address,
|
data: encodedData,
|
||||||
...txData,
|
},
|
||||||
data: encodedData,
|
self._web3Wrapper.getContractDefaults(),
|
||||||
},
|
);
|
||||||
self._web3Wrapper.getContractDefaults(),
|
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||||
);
|
return gas;
|
||||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
|
||||||
return gas;
|
|
||||||
},
|
},
|
||||||
async callAsync(
|
async callAsync(
|
||||||
_spender: string,
|
_spender: string,
|
||||||
_value: BigNumber,
|
_value: BigNumber,
|
||||||
callData: Partial<CallData> = {},
|
callData: Partial<CallData> = {},
|
||||||
defaultBlock?: BlockParam,
|
defaultBlock?: BlockParam,
|
||||||
): Promise<boolean
|
): Promise<boolean> {
|
||||||
> {
|
|
||||||
assert.isString('_spender', _spender);
|
assert.isString('_spender', _spender);
|
||||||
assert.isBigNumber('_value', _value);
|
assert.isBigNumber('_value', _value);
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
@ -141,10 +127,8 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||||
_value
|
|
||||||
]);
|
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
to: self.address,
|
to: self.address,
|
||||||
@ -157,30 +141,23 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
const result = abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(_spender: string, _value: BigNumber): string {
|
||||||
_spender: string,
|
|
||||||
_value: BigNumber,
|
|
||||||
): string {
|
|
||||||
assert.isString('_spender', _spender);
|
assert.isString('_spender', _spender);
|
||||||
assert.isBigNumber('_value', _value);
|
assert.isBigNumber('_value', _value);
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||||
_value
|
_spender,
|
||||||
]);
|
_value,
|
||||||
|
]);
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
public totalSupply = {
|
public totalSupply = {
|
||||||
async callAsync(
|
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||||
callData: Partial<CallData> = {},
|
|
||||||
defaultBlock?: BlockParam,
|
|
||||||
): Promise<BigNumber
|
|
||||||
> {
|
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
schemas.numberSchema,
|
schemas.numberSchema,
|
||||||
@ -189,7 +166,7 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const encodedData = self._strictEncodeArguments('totalSupply()', []);
|
const encodedData = self._strictEncodeArguments('totalSupply()', []);
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
@ -203,14 +180,12 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
|
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(): string {
|
||||||
): string {
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const self = this as any as ERC20TokenContract;
|
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('totalSupply()', []);
|
const abiEncodedTransactionData = self._strictEncodeArguments('totalSupply()', []);
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
@ -220,32 +195,28 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
_from: string,
|
_from: string,
|
||||||
_to: string,
|
_to: string,
|
||||||
_value: BigNumber,
|
_value: BigNumber,
|
||||||
txData?: Partial<TxData> | undefined,
|
txData?: Partial<TxData> | undefined,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
assert.isString('_from', _from);
|
assert.isString('_from', _from);
|
||||||
assert.isString('_to', _to);
|
assert.isString('_to', _to);
|
||||||
assert.isBigNumber('_value', _value);
|
assert.isBigNumber('_value', _value);
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||||
_to,
|
|
||||||
_value
|
|
||||||
]);
|
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
|
||||||
{
|
|
||||||
to: self.address,
|
|
||||||
...txData,
|
|
||||||
data: encodedData,
|
|
||||||
},
|
|
||||||
self._web3Wrapper.getContractDefaults(),
|
|
||||||
self.transferFrom.estimateGasAsync.bind(
|
|
||||||
self,
|
|
||||||
_from,
|
_from,
|
||||||
_to,
|
_to,
|
||||||
_value
|
_value,
|
||||||
),
|
]);
|
||||||
);
|
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
{
|
||||||
return txHash;
|
to: self.address,
|
||||||
|
...txData,
|
||||||
|
data: encodedData,
|
||||||
|
},
|
||||||
|
self._web3Wrapper.getContractDefaults(),
|
||||||
|
self.transferFrom.estimateGasAsync.bind(self, _from, _to, _value),
|
||||||
|
);
|
||||||
|
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||||
|
return txHash;
|
||||||
},
|
},
|
||||||
awaitTransactionSuccessAsync(
|
awaitTransactionSuccessAsync(
|
||||||
_from: string,
|
_from: string,
|
||||||
@ -255,25 +226,22 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
pollingIntervalMs?: number,
|
pollingIntervalMs?: number,
|
||||||
timeoutMs?: number,
|
timeoutMs?: number,
|
||||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||||
assert.isString('_from', _from);
|
assert.isString('_from', _from);
|
||||||
assert.isString('_to', _to);
|
assert.isString('_to', _to);
|
||||||
assert.isBigNumber('_value', _value);
|
assert.isBigNumber('_value', _value);
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const txHashPromise = self.transferFrom.sendTransactionAsync(_from,
|
const txHashPromise = self.transferFrom.sendTransactionAsync(_from, _to, _value, txData);
|
||||||
_to,
|
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||||
_value
|
txHashPromise,
|
||||||
, txData);
|
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
// When the transaction hash resolves, wait for it to be mined.
|
||||||
txHashPromise,
|
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
await txHashPromise,
|
||||||
// When the transaction hash resolves, wait for it to be mined.
|
pollingIntervalMs,
|
||||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
timeoutMs,
|
||||||
await txHashPromise,
|
);
|
||||||
pollingIntervalMs,
|
})(),
|
||||||
timeoutMs,
|
);
|
||||||
);
|
|
||||||
})(),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
async estimateGasAsync(
|
async estimateGasAsync(
|
||||||
_from: string,
|
_from: string,
|
||||||
@ -281,24 +249,25 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
_value: BigNumber,
|
_value: BigNumber,
|
||||||
txData?: Partial<TxData> | undefined,
|
txData?: Partial<TxData> | undefined,
|
||||||
): Promise<number> {
|
): Promise<number> {
|
||||||
assert.isString('_from', _from);
|
assert.isString('_from', _from);
|
||||||
assert.isString('_to', _to);
|
assert.isString('_to', _to);
|
||||||
assert.isBigNumber('_value', _value);
|
assert.isBigNumber('_value', _value);
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||||
_to,
|
_from,
|
||||||
_value
|
_to,
|
||||||
]);
|
_value,
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
]);
|
||||||
{
|
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
to: self.address,
|
{
|
||||||
...txData,
|
to: self.address,
|
||||||
data: encodedData,
|
...txData,
|
||||||
},
|
data: encodedData,
|
||||||
self._web3Wrapper.getContractDefaults(),
|
},
|
||||||
);
|
self._web3Wrapper.getContractDefaults(),
|
||||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
);
|
||||||
return gas;
|
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||||
|
return gas;
|
||||||
},
|
},
|
||||||
async callAsync(
|
async callAsync(
|
||||||
_from: string,
|
_from: string,
|
||||||
@ -306,8 +275,7 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
_value: BigNumber,
|
_value: BigNumber,
|
||||||
callData: Partial<CallData> = {},
|
callData: Partial<CallData> = {},
|
||||||
defaultBlock?: BlockParam,
|
defaultBlock?: BlockParam,
|
||||||
): Promise<boolean
|
): Promise<boolean> {
|
||||||
> {
|
|
||||||
assert.isString('_from', _from);
|
assert.isString('_from', _from);
|
||||||
assert.isString('_to', _to);
|
assert.isString('_to', _to);
|
||||||
assert.isBigNumber('_value', _value);
|
assert.isBigNumber('_value', _value);
|
||||||
@ -319,11 +287,12 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||||
_to,
|
_from,
|
||||||
_value
|
_to,
|
||||||
]);
|
_value,
|
||||||
|
]);
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
to: self.address,
|
to: self.address,
|
||||||
@ -336,24 +305,20 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
const result = abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(_from: string, _to: string, _value: BigNumber): string {
|
||||||
_from: string,
|
|
||||||
_to: string,
|
|
||||||
_value: BigNumber,
|
|
||||||
): string {
|
|
||||||
assert.isString('_from', _from);
|
assert.isString('_from', _from);
|
||||||
assert.isString('_to', _to);
|
assert.isString('_to', _to);
|
||||||
assert.isBigNumber('_value', _value);
|
assert.isBigNumber('_value', _value);
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||||
_to,
|
_from,
|
||||||
_value
|
_to,
|
||||||
]);
|
_value,
|
||||||
|
]);
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -362,8 +327,7 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
_owner: string,
|
_owner: string,
|
||||||
callData: Partial<CallData> = {},
|
callData: Partial<CallData> = {},
|
||||||
defaultBlock?: BlockParam,
|
defaultBlock?: BlockParam,
|
||||||
): Promise<BigNumber
|
): Promise<BigNumber> {
|
||||||
> {
|
|
||||||
assert.isString('_owner', _owner);
|
assert.isString('_owner', _owner);
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@ -373,9 +337,8 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner
|
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner]);
|
||||||
]);
|
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
to: self.address,
|
to: self.address,
|
||||||
@ -388,18 +351,14 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(_owner: string): string {
|
||||||
_owner: string,
|
|
||||||
): string {
|
|
||||||
assert.isString('_owner', _owner);
|
assert.isString('_owner', _owner);
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner
|
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner]);
|
||||||
]);
|
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -407,29 +366,23 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
async sendTransactionAsync(
|
async sendTransactionAsync(
|
||||||
_to: string,
|
_to: string,
|
||||||
_value: BigNumber,
|
_value: BigNumber,
|
||||||
txData?: Partial<TxData> | undefined,
|
txData?: Partial<TxData> | undefined,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
assert.isString('_to', _to);
|
assert.isString('_to', _to);
|
||||||
assert.isBigNumber('_value', _value);
|
assert.isBigNumber('_value', _value);
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||||
_value
|
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
]);
|
{
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
to: self.address,
|
||||||
{
|
...txData,
|
||||||
to: self.address,
|
data: encodedData,
|
||||||
...txData,
|
},
|
||||||
data: encodedData,
|
self._web3Wrapper.getContractDefaults(),
|
||||||
},
|
self.transfer.estimateGasAsync.bind(self, _to, _value),
|
||||||
self._web3Wrapper.getContractDefaults(),
|
);
|
||||||
self.transfer.estimateGasAsync.bind(
|
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||||
self,
|
return txHash;
|
||||||
_to,
|
|
||||||
_value
|
|
||||||
),
|
|
||||||
);
|
|
||||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
|
||||||
return txHash;
|
|
||||||
},
|
},
|
||||||
awaitTransactionSuccessAsync(
|
awaitTransactionSuccessAsync(
|
||||||
_to: string,
|
_to: string,
|
||||||
@ -438,53 +391,44 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
pollingIntervalMs?: number,
|
pollingIntervalMs?: number,
|
||||||
timeoutMs?: number,
|
timeoutMs?: number,
|
||||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||||
assert.isString('_to', _to);
|
assert.isString('_to', _to);
|
||||||
assert.isBigNumber('_value', _value);
|
assert.isBigNumber('_value', _value);
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const txHashPromise = self.transfer.sendTransactionAsync(_to,
|
const txHashPromise = self.transfer.sendTransactionAsync(_to, _value, txData);
|
||||||
_value
|
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||||
, txData);
|
txHashPromise,
|
||||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||||
txHashPromise,
|
// When the transaction hash resolves, wait for it to be mined.
|
||||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
||||||
// When the transaction hash resolves, wait for it to be mined.
|
await txHashPromise,
|
||||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
pollingIntervalMs,
|
||||||
await txHashPromise,
|
timeoutMs,
|
||||||
pollingIntervalMs,
|
);
|
||||||
timeoutMs,
|
})(),
|
||||||
);
|
);
|
||||||
})(),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
async estimateGasAsync(
|
async estimateGasAsync(_to: string, _value: BigNumber, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||||
_to: string,
|
assert.isString('_to', _to);
|
||||||
_value: BigNumber,
|
assert.isBigNumber('_value', _value);
|
||||||
txData?: Partial<TxData> | undefined,
|
const self = (this as any) as ERC20TokenContract;
|
||||||
): Promise<number> {
|
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||||
assert.isString('_to', _to);
|
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
assert.isBigNumber('_value', _value);
|
{
|
||||||
const self = this as any as ERC20TokenContract;
|
to: self.address,
|
||||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
...txData,
|
||||||
_value
|
data: encodedData,
|
||||||
]);
|
},
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
self._web3Wrapper.getContractDefaults(),
|
||||||
{
|
);
|
||||||
to: self.address,
|
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||||
...txData,
|
return gas;
|
||||||
data: encodedData,
|
|
||||||
},
|
|
||||||
self._web3Wrapper.getContractDefaults(),
|
|
||||||
);
|
|
||||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
|
||||||
return gas;
|
|
||||||
},
|
},
|
||||||
async callAsync(
|
async callAsync(
|
||||||
_to: string,
|
_to: string,
|
||||||
_value: BigNumber,
|
_value: BigNumber,
|
||||||
callData: Partial<CallData> = {},
|
callData: Partial<CallData> = {},
|
||||||
defaultBlock?: BlockParam,
|
defaultBlock?: BlockParam,
|
||||||
): Promise<boolean
|
): Promise<boolean> {
|
||||||
> {
|
|
||||||
assert.isString('_to', _to);
|
assert.isString('_to', _to);
|
||||||
assert.isBigNumber('_value', _value);
|
assert.isBigNumber('_value', _value);
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
@ -495,10 +439,8 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||||
_value
|
|
||||||
]);
|
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
to: self.address,
|
to: self.address,
|
||||||
@ -511,21 +453,15 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
|
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
const result = abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(_to: string, _value: BigNumber): string {
|
||||||
_to: string,
|
|
||||||
_value: BigNumber,
|
|
||||||
): string {
|
|
||||||
assert.isString('_to', _to);
|
assert.isString('_to', _to);
|
||||||
assert.isBigNumber('_value', _value);
|
assert.isBigNumber('_value', _value);
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||||
_value
|
|
||||||
]);
|
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -535,8 +471,7 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
_spender: string,
|
_spender: string,
|
||||||
callData: Partial<CallData> = {},
|
callData: Partial<CallData> = {},
|
||||||
defaultBlock?: BlockParam,
|
defaultBlock?: BlockParam,
|
||||||
): Promise<BigNumber
|
): Promise<BigNumber> {
|
||||||
> {
|
|
||||||
assert.isString('_owner', _owner);
|
assert.isString('_owner', _owner);
|
||||||
assert.isString('_spender', _spender);
|
assert.isString('_spender', _spender);
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
@ -547,10 +482,8 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const encodedData = self._strictEncodeArguments('allowance(address,address)', [_owner,
|
const encodedData = self._strictEncodeArguments('allowance(address,address)', [_owner, _spender]);
|
||||||
_spender
|
|
||||||
]);
|
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
to: self.address,
|
to: self.address,
|
||||||
@ -563,21 +496,18 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
|
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(_owner: string, _spender: string): string {
|
||||||
_owner: string,
|
|
||||||
_spender: string,
|
|
||||||
): string {
|
|
||||||
assert.isString('_owner', _owner);
|
assert.isString('_owner', _owner);
|
||||||
assert.isString('_spender', _spender);
|
assert.isString('_spender', _spender);
|
||||||
const self = this as any as ERC20TokenContract;
|
const self = (this as any) as ERC20TokenContract;
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('allowance(address,address)', [_owner,
|
const abiEncodedTransactionData = self._strictEncodeArguments('allowance(address,address)', [
|
||||||
_spender
|
_owner,
|
||||||
]);
|
_spender,
|
||||||
|
]);
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -597,7 +527,7 @@ 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, );
|
return ERC20TokenContract.deployAsync(bytecode, abi, provider, txDefaults);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
@ -613,17 +543,13 @@ export class ERC20TokenContract extends BaseContract {
|
|||||||
]);
|
]);
|
||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||||
[] = BaseContract._formatABIDataItemList(
|
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||||
constructorAbi.inputs,
|
|
||||||
[],
|
|
||||||
BaseContract._bigNumberToString,
|
|
||||||
);
|
|
||||||
const iface = new ethers.utils.Interface(abi);
|
const iface = new ethers.utils.Interface(abi);
|
||||||
const deployInfo = iface.deployFunction;
|
const deployInfo = iface.deployFunction;
|
||||||
const txData = deployInfo.encode(bytecode, []);
|
const txData = deployInfo.encode(bytecode, []);
|
||||||
const web3Wrapper = new Web3Wrapper(provider);
|
const web3Wrapper = new Web3Wrapper(provider);
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{data: txData},
|
{ data: txData },
|
||||||
txDefaults,
|
txDefaults,
|
||||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||||
);
|
);
|
||||||
@ -631,14 +557,194 @@ 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(abi, txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new ERC20TokenContract(txReceipt.contractAddress as string, provider, txDefaults);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
|
||||||
super('ERC20Token', abi, address, supportedProvider, txDefaults);
|
/**
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
* @returns The contract ABI
|
||||||
|
*/
|
||||||
|
public static ABI(): ContractAbi {
|
||||||
|
const abi = [
|
||||||
|
{
|
||||||
|
constant: false,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: '_spender',
|
||||||
|
type: 'address',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '_value',
|
||||||
|
type: 'uint256',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'approve',
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
type: 'bool',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'nonpayable',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
constant: true,
|
||||||
|
inputs: [],
|
||||||
|
name: 'totalSupply',
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
type: 'uint256',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'view',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
constant: false,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: '_from',
|
||||||
|
type: 'address',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '_to',
|
||||||
|
type: 'address',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '_value',
|
||||||
|
type: 'uint256',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'transferFrom',
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
type: 'bool',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'nonpayable',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
constant: true,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: '_owner',
|
||||||
|
type: 'address',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'balanceOf',
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
type: 'uint256',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'view',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
constant: false,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: '_to',
|
||||||
|
type: 'address',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '_value',
|
||||||
|
type: 'uint256',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'transfer',
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
type: 'bool',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'nonpayable',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
constant: true,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: '_owner',
|
||||||
|
type: 'address',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '_spender',
|
||||||
|
type: 'address',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'allowance',
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
type: 'uint256',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'view',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
anonymous: false,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: '_from',
|
||||||
|
type: 'address',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '_to',
|
||||||
|
type: 'address',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '_value',
|
||||||
|
type: 'uint256',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'Transfer',
|
||||||
|
outputs: [],
|
||||||
|
type: 'event',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
anonymous: false,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: '_owner',
|
||||||
|
type: 'address',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '_spender',
|
||||||
|
type: 'address',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '_value',
|
||||||
|
type: 'uint256',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'Approval',
|
||||||
|
outputs: [],
|
||||||
|
type: 'event',
|
||||||
|
},
|
||||||
|
] as ContractAbi;
|
||||||
|
return abi;
|
||||||
}
|
}
|
||||||
} // tslint:disable:max-file-line-count
|
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||||
|
super('ERC20Token', ERC20TokenContract.ABI(), address, supportedProvider, txDefaults);
|
||||||
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// tslint:disable:max-file-line-count
|
||||||
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
||||||
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -23,7 +23,6 @@ import { assert } from '@0x/assert';
|
|||||||
import * as ethers from 'ethers';
|
import * as ethers from 'ethers';
|
||||||
// tslint:enable:no-unused-variable
|
// tslint:enable:no-unused-variable
|
||||||
|
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
// tslint:disable:no-parameter-reassignment
|
// tslint:disable:no-parameter-reassignment
|
||||||
// tslint:disable-next-line:class-name
|
// tslint:disable-next-line:class-name
|
||||||
@ -33,8 +32,7 @@ export class EthBalanceCheckerContract extends BaseContract {
|
|||||||
addresses: string[],
|
addresses: string[],
|
||||||
callData: Partial<CallData> = {},
|
callData: Partial<CallData> = {},
|
||||||
defaultBlock?: BlockParam,
|
defaultBlock?: BlockParam,
|
||||||
): Promise<BigNumber[]
|
): Promise<BigNumber[]> {
|
||||||
> {
|
|
||||||
assert.isArray('addresses', addresses);
|
assert.isArray('addresses', addresses);
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
schemas.addressSchema,
|
schemas.addressSchema,
|
||||||
@ -44,9 +42,8 @@ export class EthBalanceCheckerContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as EthBalanceCheckerContract;
|
const self = (this as any) as EthBalanceCheckerContract;
|
||||||
const encodedData = self._strictEncodeArguments('getEthBalances(address[])', [addresses
|
const encodedData = self._strictEncodeArguments('getEthBalances(address[])', [addresses]);
|
||||||
]);
|
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
to: self.address,
|
to: self.address,
|
||||||
@ -59,18 +56,14 @@ export class EthBalanceCheckerContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('getEthBalances(address[])');
|
const abiEncoder = self._lookupAbiEncoder('getEthBalances(address[])');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber[]
|
const result = abiEncoder.strictDecodeReturnValue<BigNumber[]>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(addresses: string[]): string {
|
||||||
addresses: string[],
|
|
||||||
): string {
|
|
||||||
assert.isArray('addresses', addresses);
|
assert.isArray('addresses', addresses);
|
||||||
const self = this as any as EthBalanceCheckerContract;
|
const self = (this as any) as EthBalanceCheckerContract;
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('getEthBalances(address[])', [addresses
|
const abiEncodedTransactionData = self._strictEncodeArguments('getEthBalances(address[])', [addresses]);
|
||||||
]);
|
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -90,7 +83,7 @@ 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, );
|
return EthBalanceCheckerContract.deployAsync(bytecode, abi, provider, txDefaults);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
@ -106,17 +99,13 @@ export class EthBalanceCheckerContract extends BaseContract {
|
|||||||
]);
|
]);
|
||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||||
[] = BaseContract._formatABIDataItemList(
|
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||||
constructorAbi.inputs,
|
|
||||||
[],
|
|
||||||
BaseContract._bigNumberToString,
|
|
||||||
);
|
|
||||||
const iface = new ethers.utils.Interface(abi);
|
const iface = new ethers.utils.Interface(abi);
|
||||||
const deployInfo = iface.deployFunction;
|
const deployInfo = iface.deployFunction;
|
||||||
const txData = deployInfo.encode(bytecode, []);
|
const txData = deployInfo.encode(bytecode, []);
|
||||||
const web3Wrapper = new Web3Wrapper(provider);
|
const web3Wrapper = new Web3Wrapper(provider);
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{data: txData},
|
{ data: txData },
|
||||||
txDefaults,
|
txDefaults,
|
||||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||||
);
|
);
|
||||||
@ -124,14 +113,48 @@ export class EthBalanceCheckerContract extends BaseContract {
|
|||||||
logUtils.log(`transactionHash: ${txHash}`);
|
logUtils.log(`transactionHash: ${txHash}`);
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
logUtils.log(`EthBalanceChecker successfully deployed at ${txReceipt.contractAddress}`);
|
logUtils.log(`EthBalanceChecker successfully deployed at ${txReceipt.contractAddress}`);
|
||||||
const contractInstance = new EthBalanceCheckerContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new EthBalanceCheckerContract(
|
||||||
|
txReceipt.contractAddress as string,
|
||||||
|
provider,
|
||||||
|
txDefaults,
|
||||||
|
);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
|
||||||
super('EthBalanceChecker', abi, address, supportedProvider, txDefaults);
|
/**
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
* @returns The contract ABI
|
||||||
|
*/
|
||||||
|
public static ABI(): ContractAbi {
|
||||||
|
const abi = [
|
||||||
|
{
|
||||||
|
constant: true,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: 'addresses',
|
||||||
|
type: 'address[]',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'getEthBalances',
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
type: 'uint256[]',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'view',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
] as ContractAbi;
|
||||||
|
return abi;
|
||||||
}
|
}
|
||||||
} // tslint:disable:max-file-line-count
|
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||||
|
super('EthBalanceChecker', EthBalanceCheckerContract.ABI(), address, supportedProvider, txDefaults);
|
||||||
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// tslint:disable:max-file-line-count
|
||||||
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
||||||
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -23,7 +23,6 @@ import { assert } from '@0x/assert';
|
|||||||
import * as ethers from 'ethers';
|
import * as ethers from 'ethers';
|
||||||
// tslint:enable:no-unused-variable
|
// tslint:enable:no-unused-variable
|
||||||
|
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
// tslint:disable:no-parameter-reassignment
|
// tslint:disable:no-parameter-reassignment
|
||||||
// tslint:disable-next-line:class-name
|
// tslint:disable-next-line:class-name
|
||||||
@ -35,8 +34,7 @@ export class IValidatorContract extends BaseContract {
|
|||||||
signature: string,
|
signature: string,
|
||||||
callData: Partial<CallData> = {},
|
callData: Partial<CallData> = {},
|
||||||
defaultBlock?: BlockParam,
|
defaultBlock?: BlockParam,
|
||||||
): Promise<boolean
|
): Promise<boolean> {
|
||||||
> {
|
|
||||||
assert.isString('hash', hash);
|
assert.isString('hash', hash);
|
||||||
assert.isString('signerAddress', signerAddress);
|
assert.isString('signerAddress', signerAddress);
|
||||||
assert.isString('signature', signature);
|
assert.isString('signature', signature);
|
||||||
@ -48,11 +46,12 @@ export class IValidatorContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as IValidatorContract;
|
const self = (this as any) as IValidatorContract;
|
||||||
const encodedData = self._strictEncodeArguments('isValidSignature(bytes32,address,bytes)', [hash,
|
const encodedData = self._strictEncodeArguments('isValidSignature(bytes32,address,bytes)', [
|
||||||
signerAddress,
|
hash,
|
||||||
signature
|
signerAddress,
|
||||||
]);
|
signature,
|
||||||
|
]);
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
to: self.address,
|
to: self.address,
|
||||||
@ -65,24 +64,20 @@ export class IValidatorContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,address,bytes)');
|
const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,address,bytes)');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
const result = abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(hash: string, signerAddress: string, signature: string): string {
|
||||||
hash: string,
|
|
||||||
signerAddress: string,
|
|
||||||
signature: string,
|
|
||||||
): string {
|
|
||||||
assert.isString('hash', hash);
|
assert.isString('hash', hash);
|
||||||
assert.isString('signerAddress', signerAddress);
|
assert.isString('signerAddress', signerAddress);
|
||||||
assert.isString('signature', signature);
|
assert.isString('signature', signature);
|
||||||
const self = this as any as IValidatorContract;
|
const self = (this as any) as IValidatorContract;
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('isValidSignature(bytes32,address,bytes)', [hash,
|
const abiEncodedTransactionData = self._strictEncodeArguments('isValidSignature(bytes32,address,bytes)', [
|
||||||
signerAddress,
|
hash,
|
||||||
signature
|
signerAddress,
|
||||||
]);
|
signature,
|
||||||
|
]);
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -102,7 +97,7 @@ 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, );
|
return IValidatorContract.deployAsync(bytecode, abi, provider, txDefaults);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
@ -118,17 +113,13 @@ export class IValidatorContract extends BaseContract {
|
|||||||
]);
|
]);
|
||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||||
[] = BaseContract._formatABIDataItemList(
|
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||||
constructorAbi.inputs,
|
|
||||||
[],
|
|
||||||
BaseContract._bigNumberToString,
|
|
||||||
);
|
|
||||||
const iface = new ethers.utils.Interface(abi);
|
const iface = new ethers.utils.Interface(abi);
|
||||||
const deployInfo = iface.deployFunction;
|
const deployInfo = iface.deployFunction;
|
||||||
const txData = deployInfo.encode(bytecode, []);
|
const txData = deployInfo.encode(bytecode, []);
|
||||||
const web3Wrapper = new Web3Wrapper(provider);
|
const web3Wrapper = new Web3Wrapper(provider);
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{data: txData},
|
{ data: txData },
|
||||||
txDefaults,
|
txDefaults,
|
||||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||||
);
|
);
|
||||||
@ -136,14 +127,52 @@ 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(abi, txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new IValidatorContract(txReceipt.contractAddress as string, provider, txDefaults);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
|
||||||
super('IValidator', abi, address, supportedProvider, txDefaults);
|
/**
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
* @returns The contract ABI
|
||||||
|
*/
|
||||||
|
public static ABI(): ContractAbi {
|
||||||
|
const abi = [
|
||||||
|
{
|
||||||
|
constant: true,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: 'hash',
|
||||||
|
type: 'bytes32',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'signerAddress',
|
||||||
|
type: 'address',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'signature',
|
||||||
|
type: 'bytes',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'isValidSignature',
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
name: 'isValid',
|
||||||
|
type: 'bool',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'view',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
] as ContractAbi;
|
||||||
|
return abi;
|
||||||
}
|
}
|
||||||
} // tslint:disable:max-file-line-count
|
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||||
|
super('IValidator', IValidatorContract.ABI(), address, supportedProvider, txDefaults);
|
||||||
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// tslint:disable:max-file-line-count
|
||||||
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
||||||
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
||||||
|
@ -23,7 +23,6 @@ import { assert } from '@0x/assert';
|
|||||||
import * as ethers from 'ethers';
|
import * as ethers from 'ethers';
|
||||||
// tslint:enable:no-unused-variable
|
// tslint:enable:no-unused-variable
|
||||||
|
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
// tslint:disable:no-parameter-reassignment
|
// tslint:disable:no-parameter-reassignment
|
||||||
// tslint:disable-next-line:class-name
|
// tslint:disable-next-line:class-name
|
||||||
@ -34,8 +33,7 @@ export class IWalletContract extends BaseContract {
|
|||||||
signature: string,
|
signature: string,
|
||||||
callData: Partial<CallData> = {},
|
callData: Partial<CallData> = {},
|
||||||
defaultBlock?: BlockParam,
|
defaultBlock?: BlockParam,
|
||||||
): Promise<boolean
|
): Promise<boolean> {
|
||||||
> {
|
|
||||||
assert.isString('hash', hash);
|
assert.isString('hash', hash);
|
||||||
assert.isString('signature', signature);
|
assert.isString('signature', signature);
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||||
@ -46,10 +44,8 @@ export class IWalletContract extends BaseContract {
|
|||||||
if (defaultBlock !== undefined) {
|
if (defaultBlock !== undefined) {
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||||
}
|
}
|
||||||
const self = this as any as IWalletContract;
|
const self = (this as any) as IWalletContract;
|
||||||
const encodedData = self._strictEncodeArguments('isValidSignature(bytes32,bytes)', [hash,
|
const encodedData = self._strictEncodeArguments('isValidSignature(bytes32,bytes)', [hash, signature]);
|
||||||
signature
|
|
||||||
]);
|
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{
|
{
|
||||||
to: self.address,
|
to: self.address,
|
||||||
@ -62,21 +58,18 @@ export class IWalletContract extends BaseContract {
|
|||||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||||
const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,bytes)');
|
const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,bytes)');
|
||||||
// tslint:disable boolean-naming
|
// tslint:disable boolean-naming
|
||||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
const result = abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||||
>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
// tslint:enable boolean-naming
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
getABIEncodedTransactionData(
|
getABIEncodedTransactionData(hash: string, signature: string): string {
|
||||||
hash: string,
|
|
||||||
signature: string,
|
|
||||||
): string {
|
|
||||||
assert.isString('hash', hash);
|
assert.isString('hash', hash);
|
||||||
assert.isString('signature', signature);
|
assert.isString('signature', signature);
|
||||||
const self = this as any as IWalletContract;
|
const self = (this as any) as IWalletContract;
|
||||||
const abiEncodedTransactionData = self._strictEncodeArguments('isValidSignature(bytes32,bytes)', [hash,
|
const abiEncodedTransactionData = self._strictEncodeArguments('isValidSignature(bytes32,bytes)', [
|
||||||
signature
|
hash,
|
||||||
]);
|
signature,
|
||||||
|
]);
|
||||||
return abiEncodedTransactionData;
|
return abiEncodedTransactionData;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -96,7 +89,7 @@ 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, );
|
return IWalletContract.deployAsync(bytecode, abi, provider, txDefaults);
|
||||||
}
|
}
|
||||||
public static async deployAsync(
|
public static async deployAsync(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
@ -112,17 +105,13 @@ export class IWalletContract extends BaseContract {
|
|||||||
]);
|
]);
|
||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||||
[] = BaseContract._formatABIDataItemList(
|
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||||
constructorAbi.inputs,
|
|
||||||
[],
|
|
||||||
BaseContract._bigNumberToString,
|
|
||||||
);
|
|
||||||
const iface = new ethers.utils.Interface(abi);
|
const iface = new ethers.utils.Interface(abi);
|
||||||
const deployInfo = iface.deployFunction;
|
const deployInfo = iface.deployFunction;
|
||||||
const txData = deployInfo.encode(bytecode, []);
|
const txData = deployInfo.encode(bytecode, []);
|
||||||
const web3Wrapper = new Web3Wrapper(provider);
|
const web3Wrapper = new Web3Wrapper(provider);
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||||
{data: txData},
|
{ data: txData },
|
||||||
txDefaults,
|
txDefaults,
|
||||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||||
);
|
);
|
||||||
@ -130,14 +119,48 @@ 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(abi, txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new IWalletContract(txReceipt.contractAddress as string, provider, txDefaults);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
|
||||||
super('IWallet', abi, address, supportedProvider, txDefaults);
|
/**
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
* @returns The contract ABI
|
||||||
|
*/
|
||||||
|
public static ABI(): ContractAbi {
|
||||||
|
const abi = [
|
||||||
|
{
|
||||||
|
constant: true,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: 'hash',
|
||||||
|
type: 'bytes32',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'signature',
|
||||||
|
type: 'bytes',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'isValidSignature',
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
name: 'isValid',
|
||||||
|
type: 'bool',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'view',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
] as ContractAbi;
|
||||||
|
return abi;
|
||||||
}
|
}
|
||||||
} // tslint:disable:max-file-line-count
|
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||||
|
super('IWallet', IWalletContract.ABI(), address, supportedProvider, txDefaults);
|
||||||
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// tslint:disable:max-file-line-count
|
||||||
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
||||||
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -18,3 +18,5 @@ export * from './generated-wrappers/zrx_token';
|
|||||||
export * from './generated-wrappers/coordinator';
|
export * from './generated-wrappers/coordinator';
|
||||||
export * from './generated-wrappers/coordinator_registry';
|
export * from './generated-wrappers/coordinator_registry';
|
||||||
export * from './generated-wrappers/eth_balance_checker';
|
export * from './generated-wrappers/eth_balance_checker';
|
||||||
|
|
||||||
|
export * from '@0x/contract-addresses';
|
||||||
|
@ -4,7 +4,7 @@ import { AbiEncoder, abiUtils, logUtils } from '@0x/utils';
|
|||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import * as changeCase from 'change-case';
|
import * as changeCase from 'change-case';
|
||||||
import * as cliFormat from 'cli-format';
|
import * as cliFormat from 'cli-format';
|
||||||
import { AbiDefinition, ConstructorAbi, DevdocOutput, EventAbi, MethodAbi } from 'ethereum-types';
|
import { AbiDefinition, ConstructorAbi, ContractAbi, DevdocOutput, EventAbi, MethodAbi } from 'ethereum-types';
|
||||||
import { sync as globSync } from 'glob';
|
import { sync as globSync } from 'glob';
|
||||||
import * as Handlebars from 'handlebars';
|
import * as Handlebars from 'handlebars';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
@ -79,11 +79,21 @@ function registerPartials(): void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.language === 'TypeScript') {
|
function registerTypeScriptHelpers(): void {
|
||||||
Handlebars.registerHelper('parameterType', utils.solTypeToTsType.bind(utils, ParamKind.Input, args.backend));
|
Handlebars.registerHelper('parameterType', utils.solTypeToTsType.bind(utils, ParamKind.Input, args.backend));
|
||||||
Handlebars.registerHelper('assertionType', utils.solTypeToAssertion.bind(utils));
|
Handlebars.registerHelper('assertionType', utils.solTypeToAssertion.bind(utils));
|
||||||
Handlebars.registerHelper('returnType', utils.solTypeToTsType.bind(utils, ParamKind.Output, args.backend));
|
Handlebars.registerHelper('returnType', utils.solTypeToTsType.bind(utils, ParamKind.Output, args.backend));
|
||||||
} else if (args.language === 'Python') {
|
|
||||||
|
// Check if 0 or false exists
|
||||||
|
Handlebars.registerHelper(
|
||||||
|
'isDefined',
|
||||||
|
(context: any): boolean => {
|
||||||
|
return context !== undefined;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function registerPythonHelpers(): void {
|
||||||
Handlebars.registerHelper('equal', (lhs, rhs, options) => {
|
Handlebars.registerHelper('equal', (lhs, rhs, options) => {
|
||||||
return lhs === rhs;
|
return lhs === rhs;
|
||||||
});
|
});
|
||||||
@ -109,6 +119,11 @@ if (args.language === 'TypeScript') {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (args.language === 'TypeScript') {
|
||||||
|
registerTypeScriptHelpers();
|
||||||
|
} else if (args.language === 'Python') {
|
||||||
|
registerPythonHelpers();
|
||||||
|
}
|
||||||
registerPartials();
|
registerPartials();
|
||||||
|
|
||||||
function makeLanguageSpecificName(methodName: string): string {
|
function makeLanguageSpecificName(methodName: string): string {
|
||||||
@ -207,7 +222,8 @@ for (const abiFileName of abiFileNames) {
|
|||||||
const contextData = {
|
const contextData = {
|
||||||
contractName: namedContent.name,
|
contractName: namedContent.name,
|
||||||
ctor,
|
ctor,
|
||||||
ABI: JSON.stringify(ABI),
|
ABI: ABI as ContractAbi,
|
||||||
|
ABIString: JSON.stringify(ABI),
|
||||||
methods: methodsData,
|
methods: methodsData,
|
||||||
events: eventsData,
|
events: eventsData,
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { EventAbi, MethodAbi } from 'ethereum-types';
|
import { ContractAbi, EventAbi, MethodAbi } from 'ethereum-types';
|
||||||
|
|
||||||
export enum ParamKind {
|
export enum ParamKind {
|
||||||
Input = 'input',
|
Input = 'input',
|
||||||
@ -19,6 +19,7 @@ export interface Method extends MethodAbi {
|
|||||||
|
|
||||||
export interface ContextData {
|
export interface ContextData {
|
||||||
contractName: string;
|
contractName: string;
|
||||||
|
ABI: ContractAbi;
|
||||||
methods: Method[];
|
methods: Method[];
|
||||||
events: EventAbi[];
|
events: EventAbi[];
|
||||||
}
|
}
|
||||||
|
@ -428,14 +428,159 @@ 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(abi, txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new AbiGenDummyContract(txReceipt.contractAddress as string, provider, txDefaults);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
|
||||||
super('AbiGenDummy', abi, address, supportedProvider, txDefaults);
|
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
/**
|
||||||
|
* @returns The contract ABI
|
||||||
|
*/
|
||||||
|
public static ABI(): ContractAbi {
|
||||||
|
const abi = [
|
||||||
|
{
|
||||||
|
constant: true,
|
||||||
|
inputs: [
|
||||||
|
],
|
||||||
|
name: 'simpleRequire',
|
||||||
|
outputs: [
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'pure',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
constant: true,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: 'hash',
|
||||||
|
type: 'bytes32',
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'v',
|
||||||
|
type: 'uint8',
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'r',
|
||||||
|
type: 'bytes32',
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 's',
|
||||||
|
type: 'bytes32',
|
||||||
|
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'ecrecoverFn',
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
name: 'signerAddress',
|
||||||
|
type: 'address',
|
||||||
|
|
||||||
|
},
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'pure',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
constant: true,
|
||||||
|
inputs: [
|
||||||
|
],
|
||||||
|
name: 'revertWithConstant',
|
||||||
|
outputs: [
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'pure',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
constant: true,
|
||||||
|
inputs: [
|
||||||
|
],
|
||||||
|
name: 'simpleRevert',
|
||||||
|
outputs: [
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'pure',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
constant: true,
|
||||||
|
inputs: [
|
||||||
|
],
|
||||||
|
name: 'requireWithConstant',
|
||||||
|
outputs: [
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'pure',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
constant: true,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: 'x',
|
||||||
|
type: 'uint256',
|
||||||
|
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'simplePureFunctionWithInput',
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
name: 'sum',
|
||||||
|
type: 'uint256',
|
||||||
|
|
||||||
|
},
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'pure',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
constant: true,
|
||||||
|
inputs: [
|
||||||
|
],
|
||||||
|
name: 'simplePureFunction',
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
name: 'result',
|
||||||
|
type: 'uint256',
|
||||||
|
|
||||||
|
},
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'pure',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
constant: true,
|
||||||
|
inputs: [
|
||||||
|
],
|
||||||
|
name: 'pureFunctionWithConstant',
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
name: 'someConstant',
|
||||||
|
type: 'uint256',
|
||||||
|
|
||||||
|
},
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'pure',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
] as ContractAbi;
|
||||||
|
return abi;
|
||||||
}
|
}
|
||||||
} // tslint:disable:max-file-line-count
|
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||||
|
super('AbiGenDummy', AbiGenDummyContract.ABI(), address, supportedProvider, txDefaults);
|
||||||
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// tslint:disable:max-file-line-count
|
||||||
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
||||||
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
||||||
|
@ -78,14 +78,26 @@ 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(abi, txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new LibDummyContract(txReceipt.contractAddress as string, provider, txDefaults);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
|
||||||
super('LibDummy', abi, address, supportedProvider, txDefaults);
|
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
/**
|
||||||
|
* @returns The contract ABI
|
||||||
|
*/
|
||||||
|
public static ABI(): ContractAbi {
|
||||||
|
const abi = [
|
||||||
|
] as ContractAbi;
|
||||||
|
return abi;
|
||||||
}
|
}
|
||||||
} // tslint:disable:max-file-line-count
|
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||||
|
super('LibDummy', LibDummyContract.ABI(), address, supportedProvider, txDefaults);
|
||||||
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// tslint:disable:max-file-line-count
|
||||||
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
||||||
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
||||||
|
@ -170,14 +170,68 @@ 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(abi, txReceipt.contractAddress as string, provider, txDefaults);
|
const contractInstance = new TestLibDummyContract(txReceipt.contractAddress as string, provider, txDefaults);
|
||||||
contractInstance.constructorArgs = [];
|
contractInstance.constructorArgs = [];
|
||||||
return contractInstance;
|
return contractInstance;
|
||||||
}
|
}
|
||||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
|
||||||
super('TestLibDummy', abi, address, supportedProvider, txDefaults);
|
|
||||||
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
|
/**
|
||||||
|
* @returns The contract ABI
|
||||||
|
*/
|
||||||
|
public static ABI(): ContractAbi {
|
||||||
|
const abi = [
|
||||||
|
{
|
||||||
|
constant: true,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: 'x',
|
||||||
|
type: 'uint256',
|
||||||
|
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'publicAddConstant',
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
name: 'result',
|
||||||
|
type: 'uint256',
|
||||||
|
|
||||||
|
},
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'pure',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
constant: true,
|
||||||
|
inputs: [
|
||||||
|
{
|
||||||
|
name: 'x',
|
||||||
|
type: 'uint256',
|
||||||
|
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'publicAddOne',
|
||||||
|
outputs: [
|
||||||
|
{
|
||||||
|
name: 'result',
|
||||||
|
type: 'uint256',
|
||||||
|
|
||||||
|
},
|
||||||
|
],
|
||||||
|
payable: false,
|
||||||
|
stateMutability: 'pure',
|
||||||
|
type: 'function',
|
||||||
|
},
|
||||||
|
] as ContractAbi;
|
||||||
|
return abi;
|
||||||
}
|
}
|
||||||
} // tslint:disable:max-file-line-count
|
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||||
|
super('TestLibDummy', TestLibDummyContract.ABI(), address, supportedProvider, txDefaults);
|
||||||
|
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// tslint:disable:max-file-line-count
|
||||||
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
// tslint:enable:no-unbound-method no-parameter-reassignment no-consecutive-blank-lines ordered-imports align
|
||||||
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
// tslint:enable:trailing-comma whitespace no-trailing-whitespace
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { CoordinatorContract, CoordinatorRegistryContract, ExchangeContract } from '@0x/abi-gen-wrappers';
|
import { CoordinatorContract, CoordinatorRegistryContract, ExchangeContract } from '@0x/abi-gen-wrappers';
|
||||||
import { getContractAddressesForNetworkOrThrow } from '@0x/contract-addresses';
|
import { getContractAddressesForNetworkOrThrow } from '@0x/contract-addresses';
|
||||||
import { Coordinator, CoordinatorRegistry, Exchange } from '@0x/contract-artifacts';
|
import { Coordinator } from '@0x/contract-artifacts';
|
||||||
import { schemas } from '@0x/json-schemas';
|
import { schemas } from '@0x/json-schemas';
|
||||||
import { generatePseudoRandomSalt, signatureUtils } from '@0x/order-utils';
|
import { generatePseudoRandomSalt, signatureUtils } from '@0x/order-utils';
|
||||||
import { Order, SignedOrder, SignedZeroExTransaction, ZeroExTransaction } from '@0x/types';
|
import { Order, SignedOrder, SignedZeroExTransaction, ZeroExTransaction } from '@0x/types';
|
||||||
@ -69,19 +69,16 @@ export class CoordinatorWrapper extends ContractWrapper {
|
|||||||
this.registryAddress = registryAddress === undefined ? contractAddresses.coordinatorRegistry : registryAddress;
|
this.registryAddress = registryAddress === undefined ? contractAddresses.coordinatorRegistry : registryAddress;
|
||||||
|
|
||||||
this._contractInstance = new CoordinatorContract(
|
this._contractInstance = new CoordinatorContract(
|
||||||
this.abi,
|
|
||||||
this.address,
|
this.address,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
);
|
);
|
||||||
this._registryInstance = new CoordinatorRegistryContract(
|
this._registryInstance = new CoordinatorRegistryContract(
|
||||||
CoordinatorRegistry.compilerOutput.abi,
|
|
||||||
this.registryAddress,
|
this.registryAddress,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
);
|
);
|
||||||
this._exchangeInstance = new ExchangeContract(
|
this._exchangeInstance = new ExchangeContract(
|
||||||
Exchange.compilerOutput.abi,
|
|
||||||
this.exchangeAddress,
|
this.exchangeAddress,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
|
@ -171,7 +171,6 @@ export class DutchAuctionWrapper extends ContractWrapper {
|
|||||||
return this._dutchAuctionContractIfExists;
|
return this._dutchAuctionContractIfExists;
|
||||||
}
|
}
|
||||||
const contractInstance = new DutchAuctionContract(
|
const contractInstance = new DutchAuctionContract(
|
||||||
this.abi,
|
|
||||||
this.address,
|
this.address,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
|
@ -66,7 +66,6 @@ export class ERC20ProxyWrapper extends ContractWrapper {
|
|||||||
return this._erc20ProxyContractIfExists;
|
return this._erc20ProxyContractIfExists;
|
||||||
}
|
}
|
||||||
const contractInstance = new ERC20ProxyContract(
|
const contractInstance = new ERC20ProxyContract(
|
||||||
this.abi,
|
|
||||||
this.address,
|
this.address,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
|
@ -431,7 +431,6 @@ export class ERC20TokenWrapper extends ContractWrapper {
|
|||||||
return tokenContract;
|
return tokenContract;
|
||||||
}
|
}
|
||||||
const contractInstance = new ERC20TokenContract(
|
const contractInstance = new ERC20TokenContract(
|
||||||
this.abi,
|
|
||||||
normalizedTokenAddress,
|
normalizedTokenAddress,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
|
@ -66,7 +66,6 @@ export class ERC721ProxyWrapper extends ContractWrapper {
|
|||||||
return this._erc721ProxyContractIfExists;
|
return this._erc721ProxyContractIfExists;
|
||||||
}
|
}
|
||||||
const contractInstance = new ERC721ProxyContract(
|
const contractInstance = new ERC721ProxyContract(
|
||||||
this.abi,
|
|
||||||
this.address,
|
this.address,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
|
@ -458,7 +458,6 @@ export class ERC721TokenWrapper extends ContractWrapper {
|
|||||||
return tokenContract;
|
return tokenContract;
|
||||||
}
|
}
|
||||||
const contractInstance = new ERC721TokenContract(
|
const contractInstance = new ERC721TokenContract(
|
||||||
this.abi,
|
|
||||||
normalizedTokenAddress,
|
normalizedTokenAddress,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
|
@ -199,7 +199,6 @@ export class EtherTokenWrapper extends ContractWrapper {
|
|||||||
return etherTokenContract;
|
return etherTokenContract;
|
||||||
}
|
}
|
||||||
const contractInstance = new WETH9Contract(
|
const contractInstance = new WETH9Contract(
|
||||||
this.abi,
|
|
||||||
etherTokenAddress,
|
etherTokenAddress,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { ExchangeContract, ExchangeEventArgs, ExchangeEvents, IAssetProxyContract } from '@0x/abi-gen-wrappers';
|
import { ExchangeContract, ExchangeEventArgs, ExchangeEvents, IAssetProxyContract } from '@0x/abi-gen-wrappers';
|
||||||
import { Exchange, IAssetProxy } from '@0x/contract-artifacts';
|
import { Exchange } from '@0x/contract-artifacts';
|
||||||
import { schemas } from '@0x/json-schemas';
|
import { schemas } from '@0x/json-schemas';
|
||||||
import {
|
import {
|
||||||
assetDataUtils,
|
assetDataUtils,
|
||||||
@ -1212,11 +1212,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
|||||||
const makerAssetData = signedOrder.makerAssetData;
|
const makerAssetData = signedOrder.makerAssetData;
|
||||||
const makerAssetDataProxyId = assetDataUtils.decodeAssetProxyId(signedOrder.makerAssetData);
|
const makerAssetDataProxyId = assetDataUtils.decodeAssetProxyId(signedOrder.makerAssetData);
|
||||||
const assetProxyAddress = await exchangeInstance.assetProxies.callAsync(makerAssetDataProxyId);
|
const assetProxyAddress = await exchangeInstance.assetProxies.callAsync(makerAssetDataProxyId);
|
||||||
const assetProxy = new IAssetProxyContract(
|
const assetProxy = new IAssetProxyContract(assetProxyAddress, this._web3Wrapper.getProvider());
|
||||||
IAssetProxy.compilerOutput.abi,
|
|
||||||
assetProxyAddress,
|
|
||||||
this._web3Wrapper.getProvider(),
|
|
||||||
);
|
|
||||||
|
|
||||||
const result = await assetProxy.transferFrom.callAsync(
|
const result = await assetProxy.transferFrom.callAsync(
|
||||||
makerAssetData,
|
makerAssetData,
|
||||||
@ -1285,7 +1281,6 @@ export class ExchangeWrapper extends ContractWrapper {
|
|||||||
return this._exchangeContractIfExists;
|
return this._exchangeContractIfExists;
|
||||||
}
|
}
|
||||||
const contractInstance = new ExchangeContract(
|
const contractInstance = new ExchangeContract(
|
||||||
this.abi,
|
|
||||||
this.address,
|
this.address,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
|
@ -241,7 +241,6 @@ export class ForwarderWrapper extends ContractWrapper {
|
|||||||
return this._forwarderContractIfExists;
|
return this._forwarderContractIfExists;
|
||||||
}
|
}
|
||||||
const contractInstance = new ForwarderContract(
|
const contractInstance = new ForwarderContract(
|
||||||
this.abi,
|
|
||||||
this.address,
|
this.address,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
|
@ -174,7 +174,6 @@ export class OrderValidatorWrapper extends ContractWrapper {
|
|||||||
return this._orderValidatorContractIfExists;
|
return this._orderValidatorContractIfExists;
|
||||||
}
|
}
|
||||||
const contractInstance = new OrderValidatorContract(
|
const contractInstance = new OrderValidatorContract(
|
||||||
this.abi,
|
|
||||||
this.address,
|
this.address,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { CoordinatorRegistryContract } from '@0x/abi-gen-wrappers';
|
import { CoordinatorRegistryContract } from '@0x/abi-gen-wrappers';
|
||||||
import { CoordinatorRegistry } from '@0x/contract-artifacts';
|
|
||||||
import { constants } from '@0x/contracts-test-utils';
|
import { constants } from '@0x/contracts-test-utils';
|
||||||
import { defaultOrmConfig, getAppAsync } from '@0x/coordinator-server';
|
import { defaultOrmConfig, getAppAsync } from '@0x/coordinator-server';
|
||||||
import { BlockchainLifecycle } from '@0x/dev-utils';
|
import { BlockchainLifecycle } from '@0x/dev-utils';
|
||||||
@ -162,11 +161,7 @@ describe('CoordinatorWrapper', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// setup coordinator registry
|
// setup coordinator registry
|
||||||
coordinatorRegistryInstance = new CoordinatorRegistryContract(
|
coordinatorRegistryInstance = new CoordinatorRegistryContract(contractAddresses.coordinatorRegistry, provider);
|
||||||
CoordinatorRegistry.compilerOutput.abi,
|
|
||||||
contractAddresses.coordinatorRegistry,
|
|
||||||
provider,
|
|
||||||
);
|
|
||||||
|
|
||||||
// register coordinator server
|
// register coordinator server
|
||||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { DummyERC20TokenContract } from '@0x/abi-gen-wrappers';
|
import { DummyERC20TokenContract } from '@0x/abi-gen-wrappers';
|
||||||
import * as artifacts from '@0x/contract-artifacts';
|
|
||||||
import { assetDataUtils } from '@0x/order-utils';
|
import { assetDataUtils } from '@0x/order-utils';
|
||||||
import { orderFactory } from '@0x/order-utils/lib/src/order_factory';
|
import { orderFactory } from '@0x/order-utils/lib/src/order_factory';
|
||||||
import { SignedOrder } from '@0x/types';
|
import { SignedOrder } from '@0x/types';
|
||||||
@ -122,7 +121,6 @@ export class DutchAuctionUtils {
|
|||||||
}
|
}
|
||||||
private async _increaseERC20BalanceAsync(tokenAddress: string, address: string, amount: BigNumber): Promise<void> {
|
private async _increaseERC20BalanceAsync(tokenAddress: string, address: string, amount: BigNumber): Promise<void> {
|
||||||
const erc20Token = new DummyERC20TokenContract(
|
const erc20Token = new DummyERC20TokenContract(
|
||||||
artifacts.DummyERC20Token.compilerOutput.abi,
|
|
||||||
tokenAddress,
|
tokenAddress,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
@ -138,7 +136,6 @@ export class DutchAuctionUtils {
|
|||||||
amount: BigNumber,
|
amount: BigNumber,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const erc20Token = new DummyERC20TokenContract(
|
const erc20Token = new DummyERC20TokenContract(
|
||||||
artifacts.DummyERC20Token.compilerOutput.abi,
|
|
||||||
tokenAddress,
|
tokenAddress,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { DummyERC721TokenContract } from '@0x/abi-gen-wrappers';
|
import { DummyERC721TokenContract } from '@0x/abi-gen-wrappers';
|
||||||
import { DummyERC721Token } from '@0x/contract-artifacts';
|
|
||||||
import { generatePseudoRandomSalt } from '@0x/order-utils';
|
import { generatePseudoRandomSalt } from '@0x/order-utils';
|
||||||
import { BigNumber } from '@0x/utils';
|
import { BigNumber } from '@0x/utils';
|
||||||
|
|
||||||
@ -26,7 +25,7 @@ export const tokenUtils = {
|
|||||||
return DUMMY_ERC_721_ADRESSES;
|
return DUMMY_ERC_721_ADRESSES;
|
||||||
},
|
},
|
||||||
async mintDummyERC721Async(address: string, tokenOwner: string): Promise<BigNumber> {
|
async mintDummyERC721Async(address: string, tokenOwner: string): Promise<BigNumber> {
|
||||||
const erc721 = new DummyERC721TokenContract(DummyERC721Token.compilerOutput.abi, address, provider, txDefaults);
|
const erc721 = new DummyERC721TokenContract(address, provider, txDefaults);
|
||||||
const tokenId = generatePseudoRandomSalt();
|
const tokenId = generatePseudoRandomSalt();
|
||||||
const txHash = await erc721.mint.sendTransactionAsync(tokenOwner, tokenId);
|
const txHash = await erc721.mint.sendTransactionAsync(tokenOwner, tokenId);
|
||||||
web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@0x/abi-gen-wrappers": "^4.3.0",
|
"@0x/abi-gen-wrappers": "^4.3.0",
|
||||||
"@0x/base-contract": "^5.1.0",
|
"@0x/base-contract": "^5.1.0",
|
||||||
"@0x/contract-artifacts": "^1.5.1",
|
|
||||||
"@0x/order-utils": "^8.1.1",
|
"@0x/order-utils": "^8.1.1",
|
||||||
"@0x/types": "^2.2.2",
|
"@0x/types": "^2.2.2",
|
||||||
"@0x/typescript-typings": "^4.2.2",
|
"@0x/typescript-typings": "^4.2.2",
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { DummyERC20TokenContract, DummyERC721TokenContract, ExchangeContract } from '@0x/abi-gen-wrappers';
|
import { DummyERC20TokenContract, DummyERC721TokenContract, ExchangeContract } from '@0x/abi-gen-wrappers';
|
||||||
import * as artifacts from '@0x/contract-artifacts';
|
|
||||||
import { assetDataUtils } from '@0x/order-utils';
|
import { assetDataUtils } from '@0x/order-utils';
|
||||||
import { orderFactory } from '@0x/order-utils/lib/src/order_factory';
|
import { orderFactory } from '@0x/order-utils/lib/src/order_factory';
|
||||||
import { OrderWithoutExchangeAddress, SignedOrder } from '@0x/types';
|
import { OrderWithoutExchangeAddress, SignedOrder } from '@0x/types';
|
||||||
@ -120,7 +119,6 @@ export class FillScenarios {
|
|||||||
fillableAmount,
|
fillableAmount,
|
||||||
);
|
);
|
||||||
const exchangeInstance = new ExchangeContract(
|
const exchangeInstance = new ExchangeContract(
|
||||||
artifacts.Exchange.compilerOutput.abi,
|
|
||||||
signedOrder.exchangeAddress,
|
signedOrder.exchangeAddress,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
@ -195,7 +193,6 @@ export class FillScenarios {
|
|||||||
tokenId: BigNumber,
|
tokenId: BigNumber,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const erc721Token = new DummyERC721TokenContract(
|
const erc721Token = new DummyERC721TokenContract(
|
||||||
artifacts.DummyERC721Token.compilerOutput.abi,
|
|
||||||
tokenAddress,
|
tokenAddress,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
@ -211,7 +208,6 @@ export class FillScenarios {
|
|||||||
tokenId: BigNumber,
|
tokenId: BigNumber,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const erc721Token = new DummyERC721TokenContract(
|
const erc721Token = new DummyERC721TokenContract(
|
||||||
artifacts.DummyERC721Token.compilerOutput.abi,
|
|
||||||
tokenAddress,
|
tokenAddress,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
@ -241,7 +237,6 @@ export class FillScenarios {
|
|||||||
}
|
}
|
||||||
private async _increaseERC20BalanceAsync(tokenAddress: string, address: string, amount: BigNumber): Promise<void> {
|
private async _increaseERC20BalanceAsync(tokenAddress: string, address: string, amount: BigNumber): Promise<void> {
|
||||||
const erc20Token = new DummyERC20TokenContract(
|
const erc20Token = new DummyERC20TokenContract(
|
||||||
artifacts.DummyERC20Token.compilerOutput.abi,
|
|
||||||
tokenAddress,
|
tokenAddress,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
@ -257,7 +252,6 @@ export class FillScenarios {
|
|||||||
amount: BigNumber,
|
amount: BigNumber,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const erc20Token = new DummyERC20TokenContract(
|
const erc20Token = new DummyERC20TokenContract(
|
||||||
artifacts.DummyERC20Token.compilerOutput.abi,
|
|
||||||
tokenAddress,
|
tokenAddress,
|
||||||
this._web3Wrapper.getProvider(),
|
this._web3Wrapper.getProvider(),
|
||||||
this._web3Wrapper.getContractDefaults(),
|
this._web3Wrapper.getContractDefaults(),
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { ExchangeContract, IValidatorContract, IWalletContract } from '@0x/abi-gen-wrappers';
|
import { ExchangeContract, IValidatorContract, IWalletContract } from '@0x/abi-gen-wrappers';
|
||||||
import { getContractAddressesForNetworkOrThrow } from '@0x/contract-addresses';
|
import { getContractAddressesForNetworkOrThrow } from '@0x/contract-addresses';
|
||||||
import * as artifacts from '@0x/contract-artifacts';
|
|
||||||
import { schemas } from '@0x/json-schemas';
|
import { schemas } from '@0x/json-schemas';
|
||||||
import {
|
import {
|
||||||
ECSignature,
|
ECSignature,
|
||||||
@ -111,11 +110,7 @@ export const signatureUtils = {
|
|||||||
const web3Wrapper = new Web3Wrapper(provider);
|
const web3Wrapper = new Web3Wrapper(provider);
|
||||||
const networkId = await web3Wrapper.getNetworkIdAsync();
|
const networkId = await web3Wrapper.getNetworkIdAsync();
|
||||||
const addresses = getContractAddressesForNetworkOrThrow(networkId);
|
const addresses = getContractAddressesForNetworkOrThrow(networkId);
|
||||||
const exchangeContract = new ExchangeContract(
|
const exchangeContract = new ExchangeContract(addresses.exchange, provider);
|
||||||
artifacts.Exchange.compilerOutput.abi,
|
|
||||||
addresses.exchange,
|
|
||||||
provider,
|
|
||||||
);
|
|
||||||
const isValid = await exchangeContract.preSigned.callAsync(data, signerAddress);
|
const isValid = await exchangeContract.preSigned.callAsync(data, signerAddress);
|
||||||
return isValid;
|
return isValid;
|
||||||
},
|
},
|
||||||
@ -139,7 +134,7 @@ export const signatureUtils = {
|
|||||||
assert.isETHAddressHex('signerAddress', signerAddress);
|
assert.isETHAddressHex('signerAddress', signerAddress);
|
||||||
// tslint:disable-next-line:custom-no-magic-numbers
|
// tslint:disable-next-line:custom-no-magic-numbers
|
||||||
const signatureWithoutType = signature.slice(0, -2);
|
const signatureWithoutType = signature.slice(0, -2);
|
||||||
const walletContract = new IWalletContract(artifacts.IWallet.compilerOutput.abi, signerAddress, provider);
|
const walletContract = new IWalletContract(signerAddress, provider);
|
||||||
const isValid = await walletContract.isValidSignature.callAsync(data, signatureWithoutType);
|
const isValid = await walletContract.isValidSignature.callAsync(data, signatureWithoutType);
|
||||||
return isValid;
|
return isValid;
|
||||||
},
|
},
|
||||||
@ -162,7 +157,7 @@ export const signatureUtils = {
|
|||||||
assert.isHexString('signature', signature);
|
assert.isHexString('signature', signature);
|
||||||
assert.isETHAddressHex('signerAddress', signerAddress);
|
assert.isETHAddressHex('signerAddress', signerAddress);
|
||||||
const validatorSignature = parseValidatorSignature(signature);
|
const validatorSignature = parseValidatorSignature(signature);
|
||||||
const exchangeContract = new ExchangeContract(artifacts.Exchange.compilerOutput.abi, signerAddress, provider);
|
const exchangeContract = new ExchangeContract(signerAddress, provider);
|
||||||
const isValidatorApproved = await exchangeContract.allowedValidators.callAsync(
|
const isValidatorApproved = await exchangeContract.allowedValidators.callAsync(
|
||||||
signerAddress,
|
signerAddress,
|
||||||
validatorSignature.validatorAddress,
|
validatorSignature.validatorAddress,
|
||||||
@ -173,11 +168,7 @@ export const signatureUtils = {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const validatorContract = new IValidatorContract(
|
const validatorContract = new IValidatorContract(signerAddress, provider);
|
||||||
artifacts.IValidator.compilerOutput.abi,
|
|
||||||
signerAddress,
|
|
||||||
provider,
|
|
||||||
);
|
|
||||||
const isValid = await validatorContract.isValidSignature.callAsync(
|
const isValid = await validatorContract.isValidSignature.callAsync(
|
||||||
data,
|
data,
|
||||||
signerAddress,
|
signerAddress,
|
||||||
|
108
yarn.lock
108
yarn.lock
@ -512,97 +512,6 @@
|
|||||||
lodash "^4.17.11"
|
lodash "^4.17.11"
|
||||||
uuid "^3.3.2"
|
uuid "^3.3.2"
|
||||||
|
|
||||||
"@0x/contracts-asset-proxy@^1.0.2":
|
|
||||||
version "1.0.9"
|
|
||||||
resolved "https://registry.npmjs.org/@0x/contracts-asset-proxy/-/contracts-asset-proxy-1.0.9.tgz#3a48e64b93ddc642834bde1bd09cdd84ca688a2b"
|
|
||||||
dependencies:
|
|
||||||
"@0x/base-contract" "^5.0.2"
|
|
||||||
"@0x/contracts-erc20" "^1.0.9"
|
|
||||||
"@0x/contracts-erc721" "^1.0.9"
|
|
||||||
"@0x/contracts-utils" "2.0.1"
|
|
||||||
"@0x/order-utils" "^7.0.2"
|
|
||||||
"@0x/types" "^2.1.1"
|
|
||||||
"@0x/typescript-typings" "^4.1.0"
|
|
||||||
"@0x/utils" "^4.2.2"
|
|
||||||
"@0x/web3-wrapper" "^6.0.2"
|
|
||||||
ethereum-types "^2.1.0"
|
|
||||||
lodash "^4.17.11"
|
|
||||||
|
|
||||||
"@0x/contracts-erc20@^1.0.2", "@0x/contracts-erc20@^1.0.9":
|
|
||||||
version "1.0.9"
|
|
||||||
resolved "https://registry.npmjs.org/@0x/contracts-erc20/-/contracts-erc20-1.0.9.tgz#366ce8222dcae5ade0ea7ca95332416a080f6abf"
|
|
||||||
dependencies:
|
|
||||||
"@0x/base-contract" "^5.0.2"
|
|
||||||
"@0x/contracts-exchange-libs" "1.0.2"
|
|
||||||
"@0x/contracts-utils" "2.0.1"
|
|
||||||
"@0x/types" "^2.1.1"
|
|
||||||
"@0x/typescript-typings" "^4.1.0"
|
|
||||||
"@0x/utils" "^4.2.2"
|
|
||||||
"@0x/web3-wrapper" "^6.0.2"
|
|
||||||
ethereum-types "^2.1.0"
|
|
||||||
lodash "^4.17.11"
|
|
||||||
|
|
||||||
"@0x/contracts-erc721@^1.0.2", "@0x/contracts-erc721@^1.0.9":
|
|
||||||
version "1.0.9"
|
|
||||||
resolved "https://registry.npmjs.org/@0x/contracts-erc721/-/contracts-erc721-1.0.9.tgz#3991858a3bf5a80dcd6e5fd65e938f8adc3b347c"
|
|
||||||
dependencies:
|
|
||||||
"@0x/base-contract" "^5.0.2"
|
|
||||||
"@0x/contracts-utils" "2.0.1"
|
|
||||||
"@0x/types" "^2.1.1"
|
|
||||||
"@0x/typescript-typings" "^4.1.0"
|
|
||||||
"@0x/utils" "^4.2.2"
|
|
||||||
"@0x/web3-wrapper" "^6.0.2"
|
|
||||||
ethereum-types "^2.1.0"
|
|
||||||
lodash "^4.17.11"
|
|
||||||
|
|
||||||
"@0x/contracts-exchange-libs@1.0.2":
|
|
||||||
version "1.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@0x/contracts-exchange-libs/-/contracts-exchange-libs-1.0.2.tgz#0682c01cdb3e36100bda0ffbdf9badb5b8a01fc4"
|
|
||||||
dependencies:
|
|
||||||
"@0x/base-contract" "^4.0.1"
|
|
||||||
"@0x/contracts-utils" "^2.0.1"
|
|
||||||
"@0x/order-utils" "^5.0.0"
|
|
||||||
"@0x/types" "^2.0.1"
|
|
||||||
"@0x/typescript-typings" "^4.0.0"
|
|
||||||
"@0x/utils" "^4.0.2"
|
|
||||||
"@0x/web3-wrapper" "^4.0.1"
|
|
||||||
ethereum-types "^2.0.0"
|
|
||||||
lodash "^4.17.5"
|
|
||||||
|
|
||||||
"@0x/contracts-exchange-libs@^1.0.2":
|
|
||||||
version "1.1.3"
|
|
||||||
resolved "https://registry.npmjs.org/@0x/contracts-exchange-libs/-/contracts-exchange-libs-1.1.3.tgz#dc9429e9c5fc750e9f5006e5ad53ebd7aa577c28"
|
|
||||||
dependencies:
|
|
||||||
"@0x/base-contract" "^5.0.2"
|
|
||||||
"@0x/contracts-utils" "^2.0.8"
|
|
||||||
"@0x/order-utils" "^7.0.2"
|
|
||||||
"@0x/types" "^2.1.1"
|
|
||||||
"@0x/typescript-typings" "^4.1.0"
|
|
||||||
"@0x/utils" "^4.2.2"
|
|
||||||
"@0x/web3-wrapper" "^6.0.2"
|
|
||||||
ethereum-types "^2.1.0"
|
|
||||||
lodash "^4.17.11"
|
|
||||||
|
|
||||||
"@0x/contracts-exchange@1.0.2":
|
|
||||||
version "1.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@0x/contracts-exchange/-/contracts-exchange-1.0.2.tgz#4c02378b26a7bf6324e16a41f2851c43fed82c63"
|
|
||||||
dependencies:
|
|
||||||
"@0x/base-contract" "^4.0.1"
|
|
||||||
"@0x/contracts-asset-proxy" "^1.0.2"
|
|
||||||
"@0x/contracts-erc20" "^1.0.2"
|
|
||||||
"@0x/contracts-erc721" "^1.0.2"
|
|
||||||
"@0x/contracts-exchange-libs" "^1.0.2"
|
|
||||||
"@0x/contracts-test-utils" "^3.0.1"
|
|
||||||
"@0x/contracts-utils" "^2.0.1"
|
|
||||||
"@0x/order-utils" "^5.0.0"
|
|
||||||
"@0x/types" "^2.0.1"
|
|
||||||
"@0x/typescript-typings" "^4.0.0"
|
|
||||||
"@0x/utils" "^4.0.2"
|
|
||||||
"@0x/web3-wrapper" "^4.0.1"
|
|
||||||
ethereum-types "^2.0.0"
|
|
||||||
ethereumjs-util "^5.1.1"
|
|
||||||
lodash "^4.17.5"
|
|
||||||
|
|
||||||
"@0x/contracts-utils@2.0.1":
|
"@0x/contracts-utils@2.0.1":
|
||||||
version "2.0.1"
|
version "2.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/contracts-utils/-/contracts-utils-2.0.1.tgz#32e298ab5e6edb045c37294063ff928b629db0a4"
|
resolved "https://registry.yarnpkg.com/@0x/contracts-utils/-/contracts-utils-2.0.1.tgz#32e298ab5e6edb045c37294063ff928b629db0a4"
|
||||||
@ -618,21 +527,6 @@
|
|||||||
ethereumjs-util "^5.1.1"
|
ethereumjs-util "^5.1.1"
|
||||||
lodash "^4.17.5"
|
lodash "^4.17.5"
|
||||||
|
|
||||||
"@0x/contracts-utils@^2.0.1", "@0x/contracts-utils@^2.0.8":
|
|
||||||
version "2.0.8"
|
|
||||||
resolved "https://registry.npmjs.org/@0x/contracts-utils/-/contracts-utils-2.0.8.tgz#b6a3775296e04c7ca9ebea7eae56fda48a43239d"
|
|
||||||
dependencies:
|
|
||||||
"@0x/base-contract" "^5.0.2"
|
|
||||||
"@0x/order-utils" "^7.0.2"
|
|
||||||
"@0x/types" "^2.1.1"
|
|
||||||
"@0x/typescript-typings" "^4.1.0"
|
|
||||||
"@0x/utils" "^4.2.2"
|
|
||||||
"@0x/web3-wrapper" "^6.0.2"
|
|
||||||
bn.js "^4.11.8"
|
|
||||||
ethereum-types "^2.1.0"
|
|
||||||
ethereumjs-util "^5.1.1"
|
|
||||||
lodash "^4.17.11"
|
|
||||||
|
|
||||||
"@0x/coordinator-server@0.1.1":
|
"@0x/coordinator-server@0.1.1":
|
||||||
version "0.1.1"
|
version "0.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/@0x/coordinator-server/-/coordinator-server-0.1.1.tgz#7eeb74959dc72b76756b95ccd14fd9fa8d072ede"
|
resolved "https://registry.yarnpkg.com/@0x/coordinator-server/-/coordinator-server-0.1.1.tgz#7eeb74959dc72b76756b95ccd14fd9fa8d072ede"
|
||||||
@ -684,7 +578,7 @@
|
|||||||
ethers "~4.0.4"
|
ethers "~4.0.4"
|
||||||
lodash "^4.17.11"
|
lodash "^4.17.11"
|
||||||
|
|
||||||
"@0x/order-utils@^7.0.2", "@0x/order-utils@^7.1.1", "@0x/order-utils@^7.2.0":
|
"@0x/order-utils@^7.1.1", "@0x/order-utils@^7.2.0":
|
||||||
version "7.2.0"
|
version "7.2.0"
|
||||||
resolved "https://registry.npmjs.org/@0x/order-utils/-/order-utils-7.2.0.tgz#c73d81e3225e9ec7736f9789e14388c9fe2b831c"
|
resolved "https://registry.npmjs.org/@0x/order-utils/-/order-utils-7.2.0.tgz#c73d81e3225e9ec7736f9789e14388c9fe2b831c"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user