Remove ZRXToken, AssetProxies and DutchAuction contract from abi-gen-wrappers and contract-wrappers packages
This commit is contained in:
parent
869d2c02fa
commit
2915ee08ea
@ -21,7 +21,7 @@
|
|||||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output src/generated-wrappers --backend ethers"
|
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --output src/generated-wrappers --backend ethers"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"abis": "../contract-artifacts/artifacts/@(AssetProxyOwner|DevUtils|DutchAuction|DummyERC20Token|DummyERC721Token|ERC1155Mintable|ERC20Proxy|ERC20Token|ERC721Proxy|ERC721Token|Exchange|Forwarder|IAssetProxy|IValidator|IWallet|MultiAssetProxy|OrderValidator|WETH9|ZRXToken|Coordinator|CoordinatorRegistry|EthBalanceChecker|ERC1155Proxy|StaticCallProxy|Staking|StakingProxy).json"
|
"abis": "../contract-artifacts/artifacts/@(DevUtils|DummyERC20Token|DummyERC721Token|ERC1155Mintable|ERC20Token|ERC721Token|Exchange|Forwarder|IValidator|IWallet|OrderValidator|WETH9|Coordinator|CoordinatorRegistry|EthBalanceChecker|Staking|StakingProxy).json"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,444 +0,0 @@
|
|||||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma enum-naming
|
|
||||||
// tslint:disable:whitespace no-unbound-method no-trailing-whitespace
|
|
||||||
// tslint:disable:no-unused-variable
|
|
||||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
|
||||||
import { schemas } from '@0x/json-schemas';
|
|
||||||
import {
|
|
||||||
BlockParam,
|
|
||||||
BlockParamLiteral,
|
|
||||||
BlockRange,
|
|
||||||
CallData,
|
|
||||||
ContractAbi,
|
|
||||||
ContractArtifact,
|
|
||||||
DecodedLogArgs,
|
|
||||||
MethodAbi,
|
|
||||||
TransactionReceiptWithDecodedLogs,
|
|
||||||
TxData,
|
|
||||||
TxDataPayable,
|
|
||||||
SupportedProvider,
|
|
||||||
} from 'ethereum-types';
|
|
||||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
|
||||||
import {
|
|
||||||
AwaitTransactionSuccessOpts,
|
|
||||||
EventCallback,
|
|
||||||
IndexedFilterValues,
|
|
||||||
SendTransactionOpts,
|
|
||||||
SimpleContractArtifact,
|
|
||||||
} from '@0x/types';
|
|
||||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
|
||||||
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 {
|
|
||||||
/**
|
|
||||||
* @ignore
|
|
||||||
*/
|
|
||||||
public static deployedBytecode: string | undefined;
|
|
||||||
/**
|
|
||||||
* Transfers assets. Either succeeds or throws.
|
|
||||||
*/
|
|
||||||
public transferFrom = {
|
|
||||||
/**
|
|
||||||
* Sends an Ethereum transaction executing this method with the supplied parameters. This is a read/write
|
|
||||||
* Ethereum operation and will cost gas.
|
|
||||||
* @param assetData Byte array encoded for the respective asset proxy.
|
|
||||||
* @param from Address to transfer asset from.
|
|
||||||
* @param to Address to transfer asset to.
|
|
||||||
* @param amount Amount of asset to transfer.
|
|
||||||
* @param txData Additional data for transaction
|
|
||||||
* @returns The hash of the transaction
|
|
||||||
*/
|
|
||||||
async sendTransactionAsync(
|
|
||||||
assetData: string,
|
|
||||||
from: string,
|
|
||||||
to: string,
|
|
||||||
amount: BigNumber,
|
|
||||||
txData?: Partial<TxData> | undefined,
|
|
||||||
opts: SendTransactionOpts = { shouldValidate: true },
|
|
||||||
): Promise<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 encodedData = self._strictEncodeArguments('transferFrom(bytes,address,address,uint256)', [
|
|
||||||
assetData,
|
|
||||||
from.toLowerCase(),
|
|
||||||
to.toLowerCase(),
|
|
||||||
amount,
|
|
||||||
]);
|
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
|
||||||
{
|
|
||||||
to: self.address,
|
|
||||||
...txData,
|
|
||||||
data: encodedData,
|
|
||||||
},
|
|
||||||
self._web3Wrapper.getContractDefaults(),
|
|
||||||
);
|
|
||||||
if (txDataWithDefaults.from !== undefined) {
|
|
||||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (opts.shouldValidate !== false) {
|
|
||||||
await self.transferFrom.callAsync(assetData, from, to, amount, txDataWithDefaults);
|
|
||||||
}
|
|
||||||
|
|
||||||
const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
|
||||||
return txHash;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Sends an Ethereum transaction and waits until the transaction has been successfully mined without reverting.
|
|
||||||
* If the transaction was mined, but reverted, an error is thrown.
|
|
||||||
* @param assetData Byte array encoded for the respective asset proxy.
|
|
||||||
* @param from Address to transfer asset from.
|
|
||||||
* @param to Address to transfer asset to.
|
|
||||||
* @param amount Amount of asset to transfer.
|
|
||||||
* @param txData Additional data for transaction
|
|
||||||
* @param pollingIntervalMs Interval at which to poll for success
|
|
||||||
* @returns A promise that resolves when the transaction is successful
|
|
||||||
*/
|
|
||||||
awaitTransactionSuccessAsync(
|
|
||||||
assetData: string,
|
|
||||||
from: string,
|
|
||||||
to: string,
|
|
||||||
amount: BigNumber,
|
|
||||||
txData?: Partial<TxData>,
|
|
||||||
opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
|
|
||||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
|
||||||
assert.isString('assetData', assetData);
|
|
||||||
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.toLowerCase(),
|
|
||||||
to.toLowerCase(),
|
|
||||||
amount,
|
|
||||||
txData,
|
|
||||||
opts,
|
|
||||||
);
|
|
||||||
return new PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs>(
|
|
||||||
txHashPromise,
|
|
||||||
(async (): Promise<TransactionReceiptWithDecodedLogs> => {
|
|
||||||
// When the transaction hash resolves, wait for it to be mined.
|
|
||||||
return self._web3Wrapper.awaitTransactionSuccessAsync(
|
|
||||||
await txHashPromise,
|
|
||||||
opts.pollingIntervalMs,
|
|
||||||
opts.timeoutMs,
|
|
||||||
);
|
|
||||||
})(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Estimates the gas cost of sending an Ethereum transaction calling this method with these arguments.
|
|
||||||
* @param assetData Byte array encoded for the respective asset proxy.
|
|
||||||
* @param from Address to transfer asset from.
|
|
||||||
* @param to Address to transfer asset to.
|
|
||||||
* @param amount Amount of asset to transfer.
|
|
||||||
* @param txData Additional data for transaction
|
|
||||||
* @returns The hash of the transaction
|
|
||||||
*/
|
|
||||||
async estimateGasAsync(
|
|
||||||
assetData: string,
|
|
||||||
from: string,
|
|
||||||
to: string,
|
|
||||||
amount: BigNumber,
|
|
||||||
txData?: Partial<TxData> | undefined,
|
|
||||||
): Promise<number> {
|
|
||||||
assert.isString('assetData', assetData);
|
|
||||||
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,
|
|
||||||
from.toLowerCase(),
|
|
||||||
to.toLowerCase(),
|
|
||||||
amount,
|
|
||||||
]);
|
|
||||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
|
||||||
{
|
|
||||||
to: self.address,
|
|
||||||
...txData,
|
|
||||||
data: encodedData,
|
|
||||||
},
|
|
||||||
self._web3Wrapper.getContractDefaults(),
|
|
||||||
);
|
|
||||||
if (txDataWithDefaults.from !== undefined) {
|
|
||||||
txDataWithDefaults.from = txDataWithDefaults.from.toLowerCase();
|
|
||||||
}
|
|
||||||
|
|
||||||
const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
|
||||||
return gas;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
|
||||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
|
||||||
* since they don't modify state.
|
|
||||||
* @param assetData Byte array encoded for the respective asset proxy.
|
|
||||||
* @param from Address to transfer asset from.
|
|
||||||
* @param to Address to transfer asset to.
|
|
||||||
* @param amount Amount of asset to transfer.
|
|
||||||
*/
|
|
||||||
async callAsync(
|
|
||||||
assetData: string,
|
|
||||||
from: string,
|
|
||||||
to: string,
|
|
||||||
amount: BigNumber,
|
|
||||||
callData: Partial<CallData> = {},
|
|
||||||
defaultBlock?: BlockParam,
|
|
||||||
): Promise<void> {
|
|
||||||
assert.isString('assetData', assetData);
|
|
||||||
assert.isString('from', from);
|
|
||||||
assert.isString('to', to);
|
|
||||||
assert.isBigNumber('amount', amount);
|
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
|
||||||
schemas.addressSchema,
|
|
||||||
schemas.numberSchema,
|
|
||||||
schemas.jsNumber,
|
|
||||||
]);
|
|
||||||
if (defaultBlock !== undefined) {
|
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
|
||||||
}
|
|
||||||
const self = (this as any) as IAssetProxyContract;
|
|
||||||
const encodedData = self._strictEncodeArguments('transferFrom(bytes,address,address,uint256)', [
|
|
||||||
assetData,
|
|
||||||
from.toLowerCase(),
|
|
||||||
to.toLowerCase(),
|
|
||||||
amount,
|
|
||||||
]);
|
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
|
||||||
{
|
|
||||||
to: self.address,
|
|
||||||
...callData,
|
|
||||||
data: encodedData,
|
|
||||||
},
|
|
||||||
self._web3Wrapper.getContractDefaults(),
|
|
||||||
);
|
|
||||||
callDataWithDefaults.from = callDataWithDefaults.from
|
|
||||||
? callDataWithDefaults.from.toLowerCase()
|
|
||||||
: callDataWithDefaults.from;
|
|
||||||
let rawCallResult;
|
|
||||||
try {
|
|
||||||
rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
|
||||||
} catch (err) {
|
|
||||||
BaseContract._throwIfThrownErrorIsRevertError(err);
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
BaseContract._throwIfCallResultIsRevertError(rawCallResult);
|
|
||||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(bytes,address,address,uint256)');
|
|
||||||
// tslint:disable boolean-naming
|
|
||||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before
|
|
||||||
* sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used
|
|
||||||
* to create a 0x transaction (see protocol spec for more details).
|
|
||||||
* @param assetData Byte array encoded for the respective asset proxy.
|
|
||||||
* @param from Address to transfer asset from.
|
|
||||||
* @param to Address to transfer asset to.
|
|
||||||
* @param amount Amount of asset to transfer.
|
|
||||||
* @returns The ABI encoded transaction data as a 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.toLowerCase(), to.toLowerCase(), amount],
|
|
||||||
);
|
|
||||||
return abiEncodedTransactionData;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Returns the 4 byte function selector as a hex string.
|
|
||||||
*/
|
|
||||||
getSelector(): string {
|
|
||||||
const self = (this as any) as IAssetProxyContract;
|
|
||||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(bytes,address,address,uint256)');
|
|
||||||
return abiEncoder.getSelector();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* Gets the proxy id associated with the proxy address.
|
|
||||||
*/
|
|
||||||
public getProxyId = {
|
|
||||||
/**
|
|
||||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
|
||||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
|
||||||
* since they don't modify state.
|
|
||||||
* @returns Proxy id.
|
|
||||||
*/
|
|
||||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
|
||||||
schemas.addressSchema,
|
|
||||||
schemas.numberSchema,
|
|
||||||
schemas.jsNumber,
|
|
||||||
]);
|
|
||||||
if (defaultBlock !== undefined) {
|
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
|
||||||
}
|
|
||||||
const self = (this as any) as IAssetProxyContract;
|
|
||||||
const encodedData = self._strictEncodeArguments('getProxyId()', []);
|
|
||||||
const encodedDataBytes = Buffer.from(encodedData.substr(2), 'hex');
|
|
||||||
|
|
||||||
let rawCallResult;
|
|
||||||
try {
|
|
||||||
rawCallResult = await self._evmExecAsync(encodedDataBytes);
|
|
||||||
} catch (err) {
|
|
||||||
BaseContract._throwIfThrownErrorIsRevertError(err);
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
BaseContract._throwIfCallResultIsRevertError(rawCallResult);
|
|
||||||
|
|
||||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
|
||||||
// tslint:disable boolean-naming
|
|
||||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
public static async deployFrom0xArtifactAsync(
|
|
||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
|
||||||
supportedProvider: SupportedProvider,
|
|
||||||
txDefaults: Partial<TxData>,
|
|
||||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
|
||||||
): Promise<IAssetProxyContract> {
|
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
|
||||||
schemas.addressSchema,
|
|
||||||
schemas.numberSchema,
|
|
||||||
schemas.jsNumber,
|
|
||||||
]);
|
|
||||||
if (artifact.compilerOutput === undefined) {
|
|
||||||
throw new Error('Compiler output not found in the artifact file');
|
|
||||||
}
|
|
||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
|
||||||
const abi = artifact.compilerOutput.abi;
|
|
||||||
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
|
||||||
if (Object.keys(logDecodeDependencies) !== undefined) {
|
|
||||||
for (const key of Object.keys(logDecodeDependencies)) {
|
|
||||||
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return IAssetProxyContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
|
||||||
}
|
|
||||||
public static async deployAsync(
|
|
||||||
bytecode: string,
|
|
||||||
abi: ContractAbi,
|
|
||||||
supportedProvider: SupportedProvider,
|
|
||||||
txDefaults: Partial<TxData>,
|
|
||||||
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
|
||||||
): Promise<IAssetProxyContract> {
|
|
||||||
assert.isHexString('bytecode', bytecode);
|
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
|
||||||
schemas.addressSchema,
|
|
||||||
schemas.numberSchema,
|
|
||||||
schemas.jsNumber,
|
|
||||||
]);
|
|
||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
|
||||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
|
||||||
[] = 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 },
|
|
||||||
txDefaults,
|
|
||||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
|
||||||
);
|
|
||||||
const txHash = await web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
|
||||||
logUtils.log(`transactionHash: ${txHash}`);
|
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
|
||||||
logUtils.log(`IAssetProxy successfully deployed at ${txReceipt.contractAddress}`);
|
|
||||||
const contractInstance = new IAssetProxyContract(
|
|
||||||
txReceipt.contractAddress as string,
|
|
||||||
provider,
|
|
||||||
txDefaults,
|
|
||||||
logDecodeDependencies,
|
|
||||||
);
|
|
||||||
contractInstance.constructorArgs = [];
|
|
||||||
return contractInstance;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @returns The contract ABI
|
|
||||||
*/
|
|
||||||
public static ABI(): ContractAbi {
|
|
||||||
const abi = [
|
|
||||||
{
|
|
||||||
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',
|
|
||||||
},
|
|
||||||
] as ContractAbi;
|
|
||||||
return abi;
|
|
||||||
}
|
|
||||||
constructor(
|
|
||||||
address: string,
|
|
||||||
supportedProvider: SupportedProvider,
|
|
||||||
txDefaults?: Partial<TxData>,
|
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
|
||||||
deployedBytecode: string | undefined = IAssetProxyContract.deployedBytecode,
|
|
||||||
) {
|
|
||||||
super(
|
|
||||||
'IAssetProxy',
|
|
||||||
IAssetProxyContract.ABI(),
|
|
||||||
address,
|
|
||||||
supportedProvider,
|
|
||||||
txDefaults,
|
|
||||||
logDecodeDependencies,
|
|
||||||
deployedBytecode,
|
|
||||||
);
|
|
||||||
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 one or more lines are too long
@ -1,282 +0,0 @@
|
|||||||
// tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma enum-naming
|
|
||||||
// tslint:disable:whitespace no-unbound-method no-trailing-whitespace
|
|
||||||
// tslint:disable:no-unused-variable
|
|
||||||
import { BaseContract, PromiseWithTransactionHash } from '@0x/base-contract';
|
|
||||||
import { schemas } from '@0x/json-schemas';
|
|
||||||
import {
|
|
||||||
BlockParam,
|
|
||||||
BlockParamLiteral,
|
|
||||||
BlockRange,
|
|
||||||
CallData,
|
|
||||||
ContractAbi,
|
|
||||||
ContractArtifact,
|
|
||||||
DecodedLogArgs,
|
|
||||||
MethodAbi,
|
|
||||||
TransactionReceiptWithDecodedLogs,
|
|
||||||
TxData,
|
|
||||||
TxDataPayable,
|
|
||||||
SupportedProvider,
|
|
||||||
} from 'ethereum-types';
|
|
||||||
import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils';
|
|
||||||
import {
|
|
||||||
AwaitTransactionSuccessOpts,
|
|
||||||
EventCallback,
|
|
||||||
IndexedFilterValues,
|
|
||||||
SendTransactionOpts,
|
|
||||||
SimpleContractArtifact,
|
|
||||||
} from '@0x/types';
|
|
||||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
|
||||||
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 StaticCallProxyContract extends BaseContract {
|
|
||||||
/**
|
|
||||||
* @ignore
|
|
||||||
*/
|
|
||||||
public static deployedBytecode =
|
|
||||||
'0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063a85e59e41461003b578063ae25532e146100d3575b600080fd5b6100d16004803603608081101561005157600080fd5b81019060208101813564010000000081111561006c57600080fd5b82018360208201111561007e57600080fd5b803590602001918460018302840111640100000000831117156100a057600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610110565b005b6100db6103a5565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b6000606060006101656004898990508a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092949392505063ffffffff6103c5169050565b806020019051606081101561017957600080fd5b8151602083018051604051929492938301929190846401000000008211156101a057600080fd5b9083019060208201858111156101b557600080fd5b82516401000000008111828201881017156101cf57600080fd5b82525081516020918201929091019080838360005b838110156101fc5781810151838201526020016101e4565b50505050905090810190601f1680156102295780820380516001836020036101000a031916815260200191505b5060405260200180519060200190929190505050925092509250600060608473ffffffffffffffffffffffffffffffffffffffff16846040518082805190602001908083835b602083106102ac57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161026f565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d806000811461030c576040519150601f19603f3d011682016040523d82523d6000602084013e610311565b606091505b50915091508161032357805160208201fd5b8051602082012083811461039857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f554e45585045435445445f5354415449435f43414c4c5f524553554c54000000604482015290519081900360640190fd5b5050505050505050505050565b600060405180806104b06021913960210190506040518091039020905090565b6060818311156103e3576103e36103de60008585610408565b6104a7565b83518211156103fc576103fc6103de6001848751610408565b50819003910190815290565b6060632800659560e01b8484846040516024018084600781111561042857fe5b60ff1681526020018381526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090509392505050565b805160208201fdfe53746174696343616c6c28616464726573732c62797465732c6279746573333229a265627a7a72315820c55cf13cfcaaf322238d786911313ce7d45854692241ae9b56709bdbfed4f54c64736f6c634300050b0032';
|
|
||||||
/**
|
|
||||||
* Makes a staticcall to a target address and verifies that the data returned matches the expected return data.
|
|
||||||
*/
|
|
||||||
public transferFrom = {
|
|
||||||
/**
|
|
||||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
|
||||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
|
||||||
* since they don't modify state.
|
|
||||||
* @param assetData Byte array encoded with staticCallTarget, staticCallData,
|
|
||||||
* and expectedCallResultHash
|
|
||||||
* @param from This value is ignored.
|
|
||||||
* @param to This value is ignored.
|
|
||||||
* @param amount This value is ignored.
|
|
||||||
*/
|
|
||||||
async callAsync(
|
|
||||||
assetData: string,
|
|
||||||
from: string,
|
|
||||||
to: string,
|
|
||||||
amount: BigNumber,
|
|
||||||
callData: Partial<CallData> = {},
|
|
||||||
defaultBlock?: BlockParam,
|
|
||||||
): Promise<void> {
|
|
||||||
assert.isString('assetData', assetData);
|
|
||||||
assert.isString('from', from);
|
|
||||||
assert.isString('to', to);
|
|
||||||
assert.isBigNumber('amount', amount);
|
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
|
||||||
schemas.addressSchema,
|
|
||||||
schemas.numberSchema,
|
|
||||||
schemas.jsNumber,
|
|
||||||
]);
|
|
||||||
if (defaultBlock !== undefined) {
|
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
|
||||||
}
|
|
||||||
const self = (this as any) as StaticCallProxyContract;
|
|
||||||
const encodedData = self._strictEncodeArguments('transferFrom(bytes,address,address,uint256)', [
|
|
||||||
assetData,
|
|
||||||
from.toLowerCase(),
|
|
||||||
to.toLowerCase(),
|
|
||||||
amount,
|
|
||||||
]);
|
|
||||||
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
|
||||||
{
|
|
||||||
to: self.address,
|
|
||||||
...callData,
|
|
||||||
data: encodedData,
|
|
||||||
},
|
|
||||||
self._web3Wrapper.getContractDefaults(),
|
|
||||||
);
|
|
||||||
callDataWithDefaults.from = callDataWithDefaults.from
|
|
||||||
? callDataWithDefaults.from.toLowerCase()
|
|
||||||
: callDataWithDefaults.from;
|
|
||||||
let rawCallResult;
|
|
||||||
try {
|
|
||||||
rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock);
|
|
||||||
} catch (err) {
|
|
||||||
BaseContract._throwIfThrownErrorIsRevertError(err);
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
BaseContract._throwIfCallResultIsRevertError(rawCallResult);
|
|
||||||
const abiEncoder = self._lookupAbiEncoder('transferFrom(bytes,address,address,uint256)');
|
|
||||||
// tslint:disable boolean-naming
|
|
||||||
const result = abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* Gets the proxy id associated with the proxy address.
|
|
||||||
*/
|
|
||||||
public getProxyId = {
|
|
||||||
/**
|
|
||||||
* Sends a read-only call to the contract method. Returns the result that would happen if one were to send an
|
|
||||||
* Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas
|
|
||||||
* since they don't modify state.
|
|
||||||
* @returns Proxy id.
|
|
||||||
*/
|
|
||||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
|
||||||
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
|
|
||||||
schemas.addressSchema,
|
|
||||||
schemas.numberSchema,
|
|
||||||
schemas.jsNumber,
|
|
||||||
]);
|
|
||||||
if (defaultBlock !== undefined) {
|
|
||||||
assert.isBlockParam('defaultBlock', defaultBlock);
|
|
||||||
}
|
|
||||||
const self = (this as any) as StaticCallProxyContract;
|
|
||||||
const encodedData = self._strictEncodeArguments('getProxyId()', []);
|
|
||||||
const encodedDataBytes = Buffer.from(encodedData.substr(2), 'hex');
|
|
||||||
|
|
||||||
let rawCallResult;
|
|
||||||
try {
|
|
||||||
rawCallResult = await self._evmExecAsync(encodedDataBytes);
|
|
||||||
} catch (err) {
|
|
||||||
BaseContract._throwIfThrownErrorIsRevertError(err);
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
BaseContract._throwIfCallResultIsRevertError(rawCallResult);
|
|
||||||
|
|
||||||
const abiEncoder = self._lookupAbiEncoder('getProxyId()');
|
|
||||||
// tslint:disable boolean-naming
|
|
||||||
const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
|
||||||
// tslint:enable boolean-naming
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
public static async deployFrom0xArtifactAsync(
|
|
||||||
artifact: ContractArtifact | SimpleContractArtifact,
|
|
||||||
supportedProvider: SupportedProvider,
|
|
||||||
txDefaults: Partial<TxData>,
|
|
||||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
|
||||||
): Promise<StaticCallProxyContract> {
|
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
|
||||||
schemas.addressSchema,
|
|
||||||
schemas.numberSchema,
|
|
||||||
schemas.jsNumber,
|
|
||||||
]);
|
|
||||||
if (artifact.compilerOutput === undefined) {
|
|
||||||
throw new Error('Compiler output not found in the artifact file');
|
|
||||||
}
|
|
||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
|
||||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
|
||||||
const abi = artifact.compilerOutput.abi;
|
|
||||||
const logDecodeDependenciesAbiOnly: { [contractName: string]: ContractAbi } = {};
|
|
||||||
if (Object.keys(logDecodeDependencies) !== undefined) {
|
|
||||||
for (const key of Object.keys(logDecodeDependencies)) {
|
|
||||||
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return StaticCallProxyContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
|
||||||
}
|
|
||||||
public static async deployAsync(
|
|
||||||
bytecode: string,
|
|
||||||
abi: ContractAbi,
|
|
||||||
supportedProvider: SupportedProvider,
|
|
||||||
txDefaults: Partial<TxData>,
|
|
||||||
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
|
||||||
): Promise<StaticCallProxyContract> {
|
|
||||||
assert.isHexString('bytecode', bytecode);
|
|
||||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
|
||||||
schemas.addressSchema,
|
|
||||||
schemas.numberSchema,
|
|
||||||
schemas.jsNumber,
|
|
||||||
]);
|
|
||||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
|
||||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
|
||||||
[] = 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 },
|
|
||||||
txDefaults,
|
|
||||||
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
|
|
||||||
);
|
|
||||||
const txHash = await web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
|
||||||
logUtils.log(`transactionHash: ${txHash}`);
|
|
||||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
|
||||||
logUtils.log(`StaticCallProxy successfully deployed at ${txReceipt.contractAddress}`);
|
|
||||||
const contractInstance = new StaticCallProxyContract(
|
|
||||||
txReceipt.contractAddress as string,
|
|
||||||
provider,
|
|
||||||
txDefaults,
|
|
||||||
logDecodeDependencies,
|
|
||||||
);
|
|
||||||
contractInstance.constructorArgs = [];
|
|
||||||
return contractInstance;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @returns The contract ABI
|
|
||||||
*/
|
|
||||||
public static ABI(): ContractAbi {
|
|
||||||
const abi = [
|
|
||||||
{
|
|
||||||
constant: true,
|
|
||||||
inputs: [
|
|
||||||
{
|
|
||||||
name: 'assetData',
|
|
||||||
type: 'bytes',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'from',
|
|
||||||
type: 'address',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'to',
|
|
||||||
type: 'address',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'amount',
|
|
||||||
type: 'uint256',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
name: 'transferFrom',
|
|
||||||
outputs: [],
|
|
||||||
payable: false,
|
|
||||||
stateMutability: 'view',
|
|
||||||
type: 'function',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
constant: true,
|
|
||||||
inputs: [],
|
|
||||||
name: 'getProxyId',
|
|
||||||
outputs: [
|
|
||||||
{
|
|
||||||
name: '',
|
|
||||||
type: 'bytes4',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
payable: false,
|
|
||||||
stateMutability: 'pure',
|
|
||||||
type: 'function',
|
|
||||||
},
|
|
||||||
] as ContractAbi;
|
|
||||||
return abi;
|
|
||||||
}
|
|
||||||
constructor(
|
|
||||||
address: string,
|
|
||||||
supportedProvider: SupportedProvider,
|
|
||||||
txDefaults?: Partial<TxData>,
|
|
||||||
logDecodeDependencies?: { [contractName: string]: ContractAbi },
|
|
||||||
deployedBytecode: string | undefined = StaticCallProxyContract.deployedBytecode,
|
|
||||||
) {
|
|
||||||
super(
|
|
||||||
'StaticCallProxy',
|
|
||||||
StaticCallProxyContract.ABI(),
|
|
||||||
address,
|
|
||||||
supportedProvider,
|
|
||||||
txDefaults,
|
|
||||||
logDecodeDependencies,
|
|
||||||
deployedBytecode,
|
|
||||||
);
|
|
||||||
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,19 +1,3 @@
|
|||||||
export {
|
|
||||||
AssetProxyOwnerEventArgs,
|
|
||||||
AssetProxyOwnerEvents,
|
|
||||||
AssetProxyOwnerConfirmationTimeSetEventArgs,
|
|
||||||
AssetProxyOwnerTimeLockChangeEventArgs,
|
|
||||||
AssetProxyOwnerConfirmationEventArgs,
|
|
||||||
AssetProxyOwnerRevocationEventArgs,
|
|
||||||
AssetProxyOwnerSubmissionEventArgs,
|
|
||||||
AssetProxyOwnerExecutionEventArgs,
|
|
||||||
AssetProxyOwnerExecutionFailureEventArgs,
|
|
||||||
AssetProxyOwnerDepositEventArgs,
|
|
||||||
AssetProxyOwnerOwnerAdditionEventArgs,
|
|
||||||
AssetProxyOwnerOwnerRemovalEventArgs,
|
|
||||||
AssetProxyOwnerRequirementChangeEventArgs,
|
|
||||||
AssetProxyOwnerContract,
|
|
||||||
} from './generated-wrappers/asset_proxy_owner';
|
|
||||||
export { DevUtilsContract } from './generated-wrappers/dev_utils';
|
export { DevUtilsContract } from './generated-wrappers/dev_utils';
|
||||||
export {
|
export {
|
||||||
DummyERC20TokenEventArgs,
|
DummyERC20TokenEventArgs,
|
||||||
@ -37,21 +21,6 @@ export {
|
|||||||
ERC1155MintableTransferSingleEventArgs,
|
ERC1155MintableTransferSingleEventArgs,
|
||||||
ERC1155MintableURIEventArgs,
|
ERC1155MintableURIEventArgs,
|
||||||
} from './generated-wrappers/erc1155_mintable';
|
} from './generated-wrappers/erc1155_mintable';
|
||||||
export { DutchAuctionContract } from './generated-wrappers/dutch_auction';
|
|
||||||
export {
|
|
||||||
ERC1155ProxyEventArgs,
|
|
||||||
ERC1155ProxyEvents,
|
|
||||||
ERC1155ProxyAuthorizedAddressAddedEventArgs,
|
|
||||||
ERC1155ProxyAuthorizedAddressRemovedEventArgs,
|
|
||||||
ERC1155ProxyContract,
|
|
||||||
} from './generated-wrappers/erc1155_proxy';
|
|
||||||
export {
|
|
||||||
ERC20ProxyEventArgs,
|
|
||||||
ERC20ProxyEvents,
|
|
||||||
ERC20ProxyAuthorizedAddressAddedEventArgs,
|
|
||||||
ERC20ProxyAuthorizedAddressRemovedEventArgs,
|
|
||||||
ERC20ProxyContract,
|
|
||||||
} from './generated-wrappers/erc20_proxy';
|
|
||||||
export {
|
export {
|
||||||
ERC20TokenEventArgs,
|
ERC20TokenEventArgs,
|
||||||
ERC20TokenEvents,
|
ERC20TokenEvents,
|
||||||
@ -59,13 +28,6 @@ export {
|
|||||||
ERC20TokenApprovalEventArgs,
|
ERC20TokenApprovalEventArgs,
|
||||||
ERC20TokenContract,
|
ERC20TokenContract,
|
||||||
} from './generated-wrappers/erc20_token';
|
} from './generated-wrappers/erc20_token';
|
||||||
export {
|
|
||||||
ERC721ProxyEventArgs,
|
|
||||||
ERC721ProxyEvents,
|
|
||||||
ERC721ProxyAuthorizedAddressAddedEventArgs,
|
|
||||||
ERC721ProxyAuthorizedAddressRemovedEventArgs,
|
|
||||||
ERC721ProxyContract,
|
|
||||||
} from './generated-wrappers/erc721_proxy';
|
|
||||||
export {
|
export {
|
||||||
ERC721TokenEventArgs,
|
ERC721TokenEventArgs,
|
||||||
ERC721TokenEvents,
|
ERC721TokenEvents,
|
||||||
@ -88,19 +50,9 @@ export {
|
|||||||
ExchangeTransactionExecutionEventArgs,
|
ExchangeTransactionExecutionEventArgs,
|
||||||
} from './generated-wrappers/exchange';
|
} from './generated-wrappers/exchange';
|
||||||
export { ForwarderContract } from './generated-wrappers/forwarder';
|
export { ForwarderContract } from './generated-wrappers/forwarder';
|
||||||
export { IAssetProxyContract } from './generated-wrappers/i_asset_proxy';
|
|
||||||
export { IValidatorContract } from './generated-wrappers/i_validator';
|
export { IValidatorContract } from './generated-wrappers/i_validator';
|
||||||
export { IWalletContract } from './generated-wrappers/i_wallet';
|
export { IWalletContract } from './generated-wrappers/i_wallet';
|
||||||
export {
|
|
||||||
MultiAssetProxyEventArgs,
|
|
||||||
MultiAssetProxyEvents,
|
|
||||||
MultiAssetProxyAuthorizedAddressAddedEventArgs,
|
|
||||||
MultiAssetProxyAuthorizedAddressRemovedEventArgs,
|
|
||||||
MultiAssetProxyAssetProxyRegisteredEventArgs,
|
|
||||||
MultiAssetProxyContract,
|
|
||||||
} from './generated-wrappers/multi_asset_proxy';
|
|
||||||
export { OrderValidatorContract } from './generated-wrappers/order_validator';
|
export { OrderValidatorContract } from './generated-wrappers/order_validator';
|
||||||
export { StaticCallProxyContract } from './generated-wrappers/static_call_proxy';
|
|
||||||
export {
|
export {
|
||||||
StakingAuthorizedAddressAddedEventArgs,
|
StakingAuthorizedAddressAddedEventArgs,
|
||||||
StakingAuthorizedAddressRemovedEventArgs,
|
StakingAuthorizedAddressRemovedEventArgs,
|
||||||
@ -141,13 +93,6 @@ export {
|
|||||||
WETH9WithdrawalEventArgs,
|
WETH9WithdrawalEventArgs,
|
||||||
WETH9Contract,
|
WETH9Contract,
|
||||||
} from './generated-wrappers/weth9';
|
} from './generated-wrappers/weth9';
|
||||||
export {
|
|
||||||
ZRXTokenEventArgs,
|
|
||||||
ZRXTokenEvents,
|
|
||||||
ZRXTokenTransferEventArgs,
|
|
||||||
ZRXTokenApprovalEventArgs,
|
|
||||||
ZRXTokenContract,
|
|
||||||
} from './generated-wrappers/zrx_token';
|
|
||||||
export { CoordinatorContract } from './generated-wrappers/coordinator';
|
export { CoordinatorContract } from './generated-wrappers/coordinator';
|
||||||
export {
|
export {
|
||||||
CoordinatorRegistryEventArgs,
|
CoordinatorRegistryEventArgs,
|
||||||
|
@ -77,7 +77,7 @@ describe('ForwarderSwapQuoteConsumer', () => {
|
|||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await blockchainLifecycle.startAsync();
|
await blockchainLifecycle.startAsync();
|
||||||
const UNLIMITED_ALLOWANCE = UNLIMITED_ALLOWANCE_IN_BASE_UNITS;
|
const UNLIMITED_ALLOWANCE = UNLIMITED_ALLOWANCE_IN_BASE_UNITS;
|
||||||
erc20ProxyAddress = contractWrappers.erc20Proxy.address;
|
erc20ProxyAddress = contractAddresses.erc20Proxy;
|
||||||
|
|
||||||
const totalFillableAmount = FILLABLE_AMOUNTS.reduce(
|
const totalFillableAmount = FILLABLE_AMOUNTS.reduce(
|
||||||
(a: BigNumber, c: BigNumber) => a.plus(c),
|
(a: BigNumber, c: BigNumber) => a.plus(c),
|
||||||
|
@ -71,7 +71,7 @@ describe('SwapQuoteConsumer', () => {
|
|||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await blockchainLifecycle.startAsync();
|
await blockchainLifecycle.startAsync();
|
||||||
const UNLIMITED_ALLOWANCE = UNLIMITED_ALLOWANCE_IN_BASE_UNITS;
|
const UNLIMITED_ALLOWANCE = UNLIMITED_ALLOWANCE_IN_BASE_UNITS;
|
||||||
erc20ProxyAddress = contractWrappers.erc20Proxy.address;
|
erc20ProxyAddress = contractAddresses.erc20Proxy;
|
||||||
|
|
||||||
const totalFillableAmount = FILLABLE_AMOUNTS.reduce(
|
const totalFillableAmount = FILLABLE_AMOUNTS.reduce(
|
||||||
(a: BigNumber, c: BigNumber) => a.plus(c),
|
(a: BigNumber, c: BigNumber) => a.plus(c),
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
DevUtilsContract,
|
DevUtilsContract,
|
||||||
DutchAuctionContract,
|
|
||||||
ERC20ProxyContract,
|
|
||||||
ERC721ProxyContract,
|
|
||||||
ExchangeContract,
|
ExchangeContract,
|
||||||
ForwarderContract,
|
ForwarderContract,
|
||||||
OrderValidatorContract,
|
OrderValidatorContract,
|
||||||
@ -13,9 +10,7 @@ import {
|
|||||||
Coordinator,
|
Coordinator,
|
||||||
DevUtils,
|
DevUtils,
|
||||||
DutchAuction,
|
DutchAuction,
|
||||||
ERC20Proxy,
|
|
||||||
ERC20Token,
|
ERC20Token,
|
||||||
ERC721Proxy,
|
|
||||||
ERC721Token,
|
ERC721Token,
|
||||||
Exchange,
|
Exchange,
|
||||||
Forwarder,
|
Forwarder,
|
||||||
@ -45,16 +40,6 @@ export class ContractWrappers {
|
|||||||
* An instance of the ExchangeContract class containing methods for interacting with the 0x Exchange smart contract.
|
* An instance of the ExchangeContract class containing methods for interacting with the 0x Exchange smart contract.
|
||||||
*/
|
*/
|
||||||
public exchange: ExchangeContract;
|
public exchange: ExchangeContract;
|
||||||
/**
|
|
||||||
* An instance of the ERC20ProxyContract class containing methods for interacting with the
|
|
||||||
* erc20Proxy smart contract.
|
|
||||||
*/
|
|
||||||
public erc20Proxy: ERC20ProxyContract;
|
|
||||||
/**
|
|
||||||
* An instance of the ERC721ProxyContract class containing methods for interacting with the
|
|
||||||
* erc721Proxy smart contract.
|
|
||||||
*/
|
|
||||||
public erc721Proxy: ERC721ProxyContract;
|
|
||||||
/**
|
/**
|
||||||
* An instance of the WETH9Contract class containing methods for interacting with the
|
* An instance of the WETH9Contract class containing methods for interacting with the
|
||||||
* WETH9 smart contract.
|
* WETH9 smart contract.
|
||||||
@ -64,14 +49,11 @@ export class ContractWrappers {
|
|||||||
* An instance of the ForwarderContract class containing methods for interacting with any Forwarder smart contract.
|
* An instance of the ForwarderContract class containing methods for interacting with any Forwarder smart contract.
|
||||||
*/
|
*/
|
||||||
public forwarder: ForwarderContract;
|
public forwarder: ForwarderContract;
|
||||||
|
// TODO(fabio): Remove orderValidator after @0x/asset-buyer is deleted
|
||||||
/**
|
/**
|
||||||
* An instance of the OrderValidatorContract class containing methods for interacting with any OrderValidator smart contract.
|
* An instance of the OrderValidatorContract class containing methods for interacting with any OrderValidator smart contract.
|
||||||
*/
|
*/
|
||||||
public orderValidator: OrderValidatorContract;
|
public orderValidator: OrderValidatorContract;
|
||||||
/**
|
|
||||||
* An instance of the DutchAuctionContract class containing methods for interacting with any DutchAuction smart contract.
|
|
||||||
*/
|
|
||||||
public dutchAuction: DutchAuctionContract;
|
|
||||||
/**
|
/**
|
||||||
* An instance of the DevUtilsContract class containing methods for interacting with the DevUtils smart contract.
|
* An instance of the DevUtilsContract class containing methods for interacting with the DevUtils smart contract.
|
||||||
*/
|
*/
|
||||||
@ -99,9 +81,7 @@ export class ContractWrappers {
|
|||||||
Coordinator,
|
Coordinator,
|
||||||
DevUtils,
|
DevUtils,
|
||||||
DutchAuction,
|
DutchAuction,
|
||||||
ERC20Proxy,
|
|
||||||
ERC20Token,
|
ERC20Token,
|
||||||
ERC721Proxy,
|
|
||||||
ERC721Token,
|
ERC721Token,
|
||||||
Exchange,
|
Exchange,
|
||||||
Forwarder,
|
Forwarder,
|
||||||
@ -115,13 +95,10 @@ export class ContractWrappers {
|
|||||||
config.contractAddresses === undefined
|
config.contractAddresses === undefined
|
||||||
? _getDefaultContractAddresses(config.chainId)
|
? _getDefaultContractAddresses(config.chainId)
|
||||||
: config.contractAddresses;
|
: config.contractAddresses;
|
||||||
this.erc20Proxy = new ERC20ProxyContract(contractAddresses.erc20Proxy, this.getProvider());
|
|
||||||
this.erc721Proxy = new ERC721ProxyContract(contractAddresses.erc721Proxy, this.getProvider());
|
|
||||||
this.weth9 = new WETH9Contract(contractAddresses.etherToken, this.getProvider());
|
this.weth9 = new WETH9Contract(contractAddresses.etherToken, this.getProvider());
|
||||||
this.exchange = new ExchangeContract(contractAddresses.exchange, this.getProvider());
|
this.exchange = new ExchangeContract(contractAddresses.exchange, this.getProvider());
|
||||||
this.forwarder = new ForwarderContract(contractAddresses.forwarder, this.getProvider());
|
this.forwarder = new ForwarderContract(contractAddresses.forwarder, this.getProvider());
|
||||||
this.orderValidator = new OrderValidatorContract(contractAddresses.orderValidator, this.getProvider());
|
this.orderValidator = new OrderValidatorContract(contractAddresses.orderValidator, this.getProvider());
|
||||||
this.dutchAuction = new DutchAuctionContract(contractAddresses.dutchAuction, this.getProvider());
|
|
||||||
this.devUtils = new DevUtilsContract(contractAddresses.devUtils, this.getProvider());
|
this.devUtils = new DevUtilsContract(contractAddresses.devUtils, this.getProvider());
|
||||||
this.coordinator = new CoordinatorWrapper(
|
this.coordinator = new CoordinatorWrapper(
|
||||||
this.getProvider(),
|
this.getProvider(),
|
||||||
@ -137,8 +114,6 @@ export class ContractWrappers {
|
|||||||
*/
|
*/
|
||||||
public unsubscribeAll(): void {
|
public unsubscribeAll(): void {
|
||||||
this.exchange.unsubscribeAll();
|
this.exchange.unsubscribeAll();
|
||||||
this.erc20Proxy.unsubscribeAll();
|
|
||||||
this.erc721Proxy.unsubscribeAll();
|
|
||||||
this.weth9.unsubscribeAll();
|
this.weth9.unsubscribeAll();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -14,7 +14,6 @@ export {
|
|||||||
ExchangeContract,
|
ExchangeContract,
|
||||||
DevUtilsContract,
|
DevUtilsContract,
|
||||||
ForwarderContract,
|
ForwarderContract,
|
||||||
DutchAuctionContract,
|
|
||||||
CoordinatorContract,
|
CoordinatorContract,
|
||||||
CoordinatorRegistryEventArgs,
|
CoordinatorRegistryEventArgs,
|
||||||
CoordinatorRegistryEvents,
|
CoordinatorRegistryEvents,
|
||||||
@ -40,11 +39,6 @@ export {
|
|||||||
ERC721TokenApprovalEventArgs,
|
ERC721TokenApprovalEventArgs,
|
||||||
ERC721TokenApprovalForAllEventArgs,
|
ERC721TokenApprovalForAllEventArgs,
|
||||||
ERC721TokenContract,
|
ERC721TokenContract,
|
||||||
ERC1155ProxyEventArgs,
|
|
||||||
ERC1155ProxyEvents,
|
|
||||||
ERC1155ProxyAuthorizedAddressAddedEventArgs,
|
|
||||||
ERC1155ProxyAuthorizedAddressRemovedEventArgs,
|
|
||||||
ERC1155ProxyContract,
|
|
||||||
ZRXTokenEventArgs,
|
ZRXTokenEventArgs,
|
||||||
ZRXTokenEvents,
|
ZRXTokenEvents,
|
||||||
ZRXTokenTransferEventArgs,
|
ZRXTokenTransferEventArgs,
|
||||||
@ -61,16 +55,6 @@ export {
|
|||||||
DummyERC721TokenApprovalEventArgs,
|
DummyERC721TokenApprovalEventArgs,
|
||||||
DummyERC721TokenApprovalForAllEventArgs,
|
DummyERC721TokenApprovalForAllEventArgs,
|
||||||
DummyERC721TokenContract,
|
DummyERC721TokenContract,
|
||||||
ERC20ProxyEventArgs,
|
|
||||||
ERC20ProxyEvents,
|
|
||||||
ERC20ProxyContract,
|
|
||||||
ERC20ProxyAuthorizedAddressAddedEventArgs,
|
|
||||||
ERC20ProxyAuthorizedAddressRemovedEventArgs,
|
|
||||||
ERC721ProxyEventArgs,
|
|
||||||
ERC721ProxyEvents,
|
|
||||||
ERC721ProxyAuthorizedAddressAddedEventArgs,
|
|
||||||
ERC721ProxyAuthorizedAddressRemovedEventArgs,
|
|
||||||
ERC721ProxyContract,
|
|
||||||
OrderValidatorContract,
|
OrderValidatorContract,
|
||||||
ExchangeProtocolFeeCollectorAddressEventArgs,
|
ExchangeProtocolFeeCollectorAddressEventArgs,
|
||||||
ExchangeProtocolFeeMultiplierEventArgs,
|
ExchangeProtocolFeeMultiplierEventArgs,
|
||||||
|
@ -59,14 +59,18 @@
|
|||||||
"@0x/base-contract": "^5.5.0-beta.1",
|
"@0x/base-contract": "^5.5.0-beta.1",
|
||||||
"@0x/contract-addresses": "^3.3.0-beta.2",
|
"@0x/contract-addresses": "^3.3.0-beta.2",
|
||||||
"@0x/contract-artifacts": "^2.3.0-beta.2",
|
"@0x/contract-artifacts": "^2.3.0-beta.2",
|
||||||
"@0x/contracts-asset-proxy": "^2.3.0-beta.1",
|
"@0x/contracts-asset-proxy": "2.3.0-beta.1",
|
||||||
"@0x/contracts-coordinator": "^2.1.0-beta.1",
|
"@0x/contracts-exchange-forwarder": "3.1.0-beta.1",
|
||||||
"@0x/contracts-dev-utils": "^0.1.0-beta.1",
|
"@0x/contracts-dev-utils": "0.1.0-beta.1",
|
||||||
"@0x/contracts-exchange": "^2.2.0-beta.1",
|
"@0x/contracts-coordinator": "2.1.0-beta.1",
|
||||||
"@0x/contracts-exchange-forwarder": "^3.1.0-beta.1",
|
|
||||||
"@0x/contracts-multisig": "^3.2.0-beta.1",
|
"@0x/contracts-multisig": "^3.2.0-beta.1",
|
||||||
"@0x/contracts-staking": "^1.1.0-beta.1",
|
"@0x/contracts-staking": "^1.1.0-beta.1",
|
||||||
|
"@0x/contracts-exchange": "^2.2.0-beta.1",
|
||||||
|
"@0x/contracts-extensions": "^4.1.0-beta.1",
|
||||||
"@0x/contracts-utils": "^3.3.0-beta.1",
|
"@0x/contracts-utils": "^3.3.0-beta.1",
|
||||||
|
"@0x/contracts-erc20": "^2.3.0-beta.1",
|
||||||
|
"@0x/contracts-erc721": "^2.2.0-beta.1",
|
||||||
|
"@0x/contracts-erc1155": "^1.2.0-beta.1",
|
||||||
"@0x/sol-compiler": "^3.2.0-beta.1",
|
"@0x/sol-compiler": "^3.2.0-beta.1",
|
||||||
"@0x/subproviders": "^5.1.0-beta.1",
|
"@0x/subproviders": "^5.1.0-beta.1",
|
||||||
"@0x/typescript-typings": "^4.4.0-beta.1",
|
"@0x/typescript-typings": "^4.4.0-beta.1",
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
import * as wrappers from '@0x/abi-gen-wrappers';
|
|
||||||
import { ContractAddresses } from '@0x/contract-addresses';
|
import { ContractAddresses } from '@0x/contract-addresses';
|
||||||
import * as artifacts from '@0x/contract-artifacts';
|
import * as artifacts from '@0x/contract-artifacts';
|
||||||
|
import { ERC1155ProxyContract, ERC20ProxyContract, ERC721ProxyContract, MultiAssetProxyContract, StaticCallProxyContract } from '@0x/contracts-asset-proxy';
|
||||||
|
import { CoordinatorContract, CoordinatorRegistryContract } from '@0x/contracts-coordinator';
|
||||||
|
import { DevUtilsContract, OrderValidationUtilsContract } from '@0x/contracts-dev-utils';
|
||||||
|
import { ERC1155MintableContract } from '@0x/contracts-erc1155';
|
||||||
|
import { DummyERC20TokenContract, WETH9Contract, ZRXTokenContract } from '@0x/contracts-erc20';
|
||||||
|
import { DummyERC721TokenContract } from '@0x/contracts-erc721';
|
||||||
|
import { ExchangeContract } from '@0x/contracts-exchange';
|
||||||
|
import { ForwarderContract } from '@0x/contracts-exchange-forwarder';
|
||||||
import { Web3ProviderEngine } from '@0x/subproviders';
|
import { Web3ProviderEngine } from '@0x/subproviders';
|
||||||
import { AbiEncoder, BigNumber, providerUtils } from '@0x/utils';
|
import { AbiEncoder, BigNumber, providerUtils } from '@0x/utils';
|
||||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||||
@ -55,13 +62,13 @@ export async function runMigrationsAsync(
|
|||||||
const chainId = new BigNumber(await providerUtils.getChainIdAsync(provider));
|
const chainId = new BigNumber(await providerUtils.getChainIdAsync(provider));
|
||||||
|
|
||||||
// Proxies
|
// Proxies
|
||||||
const erc20Proxy = await wrappers.ERC20ProxyContract.deployFrom0xArtifactAsync(
|
const erc20Proxy = await ERC20ProxyContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.ERC20Proxy,
|
artifacts.ERC20Proxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
artifacts,
|
artifacts,
|
||||||
);
|
);
|
||||||
const erc721Proxy = await wrappers.ERC721ProxyContract.deployFrom0xArtifactAsync(
|
const erc721Proxy = await ERC721ProxyContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.ERC721Proxy,
|
artifacts.ERC721Proxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
@ -69,7 +76,7 @@ export async function runMigrationsAsync(
|
|||||||
);
|
);
|
||||||
|
|
||||||
// ZRX
|
// ZRX
|
||||||
const zrxToken = await wrappers.ZRXTokenContract.deployFrom0xArtifactAsync(
|
const zrxToken = await ZRXTokenContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.ZRXToken,
|
artifacts.ZRXToken,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
@ -77,7 +84,7 @@ export async function runMigrationsAsync(
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Ether token
|
// Ether token
|
||||||
const etherToken = await wrappers.WETH9Contract.deployFrom0xArtifactAsync(
|
const etherToken = await WETH9Contract.deployFrom0xArtifactAsync(
|
||||||
artifacts.WETH9,
|
artifacts.WETH9,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
@ -86,7 +93,7 @@ export async function runMigrationsAsync(
|
|||||||
|
|
||||||
// Exchange
|
// Exchange
|
||||||
const zrxAssetData = encodeERC20AssetData(zrxToken.address);
|
const zrxAssetData = encodeERC20AssetData(zrxToken.address);
|
||||||
const exchange = await wrappers.ExchangeContract.deployFrom0xArtifactAsync(
|
const exchange = await ExchangeContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.Exchange,
|
artifacts.Exchange,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
@ -98,7 +105,7 @@ export async function runMigrationsAsync(
|
|||||||
for (const token of erc20TokenInfo) {
|
for (const token of erc20TokenInfo) {
|
||||||
const totalSupply = new BigNumber(1000000000000000000000000000);
|
const totalSupply = new BigNumber(1000000000000000000000000000);
|
||||||
// tslint:disable-next-line:no-unused-variable
|
// tslint:disable-next-line:no-unused-variable
|
||||||
const dummyErc20Token = await wrappers.DummyERC20TokenContract.deployFrom0xArtifactAsync(
|
const dummyErc20Token = await DummyERC20TokenContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.DummyERC20Token,
|
artifacts.DummyERC20Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
@ -112,7 +119,7 @@ export async function runMigrationsAsync(
|
|||||||
|
|
||||||
// ERC721
|
// ERC721
|
||||||
// tslint:disable-next-line:no-unused-variable
|
// tslint:disable-next-line:no-unused-variable
|
||||||
const cryptoKittieToken = await wrappers.DummyERC721TokenContract.deployFrom0xArtifactAsync(
|
const cryptoKittieToken = await DummyERC721TokenContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.DummyERC721Token,
|
artifacts.DummyERC721Token,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
@ -122,21 +129,21 @@ export async function runMigrationsAsync(
|
|||||||
);
|
);
|
||||||
|
|
||||||
// 1155 Asset Proxy
|
// 1155 Asset Proxy
|
||||||
const erc1155Proxy = await wrappers.ERC1155ProxyContract.deployFrom0xArtifactAsync(
|
const erc1155Proxy = await ERC1155ProxyContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.ERC1155Proxy,
|
artifacts.ERC1155Proxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
artifacts,
|
artifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
const staticCallProxy = await wrappers.StaticCallProxyContract.deployFrom0xArtifactAsync(
|
const staticCallProxy = await StaticCallProxyContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.StaticCallProxy,
|
artifacts.StaticCallProxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
artifacts,
|
artifacts,
|
||||||
);
|
);
|
||||||
|
|
||||||
const multiAssetProxy = await wrappers.MultiAssetProxyContract.deployFrom0xArtifactAsync(
|
const multiAssetProxy = await MultiAssetProxyContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.MultiAssetProxy,
|
artifacts.MultiAssetProxy,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
@ -165,7 +172,7 @@ export async function runMigrationsAsync(
|
|||||||
await exchange.registerAssetProxy.awaitTransactionSuccessAsync(staticCallProxy.address, txDefaults);
|
await exchange.registerAssetProxy.awaitTransactionSuccessAsync(staticCallProxy.address, txDefaults);
|
||||||
|
|
||||||
// Forwarder
|
// Forwarder
|
||||||
const forwarder = await wrappers.ForwarderContract.deployFrom0xArtifactAsync(
|
const forwarder = await ForwarderContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.Forwarder,
|
artifacts.Forwarder,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
@ -175,23 +182,24 @@ export async function runMigrationsAsync(
|
|||||||
);
|
);
|
||||||
|
|
||||||
// OrderValidator
|
// OrderValidator
|
||||||
const orderValidator = await wrappers.OrderValidatorContract.deployFrom0xArtifactAsync(
|
const orderValidator = await OrderValidationUtilsContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.OrderValidator,
|
artifacts.OrderValidator,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
artifacts,
|
artifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
zrxAssetData,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// DutchAuction
|
// TODO(fabio): Uncomment dutchAuction once the @0x/contracts-extensions is refactored
|
||||||
const dutchAuction = await wrappers.DutchAuctionContract.deployFrom0xArtifactAsync(
|
// for V3
|
||||||
artifacts.DutchAuction,
|
// // DutchAuction
|
||||||
provider,
|
// const dutchAuction = await DutchAuctionContract.deployFrom0xArtifactAsync(
|
||||||
txDefaults,
|
// artifacts.DutchAuction,
|
||||||
artifacts,
|
// provider,
|
||||||
exchange.address,
|
// txDefaults,
|
||||||
);
|
// artifacts,
|
||||||
|
// exchange.address,
|
||||||
|
// );
|
||||||
|
|
||||||
// TODO (xianny): figure out how to deploy AssetProxyOwnerContract properly
|
// TODO (xianny): figure out how to deploy AssetProxyOwnerContract properly
|
||||||
// // Multisigs
|
// // Multisigs
|
||||||
@ -202,7 +210,7 @@ export async function runMigrationsAsync(
|
|||||||
|
|
||||||
// // AssetProxyOwner
|
// // AssetProxyOwner
|
||||||
|
|
||||||
// const assetProxyOwner = await wrappers.AssetProxyOwnerContract.deployFrom0xArtifactAsync(
|
// const assetProxyOwner = await AssetProxyOwnerContract.deployFrom0xArtifactAsync(
|
||||||
// artifacts.AssetProxyOwner,
|
// artifacts.AssetProxyOwner,
|
||||||
// provider,
|
// provider,
|
||||||
// txDefaults,
|
// txDefaults,
|
||||||
@ -242,7 +250,7 @@ export async function runMigrationsAsync(
|
|||||||
await zrxToken.transfer.awaitTransactionSuccessAsync(forwarder.address, zrxForwarderAmount, txDefaults);
|
await zrxToken.transfer.awaitTransactionSuccessAsync(forwarder.address, zrxForwarderAmount, txDefaults);
|
||||||
|
|
||||||
// CoordinatorRegistry
|
// CoordinatorRegistry
|
||||||
const coordinatorRegistry = await wrappers.CoordinatorRegistryContract.deployFrom0xArtifactAsync(
|
const coordinatorRegistry = await CoordinatorRegistryContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.CoordinatorRegistry,
|
artifacts.CoordinatorRegistry,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
@ -250,16 +258,17 @@ export async function runMigrationsAsync(
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Coordinator
|
// Coordinator
|
||||||
const coordinator = await wrappers.CoordinatorContract.deployFrom0xArtifactAsync(
|
const coordinator = await CoordinatorContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.Coordinator,
|
artifacts.Coordinator,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
artifacts,
|
artifacts,
|
||||||
exchange.address,
|
exchange.address,
|
||||||
|
chainId,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Dev Utils
|
// Dev Utils
|
||||||
const devUtils = await wrappers.DevUtilsContract.deployFrom0xArtifactAsync(
|
const devUtils = await DevUtilsContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.DevUtils,
|
artifacts.DevUtils,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
@ -268,7 +277,7 @@ export async function runMigrationsAsync(
|
|||||||
);
|
);
|
||||||
|
|
||||||
// tslint:disable-next-line:no-unused-variable
|
// tslint:disable-next-line:no-unused-variable
|
||||||
const erc1155DummyToken = await wrappers.ERC1155MintableContract.deployFrom0xArtifactAsync(
|
const erc1155DummyToken = await ERC1155MintableContract.deployFrom0xArtifactAsync(
|
||||||
artifacts.ERC1155Mintable,
|
artifacts.ERC1155Mintable,
|
||||||
provider,
|
provider,
|
||||||
txDefaults,
|
txDefaults,
|
||||||
@ -288,7 +297,7 @@ export async function runMigrationsAsync(
|
|||||||
zeroExGovernor: constants.NULL_ADDRESS,
|
zeroExGovernor: constants.NULL_ADDRESS,
|
||||||
forwarder: forwarder.address,
|
forwarder: forwarder.address,
|
||||||
orderValidator: orderValidator.address,
|
orderValidator: orderValidator.address,
|
||||||
dutchAuction: dutchAuction.address,
|
dutchAuction: constants.NULL_ADDRESS,
|
||||||
coordinatorRegistry: coordinatorRegistry.address,
|
coordinatorRegistry: coordinatorRegistry.address,
|
||||||
coordinator: coordinator.address,
|
coordinator: coordinator.address,
|
||||||
multiAssetProxy: multiAssetProxy.address,
|
multiAssetProxy: multiAssetProxy.address,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
import * as wrappers from '@0x/abi-gen-wrappers';
|
|
||||||
import { getContractAddressesForChainOrThrow } from '@0x/contract-addresses';
|
import { getContractAddressesForChainOrThrow } from '@0x/contract-addresses';
|
||||||
|
import { ERC1155ProxyContract, ERC20ProxyContract, ERC721ProxyContract, MultiAssetProxyContract, StaticCallProxyContract } from '@0x/contracts-asset-proxy';
|
||||||
import { ExchangeContract } from '@0x/contracts-exchange';
|
import { ExchangeContract } from '@0x/contracts-exchange';
|
||||||
import { ZeroExGovernorContract } from '@0x/contracts-multisig';
|
import { ZeroExGovernorContract } from '@0x/contracts-multisig';
|
||||||
import { StakingContract, StakingProxyContract, ZrxVaultContract } from '@0x/contracts-staking';
|
import { StakingContract, StakingProxyContract, ZrxVaultContract } from '@0x/contracts-staking';
|
||||||
@ -34,11 +34,11 @@ async function testContractConfigsAsync(provider: SupportedProvider): Promise<vo
|
|||||||
|
|
||||||
const exchange = new ExchangeContract(addresses.exchange, provider);
|
const exchange = new ExchangeContract(addresses.exchange, provider);
|
||||||
const exchangeV2 = new ExchangeContract(addresses.exchangeV2, provider);
|
const exchangeV2 = new ExchangeContract(addresses.exchangeV2, provider);
|
||||||
const erc20Proxy = new wrappers.ERC20ProxyContract(addresses.erc20Proxy, provider);
|
const erc20Proxy = new ERC20ProxyContract(addresses.erc20Proxy, provider);
|
||||||
const erc721Proxy = new wrappers.ERC721ProxyContract(addresses.erc721Proxy, provider);
|
const erc721Proxy = new ERC721ProxyContract(addresses.erc721Proxy, provider);
|
||||||
const erc1155Proxy = new wrappers.ERC1155ProxyContract(addresses.erc1155Proxy, provider);
|
const erc1155Proxy = new ERC1155ProxyContract(addresses.erc1155Proxy, provider);
|
||||||
const multiAssetProxy = new wrappers.MultiAssetProxyContract(addresses.multiAssetProxy, provider);
|
const multiAssetProxy = new MultiAssetProxyContract(addresses.multiAssetProxy, provider);
|
||||||
const erc20BridgeProxy = new wrappers.ERC20ProxyContract(addresses.erc20BridgeProxy, provider);
|
const erc20BridgeProxy = new ERC20ProxyContract(addresses.erc20BridgeProxy, provider);
|
||||||
const governor = new ZeroExGovernorContract(addresses.zeroExGovernor, provider);
|
const governor = new ZeroExGovernorContract(addresses.zeroExGovernor, provider);
|
||||||
const stakingProxy = new StakingProxyContract(addresses.stakingProxy, provider);
|
const stakingProxy = new StakingProxyContract(addresses.stakingProxy, provider);
|
||||||
const stakingContract = new StakingContract(addresses.stakingProxy, provider);
|
const stakingContract = new StakingContract(addresses.stakingProxy, provider);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user