[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/exchange-forwarder/generated-artifacts/
|
||||
contracts/dev-utils/generated-artifacts/
|
||||
/packages/abi-gen/test/generated-test/generated-artifacts
|
||||
/packages/abi-gen/test/generated-test/output
|
||||
packages/abi-gen/test/generated-test/generated-artifacts
|
||||
packages/abi-gen/test/generated-test/output
|
||||
packages/sol-tracing-utils/test/fixtures/artifacts/
|
||||
packages/metacoin/artifacts/
|
||||
python-packages/contract_artifacts/src/zero_ex/contract_artifacts/artifacts/
|
||||
|
@ -44,16 +44,8 @@ import {
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
|
||||
const assetProxyInterface = new IAssetProxyContract(
|
||||
artifacts.IAssetProxy.compilerOutput.abi,
|
||||
constants.NULL_ADDRESS,
|
||||
provider,
|
||||
);
|
||||
const assetDataInterface = new IAssetDataContract(
|
||||
artifacts.IAssetData.compilerOutput.abi,
|
||||
constants.NULL_ADDRESS,
|
||||
provider,
|
||||
);
|
||||
const assetProxyInterface = new IAssetProxyContract(constants.NULL_ADDRESS, provider);
|
||||
const assetDataInterface = new IAssetDataContract(constants.NULL_ADDRESS, provider);
|
||||
|
||||
// tslint:disable:no-unnecessary-type-assertion
|
||||
describe('Asset Transfer Proxies', () => {
|
||||
|
@ -42,12 +42,7 @@ describe('StaticCallProxy', () => {
|
||||
provider,
|
||||
txDefaults,
|
||||
);
|
||||
staticCallProxy = new IAssetProxyContract(
|
||||
artifacts.IAssetProxy.compilerOutput.abi,
|
||||
staticCallProxyWithoutTransferFrom.address,
|
||||
provider,
|
||||
txDefaults,
|
||||
);
|
||||
staticCallProxy = new IAssetProxyContract(staticCallProxyWithoutTransferFrom.address, provider, txDefaults);
|
||||
staticCallTarget = await TestStaticCallTargetContract.deployFrom0xArtifactAsync(
|
||||
artifacts.TestStaticCallTarget,
|
||||
provider,
|
||||
|
@ -36,11 +36,7 @@ export class ERC1155ProxyWrapper {
|
||||
const allArtifacts = _.merge(artifacts, erc1155Artifacts);
|
||||
this._logDecoder = new LogDecoder(this._web3Wrapper, allArtifacts);
|
||||
this._dummyTokenWrappers = [];
|
||||
this._assetProxyInterface = new IAssetProxyContract(
|
||||
artifacts.IAssetProxy.compilerOutput.abi,
|
||||
constants.NULL_ADDRESS,
|
||||
provider,
|
||||
);
|
||||
this._assetProxyInterface = new IAssetProxyContract(constants.NULL_ADDRESS, provider);
|
||||
this._tokenOwnerAddresses = tokenOwnerAddresses;
|
||||
this._contractOwnerAddress = contractOwnerAddress;
|
||||
this._fungibleTokenIds = [];
|
||||
|
@ -71,7 +71,7 @@
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contracts-asset-proxy": "^2.1.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-utils": "^3.1.6",
|
||||
"@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 { SignedOrder } from '@0x/types';
|
||||
|
||||
@ -6,11 +6,7 @@ import { constants } from './index';
|
||||
|
||||
export const exchangeDataEncoder = {
|
||||
encodeOrdersToExchangeData(fnName: string, orders: SignedOrder[]): string {
|
||||
const exchangeInstance = new IExchangeContract(
|
||||
artifacts.IExchange.compilerOutput.abi,
|
||||
devConstants.NULL_ADDRESS,
|
||||
provider,
|
||||
);
|
||||
const exchangeInstance = new IExchangeContract(devConstants.NULL_ADDRESS, provider);
|
||||
let data;
|
||||
if (constants.SINGLE_FILL_FN_NAMES.indexOf(fnName) !== -1) {
|
||||
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 { BlockchainLifecycle } from '@0x/dev-utils';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
@ -30,12 +30,7 @@ const signature =
|
||||
|
||||
describe('LibTransactionDecoder', () => {
|
||||
let libTxDecoder: LibTransactionDecoderContract;
|
||||
const exchangeInterface = new IExchangeContract(
|
||||
exchangeArtifacts.Exchange.compilerOutput.abi,
|
||||
constants.NULL_ADDRESS,
|
||||
provider,
|
||||
txDefaults,
|
||||
);
|
||||
const exchangeInterface = new IExchangeContract(constants.NULL_ADDRESS, provider, txDefaults);
|
||||
before(async () => {
|
||||
await blockchainLifecycle.startAsync();
|
||||
libTxDecoder = await LibTransactionDecoderContract.deployFrom0xArtifactAsync(
|
||||
|
@ -89,7 +89,7 @@ describe(ContractName.Forwarder, () => {
|
||||
erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address];
|
||||
|
||||
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);
|
||||
|
||||
wethAssetData = assetDataUtils.encodeERC20AssetData(wethContract.address);
|
||||
@ -135,7 +135,7 @@ describe(ContractName.Forwarder, () => {
|
||||
zrxAssetData,
|
||||
wethAssetData,
|
||||
);
|
||||
forwarderContract = new ForwarderContract(forwarderInstance.abi, forwarderInstance.address, provider);
|
||||
forwarderContract = new ForwarderContract(forwarderInstance.address, provider);
|
||||
forwarderWrapper = new ForwarderWrapper(forwarderContract, provider);
|
||||
const zrxDepositAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(10000), 18);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
|
@ -109,11 +109,7 @@ describe(ContractName.DutchAuction, () => {
|
||||
txDefaults,
|
||||
exchangeInstance.address,
|
||||
);
|
||||
dutchAuctionContract = new DutchAuctionContract(
|
||||
dutchAuctionInstance.abi,
|
||||
dutchAuctionInstance.address,
|
||||
provider,
|
||||
);
|
||||
dutchAuctionContract = new DutchAuctionContract(dutchAuctionInstance.address, provider);
|
||||
dutchAuctionTestWrapper = new DutchAuctionTestWrapper(dutchAuctionInstance, provider);
|
||||
|
||||
defaultMakerAssetAddress = erc20TokenA.address;
|
||||
|
@ -53,5 +53,5 @@ class {{contractName}}(BaseContractWrapper):
|
||||
def abi():
|
||||
"""Return the ABI to the underlying contract."""
|
||||
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}`);
|
||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
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}}];
|
||||
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: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": [
|
||||
{
|
||||
"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",
|
||||
"pr": 1823
|
||||
|
@ -15,6 +15,7 @@
|
||||
"lint": "tslint --format stylish --project .",
|
||||
"fix": "tslint --fix --format stylish --project .",
|
||||
"pre_build": "yarn generate_contract_wrappers",
|
||||
"prettier": "prettier --write src/**/* --config ../../.prettierrc",
|
||||
"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"
|
||||
},
|
||||
@ -46,6 +47,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contract-addresses": "^2.3.3",
|
||||
"@0x/contract-artifacts": "^1.5.1"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -23,7 +23,6 @@ import { assert } from '@0x/assert';
|
||||
import * as ethers from 'ethers';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
|
||||
/* istanbul ignore next */
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
@ -34,8 +33,7 @@ export class CoordinatorContract extends BaseContract {
|
||||
signature: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
): Promise<string> {
|
||||
assert.isString('hash', hash);
|
||||
assert.isString('signature', signature);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@ -46,10 +44,8 @@ export class CoordinatorContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments('getSignerAddress(bytes32,bytes)', [hash,
|
||||
signature
|
||||
]);
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments('getSignerAddress(bytes32,bytes)', [hash, signature]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -62,32 +58,27 @@ export class CoordinatorContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getSignerAddress(bytes32,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
hash: string,
|
||||
signature: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(hash: string, signature: string): string {
|
||||
assert.isString('hash', hash);
|
||||
assert.isString('signature', signature);
|
||||
const self = this as any as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getSignerAddress(bytes32,bytes)', [hash,
|
||||
signature
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getSignerAddress(bytes32,bytes)', [
|
||||
hash,
|
||||
signature,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public getTransactionHash = {
|
||||
async callAsync(
|
||||
transaction: {salt: BigNumber;signerAddress: string;data: string},
|
||||
transaction: { salt: BigNumber; signerAddress: string; data: string },
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
|
||||
): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -96,8 +87,9 @@ export class CoordinatorContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments('getTransactionHash((uint256,address,bytes))', [transaction
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments('getTransactionHash((uint256,address,bytes))', [
|
||||
transaction,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -111,29 +103,30 @@ export class CoordinatorContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getTransactionHash((uint256,address,bytes))');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
transaction: {salt: BigNumber;signerAddress: string;data: string},
|
||||
): string {
|
||||
|
||||
const self = this as any as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getTransactionHash((uint256,address,bytes))', [transaction
|
||||
]);
|
||||
getABIEncodedTransactionData(transaction: { salt: BigNumber; signerAddress: string; data: string }): string {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'getTransactionHash((uint256,address,bytes))',
|
||||
[transaction],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public getCoordinatorApprovalHash = {
|
||||
async callAsync(
|
||||
approval: {txOrigin: string;transactionHash: string;transactionSignature: string;approvalExpirationTimeSeconds: BigNumber},
|
||||
approval: {
|
||||
txOrigin: string;
|
||||
transactionHash: string;
|
||||
transactionSignature: string;
|
||||
approvalExpirationTimeSeconds: BigNumber;
|
||||
},
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
|
||||
): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -142,9 +135,11 @@ export class CoordinatorContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments('getCoordinatorApprovalHash((address,bytes32,bytes,uint256))', [approval
|
||||
]);
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'getCoordinatorApprovalHash((address,bytes32,bytes,uint256))',
|
||||
[approval],
|
||||
);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -157,42 +152,42 @@ export class CoordinatorContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getCoordinatorApprovalHash((address,bytes32,bytes,uint256))');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
approval: {txOrigin: string;transactionHash: string;transactionSignature: string;approvalExpirationTimeSeconds: BigNumber},
|
||||
): string {
|
||||
|
||||
const self = this as any as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getCoordinatorApprovalHash((address,bytes32,bytes,uint256))', [approval
|
||||
]);
|
||||
getABIEncodedTransactionData(approval: {
|
||||
txOrigin: string;
|
||||
transactionHash: string;
|
||||
transactionSignature: string;
|
||||
approvalExpirationTimeSeconds: BigNumber;
|
||||
}): string {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'getCoordinatorApprovalHash((address,bytes32,bytes,uint256))',
|
||||
[approval],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public executeTransaction = {
|
||||
async sendTransactionAsync(
|
||||
transaction: {salt: BigNumber;signerAddress: string;data: string},
|
||||
transaction: { salt: BigNumber; signerAddress: string; data: string },
|
||||
txOrigin: string,
|
||||
transactionSignature: string,
|
||||
approvalExpirationTimeSeconds: BigNumber[],
|
||||
approvalSignatures: string[],
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
|
||||
assert.isString('txOrigin', txOrigin);
|
||||
assert.isString('transactionSignature', transactionSignature);
|
||||
assert.isArray('approvalExpirationTimeSeconds', approvalExpirationTimeSeconds);
|
||||
assert.isArray('approvalSignatures', approvalSignatures);
|
||||
const self = this as any as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments('executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])', [transaction,
|
||||
txOrigin,
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures
|
||||
]);
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
[transaction, txOrigin, transactionSignature, approvalExpirationTimeSeconds, approvalSignatures],
|
||||
);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -206,14 +201,14 @@ export class CoordinatorContract extends BaseContract {
|
||||
txOrigin,
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures
|
||||
approvalSignatures,
|
||||
),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
transaction: {salt: BigNumber;signerAddress: string;data: string},
|
||||
transaction: { salt: BigNumber; signerAddress: string; data: string },
|
||||
txOrigin: string,
|
||||
transactionSignature: string,
|
||||
approvalExpirationTimeSeconds: BigNumber[],
|
||||
@ -222,18 +217,19 @@ export class CoordinatorContract extends BaseContract {
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
|
||||
assert.isString('txOrigin', txOrigin);
|
||||
assert.isString('transactionSignature', transactionSignature);
|
||||
assert.isArray('approvalExpirationTimeSeconds', approvalExpirationTimeSeconds);
|
||||
assert.isArray('approvalSignatures', approvalSignatures);
|
||||
const self = this as any as CoordinatorContract;
|
||||
const txHashPromise = self.executeTransaction.sendTransactionAsync(transaction,
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const txHashPromise = self.executeTransaction.sendTransactionAsync(
|
||||
transaction,
|
||||
txOrigin,
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures
|
||||
, txData);
|
||||
approvalSignatures,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -247,25 +243,22 @@ export class CoordinatorContract extends BaseContract {
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
transaction: {salt: BigNumber;signerAddress: string;data: string},
|
||||
transaction: { salt: BigNumber; signerAddress: string; data: string },
|
||||
txOrigin: string,
|
||||
transactionSignature: string,
|
||||
approvalExpirationTimeSeconds: BigNumber[],
|
||||
approvalSignatures: string[],
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<number> {
|
||||
|
||||
assert.isString('txOrigin', txOrigin);
|
||||
assert.isString('transactionSignature', transactionSignature);
|
||||
assert.isArray('approvalExpirationTimeSeconds', approvalExpirationTimeSeconds);
|
||||
assert.isArray('approvalSignatures', approvalSignatures);
|
||||
const self = this as any as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments('executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])', [transaction,
|
||||
txOrigin,
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures
|
||||
]);
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
[transaction, txOrigin, transactionSignature, approvalExpirationTimeSeconds, approvalSignatures],
|
||||
);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -278,16 +271,14 @@ export class CoordinatorContract extends BaseContract {
|
||||
return gas;
|
||||
},
|
||||
async callAsync(
|
||||
transaction: {salt: BigNumber;signerAddress: string;data: string},
|
||||
transaction: { salt: BigNumber; signerAddress: string; data: string },
|
||||
txOrigin: string,
|
||||
transactionSignature: string,
|
||||
approvalExpirationTimeSeconds: BigNumber[],
|
||||
approvalSignatures: string[],
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
|
||||
): Promise<void> {
|
||||
assert.isString('txOrigin', txOrigin);
|
||||
assert.isString('transactionSignature', transactionSignature);
|
||||
assert.isArray('approvalExpirationTimeSeconds', approvalExpirationTimeSeconds);
|
||||
@ -300,13 +291,11 @@ export class CoordinatorContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments('executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])', [transaction,
|
||||
txOrigin,
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures
|
||||
]);
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
[transaction, txOrigin, transactionSignature, approvalExpirationTimeSeconds, approvalSignatures],
|
||||
);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -317,41 +306,35 @@ export class CoordinatorContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])');
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
'executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
);
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
transaction: {salt: BigNumber;signerAddress: string;data: string},
|
||||
transaction: { salt: BigNumber; signerAddress: string; data: string },
|
||||
txOrigin: string,
|
||||
transactionSignature: string,
|
||||
approvalExpirationTimeSeconds: BigNumber[],
|
||||
approvalSignatures: string[],
|
||||
): string {
|
||||
|
||||
assert.isString('txOrigin', txOrigin);
|
||||
assert.isString('transactionSignature', transactionSignature);
|
||||
assert.isArray('approvalExpirationTimeSeconds', approvalExpirationTimeSeconds);
|
||||
assert.isArray('approvalSignatures', approvalSignatures);
|
||||
const self = this as any as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])', [transaction,
|
||||
txOrigin,
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures
|
||||
]);
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'executeTransaction((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
[transaction, txOrigin, transactionSignature, approvalExpirationTimeSeconds, approvalSignatures],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public EIP712_EXCHANGE_DOMAIN_HASH = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -360,7 +343,7 @@ export class CoordinatorContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as CoordinatorContract;
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments('EIP712_EXCHANGE_DOMAIN_HASH()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -374,30 +357,26 @@ export class CoordinatorContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('EIP712_EXCHANGE_DOMAIN_HASH()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
): string {
|
||||
const self = this as any as CoordinatorContract;
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('EIP712_EXCHANGE_DOMAIN_HASH()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public assertValidCoordinatorApprovals = {
|
||||
async callAsync(
|
||||
transaction: {salt: BigNumber;signerAddress: string;data: string},
|
||||
transaction: { salt: BigNumber; signerAddress: string; data: string },
|
||||
txOrigin: string,
|
||||
transactionSignature: string,
|
||||
approvalExpirationTimeSeconds: BigNumber[],
|
||||
approvalSignatures: string[],
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
|
||||
): Promise<void> {
|
||||
assert.isString('txOrigin', txOrigin);
|
||||
assert.isString('transactionSignature', transactionSignature);
|
||||
assert.isArray('approvalExpirationTimeSeconds', approvalExpirationTimeSeconds);
|
||||
@ -410,13 +389,11 @@ export class CoordinatorContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments('assertValidCoordinatorApprovals((uint256,address,bytes),address,bytes,uint256[],bytes[])', [transaction,
|
||||
txOrigin,
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures
|
||||
]);
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'assertValidCoordinatorApprovals((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
[transaction, txOrigin, transactionSignature, approvalExpirationTimeSeconds, approvalSignatures],
|
||||
);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -427,32 +404,30 @@ export class CoordinatorContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('assertValidCoordinatorApprovals((uint256,address,bytes),address,bytes,uint256[],bytes[])');
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
'assertValidCoordinatorApprovals((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
);
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
transaction: {salt: BigNumber;signerAddress: string;data: string},
|
||||
transaction: { salt: BigNumber; signerAddress: string; data: string },
|
||||
txOrigin: string,
|
||||
transactionSignature: string,
|
||||
approvalExpirationTimeSeconds: BigNumber[],
|
||||
approvalSignatures: string[],
|
||||
): string {
|
||||
|
||||
assert.isString('txOrigin', txOrigin);
|
||||
assert.isString('transactionSignature', transactionSignature);
|
||||
assert.isArray('approvalExpirationTimeSeconds', approvalExpirationTimeSeconds);
|
||||
assert.isArray('approvalSignatures', approvalSignatures);
|
||||
const self = this as any as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('assertValidCoordinatorApprovals((uint256,address,bytes),address,bytes,uint256[],bytes[])', [transaction,
|
||||
txOrigin,
|
||||
transactionSignature,
|
||||
approvalExpirationTimeSeconds,
|
||||
approvalSignatures
|
||||
]);
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'assertValidCoordinatorApprovals((uint256,address,bytes),address,bytes,uint256[],bytes[])',
|
||||
[transaction, txOrigin, transactionSignature, approvalExpirationTimeSeconds, approvalSignatures],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@ -461,7 +436,21 @@ export class CoordinatorContract extends BaseContract {
|
||||
data: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>
|
||||
): Promise<
|
||||
Array<{
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
}>
|
||||
> {
|
||||
assert.isString('data', data);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@ -472,9 +461,8 @@ export class CoordinatorContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments('decodeOrdersFromFillData(bytes)', [data
|
||||
]);
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments('decodeOrdersFromFillData(bytes)', [data]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -487,27 +475,34 @@ export class CoordinatorContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('decodeOrdersFromFillData(bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<Array<{makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string}>
|
||||
const result = abiEncoder.strictDecodeReturnValue<
|
||||
Array<{
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
}>
|
||||
>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
data: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(data: string): string {
|
||||
assert.isString('data', data);
|
||||
const self = this as any as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('decodeOrdersFromFillData(bytes)', [data
|
||||
]);
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('decodeOrdersFromFillData(bytes)', [data]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public EIP712_COORDINATOR_DOMAIN_HASH = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -516,7 +511,7 @@ export class CoordinatorContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as CoordinatorContract;
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const encodedData = self._strictEncodeArguments('EIP712_COORDINATOR_DOMAIN_HASH()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -530,14 +525,12 @@ export class CoordinatorContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('EIP712_COORDINATOR_DOMAIN_HASH()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
): string {
|
||||
const self = this as any as CoordinatorContract;
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as CoordinatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('EIP712_COORDINATOR_DOMAIN_HASH()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@ -559,8 +552,7 @@ export class CoordinatorContract extends BaseContract {
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
return CoordinatorContract.deployAsync(bytecode, abi, provider, txDefaults, _exchange
|
||||
);
|
||||
return CoordinatorContract.deployAsync(bytecode, abi, provider, txDefaults, _exchange);
|
||||
}
|
||||
public static async deployAsync(
|
||||
bytecode: string,
|
||||
@ -577,20 +569,17 @@ export class CoordinatorContract extends BaseContract {
|
||||
]);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[_exchange
|
||||
] = BaseContract._formatABIDataItemList(
|
||||
[_exchange] = BaseContract._formatABIDataItemList(
|
||||
constructorAbi.inputs,
|
||||
[_exchange
|
||||
],
|
||||
[_exchange],
|
||||
BaseContract._bigNumberToString,
|
||||
);
|
||||
const iface = new ethers.utils.Interface(abi);
|
||||
const deployInfo = iface.deployFunction;
|
||||
const txData = deployInfo.encode(bytecode, [_exchange
|
||||
]);
|
||||
const txData = deployInfo.encode(bytecode, [_exchange]);
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{data: txData},
|
||||
{ data: txData },
|
||||
txDefaults,
|
||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||
);
|
||||
@ -598,15 +587,315 @@ export class CoordinatorContract extends BaseContract {
|
||||
logUtils.log(`transactionHash: ${txHash}`);
|
||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
logUtils.log(`Coordinator successfully deployed at ${txReceipt.contractAddress}`);
|
||||
const contractInstance = new CoordinatorContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
|
||||
contractInstance.constructorArgs = [_exchange
|
||||
];
|
||||
const contractInstance = new CoordinatorContract(txReceipt.contractAddress as string, provider, txDefaults);
|
||||
contractInstance.constructorArgs = [_exchange];
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('Coordinator', 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: 'getSignerAddress',
|
||||
outputs: [
|
||||
{
|
||||
name: 'signerAddress',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'pure',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [
|
||||
{
|
||||
name: 'transaction',
|
||||
type: 'tuple',
|
||||
components: [
|
||||
{
|
||||
name: 'salt',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'signerAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'data',
|
||||
type: 'bytes',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
name: 'getTransactionHash',
|
||||
outputs: [
|
||||
{
|
||||
name: 'transactionHash',
|
||||
type: 'bytes32',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [
|
||||
{
|
||||
name: 'approval',
|
||||
type: 'tuple',
|
||||
components: [
|
||||
{
|
||||
name: 'txOrigin',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'transactionHash',
|
||||
type: 'bytes32',
|
||||
},
|
||||
{
|
||||
name: 'transactionSignature',
|
||||
type: 'bytes',
|
||||
},
|
||||
{
|
||||
name: 'approvalExpirationTimeSeconds',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
name: 'getCoordinatorApprovalHash',
|
||||
outputs: [
|
||||
{
|
||||
name: 'approvalHash',
|
||||
type: 'bytes32',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'transaction',
|
||||
type: 'tuple',
|
||||
components: [
|
||||
{
|
||||
name: 'salt',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'signerAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'data',
|
||||
type: 'bytes',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'txOrigin',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'transactionSignature',
|
||||
type: 'bytes',
|
||||
},
|
||||
{
|
||||
name: 'approvalExpirationTimeSeconds',
|
||||
type: 'uint256[]',
|
||||
},
|
||||
{
|
||||
name: 'approvalSignatures',
|
||||
type: 'bytes[]',
|
||||
},
|
||||
],
|
||||
name: 'executeTransaction',
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'EIP712_EXCHANGE_DOMAIN_HASH',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'bytes32',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [
|
||||
{
|
||||
name: 'transaction',
|
||||
type: 'tuple',
|
||||
components: [
|
||||
{
|
||||
name: 'salt',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'signerAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'data',
|
||||
type: 'bytes',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'txOrigin',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'transactionSignature',
|
||||
type: 'bytes',
|
||||
},
|
||||
{
|
||||
name: 'approvalExpirationTimeSeconds',
|
||||
type: 'uint256[]',
|
||||
},
|
||||
{
|
||||
name: 'approvalSignatures',
|
||||
type: 'bytes[]',
|
||||
},
|
||||
],
|
||||
name: 'assertValidCoordinatorApprovals',
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [
|
||||
{
|
||||
name: 'data',
|
||||
type: 'bytes',
|
||||
},
|
||||
],
|
||||
name: 'decodeOrdersFromFillData',
|
||||
outputs: [
|
||||
{
|
||||
name: 'orders',
|
||||
type: 'tuple[]',
|
||||
components: [
|
||||
{
|
||||
name: 'makerAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'takerAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'feeRecipientAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'senderAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'makerAssetAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'takerAssetAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'makerFee',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'takerFee',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'expirationTimeSeconds',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'salt',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'makerAssetData',
|
||||
type: 'bytes',
|
||||
},
|
||||
{
|
||||
name: 'takerAssetData',
|
||||
type: 'bytes',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'pure',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'EIP712_COORDINATOR_DOMAIN_HASH',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'bytes32',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
name: '_exchange',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'constructor',
|
||||
},
|
||||
] as ContractAbi;
|
||||
return abi;
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('Coordinator', CoordinatorContract.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:trailing-comma whitespace no-trailing-whitespace
|
||||
|
@ -23,8 +23,7 @@ import { assert } from '@0x/assert';
|
||||
import * as ethers from 'ethers';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
export type CoordinatorRegistryEventArgs =
|
||||
| CoordinatorRegistryCoordinatorEndpointSetEventArgs;
|
||||
export type CoordinatorRegistryEventArgs = CoordinatorRegistryCoordinatorEndpointSetEventArgs;
|
||||
|
||||
export enum CoordinatorRegistryEvents {
|
||||
CoordinatorEndpointSet = 'CoordinatorEndpointSet',
|
||||
@ -35,20 +34,15 @@ export interface CoordinatorRegistryCoordinatorEndpointSetEventArgs extends Deco
|
||||
coordinatorEndpoint: string;
|
||||
}
|
||||
|
||||
|
||||
/* istanbul ignore next */
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class CoordinatorRegistryContract extends BaseContract {
|
||||
public setCoordinatorEndpoint = {
|
||||
async sendTransactionAsync(
|
||||
coordinatorEndpoint: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
async sendTransactionAsync(coordinatorEndpoint: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
||||
const self = this as any as CoordinatorRegistryContract;
|
||||
const encodedData = self._strictEncodeArguments('setCoordinatorEndpoint(string)', [coordinatorEndpoint
|
||||
]);
|
||||
const self = (this as any) as CoordinatorRegistryContract;
|
||||
const encodedData = self._strictEncodeArguments('setCoordinatorEndpoint(string)', [coordinatorEndpoint]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -56,10 +50,7 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.setCoordinatorEndpoint.estimateGasAsync.bind(
|
||||
self,
|
||||
coordinatorEndpoint
|
||||
),
|
||||
self.setCoordinatorEndpoint.estimateGasAsync.bind(self, coordinatorEndpoint),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -71,9 +62,8 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
||||
const self = this as any as CoordinatorRegistryContract;
|
||||
const txHashPromise = self.setCoordinatorEndpoint.sendTransactionAsync(coordinatorEndpoint
|
||||
, txData);
|
||||
const self = (this as any) as CoordinatorRegistryContract;
|
||||
const txHashPromise = self.setCoordinatorEndpoint.sendTransactionAsync(coordinatorEndpoint, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -86,14 +76,10 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
coordinatorEndpoint: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<number> {
|
||||
async estimateGasAsync(coordinatorEndpoint: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
||||
const self = this as any as CoordinatorRegistryContract;
|
||||
const encodedData = self._strictEncodeArguments('setCoordinatorEndpoint(string)', [coordinatorEndpoint
|
||||
]);
|
||||
const self = (this as any) as CoordinatorRegistryContract;
|
||||
const encodedData = self._strictEncodeArguments('setCoordinatorEndpoint(string)', [coordinatorEndpoint]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -109,8 +95,7 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
coordinatorEndpoint: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
): Promise<void> {
|
||||
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -120,9 +105,8 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as CoordinatorRegistryContract;
|
||||
const encodedData = self._strictEncodeArguments('setCoordinatorEndpoint(string)', [coordinatorEndpoint
|
||||
]);
|
||||
const self = (this as any) as CoordinatorRegistryContract;
|
||||
const encodedData = self._strictEncodeArguments('setCoordinatorEndpoint(string)', [coordinatorEndpoint]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -135,17 +119,15 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('setCoordinatorEndpoint(string)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
coordinatorEndpoint: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(coordinatorEndpoint: string): string {
|
||||
assert.isString('coordinatorEndpoint', coordinatorEndpoint);
|
||||
const self = this as any as CoordinatorRegistryContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('setCoordinatorEndpoint(string)', [coordinatorEndpoint
|
||||
const self = (this as any) as CoordinatorRegistryContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('setCoordinatorEndpoint(string)', [
|
||||
coordinatorEndpoint,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@ -155,8 +137,7 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
coordinatorOperator: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
): Promise<string> {
|
||||
assert.isString('coordinatorOperator', coordinatorOperator);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -166,9 +147,8 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as CoordinatorRegistryContract;
|
||||
const encodedData = self._strictEncodeArguments('getCoordinatorEndpoint(address)', [coordinatorOperator
|
||||
]);
|
||||
const self = (this as any) as CoordinatorRegistryContract;
|
||||
const encodedData = self._strictEncodeArguments('getCoordinatorEndpoint(address)', [coordinatorOperator]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -181,17 +161,15 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getCoordinatorEndpoint(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
coordinatorOperator: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(coordinatorOperator: string): string {
|
||||
assert.isString('coordinatorOperator', coordinatorOperator);
|
||||
const self = this as any as CoordinatorRegistryContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getCoordinatorEndpoint(address)', [coordinatorOperator
|
||||
const self = (this as any) as CoordinatorRegistryContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getCoordinatorEndpoint(address)', [
|
||||
coordinatorOperator,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@ -212,7 +190,7 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
return CoordinatorRegistryContract.deployAsync(bytecode, abi, provider, txDefaults, );
|
||||
return CoordinatorRegistryContract.deployAsync(bytecode, abi, provider, txDefaults);
|
||||
}
|
||||
public static async deployAsync(
|
||||
bytecode: string,
|
||||
@ -228,17 +206,13 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
]);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[] = BaseContract._formatABIDataItemList(
|
||||
constructorAbi.inputs,
|
||||
[],
|
||||
BaseContract._bigNumberToString,
|
||||
);
|
||||
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||
const iface = new ethers.utils.Interface(abi);
|
||||
const deployInfo = iface.deployFunction;
|
||||
const txData = deployInfo.encode(bytecode, []);
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{data: txData},
|
||||
{ data: txData },
|
||||
txDefaults,
|
||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||
);
|
||||
@ -246,14 +220,85 @@ export class CoordinatorRegistryContract extends BaseContract {
|
||||
logUtils.log(`transactionHash: ${txHash}`);
|
||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
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 = [];
|
||||
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: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,20 +23,33 @@ import { assert } from '@0x/assert';
|
||||
import * as ethers from 'ethers';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
|
||||
/* istanbul ignore next */
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class DutchAuctionContract extends BaseContract {
|
||||
public getAuctionDetails = {
|
||||
async sendTransactionAsync(
|
||||
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
order: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
},
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const encodedData = self._strictEncodeArguments('getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', [order
|
||||
]);
|
||||
const self = (this as any) as DutchAuctionContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))',
|
||||
[order],
|
||||
);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -44,24 +57,32 @@ export class DutchAuctionContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.getAuctionDetails.estimateGasAsync.bind(
|
||||
self,
|
||||
order
|
||||
),
|
||||
self.getAuctionDetails.estimateGasAsync.bind(self, order),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
order: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
},
|
||||
txData?: Partial<TxData>,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const txHashPromise = self.getAuctionDetails.sendTransactionAsync(order
|
||||
, txData);
|
||||
const self = (this as any) as DutchAuctionContract;
|
||||
const txHashPromise = self.getAuctionDetails.sendTransactionAsync(order, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -75,13 +96,27 @@ export class DutchAuctionContract extends BaseContract {
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
order: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
},
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<number> {
|
||||
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const encodedData = self._strictEncodeArguments('getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', [order
|
||||
]);
|
||||
const self = (this as any) as DutchAuctionContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))',
|
||||
[order],
|
||||
);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -94,12 +129,30 @@ export class DutchAuctionContract extends BaseContract {
|
||||
return gas;
|
||||
},
|
||||
async callAsync(
|
||||
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
order: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
},
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<{beginTimeSeconds: BigNumber;endTimeSeconds: BigNumber;beginAmount: BigNumber;endAmount: BigNumber;currentAmount: BigNumber;currentTimeSeconds: BigNumber}
|
||||
> {
|
||||
|
||||
): Promise<{
|
||||
beginTimeSeconds: BigNumber;
|
||||
endTimeSeconds: BigNumber;
|
||||
beginAmount: BigNumber;
|
||||
endAmount: BigNumber;
|
||||
currentAmount: BigNumber;
|
||||
currentTimeSeconds: BigNumber;
|
||||
}> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -108,9 +161,11 @@ export class DutchAuctionContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const encodedData = self._strictEncodeArguments('getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', [order
|
||||
]);
|
||||
const self = (this as any) as DutchAuctionContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))',
|
||||
[order],
|
||||
);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -121,41 +176,84 @@ export class DutchAuctionContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))');
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
'getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))',
|
||||
);
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<{beginTimeSeconds: BigNumber;endTimeSeconds: BigNumber;beginAmount: BigNumber;endAmount: BigNumber;currentAmount: BigNumber;currentTimeSeconds: BigNumber}
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<{
|
||||
beginTimeSeconds: BigNumber;
|
||||
endTimeSeconds: BigNumber;
|
||||
beginAmount: BigNumber;
|
||||
endAmount: BigNumber;
|
||||
currentAmount: BigNumber;
|
||||
currentTimeSeconds: BigNumber;
|
||||
}>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
order: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
): string {
|
||||
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', [order
|
||||
]);
|
||||
getABIEncodedTransactionData(order: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
}): string {
|
||||
const self = (this as any) as DutchAuctionContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))',
|
||||
[order],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public matchOrders = {
|
||||
async sendTransactionAsync(
|
||||
buyOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
sellOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
buyOrder: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
},
|
||||
sellOrder: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
},
|
||||
buySignature: string,
|
||||
sellSignature: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
|
||||
|
||||
assert.isString('buySignature', buySignature);
|
||||
assert.isString('sellSignature', sellSignature);
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const encodedData = self._strictEncodeArguments('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', [buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
]);
|
||||
const self = (this as any) as DutchAuctionContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)',
|
||||
[buyOrder, sellOrder, buySignature, sellSignature],
|
||||
);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -163,36 +261,56 @@ export class DutchAuctionContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.matchOrders.estimateGasAsync.bind(
|
||||
self,
|
||||
buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
),
|
||||
self.matchOrders.estimateGasAsync.bind(self, buyOrder, sellOrder, buySignature, sellSignature),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
buyOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
sellOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
buyOrder: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
},
|
||||
sellOrder: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
},
|
||||
buySignature: string,
|
||||
sellSignature: string,
|
||||
txData?: Partial<TxData>,
|
||||
pollingIntervalMs?: number,
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
|
||||
|
||||
assert.isString('buySignature', buySignature);
|
||||
assert.isString('sellSignature', sellSignature);
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const txHashPromise = self.matchOrders.sendTransactionAsync(buyOrder,
|
||||
const self = (this as any) as DutchAuctionContract;
|
||||
const txHashPromise = self.matchOrders.sendTransactionAsync(
|
||||
buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
, txData);
|
||||
sellSignature,
|
||||
txData,
|
||||
);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -206,22 +324,45 @@ export class DutchAuctionContract extends BaseContract {
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
buyOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
sellOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
buyOrder: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
},
|
||||
sellOrder: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
},
|
||||
buySignature: string,
|
||||
sellSignature: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<number> {
|
||||
|
||||
|
||||
assert.isString('buySignature', buySignature);
|
||||
assert.isString('sellSignature', sellSignature);
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const encodedData = self._strictEncodeArguments('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', [buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
]);
|
||||
const self = (this as any) as DutchAuctionContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)',
|
||||
[buyOrder, sellOrder, buySignature, sellSignature],
|
||||
);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -234,16 +375,53 @@ export class DutchAuctionContract extends BaseContract {
|
||||
return gas;
|
||||
},
|
||||
async callAsync(
|
||||
buyOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
sellOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
buyOrder: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
},
|
||||
sellOrder: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
},
|
||||
buySignature: string,
|
||||
sellSignature: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<{left: {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber};right: {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber};leftMakerAssetSpreadAmount: BigNumber}
|
||||
> {
|
||||
|
||||
|
||||
): Promise<{
|
||||
left: {
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
};
|
||||
right: {
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
};
|
||||
leftMakerAssetSpreadAmount: BigNumber;
|
||||
}> {
|
||||
assert.isString('buySignature', buySignature);
|
||||
assert.isString('sellSignature', sellSignature);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@ -254,12 +432,11 @@ export class DutchAuctionContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const encodedData = self._strictEncodeArguments('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', [buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
]);
|
||||
const self = (this as any) as DutchAuctionContract;
|
||||
const encodedData = self._strictEncodeArguments(
|
||||
'matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)',
|
||||
[buyOrder, sellOrder, buySignature, sellSignature],
|
||||
);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -270,29 +447,67 @@ export class DutchAuctionContract extends BaseContract {
|
||||
);
|
||||
const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)');
|
||||
const abiEncoder = self._lookupAbiEncoder(
|
||||
'matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)',
|
||||
);
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<{left: {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber};right: {makerAssetFilledAmount: BigNumber;takerAssetFilledAmount: BigNumber;makerFeePaid: BigNumber;takerFeePaid: BigNumber};leftMakerAssetSpreadAmount: BigNumber}
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<{
|
||||
left: {
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
};
|
||||
right: {
|
||||
makerAssetFilledAmount: BigNumber;
|
||||
takerAssetFilledAmount: BigNumber;
|
||||
makerFeePaid: BigNumber;
|
||||
takerFeePaid: BigNumber;
|
||||
};
|
||||
leftMakerAssetSpreadAmount: BigNumber;
|
||||
}>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
buyOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
sellOrder: {makerAddress: string;takerAddress: string;feeRecipientAddress: string;senderAddress: string;makerAssetAmount: BigNumber;takerAssetAmount: BigNumber;makerFee: BigNumber;takerFee: BigNumber;expirationTimeSeconds: BigNumber;salt: BigNumber;makerAssetData: string;takerAssetData: string},
|
||||
buyOrder: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
},
|
||||
sellOrder: {
|
||||
makerAddress: string;
|
||||
takerAddress: string;
|
||||
feeRecipientAddress: string;
|
||||
senderAddress: string;
|
||||
makerAssetAmount: BigNumber;
|
||||
takerAssetAmount: BigNumber;
|
||||
makerFee: BigNumber;
|
||||
takerFee: BigNumber;
|
||||
expirationTimeSeconds: BigNumber;
|
||||
salt: BigNumber;
|
||||
makerAssetData: string;
|
||||
takerAssetData: string;
|
||||
},
|
||||
buySignature: string,
|
||||
sellSignature: string,
|
||||
): string {
|
||||
|
||||
|
||||
assert.isString('buySignature', buySignature);
|
||||
assert.isString('sellSignature', sellSignature);
|
||||
const self = this as any as DutchAuctionContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', [buyOrder,
|
||||
sellOrder,
|
||||
buySignature,
|
||||
sellSignature
|
||||
]);
|
||||
const self = (this as any) as DutchAuctionContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)',
|
||||
[buyOrder, sellOrder, buySignature, sellSignature],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@ -313,8 +528,7 @@ export class DutchAuctionContract extends BaseContract {
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
return DutchAuctionContract.deployAsync(bytecode, abi, provider, txDefaults, _exchange
|
||||
);
|
||||
return DutchAuctionContract.deployAsync(bytecode, abi, provider, txDefaults, _exchange);
|
||||
}
|
||||
public static async deployAsync(
|
||||
bytecode: string,
|
||||
@ -331,20 +545,17 @@ export class DutchAuctionContract extends BaseContract {
|
||||
]);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[_exchange
|
||||
] = BaseContract._formatABIDataItemList(
|
||||
[_exchange] = BaseContract._formatABIDataItemList(
|
||||
constructorAbi.inputs,
|
||||
[_exchange
|
||||
],
|
||||
[_exchange],
|
||||
BaseContract._bigNumberToString,
|
||||
);
|
||||
const iface = new ethers.utils.Interface(abi);
|
||||
const deployInfo = iface.deployFunction;
|
||||
const txData = deployInfo.encode(bytecode, [_exchange
|
||||
]);
|
||||
const txData = deployInfo.encode(bytecode, [_exchange]);
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{data: txData},
|
||||
{ data: txData },
|
||||
txDefaults,
|
||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||
);
|
||||
@ -352,15 +563,313 @@ export class DutchAuctionContract extends BaseContract {
|
||||
logUtils.log(`transactionHash: ${txHash}`);
|
||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
logUtils.log(`DutchAuction successfully deployed at ${txReceipt.contractAddress}`);
|
||||
const contractInstance = new DutchAuctionContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
|
||||
contractInstance.constructorArgs = [_exchange
|
||||
];
|
||||
const contractInstance = new DutchAuctionContract(txReceipt.contractAddress as string, provider, txDefaults);
|
||||
contractInstance.constructorArgs = [_exchange];
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('DutchAuction', 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: 'order',
|
||||
type: 'tuple',
|
||||
components: [
|
||||
{
|
||||
name: 'makerAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'takerAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'feeRecipientAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'senderAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'makerAssetAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'takerAssetAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'makerFee',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'takerFee',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'expirationTimeSeconds',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'salt',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'makerAssetData',
|
||||
type: 'bytes',
|
||||
},
|
||||
{
|
||||
name: 'takerAssetData',
|
||||
type: 'bytes',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
name: 'getAuctionDetails',
|
||||
outputs: [
|
||||
{
|
||||
name: 'auctionDetails',
|
||||
type: 'tuple',
|
||||
components: [
|
||||
{
|
||||
name: 'beginTimeSeconds',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'endTimeSeconds',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'beginAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'endAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'currentAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'currentTimeSeconds',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'buyOrder',
|
||||
type: 'tuple',
|
||||
components: [
|
||||
{
|
||||
name: 'makerAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'takerAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'feeRecipientAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'senderAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'makerAssetAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'takerAssetAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'makerFee',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'takerFee',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'expirationTimeSeconds',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'salt',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'makerAssetData',
|
||||
type: 'bytes',
|
||||
},
|
||||
{
|
||||
name: 'takerAssetData',
|
||||
type: 'bytes',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'sellOrder',
|
||||
type: 'tuple',
|
||||
components: [
|
||||
{
|
||||
name: 'makerAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'takerAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'feeRecipientAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'senderAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'makerAssetAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'takerAssetAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'makerFee',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'takerFee',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'expirationTimeSeconds',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'salt',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'makerAssetData',
|
||||
type: 'bytes',
|
||||
},
|
||||
{
|
||||
name: 'takerAssetData',
|
||||
type: 'bytes',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'buySignature',
|
||||
type: 'bytes',
|
||||
},
|
||||
{
|
||||
name: 'sellSignature',
|
||||
type: 'bytes',
|
||||
},
|
||||
],
|
||||
name: 'matchOrders',
|
||||
outputs: [
|
||||
{
|
||||
name: 'matchedFillResults',
|
||||
type: 'tuple',
|
||||
components: [
|
||||
{
|
||||
name: 'left',
|
||||
type: 'tuple',
|
||||
components: [
|
||||
{
|
||||
name: 'makerAssetFilledAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'takerAssetFilledAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'makerFeePaid',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'takerFeePaid',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'right',
|
||||
type: 'tuple',
|
||||
components: [
|
||||
{
|
||||
name: 'makerAssetFilledAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'takerAssetFilledAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'makerFeePaid',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'takerFeePaid',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'leftMakerAssetSpreadAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
name: '_exchange',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'constructor',
|
||||
},
|
||||
] as ContractAbi;
|
||||
return abi;
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('DutchAuction', DutchAuctionContract.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:trailing-comma whitespace no-trailing-whitespace
|
||||
|
@ -42,20 +42,15 @@ export interface ERC20ProxyAuthorizedAddressRemovedEventArgs extends DecodedLogA
|
||||
caller: string;
|
||||
}
|
||||
|
||||
|
||||
/* istanbul ignore next */
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class ERC20ProxyContract extends BaseContract {
|
||||
public addAuthorizedAddress = {
|
||||
async sendTransactionAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -63,10 +58,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.addAuthorizedAddress.estimateGasAsync.bind(
|
||||
self,
|
||||
target
|
||||
),
|
||||
self.addAuthorizedAddress.estimateGasAsync.bind(self, target),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -78,9 +70,8 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target
|
||||
, txData);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -93,14 +84,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<number> {
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -112,12 +99,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
async callAsync(
|
||||
target: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
async callAsync(target: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('target', target);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -127,9 +109,8 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -142,18 +123,14 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
target: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@ -162,8 +139,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
index_0: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
): Promise<string> {
|
||||
assert.isBigNumber('index_0', index_0);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -173,9 +149,8 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('authorities(uint256)', [index_0
|
||||
]);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('authorities(uint256)', [index_0]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -188,30 +163,22 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('authorities(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
index_0: BigNumber,
|
||||
): string {
|
||||
getABIEncodedTransactionData(index_0: BigNumber): string {
|
||||
assert.isBigNumber('index_0', index_0);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('authorities(uint256)', [index_0
|
||||
]);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('authorities(uint256)', [index_0]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public removeAuthorizedAddress = {
|
||||
async sendTransactionAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -219,10 +186,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.removeAuthorizedAddress.estimateGasAsync.bind(
|
||||
self,
|
||||
target
|
||||
),
|
||||
self.removeAuthorizedAddress.estimateGasAsync.bind(self, target),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -234,9 +198,8 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target
|
||||
, txData);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -249,14 +212,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<number> {
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -268,12 +227,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
async callAsync(
|
||||
target: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
async callAsync(target: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('target', target);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -283,9 +237,8 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -298,27 +251,19 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
target: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public owner = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -327,7 +272,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('owner()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -341,14 +286,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
): string {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('owner()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@ -361,9 +304,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
index,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -372,11 +316,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.removeAuthorizedAddressAtIndex.estimateGasAsync.bind(
|
||||
self,
|
||||
target,
|
||||
index
|
||||
),
|
||||
self.removeAuthorizedAddressAtIndex.estimateGasAsync.bind(self, target, index),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -390,10 +330,8 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(target,
|
||||
index
|
||||
, txData);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(target, index, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -413,9 +351,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
index,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -433,8 +372,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
index: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
): Promise<void> {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@ -445,9 +383,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
index,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -461,30 +400,23 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
): string {
|
||||
getABIEncodedTransactionData(target: string, index: BigNumber): string {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
]);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'removeAuthorizedAddressAtIndex(address,uint256)',
|
||||
[target, index],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public getProxyId = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -493,7 +425,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('getProxyId()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -507,14 +439,12 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
): string {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getProxyId()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@ -524,8 +454,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
index_0: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<boolean
|
||||
> {
|
||||
): Promise<boolean> {
|
||||
assert.isString('index_0', index_0);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -535,9 +464,8 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('authorized(address)', [index_0
|
||||
]);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('authorized(address)', [index_0]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -550,27 +478,19 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('authorized(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
index_0: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(index_0: string): string {
|
||||
assert.isString('index_0', index_0);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('authorized(address)', [index_0
|
||||
]);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('authorized(address)', [index_0]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public getAuthorizedAddresses = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string[]
|
||||
> {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string[]> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -579,7 +499,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('getAuthorizedAddresses()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -593,27 +513,21 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string[]
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string[]>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
): string {
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getAuthorizedAddresses()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public transferOwnership = {
|
||||
async sendTransactionAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
async sendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -621,10 +535,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferOwnership.estimateGasAsync.bind(
|
||||
self,
|
||||
newOwner
|
||||
),
|
||||
self.transferOwnership.estimateGasAsync.bind(self, newOwner),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -636,9 +547,8 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner
|
||||
, txData);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -651,14 +561,10 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<number> {
|
||||
async estimateGasAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -670,12 +576,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
async callAsync(
|
||||
newOwner: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
async callAsync(newOwner: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -685,9 +586,8 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -700,18 +600,14 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
newOwner: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(newOwner: string): string {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = this as any as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const self = (this as any) as ERC20ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@ -731,7 +627,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
return ERC20ProxyContract.deployAsync(bytecode, abi, provider, txDefaults, );
|
||||
return ERC20ProxyContract.deployAsync(bytecode, abi, provider, txDefaults);
|
||||
}
|
||||
public static async deployAsync(
|
||||
bytecode: string,
|
||||
@ -747,17 +643,13 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
]);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[] = BaseContract._formatABIDataItemList(
|
||||
constructorAbi.inputs,
|
||||
[],
|
||||
BaseContract._bigNumberToString,
|
||||
);
|
||||
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||
const iface = new ethers.utils.Interface(abi);
|
||||
const deployInfo = iface.deployFunction;
|
||||
const txData = deployInfo.encode(bytecode, []);
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{data: txData},
|
||||
{ data: txData },
|
||||
txDefaults,
|
||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||
);
|
||||
@ -765,14 +657,204 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
logUtils.log(`transactionHash: ${txHash}`);
|
||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
logUtils.log(`ERC20Proxy successfully deployed at ${txReceipt.contractAddress}`);
|
||||
const contractInstance = new ERC20ProxyContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
|
||||
const contractInstance = new ERC20ProxyContract(txReceipt.contractAddress as string, provider, txDefaults);
|
||||
contractInstance.constructorArgs = [];
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('ERC20Proxy', 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: 'target',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'addAuthorizedAddress',
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [
|
||||
{
|
||||
name: 'index_0',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
name: 'authorities',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'target',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'removeAuthorizedAddress',
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'owner',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'target',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'index',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
name: 'removeAuthorizedAddressAtIndex',
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'getProxyId',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'bytes4',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'pure',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [
|
||||
{
|
||||
name: 'index_0',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'authorized',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'bool',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'getAuthorizedAddresses',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'address[]',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'newOwner',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'transferOwnership',
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'fallback',
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'target',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'caller',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'AuthorizedAddressAdded',
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'target',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'caller',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'AuthorizedAddressRemoved',
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
},
|
||||
] as ContractAbi;
|
||||
return abi;
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('ERC20Proxy', ERC20ProxyContract.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:trailing-comma whitespace no-trailing-whitespace
|
||||
|
@ -23,9 +23,7 @@ import { assert } from '@0x/assert';
|
||||
import * as ethers from 'ethers';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
export type ERC20TokenEventArgs =
|
||||
| ERC20TokenTransferEventArgs
|
||||
| ERC20TokenApprovalEventArgs;
|
||||
export type ERC20TokenEventArgs = ERC20TokenTransferEventArgs | ERC20TokenApprovalEventArgs;
|
||||
|
||||
export enum ERC20TokenEvents {
|
||||
Transfer = 'Transfer',
|
||||
@ -44,7 +42,6 @@ export interface ERC20TokenApprovalEventArgs extends DecodedLogArgs {
|
||||
_value: BigNumber;
|
||||
}
|
||||
|
||||
|
||||
/* istanbul ignore next */
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
@ -57,10 +54,8 @@ export class ERC20TokenContract extends BaseContract {
|
||||
): Promise<string> {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -68,11 +63,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.approve.estimateGasAsync.bind(
|
||||
self,
|
||||
_spender,
|
||||
_value
|
||||
),
|
||||
self.approve.estimateGasAsync.bind(self, _spender, _value),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -86,10 +77,8 @@ export class ERC20TokenContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_spender,
|
||||
_value
|
||||
, txData);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_spender, _value, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -109,10 +98,8 @@ export class ERC20TokenContract extends BaseContract {
|
||||
): Promise<number> {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -129,8 +116,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
_value: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<boolean
|
||||
> {
|
||||
): Promise<boolean> {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@ -141,10 +127,8 @@ export class ERC20TokenContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -157,30 +141,23 @@ export class ERC20TokenContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
_spender: string,
|
||||
_value: BigNumber,
|
||||
): string {
|
||||
getABIEncodedTransactionData(_spender: string, _value: BigNumber): string {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_spender,
|
||||
_value,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public totalSupply = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -189,7 +166,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('totalSupply()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -203,14 +180,12 @@ export class ERC20TokenContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
): string {
|
||||
const self = this as any as ERC20TokenContract;
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('totalSupply()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@ -225,10 +200,11 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isString('_from', _from);
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_value
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -237,12 +213,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferFrom.estimateGasAsync.bind(
|
||||
self,
|
||||
_from,
|
||||
_to,
|
||||
_value
|
||||
),
|
||||
self.transferFrom.estimateGasAsync.bind(self, _from, _to, _value),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -258,11 +229,8 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isString('_from', _from);
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(_from,
|
||||
_to,
|
||||
_value
|
||||
, txData);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(_from, _to, _value, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -284,10 +252,11 @@ export class ERC20TokenContract extends BaseContract {
|
||||
assert.isString('_from', _from);
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_value
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -306,8 +275,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
_value: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<boolean
|
||||
> {
|
||||
): Promise<boolean> {
|
||||
assert.isString('_from', _from);
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
@ -319,10 +287,11 @@ export class ERC20TokenContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_value
|
||||
_value,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -336,23 +305,19 @@ export class ERC20TokenContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
_from: string,
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
): string {
|
||||
getABIEncodedTransactionData(_from: string, _to: string, _value: BigNumber): string {
|
||||
assert.isString('_from', _from);
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_value
|
||||
_value,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@ -362,8 +327,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
_owner: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
): Promise<BigNumber> {
|
||||
assert.isString('_owner', _owner);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -373,9 +337,8 @@ export class ERC20TokenContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner
|
||||
]);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -388,18 +351,14 @@ export class ERC20TokenContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
_owner: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(_owner: string): string {
|
||||
assert.isString('_owner', _owner);
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner
|
||||
]);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@ -411,10 +370,8 @@ export class ERC20TokenContract extends BaseContract {
|
||||
): Promise<string> {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -422,11 +379,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transfer.estimateGasAsync.bind(
|
||||
self,
|
||||
_to,
|
||||
_value
|
||||
),
|
||||
self.transfer.estimateGasAsync.bind(self, _to, _value),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -440,10 +393,8 @@ export class ERC20TokenContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const txHashPromise = self.transfer.sendTransactionAsync(_to,
|
||||
_value
|
||||
, txData);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const txHashPromise = self.transfer.sendTransactionAsync(_to, _value, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -456,17 +407,11 @@ export class ERC20TokenContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<number> {
|
||||
async estimateGasAsync(_to: string, _value: BigNumber, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -483,8 +428,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
_value: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<boolean
|
||||
> {
|
||||
): Promise<boolean> {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@ -495,10 +439,8 @@ export class ERC20TokenContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -511,21 +453,15 @@ export class ERC20TokenContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
): string {
|
||||
getABIEncodedTransactionData(_to: string, _value: BigNumber): string {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@ -535,8 +471,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
_spender: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
): Promise<BigNumber> {
|
||||
assert.isString('_owner', _owner);
|
||||
assert.isString('_spender', _spender);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@ -547,10 +482,8 @@ export class ERC20TokenContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('allowance(address,address)', [_owner,
|
||||
_spender
|
||||
]);
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const encodedData = self._strictEncodeArguments('allowance(address,address)', [_owner, _spender]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -563,20 +496,17 @@ export class ERC20TokenContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
_owner: string,
|
||||
_spender: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(_owner: string, _spender: string): string {
|
||||
assert.isString('_owner', _owner);
|
||||
assert.isString('_spender', _spender);
|
||||
const self = this as any as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('allowance(address,address)', [_owner,
|
||||
_spender
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('allowance(address,address)', [
|
||||
_owner,
|
||||
_spender,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@ -597,7 +527,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
return ERC20TokenContract.deployAsync(bytecode, abi, provider, txDefaults, );
|
||||
return ERC20TokenContract.deployAsync(bytecode, abi, provider, txDefaults);
|
||||
}
|
||||
public static async deployAsync(
|
||||
bytecode: string,
|
||||
@ -613,17 +543,13 @@ export class ERC20TokenContract extends BaseContract {
|
||||
]);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[] = BaseContract._formatABIDataItemList(
|
||||
constructorAbi.inputs,
|
||||
[],
|
||||
BaseContract._bigNumberToString,
|
||||
);
|
||||
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||
const iface = new ethers.utils.Interface(abi);
|
||||
const deployInfo = iface.deployFunction;
|
||||
const txData = deployInfo.encode(bytecode, []);
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{data: txData},
|
||||
{ data: txData },
|
||||
txDefaults,
|
||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||
);
|
||||
@ -631,14 +557,194 @@ export class ERC20TokenContract extends BaseContract {
|
||||
logUtils.log(`transactionHash: ${txHash}`);
|
||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
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 = [];
|
||||
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:trailing-comma whitespace no-trailing-whitespace
|
||||
|
@ -42,20 +42,15 @@ export interface ERC721ProxyAuthorizedAddressRemovedEventArgs extends DecodedLog
|
||||
caller: string;
|
||||
}
|
||||
|
||||
|
||||
/* istanbul ignore next */
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class ERC721ProxyContract extends BaseContract {
|
||||
public addAuthorizedAddress = {
|
||||
async sendTransactionAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -63,10 +58,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.addAuthorizedAddress.estimateGasAsync.bind(
|
||||
self,
|
||||
target
|
||||
),
|
||||
self.addAuthorizedAddress.estimateGasAsync.bind(self, target),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -78,9 +70,8 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target
|
||||
, txData);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -93,14 +84,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<number> {
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -112,12 +99,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
async callAsync(
|
||||
target: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
async callAsync(target: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('target', target);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -127,9 +109,8 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -142,18 +123,14 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
target: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@ -162,8 +139,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
index_0: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
): Promise<string> {
|
||||
assert.isBigNumber('index_0', index_0);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -173,9 +149,8 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('authorities(uint256)', [index_0
|
||||
]);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('authorities(uint256)', [index_0]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -188,30 +163,22 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('authorities(uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
index_0: BigNumber,
|
||||
): string {
|
||||
getABIEncodedTransactionData(index_0: BigNumber): string {
|
||||
assert.isBigNumber('index_0', index_0);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('authorities(uint256)', [index_0
|
||||
]);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('authorities(uint256)', [index_0]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public removeAuthorizedAddress = {
|
||||
async sendTransactionAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -219,10 +186,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.removeAuthorizedAddress.estimateGasAsync.bind(
|
||||
self,
|
||||
target
|
||||
),
|
||||
self.removeAuthorizedAddress.estimateGasAsync.bind(self, target),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -234,9 +198,8 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target
|
||||
, txData);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -249,14 +212,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<number> {
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -268,12 +227,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
async callAsync(
|
||||
target: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
async callAsync(target: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('target', target);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -283,9 +237,8 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -298,27 +251,19 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
target: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public owner = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -327,7 +272,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('owner()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -341,14 +286,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('owner()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
): string {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('owner()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@ -361,9 +304,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
index,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -372,11 +316,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.removeAuthorizedAddressAtIndex.estimateGasAsync.bind(
|
||||
self,
|
||||
target,
|
||||
index
|
||||
),
|
||||
self.removeAuthorizedAddressAtIndex.estimateGasAsync.bind(self, target, index),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -390,10 +330,8 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(target,
|
||||
index
|
||||
, txData);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(target, index, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -413,9 +351,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
index,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -433,8 +372,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
index: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
): Promise<void> {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@ -445,9 +383,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
index,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -461,30 +400,23 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
): string {
|
||||
getABIEncodedTransactionData(target: string, index: BigNumber): string {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
]);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'removeAuthorizedAddressAtIndex(address,uint256)',
|
||||
[target, index],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public getProxyId = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -493,7 +425,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('getProxyId()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -507,14 +439,12 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
): string {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getProxyId()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@ -524,8 +454,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
index_0: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<boolean
|
||||
> {
|
||||
): Promise<boolean> {
|
||||
assert.isString('index_0', index_0);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -535,9 +464,8 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('authorized(address)', [index_0
|
||||
]);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('authorized(address)', [index_0]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -550,27 +478,19 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('authorized(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
index_0: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(index_0: string): string {
|
||||
assert.isString('index_0', index_0);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('authorized(address)', [index_0
|
||||
]);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('authorized(address)', [index_0]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public getAuthorizedAddresses = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string[]
|
||||
> {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string[]> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -579,7 +499,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('getAuthorizedAddresses()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -593,27 +513,21 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string[]
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string[]>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
): string {
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getAuthorizedAddresses()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public transferOwnership = {
|
||||
async sendTransactionAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
async sendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -621,10 +535,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferOwnership.estimateGasAsync.bind(
|
||||
self,
|
||||
newOwner
|
||||
),
|
||||
self.transferOwnership.estimateGasAsync.bind(self, newOwner),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -636,9 +547,8 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner
|
||||
, txData);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -651,14 +561,10 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<number> {
|
||||
async estimateGasAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -670,12 +576,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
async callAsync(
|
||||
newOwner: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
async callAsync(newOwner: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -685,9 +586,8 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -700,18 +600,14 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
newOwner: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(newOwner: string): string {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = this as any as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const self = (this as any) as ERC721ProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@ -731,7 +627,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
return ERC721ProxyContract.deployAsync(bytecode, abi, provider, txDefaults, );
|
||||
return ERC721ProxyContract.deployAsync(bytecode, abi, provider, txDefaults);
|
||||
}
|
||||
public static async deployAsync(
|
||||
bytecode: string,
|
||||
@ -747,17 +643,13 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
]);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[] = BaseContract._formatABIDataItemList(
|
||||
constructorAbi.inputs,
|
||||
[],
|
||||
BaseContract._bigNumberToString,
|
||||
);
|
||||
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||
const iface = new ethers.utils.Interface(abi);
|
||||
const deployInfo = iface.deployFunction;
|
||||
const txData = deployInfo.encode(bytecode, []);
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{data: txData},
|
||||
{ data: txData },
|
||||
txDefaults,
|
||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||
);
|
||||
@ -765,14 +657,204 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
logUtils.log(`transactionHash: ${txHash}`);
|
||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
logUtils.log(`ERC721Proxy successfully deployed at ${txReceipt.contractAddress}`);
|
||||
const contractInstance = new ERC721ProxyContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
|
||||
const contractInstance = new ERC721ProxyContract(txReceipt.contractAddress as string, provider, txDefaults);
|
||||
contractInstance.constructorArgs = [];
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('ERC721Proxy', 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: 'target',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'addAuthorizedAddress',
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [
|
||||
{
|
||||
name: 'index_0',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
name: 'authorities',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'target',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'removeAuthorizedAddress',
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'owner',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'target',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'index',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
name: 'removeAuthorizedAddressAtIndex',
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'getProxyId',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'bytes4',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'pure',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [
|
||||
{
|
||||
name: 'index_0',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'authorized',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'bool',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'getAuthorizedAddresses',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'address[]',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'newOwner',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'transferOwnership',
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'fallback',
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'target',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'caller',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'AuthorizedAddressAdded',
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'target',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'caller',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'AuthorizedAddressRemoved',
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
},
|
||||
] as ContractAbi;
|
||||
return abi;
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('ERC721Proxy', ERC721ProxyContract.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:trailing-comma whitespace no-trailing-whitespace
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -23,7 +23,6 @@ import { assert } from '@0x/assert';
|
||||
import * as ethers from 'ethers';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
|
||||
/* istanbul ignore next */
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
@ -33,8 +32,7 @@ export class EthBalanceCheckerContract extends BaseContract {
|
||||
addresses: string[],
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<BigNumber[]
|
||||
> {
|
||||
): Promise<BigNumber[]> {
|
||||
assert.isArray('addresses', addresses);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -44,9 +42,8 @@ export class EthBalanceCheckerContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as EthBalanceCheckerContract;
|
||||
const encodedData = self._strictEncodeArguments('getEthBalances(address[])', [addresses
|
||||
]);
|
||||
const self = (this as any) as EthBalanceCheckerContract;
|
||||
const encodedData = self._strictEncodeArguments('getEthBalances(address[])', [addresses]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -59,18 +56,14 @@ export class EthBalanceCheckerContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getEthBalances(address[])');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber[]
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber[]>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
addresses: string[],
|
||||
): string {
|
||||
getABIEncodedTransactionData(addresses: string[]): string {
|
||||
assert.isArray('addresses', addresses);
|
||||
const self = this as any as EthBalanceCheckerContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getEthBalances(address[])', [addresses
|
||||
]);
|
||||
const self = (this as any) as EthBalanceCheckerContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getEthBalances(address[])', [addresses]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@ -90,7 +83,7 @@ export class EthBalanceCheckerContract extends BaseContract {
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
return EthBalanceCheckerContract.deployAsync(bytecode, abi, provider, txDefaults, );
|
||||
return EthBalanceCheckerContract.deployAsync(bytecode, abi, provider, txDefaults);
|
||||
}
|
||||
public static async deployAsync(
|
||||
bytecode: string,
|
||||
@ -106,17 +99,13 @@ export class EthBalanceCheckerContract extends BaseContract {
|
||||
]);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[] = BaseContract._formatABIDataItemList(
|
||||
constructorAbi.inputs,
|
||||
[],
|
||||
BaseContract._bigNumberToString,
|
||||
);
|
||||
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||
const iface = new ethers.utils.Interface(abi);
|
||||
const deployInfo = iface.deployFunction;
|
||||
const txData = deployInfo.encode(bytecode, []);
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{data: txData},
|
||||
{ data: txData },
|
||||
txDefaults,
|
||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||
);
|
||||
@ -124,14 +113,48 @@ export class EthBalanceCheckerContract extends BaseContract {
|
||||
logUtils.log(`transactionHash: ${txHash}`);
|
||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
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 = [];
|
||||
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: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,20 +23,15 @@ import { assert } from '@0x/assert';
|
||||
import * as ethers from 'ethers';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
|
||||
/* istanbul ignore next */
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class IAssetProxyContract extends BaseContract {
|
||||
public addAuthorizedAddress = {
|
||||
async sendTransactionAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -44,10 +39,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.addAuthorizedAddress.estimateGasAsync.bind(
|
||||
self,
|
||||
target
|
||||
),
|
||||
self.addAuthorizedAddress.estimateGasAsync.bind(self, target),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -59,9 +51,8 @@ export class IAssetProxyContract extends BaseContract {
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target
|
||||
, txData);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -74,14 +65,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<number> {
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -93,12 +80,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
async callAsync(
|
||||
target: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
async callAsync(target: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('target', target);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -108,9 +90,8 @@ export class IAssetProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -123,30 +104,22 @@ export class IAssetProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('addAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
target: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('addAuthorizedAddress(address)', [target]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public removeAuthorizedAddress = {
|
||||
async sendTransactionAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
async sendTransactionAsync(target: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -154,10 +127,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.removeAuthorizedAddress.estimateGasAsync.bind(
|
||||
self,
|
||||
target
|
||||
),
|
||||
self.removeAuthorizedAddress.estimateGasAsync.bind(self, target),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -169,9 +139,8 @@ export class IAssetProxyContract extends BaseContract {
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target
|
||||
, txData);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -184,14 +153,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
target: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<number> {
|
||||
async estimateGasAsync(target: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -203,12 +168,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
async callAsync(
|
||||
target: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
async callAsync(target: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('target', target);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -218,9 +178,8 @@ export class IAssetProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -233,18 +192,14 @@ export class IAssetProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddress(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
target: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(target: string): string {
|
||||
assert.isString('target', target);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target
|
||||
]);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddress(address)', [target]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@ -256,9 +211,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
): Promise<string> {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
index,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -267,11 +223,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.removeAuthorizedAddressAtIndex.estimateGasAsync.bind(
|
||||
self,
|
||||
target,
|
||||
index
|
||||
),
|
||||
self.removeAuthorizedAddressAtIndex.estimateGasAsync.bind(self, target, index),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -285,10 +237,8 @@ export class IAssetProxyContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(target,
|
||||
index
|
||||
, txData);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(target, index, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -308,9 +258,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
): Promise<number> {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
index,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -328,8 +279,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
index: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
): Promise<void> {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@ -340,9 +290,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [
|
||||
target,
|
||||
index,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -356,21 +307,18 @@ export class IAssetProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('removeAuthorizedAddressAtIndex(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
target: string,
|
||||
index: BigNumber,
|
||||
): string {
|
||||
getABIEncodedTransactionData(target: string, index: BigNumber): string {
|
||||
assert.isString('target', target);
|
||||
assert.isBigNumber('index', index);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('removeAuthorizedAddressAtIndex(address,uint256)', [target,
|
||||
index
|
||||
]);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'removeAuthorizedAddressAtIndex(address,uint256)',
|
||||
[target, index],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@ -386,11 +334,12 @@ export class IAssetProxyContract extends BaseContract {
|
||||
assert.isString('from', from);
|
||||
assert.isString('to', to);
|
||||
assert.isBigNumber('amount', amount);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(bytes,address,address,uint256)', [assetData,
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(bytes,address,address,uint256)', [
|
||||
assetData,
|
||||
from,
|
||||
to,
|
||||
amount
|
||||
amount,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -399,13 +348,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferFrom.estimateGasAsync.bind(
|
||||
self,
|
||||
assetData,
|
||||
from,
|
||||
to,
|
||||
amount
|
||||
),
|
||||
self.transferFrom.estimateGasAsync.bind(self, assetData, from, to, amount),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -423,12 +366,8 @@ export class IAssetProxyContract extends BaseContract {
|
||||
assert.isString('from', from);
|
||||
assert.isString('to', to);
|
||||
assert.isBigNumber('amount', amount);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(assetData,
|
||||
from,
|
||||
to,
|
||||
amount
|
||||
, txData);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(assetData, from, to, amount, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -452,11 +391,12 @@ export class IAssetProxyContract extends BaseContract {
|
||||
assert.isString('from', from);
|
||||
assert.isString('to', to);
|
||||
assert.isBigNumber('amount', amount);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(bytes,address,address,uint256)', [assetData,
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(bytes,address,address,uint256)', [
|
||||
assetData,
|
||||
from,
|
||||
to,
|
||||
amount
|
||||
amount,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -476,8 +416,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
amount: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
): Promise<void> {
|
||||
assert.isString('assetData', assetData);
|
||||
assert.isString('from', from);
|
||||
assert.isString('to', to);
|
||||
@ -490,11 +429,12 @@ export class IAssetProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(bytes,address,address,uint256)', [assetData,
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(bytes,address,address,uint256)', [
|
||||
assetData,
|
||||
from,
|
||||
to,
|
||||
amount
|
||||
amount,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -508,36 +448,25 @@ export class IAssetProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(bytes,address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
assetData: string,
|
||||
from: string,
|
||||
to: string,
|
||||
amount: BigNumber,
|
||||
): string {
|
||||
getABIEncodedTransactionData(assetData: string, from: string, to: string, amount: BigNumber): string {
|
||||
assert.isString('assetData', assetData);
|
||||
assert.isString('from', from);
|
||||
assert.isString('to', to);
|
||||
assert.isBigNumber('amount', amount);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(bytes,address,address,uint256)', [assetData,
|
||||
from,
|
||||
to,
|
||||
amount
|
||||
]);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments(
|
||||
'transferFrom(bytes,address,address,uint256)',
|
||||
[assetData, from, to, amount],
|
||||
);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public getProxyId = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -546,7 +475,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('getProxyId()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -560,24 +489,18 @@ export class IAssetProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
): string {
|
||||
const self = this as any as IAssetProxyContract;
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getProxyId()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public getAuthorizedAddresses = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string[]
|
||||
> {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string[]> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -586,7 +509,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('getAuthorizedAddresses()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -600,27 +523,21 @@ export class IAssetProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('getAuthorizedAddresses()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string[]
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string[]>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
): string {
|
||||
const self = this as any as IAssetProxyContract;
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('getAuthorizedAddresses()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public transferOwnership = {
|
||||
async sendTransactionAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<string> {
|
||||
async sendTransactionAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<string> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -628,10 +545,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferOwnership.estimateGasAsync.bind(
|
||||
self,
|
||||
newOwner
|
||||
),
|
||||
self.transferOwnership.estimateGasAsync.bind(self, newOwner),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -643,9 +557,8 @@ export class IAssetProxyContract extends BaseContract {
|
||||
timeoutMs?: number,
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner
|
||||
, txData);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -658,14 +571,10 @@ export class IAssetProxyContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
newOwner: string,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<number> {
|
||||
async estimateGasAsync(newOwner: string, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -677,12 +586,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
return gas;
|
||||
},
|
||||
async callAsync(
|
||||
newOwner: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<void
|
||||
> {
|
||||
async callAsync(newOwner: string, callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
assert.isString('newOwner', newOwner);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -692,9 +596,8 @@ export class IAssetProxyContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const encodedData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -707,18 +610,14 @@ export class IAssetProxyContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferOwnership(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<void
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
newOwner: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(newOwner: string): string {
|
||||
assert.isString('newOwner', newOwner);
|
||||
const self = this as any as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner
|
||||
]);
|
||||
const self = (this as any) as IAssetProxyContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferOwnership(address)', [newOwner]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@ -738,7 +637,7 @@ export class IAssetProxyContract extends BaseContract {
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
return IAssetProxyContract.deployAsync(bytecode, abi, provider, txDefaults, );
|
||||
return IAssetProxyContract.deployAsync(bytecode, abi, provider, txDefaults);
|
||||
}
|
||||
public static async deployAsync(
|
||||
bytecode: string,
|
||||
@ -754,17 +653,13 @@ export class IAssetProxyContract extends BaseContract {
|
||||
]);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[] = BaseContract._formatABIDataItemList(
|
||||
constructorAbi.inputs,
|
||||
[],
|
||||
BaseContract._bigNumberToString,
|
||||
);
|
||||
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||
const iface = new ethers.utils.Interface(abi);
|
||||
const deployInfo = iface.deployFunction;
|
||||
const txData = deployInfo.encode(bytecode, []);
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{data: txData},
|
||||
{ data: txData },
|
||||
txDefaults,
|
||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||
);
|
||||
@ -772,14 +667,139 @@ export class IAssetProxyContract extends BaseContract {
|
||||
logUtils.log(`transactionHash: ${txHash}`);
|
||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
logUtils.log(`IAssetProxy successfully deployed at ${txReceipt.contractAddress}`);
|
||||
const contractInstance = new IAssetProxyContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
|
||||
const contractInstance = new IAssetProxyContract(txReceipt.contractAddress as string, provider, txDefaults);
|
||||
contractInstance.constructorArgs = [];
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('IAssetProxy', 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: 'target',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'addAuthorizedAddress',
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'target',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'removeAuthorizedAddress',
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'target',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'index',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
name: 'removeAuthorizedAddressAtIndex',
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'assetData',
|
||||
type: 'bytes',
|
||||
},
|
||||
{
|
||||
name: 'from',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'to',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'amount',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
name: 'transferFrom',
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'getProxyId',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'bytes4',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'pure',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'getAuthorizedAddresses',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'address[]',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'newOwner',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'transferOwnership',
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
] as ContractAbi;
|
||||
return abi;
|
||||
}
|
||||
} // tslint:disable:max-file-line-count
|
||||
constructor(address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('IAssetProxy', IAssetProxyContract.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:trailing-comma whitespace no-trailing-whitespace
|
||||
|
@ -23,7 +23,6 @@ import { assert } from '@0x/assert';
|
||||
import * as ethers from 'ethers';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
|
||||
/* istanbul ignore next */
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
@ -35,8 +34,7 @@ export class IValidatorContract extends BaseContract {
|
||||
signature: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<boolean
|
||||
> {
|
||||
): Promise<boolean> {
|
||||
assert.isString('hash', hash);
|
||||
assert.isString('signerAddress', signerAddress);
|
||||
assert.isString('signature', signature);
|
||||
@ -48,10 +46,11 @@ export class IValidatorContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as IValidatorContract;
|
||||
const encodedData = self._strictEncodeArguments('isValidSignature(bytes32,address,bytes)', [hash,
|
||||
const self = (this as any) as IValidatorContract;
|
||||
const encodedData = self._strictEncodeArguments('isValidSignature(bytes32,address,bytes)', [
|
||||
hash,
|
||||
signerAddress,
|
||||
signature
|
||||
signature,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -65,23 +64,19 @@ export class IValidatorContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,address,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
hash: string,
|
||||
signerAddress: string,
|
||||
signature: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(hash: string, signerAddress: string, signature: string): string {
|
||||
assert.isString('hash', hash);
|
||||
assert.isString('signerAddress', signerAddress);
|
||||
assert.isString('signature', signature);
|
||||
const self = this as any as IValidatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('isValidSignature(bytes32,address,bytes)', [hash,
|
||||
const self = (this as any) as IValidatorContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('isValidSignature(bytes32,address,bytes)', [
|
||||
hash,
|
||||
signerAddress,
|
||||
signature
|
||||
signature,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@ -102,7 +97,7 @@ export class IValidatorContract extends BaseContract {
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
return IValidatorContract.deployAsync(bytecode, abi, provider, txDefaults, );
|
||||
return IValidatorContract.deployAsync(bytecode, abi, provider, txDefaults);
|
||||
}
|
||||
public static async deployAsync(
|
||||
bytecode: string,
|
||||
@ -118,17 +113,13 @@ export class IValidatorContract extends BaseContract {
|
||||
]);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[] = BaseContract._formatABIDataItemList(
|
||||
constructorAbi.inputs,
|
||||
[],
|
||||
BaseContract._bigNumberToString,
|
||||
);
|
||||
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||
const iface = new ethers.utils.Interface(abi);
|
||||
const deployInfo = iface.deployFunction;
|
||||
const txData = deployInfo.encode(bytecode, []);
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{data: txData},
|
||||
{ data: txData },
|
||||
txDefaults,
|
||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||
);
|
||||
@ -136,14 +127,52 @@ export class IValidatorContract extends BaseContract {
|
||||
logUtils.log(`transactionHash: ${txHash}`);
|
||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
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 = [];
|
||||
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:trailing-comma whitespace no-trailing-whitespace
|
||||
|
@ -23,7 +23,6 @@ import { assert } from '@0x/assert';
|
||||
import * as ethers from 'ethers';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
|
||||
/* istanbul ignore next */
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
@ -34,8 +33,7 @@ export class IWalletContract extends BaseContract {
|
||||
signature: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<boolean
|
||||
> {
|
||||
): Promise<boolean> {
|
||||
assert.isString('hash', hash);
|
||||
assert.isString('signature', signature);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@ -46,10 +44,8 @@ export class IWalletContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as IWalletContract;
|
||||
const encodedData = self._strictEncodeArguments('isValidSignature(bytes32,bytes)', [hash,
|
||||
signature
|
||||
]);
|
||||
const self = (this as any) as IWalletContract;
|
||||
const encodedData = self._strictEncodeArguments('isValidSignature(bytes32,bytes)', [hash, signature]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -62,20 +58,17 @@ export class IWalletContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('isValidSignature(bytes32,bytes)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
hash: string,
|
||||
signature: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(hash: string, signature: string): string {
|
||||
assert.isString('hash', hash);
|
||||
assert.isString('signature', signature);
|
||||
const self = this as any as IWalletContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('isValidSignature(bytes32,bytes)', [hash,
|
||||
signature
|
||||
const self = (this as any) as IWalletContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('isValidSignature(bytes32,bytes)', [
|
||||
hash,
|
||||
signature,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@ -96,7 +89,7 @@ export class IWalletContract extends BaseContract {
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
return IWalletContract.deployAsync(bytecode, abi, provider, txDefaults, );
|
||||
return IWalletContract.deployAsync(bytecode, abi, provider, txDefaults);
|
||||
}
|
||||
public static async deployAsync(
|
||||
bytecode: string,
|
||||
@ -112,17 +105,13 @@ export class IWalletContract extends BaseContract {
|
||||
]);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[] = BaseContract._formatABIDataItemList(
|
||||
constructorAbi.inputs,
|
||||
[],
|
||||
BaseContract._bigNumberToString,
|
||||
);
|
||||
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||
const iface = new ethers.utils.Interface(abi);
|
||||
const deployInfo = iface.deployFunction;
|
||||
const txData = deployInfo.encode(bytecode, []);
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{data: txData},
|
||||
{ data: txData },
|
||||
txDefaults,
|
||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||
);
|
||||
@ -130,14 +119,48 @@ export class IWalletContract extends BaseContract {
|
||||
logUtils.log(`transactionHash: ${txHash}`);
|
||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
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 = [];
|
||||
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: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,9 +23,7 @@ import { assert } from '@0x/assert';
|
||||
import * as ethers from 'ethers';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
export type ZRXTokenEventArgs =
|
||||
| ZRXTokenTransferEventArgs
|
||||
| ZRXTokenApprovalEventArgs;
|
||||
export type ZRXTokenEventArgs = ZRXTokenTransferEventArgs | ZRXTokenApprovalEventArgs;
|
||||
|
||||
export enum ZRXTokenEvents {
|
||||
Transfer = 'Transfer',
|
||||
@ -44,17 +42,12 @@ export interface ZRXTokenApprovalEventArgs extends DecodedLogArgs {
|
||||
_value: BigNumber;
|
||||
}
|
||||
|
||||
|
||||
/* istanbul ignore next */
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
export class ZRXTokenContract extends BaseContract {
|
||||
public name = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -63,7 +56,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('name()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -77,14 +70,12 @@ export class ZRXTokenContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('name()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
): string {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('name()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@ -97,10 +88,8 @@ export class ZRXTokenContract extends BaseContract {
|
||||
): Promise<string> {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -108,11 +97,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.approve.estimateGasAsync.bind(
|
||||
self,
|
||||
_spender,
|
||||
_value
|
||||
),
|
||||
self.approve.estimateGasAsync.bind(self, _spender, _value),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -126,10 +111,8 @@ export class ZRXTokenContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_spender,
|
||||
_value
|
||||
, txData);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const txHashPromise = self.approve.sendTransactionAsync(_spender, _value, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -149,10 +132,8 @@ export class ZRXTokenContract extends BaseContract {
|
||||
): Promise<number> {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -169,8 +150,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
_value: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<boolean
|
||||
> {
|
||||
): Promise<boolean> {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@ -181,10 +161,8 @@ export class ZRXTokenContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
]);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('approve(address,uint256)', [_spender, _value]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -197,30 +175,23 @@ export class ZRXTokenContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
_spender: string,
|
||||
_value: BigNumber,
|
||||
): string {
|
||||
getABIEncodedTransactionData(_spender: string, _value: BigNumber): string {
|
||||
assert.isString('_spender', _spender);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [_spender,
|
||||
_value
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('approve(address,uint256)', [
|
||||
_spender,
|
||||
_value,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public totalSupply = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -229,7 +200,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('totalSupply()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -243,14 +214,12 @@ export class ZRXTokenContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('totalSupply()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
): string {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('totalSupply()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@ -265,10 +234,11 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isString('_from', _from);
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_value
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -277,12 +247,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transferFrom.estimateGasAsync.bind(
|
||||
self,
|
||||
_from,
|
||||
_to,
|
||||
_value
|
||||
),
|
||||
self.transferFrom.estimateGasAsync.bind(self, _from, _to, _value),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -298,11 +263,8 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isString('_from', _from);
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(_from,
|
||||
_to,
|
||||
_value
|
||||
, txData);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const txHashPromise = self.transferFrom.sendTransactionAsync(_from, _to, _value, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -324,10 +286,11 @@ export class ZRXTokenContract extends BaseContract {
|
||||
assert.isString('_from', _from);
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_value
|
||||
_value,
|
||||
]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -346,8 +309,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
_value: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<boolean
|
||||
> {
|
||||
): Promise<boolean> {
|
||||
assert.isString('_from', _from);
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
@ -359,10 +321,11 @@ export class ZRXTokenContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_value
|
||||
_value,
|
||||
]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -376,33 +339,25 @@ export class ZRXTokenContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
_from: string,
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
): string {
|
||||
getABIEncodedTransactionData(_from: string, _to: string, _value: BigNumber): string {
|
||||
assert.isString('_from', _from);
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [_from,
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transferFrom(address,address,uint256)', [
|
||||
_from,
|
||||
_to,
|
||||
_value
|
||||
_value,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public decimals = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<number
|
||||
> {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<number> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -411,7 +366,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('decimals()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -425,14 +380,12 @@ export class ZRXTokenContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('decimals()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<number
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<number>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
): string {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('decimals()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@ -442,8 +395,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
_owner: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
): Promise<BigNumber> {
|
||||
assert.isString('_owner', _owner);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -453,9 +405,8 @@ export class ZRXTokenContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner
|
||||
]);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('balanceOf(address)', [_owner]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -468,27 +419,19 @@ export class ZRXTokenContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('balanceOf(address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
_owner: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(_owner: string): string {
|
||||
assert.isString('_owner', _owner);
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner
|
||||
]);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
public symbol = {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<string
|
||||
> {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
schemas.addressSchema,
|
||||
schemas.numberSchema,
|
||||
@ -497,7 +440,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('symbol()', []);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
@ -511,14 +454,12 @@ export class ZRXTokenContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('symbol()');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<string
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
): string {
|
||||
const self = this as any as ZRXTokenContract;
|
||||
getABIEncodedTransactionData(): string {
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('symbol()', []);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@ -531,10 +472,8 @@ export class ZRXTokenContract extends BaseContract {
|
||||
): Promise<string> {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -542,11 +481,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
data: encodedData,
|
||||
},
|
||||
self._web3Wrapper.getContractDefaults(),
|
||||
self.transfer.estimateGasAsync.bind(
|
||||
self,
|
||||
_to,
|
||||
_value
|
||||
),
|
||||
self.transfer.estimateGasAsync.bind(self, _to, _value),
|
||||
);
|
||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
return txHash;
|
||||
@ -560,10 +495,8 @@ export class ZRXTokenContract extends BaseContract {
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const txHashPromise = self.transfer.sendTransactionAsync(_to,
|
||||
_value
|
||||
, txData);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const txHashPromise = self.transfer.sendTransactionAsync(_to, _value, txData);
|
||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
||||
txHashPromise,
|
||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
||||
@ -576,17 +509,11 @@ export class ZRXTokenContract extends BaseContract {
|
||||
})(),
|
||||
);
|
||||
},
|
||||
async estimateGasAsync(
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
txData?: Partial<TxData> | undefined,
|
||||
): Promise<number> {
|
||||
async estimateGasAsync(_to: string, _value: BigNumber, txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -603,8 +530,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
_value: BigNumber,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<boolean
|
||||
> {
|
||||
): Promise<boolean> {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@ -615,10 +541,8 @@ export class ZRXTokenContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -631,21 +555,15 @@ export class ZRXTokenContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
_to: string,
|
||||
_value: BigNumber,
|
||||
): string {
|
||||
getABIEncodedTransactionData(_to: string, _value: BigNumber): string {
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [_to,
|
||||
_value
|
||||
]);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('transfer(address,uint256)', [_to, _value]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
};
|
||||
@ -655,8 +573,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
_spender: string,
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<BigNumber
|
||||
> {
|
||||
): Promise<BigNumber> {
|
||||
assert.isString('_owner', _owner);
|
||||
assert.isString('_spender', _spender);
|
||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
||||
@ -667,10 +584,8 @@ export class ZRXTokenContract extends BaseContract {
|
||||
if (defaultBlock !== undefined) {
|
||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
||||
}
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('allowance(address,address)', [_owner,
|
||||
_spender
|
||||
]);
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const encodedData = self._strictEncodeArguments('allowance(address,address)', [_owner, _spender]);
|
||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{
|
||||
to: self.address,
|
||||
@ -683,20 +598,17 @@ export class ZRXTokenContract extends BaseContract {
|
||||
BaseContract._throwIfRevertWithReasonCallResult(rawCallResult);
|
||||
const abiEncoder = self._lookupAbiEncoder('allowance(address,address)');
|
||||
// tslint:disable boolean-naming
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber
|
||||
>(rawCallResult);
|
||||
const result = abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||
// tslint:enable boolean-naming
|
||||
return result;
|
||||
},
|
||||
getABIEncodedTransactionData(
|
||||
_owner: string,
|
||||
_spender: string,
|
||||
): string {
|
||||
getABIEncodedTransactionData(_owner: string, _spender: string): string {
|
||||
assert.isString('_owner', _owner);
|
||||
assert.isString('_spender', _spender);
|
||||
const self = this as any as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('allowance(address,address)', [_owner,
|
||||
_spender
|
||||
const self = (this as any) as ZRXTokenContract;
|
||||
const abiEncodedTransactionData = self._strictEncodeArguments('allowance(address,address)', [
|
||||
_owner,
|
||||
_spender,
|
||||
]);
|
||||
return abiEncodedTransactionData;
|
||||
},
|
||||
@ -717,7 +629,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
return ZRXTokenContract.deployAsync(bytecode, abi, provider, txDefaults, );
|
||||
return ZRXTokenContract.deployAsync(bytecode, abi, provider, txDefaults);
|
||||
}
|
||||
public static async deployAsync(
|
||||
bytecode: string,
|
||||
@ -733,17 +645,13 @@ export class ZRXTokenContract extends BaseContract {
|
||||
]);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[] = BaseContract._formatABIDataItemList(
|
||||
constructorAbi.inputs,
|
||||
[],
|
||||
BaseContract._bigNumberToString,
|
||||
);
|
||||
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||
const iface = new ethers.utils.Interface(abi);
|
||||
const deployInfo = iface.deployFunction;
|
||||
const txData = deployInfo.encode(bytecode, []);
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{data: txData},
|
||||
{ data: txData },
|
||||
txDefaults,
|
||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
||||
);
|
||||
@ -751,14 +659,233 @@ export class ZRXTokenContract extends BaseContract {
|
||||
logUtils.log(`transactionHash: ${txHash}`);
|
||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
logUtils.log(`ZRXToken successfully deployed at ${txReceipt.contractAddress}`);
|
||||
const contractInstance = new ZRXTokenContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
|
||||
const contractInstance = new ZRXTokenContract(txReceipt.contractAddress as string, provider, txDefaults);
|
||||
contractInstance.constructorArgs = [];
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, supportedProvider: SupportedProvider, txDefaults?: Partial<TxData>) {
|
||||
super('ZRXToken', 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: 'name',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'string',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
{
|
||||
name: '_spender',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: '_value',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
name: 'approve',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'bool',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'totalSupply',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
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,
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'decimals',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'uint8',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [
|
||||
{
|
||||
name: '_owner',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'balanceOf',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'symbol',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'string',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
{
|
||||
name: '_to',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: '_value',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
name: 'transfer',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'bool',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [
|
||||
{
|
||||
name: '_owner',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: '_spender',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'allowance',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
outputs: [],
|
||||
payable: false,
|
||||
type: 'constructor',
|
||||
},
|
||||
{
|
||||
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('ZRXToken', ZRXTokenContract.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:trailing-comma whitespace no-trailing-whitespace
|
||||
|
@ -18,3 +18,5 @@ export * from './generated-wrappers/zrx_token';
|
||||
export * from './generated-wrappers/coordinator';
|
||||
export * from './generated-wrappers/coordinator_registry';
|
||||
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 * as changeCase from 'change-case';
|
||||
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 * as Handlebars from 'handlebars';
|
||||
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('assertionType', utils.solTypeToAssertion.bind(utils));
|
||||
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) => {
|
||||
return lhs === rhs;
|
||||
});
|
||||
@ -109,6 +119,11 @@ if (args.language === 'TypeScript') {
|
||||
},
|
||||
);
|
||||
}
|
||||
if (args.language === 'TypeScript') {
|
||||
registerTypeScriptHelpers();
|
||||
} else if (args.language === 'Python') {
|
||||
registerPythonHelpers();
|
||||
}
|
||||
registerPartials();
|
||||
|
||||
function makeLanguageSpecificName(methodName: string): string {
|
||||
@ -207,7 +222,8 @@ for (const abiFileName of abiFileNames) {
|
||||
const contextData = {
|
||||
contractName: namedContent.name,
|
||||
ctor,
|
||||
ABI: JSON.stringify(ABI),
|
||||
ABI: ABI as ContractAbi,
|
||||
ABIString: JSON.stringify(ABI),
|
||||
methods: methodsData,
|
||||
events: eventsData,
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { EventAbi, MethodAbi } from 'ethereum-types';
|
||||
import { ContractAbi, EventAbi, MethodAbi } from 'ethereum-types';
|
||||
|
||||
export enum ParamKind {
|
||||
Input = 'input',
|
||||
@ -19,6 +19,7 @@ export interface Method extends MethodAbi {
|
||||
|
||||
export interface ContextData {
|
||||
contractName: string;
|
||||
ABI: ContractAbi;
|
||||
methods: Method[];
|
||||
events: EventAbi[];
|
||||
}
|
||||
|
@ -428,14 +428,159 @@ export class AbiGenDummyContract extends BaseContract {
|
||||
logUtils.log(`transactionHash: ${txHash}`);
|
||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
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 = [];
|
||||
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:trailing-comma whitespace no-trailing-whitespace
|
||||
|
@ -78,14 +78,26 @@ export class LibDummyContract extends BaseContract {
|
||||
logUtils.log(`transactionHash: ${txHash}`);
|
||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
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 = [];
|
||||
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:trailing-comma whitespace no-trailing-whitespace
|
||||
|
@ -170,14 +170,68 @@ export class TestLibDummyContract extends BaseContract {
|
||||
logUtils.log(`transactionHash: ${txHash}`);
|
||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
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 = [];
|
||||
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:trailing-comma whitespace no-trailing-whitespace
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { CoordinatorContract, CoordinatorRegistryContract, ExchangeContract } from '@0x/abi-gen-wrappers';
|
||||
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 { generatePseudoRandomSalt, signatureUtils } from '@0x/order-utils';
|
||||
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._contractInstance = new CoordinatorContract(
|
||||
this.abi,
|
||||
this.address,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
this._registryInstance = new CoordinatorRegistryContract(
|
||||
CoordinatorRegistry.compilerOutput.abi,
|
||||
this.registryAddress,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
);
|
||||
this._exchangeInstance = new ExchangeContract(
|
||||
Exchange.compilerOutput.abi,
|
||||
this.exchangeAddress,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
|
@ -171,7 +171,6 @@ export class DutchAuctionWrapper extends ContractWrapper {
|
||||
return this._dutchAuctionContractIfExists;
|
||||
}
|
||||
const contractInstance = new DutchAuctionContract(
|
||||
this.abi,
|
||||
this.address,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
|
@ -66,7 +66,6 @@ export class ERC20ProxyWrapper extends ContractWrapper {
|
||||
return this._erc20ProxyContractIfExists;
|
||||
}
|
||||
const contractInstance = new ERC20ProxyContract(
|
||||
this.abi,
|
||||
this.address,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
|
@ -431,7 +431,6 @@ export class ERC20TokenWrapper extends ContractWrapper {
|
||||
return tokenContract;
|
||||
}
|
||||
const contractInstance = new ERC20TokenContract(
|
||||
this.abi,
|
||||
normalizedTokenAddress,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
|
@ -66,7 +66,6 @@ export class ERC721ProxyWrapper extends ContractWrapper {
|
||||
return this._erc721ProxyContractIfExists;
|
||||
}
|
||||
const contractInstance = new ERC721ProxyContract(
|
||||
this.abi,
|
||||
this.address,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
|
@ -458,7 +458,6 @@ export class ERC721TokenWrapper extends ContractWrapper {
|
||||
return tokenContract;
|
||||
}
|
||||
const contractInstance = new ERC721TokenContract(
|
||||
this.abi,
|
||||
normalizedTokenAddress,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
|
@ -199,7 +199,6 @@ export class EtherTokenWrapper extends ContractWrapper {
|
||||
return etherTokenContract;
|
||||
}
|
||||
const contractInstance = new WETH9Contract(
|
||||
this.abi,
|
||||
etherTokenAddress,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
|
@ -1,5 +1,5 @@
|
||||
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 {
|
||||
assetDataUtils,
|
||||
@ -1212,11 +1212,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
const makerAssetData = signedOrder.makerAssetData;
|
||||
const makerAssetDataProxyId = assetDataUtils.decodeAssetProxyId(signedOrder.makerAssetData);
|
||||
const assetProxyAddress = await exchangeInstance.assetProxies.callAsync(makerAssetDataProxyId);
|
||||
const assetProxy = new IAssetProxyContract(
|
||||
IAssetProxy.compilerOutput.abi,
|
||||
assetProxyAddress,
|
||||
this._web3Wrapper.getProvider(),
|
||||
);
|
||||
const assetProxy = new IAssetProxyContract(assetProxyAddress, this._web3Wrapper.getProvider());
|
||||
|
||||
const result = await assetProxy.transferFrom.callAsync(
|
||||
makerAssetData,
|
||||
@ -1285,7 +1281,6 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
return this._exchangeContractIfExists;
|
||||
}
|
||||
const contractInstance = new ExchangeContract(
|
||||
this.abi,
|
||||
this.address,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
|
@ -241,7 +241,6 @@ export class ForwarderWrapper extends ContractWrapper {
|
||||
return this._forwarderContractIfExists;
|
||||
}
|
||||
const contractInstance = new ForwarderContract(
|
||||
this.abi,
|
||||
this.address,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
|
@ -174,7 +174,6 @@ export class OrderValidatorWrapper extends ContractWrapper {
|
||||
return this._orderValidatorContractIfExists;
|
||||
}
|
||||
const contractInstance = new OrderValidatorContract(
|
||||
this.abi,
|
||||
this.address,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { CoordinatorRegistryContract } from '@0x/abi-gen-wrappers';
|
||||
import { CoordinatorRegistry } from '@0x/contract-artifacts';
|
||||
import { constants } from '@0x/contracts-test-utils';
|
||||
import { defaultOrmConfig, getAppAsync } from '@0x/coordinator-server';
|
||||
import { BlockchainLifecycle } from '@0x/dev-utils';
|
||||
@ -162,11 +161,7 @@ describe('CoordinatorWrapper', () => {
|
||||
});
|
||||
|
||||
// setup coordinator registry
|
||||
coordinatorRegistryInstance = new CoordinatorRegistryContract(
|
||||
CoordinatorRegistry.compilerOutput.abi,
|
||||
contractAddresses.coordinatorRegistry,
|
||||
provider,
|
||||
);
|
||||
coordinatorRegistryInstance = new CoordinatorRegistryContract(contractAddresses.coordinatorRegistry, provider);
|
||||
|
||||
// register coordinator server
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { DummyERC20TokenContract } from '@0x/abi-gen-wrappers';
|
||||
import * as artifacts from '@0x/contract-artifacts';
|
||||
import { assetDataUtils } from '@0x/order-utils';
|
||||
import { orderFactory } from '@0x/order-utils/lib/src/order_factory';
|
||||
import { SignedOrder } from '@0x/types';
|
||||
@ -122,7 +121,6 @@ export class DutchAuctionUtils {
|
||||
}
|
||||
private async _increaseERC20BalanceAsync(tokenAddress: string, address: string, amount: BigNumber): Promise<void> {
|
||||
const erc20Token = new DummyERC20TokenContract(
|
||||
artifacts.DummyERC20Token.compilerOutput.abi,
|
||||
tokenAddress,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
@ -138,7 +136,6 @@ export class DutchAuctionUtils {
|
||||
amount: BigNumber,
|
||||
): Promise<void> {
|
||||
const erc20Token = new DummyERC20TokenContract(
|
||||
artifacts.DummyERC20Token.compilerOutput.abi,
|
||||
tokenAddress,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { DummyERC721TokenContract } from '@0x/abi-gen-wrappers';
|
||||
import { DummyERC721Token } from '@0x/contract-artifacts';
|
||||
import { generatePseudoRandomSalt } from '@0x/order-utils';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
|
||||
@ -26,7 +25,7 @@ export const tokenUtils = {
|
||||
return DUMMY_ERC_721_ADRESSES;
|
||||
},
|
||||
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 txHash = await erc721.mint.sendTransactionAsync(tokenOwner, tokenId);
|
||||
web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
|
@ -31,7 +31,6 @@
|
||||
"dependencies": {
|
||||
"@0x/abi-gen-wrappers": "^4.3.0",
|
||||
"@0x/base-contract": "^5.1.0",
|
||||
"@0x/contract-artifacts": "^1.5.1",
|
||||
"@0x/order-utils": "^8.1.1",
|
||||
"@0x/types": "^2.2.2",
|
||||
"@0x/typescript-typings": "^4.2.2",
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { DummyERC20TokenContract, DummyERC721TokenContract, ExchangeContract } from '@0x/abi-gen-wrappers';
|
||||
import * as artifacts from '@0x/contract-artifacts';
|
||||
import { assetDataUtils } from '@0x/order-utils';
|
||||
import { orderFactory } from '@0x/order-utils/lib/src/order_factory';
|
||||
import { OrderWithoutExchangeAddress, SignedOrder } from '@0x/types';
|
||||
@ -120,7 +119,6 @@ export class FillScenarios {
|
||||
fillableAmount,
|
||||
);
|
||||
const exchangeInstance = new ExchangeContract(
|
||||
artifacts.Exchange.compilerOutput.abi,
|
||||
signedOrder.exchangeAddress,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
@ -195,7 +193,6 @@ export class FillScenarios {
|
||||
tokenId: BigNumber,
|
||||
): Promise<void> {
|
||||
const erc721Token = new DummyERC721TokenContract(
|
||||
artifacts.DummyERC721Token.compilerOutput.abi,
|
||||
tokenAddress,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
@ -211,7 +208,6 @@ export class FillScenarios {
|
||||
tokenId: BigNumber,
|
||||
): Promise<void> {
|
||||
const erc721Token = new DummyERC721TokenContract(
|
||||
artifacts.DummyERC721Token.compilerOutput.abi,
|
||||
tokenAddress,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
@ -241,7 +237,6 @@ export class FillScenarios {
|
||||
}
|
||||
private async _increaseERC20BalanceAsync(tokenAddress: string, address: string, amount: BigNumber): Promise<void> {
|
||||
const erc20Token = new DummyERC20TokenContract(
|
||||
artifacts.DummyERC20Token.compilerOutput.abi,
|
||||
tokenAddress,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
@ -257,7 +252,6 @@ export class FillScenarios {
|
||||
amount: BigNumber,
|
||||
): Promise<void> {
|
||||
const erc20Token = new DummyERC20TokenContract(
|
||||
artifacts.DummyERC20Token.compilerOutput.abi,
|
||||
tokenAddress,
|
||||
this._web3Wrapper.getProvider(),
|
||||
this._web3Wrapper.getContractDefaults(),
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { ExchangeContract, IValidatorContract, IWalletContract } from '@0x/abi-gen-wrappers';
|
||||
import { getContractAddressesForNetworkOrThrow } from '@0x/contract-addresses';
|
||||
import * as artifacts from '@0x/contract-artifacts';
|
||||
import { schemas } from '@0x/json-schemas';
|
||||
import {
|
||||
ECSignature,
|
||||
@ -111,11 +110,7 @@ export const signatureUtils = {
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const networkId = await web3Wrapper.getNetworkIdAsync();
|
||||
const addresses = getContractAddressesForNetworkOrThrow(networkId);
|
||||
const exchangeContract = new ExchangeContract(
|
||||
artifacts.Exchange.compilerOutput.abi,
|
||||
addresses.exchange,
|
||||
provider,
|
||||
);
|
||||
const exchangeContract = new ExchangeContract(addresses.exchange, provider);
|
||||
const isValid = await exchangeContract.preSigned.callAsync(data, signerAddress);
|
||||
return isValid;
|
||||
},
|
||||
@ -139,7 +134,7 @@ export const signatureUtils = {
|
||||
assert.isETHAddressHex('signerAddress', signerAddress);
|
||||
// tslint:disable-next-line:custom-no-magic-numbers
|
||||
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);
|
||||
return isValid;
|
||||
},
|
||||
@ -162,7 +157,7 @@ export const signatureUtils = {
|
||||
assert.isHexString('signature', signature);
|
||||
assert.isETHAddressHex('signerAddress', signerAddress);
|
||||
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(
|
||||
signerAddress,
|
||||
validatorSignature.validatorAddress,
|
||||
@ -173,11 +168,7 @@ export const signatureUtils = {
|
||||
);
|
||||
}
|
||||
|
||||
const validatorContract = new IValidatorContract(
|
||||
artifacts.IValidator.compilerOutput.abi,
|
||||
signerAddress,
|
||||
provider,
|
||||
);
|
||||
const validatorContract = new IValidatorContract(signerAddress, provider);
|
||||
const isValid = await validatorContract.isValidSignature.callAsync(
|
||||
data,
|
||||
signerAddress,
|
||||
|
108
yarn.lock
108
yarn.lock
@ -512,97 +512,6 @@
|
||||
lodash "^4.17.11"
|
||||
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":
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@0x/contracts-utils/-/contracts-utils-2.0.1.tgz#32e298ab5e6edb045c37294063ff928b629db0a4"
|
||||
@ -618,21 +527,6 @@
|
||||
ethereumjs-util "^5.1.1"
|
||||
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":
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@0x/coordinator-server/-/coordinator-server-0.1.1.tgz#7eeb74959dc72b76756b95ccd14fd9fa8d072ede"
|
||||
@ -684,7 +578,7 @@
|
||||
ethers "~4.0.4"
|
||||
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"
|
||||
resolved "https://registry.npmjs.org/@0x/order-utils/-/order-utils-7.2.0.tgz#c73d81e3225e9ec7736f9789e14388c9fe2b831c"
|
||||
dependencies:
|
||||
|
Loading…
x
Reference in New Issue
Block a user