Update contract wrappers (esp Forwarder + asset-swapper) (#2432)
* `@0x/contract-artifacts`: Update artifacts. * `@0x/contract-wrappers`: Regenerate wrappers. * `@0x/migrations`: Update Forwarder migration. * `@0x/asset-swapper`: Update forwarder fees for new forwarder contract. * `@0x/dev-utils`: Make `"istanbul"` the default `hardfork` when creating a ganache provider. * `@0x/asset-swapper`: Remove debug code. * `@0x/asset-swapper`: Remove `getSmartContractParamsOrThrowAsync()` because why does it even exist? `@0x/asset-swapper`: Fix broken tests. `@0x/asset-swapper`: Correctly handle affiliate fees in `getCalldataOrThrow()`. * `@0x/contract-wrappers`: Export `ExchangeOwnershipTransferredEventArgs`. `@0x/0x.js`: Export `ExchangeOwnershipTransferredEventArgs`. `@0x/asset-swapper`: Unexport `MethodAbi`, `ConstructorStateMutability`, and `StateMutability`. * Update changelogs * Update packages/migrations/CHANGELOG.json Co-Authored-By: Jacob Evans <jacob@dekz.net> * Update packages/asset-swapper/CHANGELOG.json Co-Authored-By: Jacob Evans <jacob@dekz.net> Co-authored-by: Lawrence Forman <me@merklejerk.com> Co-authored-by: Jacob Evans <dekz@dekz.net>
This commit is contained in:
parent
726ea5e01e
commit
71731d223b
@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"version": "9.0.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Update exports.",
|
||||
"pr": 2432
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1578272714,
|
||||
"version": "9.0.3",
|
||||
|
@ -30,6 +30,7 @@ export {
|
||||
ERC721TokenApprovalEventArgs,
|
||||
ERC721TokenApprovalForAllEventArgs,
|
||||
ERC721TokenContract,
|
||||
ExchangeOwnershipTransferredEventArgs,
|
||||
ExchangeProtocolFeeCollectorAddressEventArgs,
|
||||
ExchangeProtocolFeeMultiplierEventArgs,
|
||||
ExchangeTransactionExecutionEventArgs,
|
||||
|
@ -1,4 +1,17 @@
|
||||
[
|
||||
{
|
||||
"version": "4.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Upgrade to new `Forwarder` contract with flat affiliate fees.",
|
||||
"pr": 2432
|
||||
},
|
||||
{
|
||||
"note": "Remove `getSmartContractParamsOrThrow()` from `SwapQuoteConsumer`s.",
|
||||
"pr": 2432
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.0.3",
|
||||
"changes": [
|
||||
|
@ -73,7 +73,6 @@ export const constants = {
|
||||
DEFAULT_ORDER_PRUNER_OPTS,
|
||||
ETHER_TOKEN_DECIMALS: 18,
|
||||
ONE_AMOUNT: new BigNumber(1),
|
||||
MAX_AFFILIATE_FEE_PERCENTAGE: 0.05,
|
||||
ONE_SECOND_MS,
|
||||
DEFAULT_SWAP_QUOTER_OPTS,
|
||||
DEFAULT_FORWARDER_SWAP_QUOTE_GET_OPTS,
|
||||
|
@ -14,7 +14,6 @@ export {
|
||||
export { APIOrder, Asset, AssetPairsItem, Order, SignedOrder } from '@0x/types';
|
||||
export { BigNumber } from '@0x/utils';
|
||||
export {
|
||||
ConstructorStateMutability,
|
||||
DataItem,
|
||||
EIP1193Event,
|
||||
EIP1193Provider,
|
||||
@ -24,8 +23,6 @@ export {
|
||||
JSONRPCRequestPayload,
|
||||
JSONRPCResponseError,
|
||||
JSONRPCResponsePayload,
|
||||
MethodAbi,
|
||||
StateMutability,
|
||||
SupportedProvider,
|
||||
TupleDataItem,
|
||||
Web3JsProvider,
|
||||
@ -45,7 +42,6 @@ export {
|
||||
LiquidityForTakerMakerAssetDataPair,
|
||||
MarketBuySwapQuote,
|
||||
MarketSellSwapQuote,
|
||||
SmartContractParamsInfo,
|
||||
SwapQuote,
|
||||
SwapQuoteConsumerBase,
|
||||
SwapQuoteConsumerOpts,
|
||||
|
@ -1,16 +1,13 @@
|
||||
import { ContractAddresses } from '@0x/contract-addresses';
|
||||
import { ExchangeContract } from '@0x/contract-wrappers';
|
||||
import { AbiEncoder, providerUtils } from '@0x/utils';
|
||||
import { providerUtils } from '@0x/utils';
|
||||
import { SupportedProvider, ZeroExProvider } from '@0x/web3-wrapper';
|
||||
import { MethodAbi } from 'ethereum-types';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { constants } from '../constants';
|
||||
import {
|
||||
CalldataInfo,
|
||||
ExchangeSmartContractParams,
|
||||
MarketOperation,
|
||||
SmartContractParamsInfo,
|
||||
SwapQuote,
|
||||
SwapQuoteConsumerBase,
|
||||
SwapQuoteConsumerOpts,
|
||||
@ -19,9 +16,8 @@ import {
|
||||
} from '../types';
|
||||
import { assert } from '../utils/assert';
|
||||
import { swapQuoteConsumerUtils } from '../utils/swap_quote_consumer_utils';
|
||||
import { utils } from '../utils/utils';
|
||||
|
||||
export class ExchangeSwapQuoteConsumer implements SwapQuoteConsumerBase<ExchangeSmartContractParams> {
|
||||
export class ExchangeSwapQuoteConsumer implements SwapQuoteConsumerBase {
|
||||
public readonly provider: ZeroExProvider;
|
||||
public readonly chainId: number;
|
||||
|
||||
@ -42,76 +38,27 @@ export class ExchangeSwapQuoteConsumer implements SwapQuoteConsumerBase<Exchange
|
||||
|
||||
public async getCalldataOrThrowAsync(
|
||||
quote: SwapQuote,
|
||||
opts: Partial<SwapQuoteGetOutputOpts>,
|
||||
_opts: Partial<SwapQuoteGetOutputOpts> = {},
|
||||
): Promise<CalldataInfo> {
|
||||
assert.isValidSwapQuote('quote', quote);
|
||||
|
||||
const { toAddress, methodAbi, ethAmount, params } = await this.getSmartContractParamsOrThrowAsync(quote, opts);
|
||||
|
||||
const abiEncoder = new AbiEncoder.Method(methodAbi);
|
||||
|
||||
const { orders, signatures } = params;
|
||||
let args: any[];
|
||||
if (params.type === MarketOperation.Buy) {
|
||||
const { makerAssetFillAmount } = params;
|
||||
args = [orders, makerAssetFillAmount, signatures];
|
||||
} else {
|
||||
const { takerAssetFillAmount } = params;
|
||||
args = [orders, takerAssetFillAmount, signatures];
|
||||
}
|
||||
const calldataHexString = abiEncoder.encode(args, { shouldOptimize: true });
|
||||
return {
|
||||
calldataHexString,
|
||||
methodAbi,
|
||||
toAddress,
|
||||
ethAmount,
|
||||
};
|
||||
}
|
||||
|
||||
public async getSmartContractParamsOrThrowAsync(
|
||||
quote: SwapQuote,
|
||||
_opts: Partial<SwapQuoteGetOutputOpts> = {},
|
||||
): Promise<SmartContractParamsInfo<ExchangeSmartContractParams>> {
|
||||
assert.isValidSwapQuote('quote', quote);
|
||||
|
||||
const { orders } = quote;
|
||||
|
||||
const signatures = _.map(orders, o => o.signature);
|
||||
|
||||
let params: ExchangeSmartContractParams;
|
||||
let methodName: string;
|
||||
|
||||
let calldataHexString;
|
||||
if (quote.type === MarketOperation.Buy) {
|
||||
const { makerAssetFillAmount } = quote;
|
||||
|
||||
params = {
|
||||
orders,
|
||||
signatures,
|
||||
makerAssetFillAmount,
|
||||
type: MarketOperation.Buy,
|
||||
};
|
||||
|
||||
methodName = 'marketBuyOrdersFillOrKill';
|
||||
calldataHexString = this._exchangeContract
|
||||
.marketBuyOrdersFillOrKill(orders, quote.makerAssetFillAmount, signatures)
|
||||
.getABIEncodedTransactionData();
|
||||
} else {
|
||||
const { takerAssetFillAmount } = quote;
|
||||
|
||||
params = {
|
||||
orders,
|
||||
signatures,
|
||||
takerAssetFillAmount,
|
||||
type: MarketOperation.Sell,
|
||||
};
|
||||
|
||||
methodName = 'marketSellOrdersFillOrKill';
|
||||
calldataHexString = this._exchangeContract
|
||||
.marketSellOrdersNoThrow(orders, quote.takerAssetFillAmount, signatures)
|
||||
.getABIEncodedTransactionData();
|
||||
}
|
||||
|
||||
const methodAbi = utils.getMethodAbiFromContractAbi(this._exchangeContract.abi, methodName) as MethodAbi;
|
||||
|
||||
return {
|
||||
params,
|
||||
toAddress: this._exchangeContract.address,
|
||||
methodAbi,
|
||||
calldataHexString,
|
||||
ethAmount: quote.worstCaseQuoteInfo.protocolFeeInWeiAmount,
|
||||
toAddress: this._exchangeContract.address,
|
||||
};
|
||||
}
|
||||
|
||||
@ -133,6 +80,7 @@ export class ExchangeSwapQuoteConsumer implements SwapQuoteConsumerBase<Exchange
|
||||
assert.isBigNumber('ethAmount', ethAmount);
|
||||
}
|
||||
const { orders, gasPrice } = quote;
|
||||
const signatures = orders.map(o => o.signature);
|
||||
|
||||
const finalTakerAddress = await swapQuoteConsumerUtils.getTakerAddressOrThrowAsync(this.provider, opts);
|
||||
const value = ethAmount || quote.worstCaseQuoteInfo.protocolFeeInWeiAmount;
|
||||
@ -140,7 +88,7 @@ export class ExchangeSwapQuoteConsumer implements SwapQuoteConsumerBase<Exchange
|
||||
if (quote.type === MarketOperation.Buy) {
|
||||
const { makerAssetFillAmount } = quote;
|
||||
txHash = await this._exchangeContract
|
||||
.marketBuyOrdersFillOrKill(orders, makerAssetFillAmount, orders.map(o => o.signature))
|
||||
.marketBuyOrdersFillOrKill(orders, makerAssetFillAmount, signatures)
|
||||
.sendTransactionAsync({
|
||||
from: finalTakerAddress,
|
||||
gas: gasLimit,
|
||||
@ -150,7 +98,7 @@ export class ExchangeSwapQuoteConsumer implements SwapQuoteConsumerBase<Exchange
|
||||
} else {
|
||||
const { takerAssetFillAmount } = quote;
|
||||
txHash = await this._exchangeContract
|
||||
.marketSellOrdersFillOrKill(orders, takerAssetFillAmount, orders.map(o => o.signature))
|
||||
.marketSellOrdersFillOrKill(orders, takerAssetFillAmount, signatures)
|
||||
.sendTransactionAsync({
|
||||
from: finalTakerAddress,
|
||||
gas: gasLimit,
|
||||
|
@ -1,17 +1,14 @@
|
||||
import { ContractAddresses } from '@0x/contract-addresses';
|
||||
import { ForwarderContract } from '@0x/contract-wrappers';
|
||||
import { assetDataUtils } from '@0x/order-utils';
|
||||
import { AbiEncoder, providerUtils } from '@0x/utils';
|
||||
import { providerUtils } from '@0x/utils';
|
||||
import { SupportedProvider, ZeroExProvider } from '@0x/web3-wrapper';
|
||||
import { MethodAbi } from 'ethereum-types';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { constants } from '../constants';
|
||||
import {
|
||||
CalldataInfo,
|
||||
ForwarderSmartContractParams,
|
||||
MarketOperation,
|
||||
SmartContractParamsInfo,
|
||||
SwapQuote,
|
||||
SwapQuoteConsumerBase,
|
||||
SwapQuoteConsumerOpts,
|
||||
@ -21,9 +18,8 @@ import {
|
||||
import { affiliateFeeUtils } from '../utils/affiliate_fee_utils';
|
||||
import { assert } from '../utils/assert';
|
||||
import { swapQuoteConsumerUtils } from '../utils/swap_quote_consumer_utils';
|
||||
import { utils } from '../utils/utils';
|
||||
|
||||
export class ForwarderSwapQuoteConsumer implements SwapQuoteConsumerBase<ForwarderSmartContractParams> {
|
||||
export class ForwarderSwapQuoteConsumer implements SwapQuoteConsumerBase {
|
||||
public readonly provider: ZeroExProvider;
|
||||
public readonly chainId: number;
|
||||
|
||||
@ -54,91 +50,40 @@ export class ForwarderSwapQuoteConsumer implements SwapQuoteConsumerBase<Forward
|
||||
opts: Partial<SwapQuoteGetOutputOpts> = {},
|
||||
): Promise<CalldataInfo> {
|
||||
assert.isValidForwarderSwapQuote('quote', quote, this._getEtherTokenAssetDataOrThrow());
|
||||
|
||||
const { toAddress, methodAbi, ethAmount, params } = await this.getSmartContractParamsOrThrowAsync(quote, opts);
|
||||
|
||||
const abiEncoder = new AbiEncoder.Method(methodAbi);
|
||||
const { orders, signatures, feePercentage, feeRecipient } = params;
|
||||
|
||||
let args: any[];
|
||||
if (params.type === MarketOperation.Buy) {
|
||||
const { makerAssetFillAmount } = params;
|
||||
args = [orders, makerAssetFillAmount, signatures, feePercentage, feeRecipient];
|
||||
} else {
|
||||
args = [orders, signatures, feePercentage, feeRecipient];
|
||||
}
|
||||
const calldataHexString = abiEncoder.encode(args, { shouldOptimize: true });
|
||||
return {
|
||||
calldataHexString,
|
||||
methodAbi,
|
||||
toAddress,
|
||||
ethAmount,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a SwapQuote, returns 'SmartContractParamsInfo' for a forwarder extension call. See type definition of CalldataInfo for more information.
|
||||
* @param quote An object that conforms to SwapQuote. See type definition for more information.
|
||||
* @param opts Options for getting SmartContractParams. See type definition for more information.
|
||||
*/
|
||||
public async getSmartContractParamsOrThrowAsync(
|
||||
quote: SwapQuote,
|
||||
opts: Partial<SwapQuoteGetOutputOpts> = {},
|
||||
): Promise<SmartContractParamsInfo<ForwarderSmartContractParams>> {
|
||||
assert.isValidForwarderSwapQuote('quote', quote, this._getEtherTokenAssetDataOrThrow());
|
||||
|
||||
const { extensionContractOpts } = _.merge({}, constants.DEFAULT_FORWARDER_SWAP_QUOTE_GET_OPTS, opts);
|
||||
|
||||
const { extensionContractOpts } = { ...constants.DEFAULT_FORWARDER_SWAP_QUOTE_GET_OPTS, ...opts };
|
||||
assert.isValidForwarderExtensionContractOpts('extensionContractOpts', extensionContractOpts);
|
||||
|
||||
const { feeRecipient, feePercentage } = extensionContractOpts;
|
||||
|
||||
const { orders, worstCaseQuoteInfo } = quote;
|
||||
|
||||
// lowercase input addresses
|
||||
const normalizedFeeRecipientAddress = feeRecipient.toLowerCase();
|
||||
|
||||
const signatures = _.map(orders, o => o.signature);
|
||||
|
||||
const formattedFeePercentage = utils.numberPercentageToEtherTokenAmountPercentage(feePercentage);
|
||||
|
||||
let params: ForwarderSmartContractParams;
|
||||
let methodName: string;
|
||||
|
||||
if (quote.type === MarketOperation.Buy) {
|
||||
const { makerAssetFillAmount } = quote;
|
||||
|
||||
params = {
|
||||
orders,
|
||||
makerAssetFillAmount,
|
||||
signatures,
|
||||
feePercentage: formattedFeePercentage,
|
||||
feeRecipient: normalizedFeeRecipientAddress,
|
||||
type: MarketOperation.Buy,
|
||||
};
|
||||
|
||||
methodName = 'marketBuyOrdersWithEth';
|
||||
} else {
|
||||
params = {
|
||||
orders,
|
||||
signatures,
|
||||
feePercentage: formattedFeePercentage,
|
||||
feeRecipient: normalizedFeeRecipientAddress,
|
||||
type: MarketOperation.Sell,
|
||||
};
|
||||
methodName = 'marketSellOrdersWithEth';
|
||||
}
|
||||
const methodAbi = utils.getMethodAbiFromContractAbi(this._forwarder.abi, methodName) as MethodAbi;
|
||||
|
||||
const ethAmountWithFees = affiliateFeeUtils.getTotalEthAmountWithAffiliateFee(
|
||||
worstCaseQuoteInfo,
|
||||
feePercentage,
|
||||
);
|
||||
const feeAmount = affiliateFeeUtils.getFeeAmount(worstCaseQuoteInfo, feePercentage);
|
||||
|
||||
let calldataHexString;
|
||||
if (quote.type === MarketOperation.Buy) {
|
||||
calldataHexString = this._forwarder
|
||||
.marketBuyOrdersWithEth(
|
||||
orders,
|
||||
quote.makerAssetFillAmount,
|
||||
signatures,
|
||||
[feeAmount],
|
||||
[normalizedFeeRecipientAddress],
|
||||
)
|
||||
.getABIEncodedTransactionData();
|
||||
} else {
|
||||
calldataHexString = this._forwarder
|
||||
.marketSellOrdersWithEth(orders, signatures, [feeAmount], [normalizedFeeRecipientAddress])
|
||||
.getABIEncodedTransactionData();
|
||||
}
|
||||
|
||||
return {
|
||||
params,
|
||||
calldataHexString,
|
||||
toAddress: this._forwarder.address,
|
||||
ethAmount: ethAmountWithFees,
|
||||
methodAbi,
|
||||
};
|
||||
}
|
||||
|
||||
@ -153,11 +98,10 @@ export class ForwarderSwapQuoteConsumer implements SwapQuoteConsumerBase<Forward
|
||||
): Promise<string> {
|
||||
assert.isValidForwarderSwapQuote('quote', quote, this._getEtherTokenAssetDataOrThrow());
|
||||
|
||||
const { ethAmount: providedEthAmount, takerAddress, gasLimit, extensionContractOpts } = _.merge(
|
||||
{},
|
||||
constants.DEFAULT_FORWARDER_SWAP_QUOTE_EXECUTE_OPTS,
|
||||
opts,
|
||||
);
|
||||
const { ethAmount: providedEthAmount, takerAddress, gasLimit, extensionContractOpts } = {
|
||||
...constants.DEFAULT_FORWARDER_SWAP_QUOTE_EXECUTE_OPTS,
|
||||
...opts,
|
||||
};
|
||||
|
||||
assert.isValidForwarderExtensionContractOpts('extensionContractOpts', extensionContractOpts);
|
||||
|
||||
@ -172,42 +116,35 @@ export class ForwarderSwapQuoteConsumer implements SwapQuoteConsumerBase<Forward
|
||||
if (gasLimit !== undefined) {
|
||||
assert.isNumber('gasLimit', gasLimit);
|
||||
}
|
||||
const { orders, worstCaseQuoteInfo, gasPrice } = quote; // tslint:disable-line:no-unused-variable
|
||||
const { orders, gasPrice } = quote; // tslint:disable-line:no-unused-variable
|
||||
const signatures = orders.map(o => o.signature);
|
||||
|
||||
// get taker address
|
||||
const finalTakerAddress = await swapQuoteConsumerUtils.getTakerAddressOrThrowAsync(this.provider, opts);
|
||||
// if no ethAmount is provided, default to the worst totalTakerAssetAmount
|
||||
const ethAmountWithFees = affiliateFeeUtils.getTotalEthAmountWithAffiliateFee(
|
||||
worstCaseQuoteInfo,
|
||||
feePercentage,
|
||||
);
|
||||
// format fee percentage
|
||||
const formattedFeePercentage = utils.numberPercentageToEtherTokenAmountPercentage(feePercentage);
|
||||
const ethAmountWithFees =
|
||||
providedEthAmount ||
|
||||
affiliateFeeUtils.getTotalEthAmountWithAffiliateFee(quote.worstCaseQuoteInfo, feePercentage);
|
||||
const feeAmount = affiliateFeeUtils.getFeeAmount(quote.worstCaseQuoteInfo, feePercentage);
|
||||
let txHash: string;
|
||||
if (quote.type === MarketOperation.Buy) {
|
||||
const { makerAssetFillAmount } = quote;
|
||||
txHash = await this._forwarder
|
||||
.marketBuyOrdersWithEth(
|
||||
orders,
|
||||
makerAssetFillAmount,
|
||||
orders.map(o => o.signature),
|
||||
formattedFeePercentage,
|
||||
feeRecipient,
|
||||
)
|
||||
.marketBuyOrdersWithEth(orders, makerAssetFillAmount, signatures, [feeAmount], [feeRecipient])
|
||||
.sendTransactionAsync({
|
||||
from: finalTakerAddress,
|
||||
gas: gasLimit,
|
||||
gasPrice,
|
||||
value: providedEthAmount || ethAmountWithFees,
|
||||
value: ethAmountWithFees,
|
||||
});
|
||||
} else {
|
||||
txHash = await this._forwarder
|
||||
.marketSellOrdersWithEth(orders, orders.map(o => o.signature), formattedFeePercentage, feeRecipient)
|
||||
.marketSellOrdersWithEth(orders, signatures, [feeAmount], [feeRecipient])
|
||||
.sendTransactionAsync({
|
||||
from: finalTakerAddress,
|
||||
gas: gasLimit,
|
||||
gasPrice,
|
||||
value: providedEthAmount || ethAmountWithFees,
|
||||
value: ethAmountWithFees,
|
||||
});
|
||||
}
|
||||
// TODO(dorothy-zbornak): Handle signature request denied
|
||||
|
@ -8,8 +8,6 @@ import {
|
||||
CalldataInfo,
|
||||
ExtensionContractType,
|
||||
GetExtensionContractTypeOpts,
|
||||
SmartContractParams,
|
||||
SmartContractParamsInfo,
|
||||
SwapQuote,
|
||||
SwapQuoteConsumerBase,
|
||||
SwapQuoteConsumerOpts,
|
||||
@ -22,7 +20,7 @@ import { swapQuoteConsumerUtils } from '../utils/swap_quote_consumer_utils';
|
||||
import { ExchangeSwapQuoteConsumer } from './exchange_swap_quote_consumer';
|
||||
import { ForwarderSwapQuoteConsumer } from './forwarder_swap_quote_consumer';
|
||||
|
||||
export class SwapQuoteConsumer implements SwapQuoteConsumerBase<SmartContractParams> {
|
||||
export class SwapQuoteConsumer implements SwapQuoteConsumerBase {
|
||||
public readonly provider: ZeroExProvider;
|
||||
public readonly chainId: number;
|
||||
|
||||
@ -63,20 +61,6 @@ export class SwapQuoteConsumer implements SwapQuoteConsumerBase<SmartContractPar
|
||||
return consumer.getCalldataOrThrowAsync(quote, opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a SwapQuote, returns 'SmartContractParamsInfo' for a 0x extension or exchange call. See type definition of SmartContractParamsInfo for more information.
|
||||
* @param quote An object that conforms to SwapQuote. See type definition for more information.
|
||||
* @param opts Options for getting SmartContractParams. See type definition for more information.
|
||||
*/
|
||||
public async getSmartContractParamsOrThrowAsync(
|
||||
quote: SwapQuote,
|
||||
opts: Partial<SwapQuoteGetOutputOpts> = {},
|
||||
): Promise<SmartContractParamsInfo<SmartContractParams>> {
|
||||
assert.isValidSwapQuote('quote', quote);
|
||||
const consumer = await this._getConsumerForSwapQuoteAsync(opts);
|
||||
return consumer.getSmartContractParamsOrThrowAsync(quote, opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a SwapQuote and desired rate (in takerAsset), attempt to execute the swap with 0x extension or exchange contract.
|
||||
* @param quote An object that conforms to SwapQuote. See type definition for more information.
|
||||
@ -108,9 +92,7 @@ export class SwapQuoteConsumer implements SwapQuoteConsumerBase<SmartContractPar
|
||||
);
|
||||
}
|
||||
|
||||
private async _getConsumerForSwapQuoteAsync(
|
||||
opts: Partial<SwapQuoteGetOutputOpts>,
|
||||
): Promise<SwapQuoteConsumerBase<SmartContractParams>> {
|
||||
private async _getConsumerForSwapQuoteAsync(opts: Partial<SwapQuoteGetOutputOpts>): Promise<SwapQuoteConsumerBase> {
|
||||
if (opts.useExtensionContract === ExtensionContractType.Forwarder) {
|
||||
return this._forwarderConsumer;
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { SignedOrder } from '@0x/types';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import { MethodAbi } from 'ethereum-types';
|
||||
|
||||
import { GetMarketOrdersOpts } from './utils/market_operation_utils/types';
|
||||
|
||||
@ -47,58 +46,15 @@ export interface SignedOrderWithFillableAmounts extends SignedOrder {
|
||||
/**
|
||||
* Represents the metadata to call a smart contract with calldata.
|
||||
* calldataHexString: The hexstring of the calldata.
|
||||
* methodAbi: The ABI of the smart contract method to call.
|
||||
* toAddress: The contract address to call.
|
||||
* ethAmount: The eth amount in wei to send with the smart contract call.
|
||||
*/
|
||||
export interface CalldataInfo {
|
||||
calldataHexString: string;
|
||||
methodAbi: MethodAbi;
|
||||
toAddress: string;
|
||||
ethAmount: BigNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the metadata to call a smart contract with parameters.
|
||||
* params: The metadata object containing all the input parameters of a smart contract call.
|
||||
* toAddress: The contract address to call.
|
||||
* ethAmount: If provided, the eth amount in wei to send with the smart contract call.
|
||||
* methodAbi: The ABI of the smart contract method to call with params.
|
||||
*/
|
||||
export interface SmartContractParamsInfo<T> {
|
||||
params: T;
|
||||
toAddress: string;
|
||||
ethAmount: BigNumber;
|
||||
methodAbi: MethodAbi;
|
||||
}
|
||||
|
||||
/**
|
||||
* orders: An array of objects conforming to SignedOrder. These orders can be used to cover the requested assetBuyAmount plus slippage.
|
||||
* signatures: An array of signatures that attest that the maker of the orders in fact made the orders.
|
||||
*/
|
||||
export interface SmartContractParamsBase {
|
||||
orders: SignedOrder[];
|
||||
signatures: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* makerAssetFillAmount: The amount of makerAsset to swap for.
|
||||
* type: String specifiying which market operation will be performed with the provided parameters. (In this case a market buy operation)
|
||||
*/
|
||||
export interface ExchangeMarketBuySmartContractParams extends SmartContractParamsBase {
|
||||
makerAssetFillAmount: BigNumber;
|
||||
type: MarketOperation.Buy;
|
||||
}
|
||||
|
||||
/**
|
||||
* takerAssetFillAmount: The amount of takerAsset swapped for makerAsset.
|
||||
* type: String specifiying which market operation will be performed with the provided parameters. (In this case a market sell operation)
|
||||
*/
|
||||
export interface ExchangeMarketSellSmartContractParams extends SmartContractParamsBase {
|
||||
takerAssetFillAmount: BigNumber;
|
||||
type: MarketOperation.Sell;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the varying smart contracts that can consume a valid swap quote
|
||||
*/
|
||||
@ -107,11 +63,6 @@ export enum ExtensionContractType {
|
||||
None = 'NONE',
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents all the parameters to interface with 0x exchange contracts' marketSell and marketBuy functions.
|
||||
*/
|
||||
export type ExchangeSmartContractParams = ExchangeMarketBuySmartContractParams | ExchangeMarketSellSmartContractParams;
|
||||
|
||||
/**
|
||||
* feePercentage: Optional affiliate fee percentage used to calculate the eth amount paid to fee recipient.
|
||||
* feeRecipient: The address where affiliate fees are sent. Defaults to null address (0x000...000).
|
||||
@ -121,41 +72,13 @@ export interface ForwarderSmartContractParamsBase {
|
||||
feeRecipient: string;
|
||||
}
|
||||
|
||||
export interface ForwarderMarketBuySmartContractParams
|
||||
extends ExchangeMarketBuySmartContractParams,
|
||||
ForwarderSmartContractParamsBase {}
|
||||
|
||||
// Temporary fix until typescript is upgraded to ^3.5
|
||||
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
||||
|
||||
export interface ForwarderMarketSellSmartContractParams
|
||||
extends Omit<ExchangeMarketSellSmartContractParams, 'takerAssetFillAmount'>,
|
||||
ForwarderSmartContractParamsBase {}
|
||||
|
||||
/**
|
||||
* Represents all the parameters to interface with 0x forwarder extension contract marketSell and marketBuy functions.
|
||||
*/
|
||||
export type ForwarderSmartContractParams =
|
||||
| ForwarderMarketBuySmartContractParams
|
||||
| ForwarderMarketSellSmartContractParams;
|
||||
|
||||
/**
|
||||
* Object containing all the parameters to interface with 0x exchange contracts' marketSell and marketBuy functions.
|
||||
*/
|
||||
export type SmartContractParams = ForwarderSmartContractParams | ExchangeSmartContractParams;
|
||||
|
||||
/**
|
||||
* Interface that varying SwapQuoteConsumers adhere to (exchange consumer, router consumer, forwarder consumer, coordinator consumer)
|
||||
* getCalldataOrThrow: Get CalldataInfo to swap for tokens with provided SwapQuote. Throws if invalid SwapQuote is provided.
|
||||
* getSmartContractParamsOrThrow: Get SmartContractParamsInfo to swap for tokens with provided SwapQuote. Throws if invalid SwapQuote is provided.
|
||||
* executeSwapQuoteOrThrowAsync: Executes a web3 transaction to swap for tokens with provided SwapQuote. Throws if invalid SwapQuote is provided.
|
||||
*/
|
||||
export interface SwapQuoteConsumerBase<T> {
|
||||
export interface SwapQuoteConsumerBase {
|
||||
getCalldataOrThrowAsync(quote: SwapQuote, opts: Partial<SwapQuoteGetOutputOpts>): Promise<CalldataInfo>;
|
||||
getSmartContractParamsOrThrowAsync(
|
||||
quote: SwapQuote,
|
||||
opts: Partial<SwapQuoteGetOutputOpts>,
|
||||
): Promise<SmartContractParamsInfo<T>>;
|
||||
executeSwapQuoteOrThrowAsync(quote: SwapQuote, opts: Partial<SwapQuoteExecutionOpts>): Promise<string>;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { BigNumber } from '@0x/utils';
|
||||
|
||||
import { constants } from '../constants';
|
||||
import { SwapQuoteInfo } from '../types';
|
||||
|
||||
import { assert } from './assert';
|
||||
@ -9,17 +8,22 @@ export const affiliateFeeUtils = {
|
||||
/**
|
||||
* Get the amount of eth to send for a forwarder contract call (includes takerAssetAmount, protocol fees, and specified affiliate fee amount)
|
||||
* @param swapQuoteInfo SwapQuoteInfo to generate total eth amount from
|
||||
* @param feePercentage Percentage of additive fees to apply to totalTakerAssetAmount + protocol fee. (max 5%)
|
||||
* @param feePercentage Percentage of additive fees to apply to totalTakerAssetAmount + protocol fee.
|
||||
*/
|
||||
getTotalEthAmountWithAffiliateFee(swapQuoteInfo: SwapQuoteInfo, feePercentage: number): BigNumber {
|
||||
assert.assert(
|
||||
feePercentage >= 0 && feePercentage <= constants.MAX_AFFILIATE_FEE_PERCENTAGE,
|
||||
'feePercentage must be between range 0-0.05 (inclusive)',
|
||||
);
|
||||
const ethAmount = swapQuoteInfo.protocolFeeInWeiAmount.plus(swapQuoteInfo.totalTakerAssetAmount);
|
||||
// HACK(dekz): This is actually in WEI amount not ETH
|
||||
const affiliateFeeAmount = ethAmount.multipliedBy(feePercentage).toFixed(0, BigNumber.ROUND_UP);
|
||||
const ethAmountWithFees = ethAmount.plus(affiliateFeeAmount);
|
||||
const ethAmountWithFees = ethAmount.plus(affiliateFeeUtils.getFeeAmount(swapQuoteInfo, feePercentage));
|
||||
return ethAmountWithFees;
|
||||
},
|
||||
/**
|
||||
* Get the affiliate fee owed to the forwarder fee recipient.
|
||||
* @param swapQuoteInfo SwapQuoteInfo to generate total eth amount from
|
||||
* @param feePercentage Percentage of additive fees to apply to totalTakerAssetAmount + protocol fee.
|
||||
*/
|
||||
getFeeAmount(swapQuoteInfo: SwapQuoteInfo, feePercentage: number): BigNumber {
|
||||
assert.assert(feePercentage >= 0, 'feePercentage must be >= 0');
|
||||
const ethAmount = swapQuoteInfo.protocolFeeInWeiAmount.plus(swapQuoteInfo.totalTakerAssetAmount);
|
||||
// HACK(dekz): This is actually in WEI amount not ETH
|
||||
return ethAmount.times(feePercentage).integerValue(BigNumber.ROUND_UP);
|
||||
},
|
||||
};
|
||||
|
@ -2,8 +2,6 @@ import { assetDataUtils } from '@0x/order-utils';
|
||||
import { AssetData, ERC20AssetData, ERC20BridgeAssetData, Order } from '@0x/types';
|
||||
import { BigNumber, NULL_BYTES } from '@0x/utils';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import { AbiDefinition, ContractAbi, MethodAbi } from 'ethereum-types';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { constants } from '../constants';
|
||||
|
||||
@ -14,19 +12,6 @@ export const utils = {
|
||||
percentage,
|
||||
);
|
||||
},
|
||||
getMethodAbiFromContractAbi(abi: ContractAbi, name: string): MethodAbi | undefined {
|
||||
return _.find(
|
||||
abi,
|
||||
(def: AbiDefinition): boolean => {
|
||||
if (def.type === 'function') {
|
||||
const methodDef = def as MethodAbi;
|
||||
return methodDef.name === name;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
) as MethodAbi | undefined;
|
||||
},
|
||||
isOrderTakerFeePayableWithMakerAsset<T extends Order>(order: T): boolean {
|
||||
return !order.takerFee.isZero() && utils.isAssetDataEquivalent(order.takerFeeAssetData, order.makerAssetData);
|
||||
},
|
||||
|
@ -11,14 +11,7 @@ import 'mocha';
|
||||
import { SwapQuote } from '../src';
|
||||
import { constants } from '../src/constants';
|
||||
import { ExchangeSwapQuoteConsumer } from '../src/quote_consumers/exchange_swap_quote_consumer';
|
||||
import {
|
||||
ExchangeMarketBuySmartContractParams,
|
||||
ExchangeMarketSellSmartContractParams,
|
||||
MarketBuySwapQuote,
|
||||
MarketOperation,
|
||||
MarketSellSwapQuote,
|
||||
SignedOrderWithFillableAmounts,
|
||||
} from '../src/types';
|
||||
import { MarketOperation, SignedOrderWithFillableAmounts } from '../src/types';
|
||||
import { ProtocolFeeUtils } from '../src/utils/protocol_fee_utils';
|
||||
|
||||
import { chaiSetup } from './utils/chai_setup';
|
||||
@ -250,40 +243,6 @@ describe('ExchangeSwapQuoteConsumer', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getSmartContractParamsOrThrow', () => {
|
||||
describe('valid swap quote', async () => {
|
||||
// TODO(david) Check for valid MethodAbi
|
||||
it('provide correct and optimized smart contract params for a marketSell SwapQuote', async () => {
|
||||
const { toAddress, params } = await swapQuoteConsumer.getSmartContractParamsOrThrowAsync(
|
||||
marketSellSwapQuote,
|
||||
{},
|
||||
);
|
||||
expect(toAddress).to.deep.equal(exchangeContract.address);
|
||||
const { takerAssetFillAmount, signatures, type } = params as ExchangeMarketSellSmartContractParams;
|
||||
expect(type).to.deep.equal(MarketOperation.Sell);
|
||||
expect(takerAssetFillAmount).to.bignumber.equal(
|
||||
(marketSellSwapQuote as MarketSellSwapQuote).takerAssetFillAmount,
|
||||
);
|
||||
const orderSignatures = marketSellSwapQuote.orders.map(order => order.signature);
|
||||
expect(signatures).to.deep.equal(orderSignatures);
|
||||
});
|
||||
it('provide correct smart contract params for a marketBuy SwapQuote', async () => {
|
||||
const { toAddress, params } = await swapQuoteConsumer.getSmartContractParamsOrThrowAsync(
|
||||
marketBuySwapQuote,
|
||||
{},
|
||||
);
|
||||
expect(toAddress).to.deep.equal(exchangeContract.address);
|
||||
const { makerAssetFillAmount, signatures, type } = params as ExchangeMarketBuySmartContractParams;
|
||||
expect(type).to.deep.equal(MarketOperation.Buy);
|
||||
expect(makerAssetFillAmount).to.bignumber.equal(
|
||||
(marketBuySwapQuote as MarketBuySwapQuote).makerAssetFillAmount,
|
||||
);
|
||||
const orderSignatures = marketSellSwapQuote.orders.map(order => order.signature);
|
||||
expect(signatures).to.deep.equal(orderSignatures);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getCalldataOrThrow', () => {
|
||||
describe('valid swap quote', async () => {
|
||||
it('provide correct and optimized calldata options with default options for a marketSell SwapQuote (no affiliate fees)', async () => {
|
||||
|
@ -11,13 +11,7 @@ import 'mocha';
|
||||
import { SwapQuote } from '../src';
|
||||
import { constants } from '../src/constants';
|
||||
import { ForwarderSwapQuoteConsumer } from '../src/quote_consumers/forwarder_swap_quote_consumer';
|
||||
import {
|
||||
ForwarderMarketBuySmartContractParams,
|
||||
ForwarderMarketSellSmartContractParams,
|
||||
MarketBuySwapQuote,
|
||||
MarketOperation,
|
||||
SignedOrderWithFillableAmounts,
|
||||
} from '../src/types';
|
||||
import { MarketOperation, SignedOrderWithFillableAmounts } from '../src/types';
|
||||
import { ProtocolFeeUtils } from '../src/utils/protocol_fee_utils';
|
||||
|
||||
import { chaiSetup } from './utils/chai_setup';
|
||||
@ -317,111 +311,6 @@ describe('ForwarderSwapQuoteConsumer', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getSmartContractParamsOrThrow', () => {
|
||||
describe('validation', () => {
|
||||
it('should throw if swap quote provided is not a valid forwarder SwapQuote (taker asset is WETH)', async () => {
|
||||
expect(
|
||||
swapQuoteConsumer.getSmartContractParamsOrThrowAsync(invalidMarketBuySwapQuote, {}),
|
||||
).to.be.rejectedWith(
|
||||
`Expected quote.orders[0] to have takerAssetData set as ${wethAssetData}, but is ${takerAssetData}`,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('valid swap quote', async () => {
|
||||
it('provide correct and optimized smart contract params with default options for a marketSell SwapQuote (no affiliate fees)', async () => {
|
||||
const { toAddress, params } = await swapQuoteConsumer.getSmartContractParamsOrThrowAsync(
|
||||
marketSellSwapQuote,
|
||||
{},
|
||||
);
|
||||
expect(toAddress).to.deep.equal(forwarderContract.address);
|
||||
const {
|
||||
feePercentage,
|
||||
feeRecipient: feeRecipientFromParams,
|
||||
signatures,
|
||||
type,
|
||||
} = params as ForwarderMarketSellSmartContractParams;
|
||||
expect(type).to.deep.equal(MarketOperation.Sell);
|
||||
expect(feeRecipientFromParams).to.deep.equal(constants.NULL_ADDRESS);
|
||||
const orderSignatures = marketSellSwapQuote.orders.map(order => order.signature);
|
||||
expect(signatures).to.deep.equal(orderSignatures);
|
||||
expect(feePercentage).to.bignumber.equal(0);
|
||||
});
|
||||
it('provide correct and optimized smart contract params with default options for a marketBuy SwapQuote (no affiliate fees)', async () => {
|
||||
const { toAddress, params } = await swapQuoteConsumer.getSmartContractParamsOrThrowAsync(
|
||||
marketBuySwapQuote,
|
||||
{},
|
||||
);
|
||||
expect(toAddress).to.deep.equal(forwarderContract.address);
|
||||
const {
|
||||
makerAssetFillAmount,
|
||||
feePercentage,
|
||||
feeRecipient: feeRecipientFromParams,
|
||||
signatures,
|
||||
type,
|
||||
} = params as ForwarderMarketBuySmartContractParams;
|
||||
expect(type).to.deep.equal(MarketOperation.Buy);
|
||||
expect(feeRecipientFromParams).to.deep.equal(constants.NULL_ADDRESS);
|
||||
expect(makerAssetFillAmount).to.bignumber.equal(
|
||||
(marketBuySwapQuote as MarketBuySwapQuote).makerAssetFillAmount,
|
||||
);
|
||||
const orderSignatures = marketBuySwapQuote.orders.map(order => order.signature);
|
||||
expect(signatures).to.deep.equal(orderSignatures);
|
||||
expect(feePercentage).to.bignumber.equal(0);
|
||||
});
|
||||
it('provide correct and optimized smart contract params with affiliate fees for a marketSell SwapQuote', async () => {
|
||||
const { toAddress, params } = await swapQuoteConsumer.getSmartContractParamsOrThrowAsync(
|
||||
marketSellSwapQuote,
|
||||
{
|
||||
extensionContractOpts: {
|
||||
feePercentage: 0.05,
|
||||
feeRecipient,
|
||||
},
|
||||
},
|
||||
);
|
||||
expect(toAddress).to.deep.equal(forwarderContract.address);
|
||||
const {
|
||||
feePercentage,
|
||||
feeRecipient: feeRecipientFromParams,
|
||||
signatures,
|
||||
type,
|
||||
} = params as ForwarderMarketSellSmartContractParams;
|
||||
expect(type).to.deep.equal(MarketOperation.Sell);
|
||||
expect(feeRecipientFromParams).to.deep.equal(feeRecipient);
|
||||
const orderSignatures = marketSellSwapQuote.orders.map(order => order.signature);
|
||||
expect(signatures).to.deep.equal(orderSignatures);
|
||||
expect(feePercentage).to.bignumber.equal(new BigNumber(0.05).multipliedBy(ONE_ETH_IN_WEI));
|
||||
});
|
||||
it('provide correct and optimized smart contract params with affiliate fees for a marketBuy SwapQuote', async () => {
|
||||
const { toAddress, params } = await swapQuoteConsumer.getSmartContractParamsOrThrowAsync(
|
||||
marketBuySwapQuote,
|
||||
{
|
||||
extensionContractOpts: {
|
||||
feePercentage: 0.05,
|
||||
feeRecipient,
|
||||
},
|
||||
},
|
||||
);
|
||||
expect(toAddress).to.deep.equal(forwarderContract.address);
|
||||
const {
|
||||
makerAssetFillAmount,
|
||||
feePercentage,
|
||||
feeRecipient: feeRecipientFromParams,
|
||||
signatures,
|
||||
type,
|
||||
} = params as ForwarderMarketBuySmartContractParams;
|
||||
expect(type).to.deep.equal(MarketOperation.Buy);
|
||||
expect(feeRecipientFromParams).to.deep.equal(feeRecipient);
|
||||
expect(makerAssetFillAmount).to.bignumber.equal(
|
||||
(marketBuySwapQuote as MarketBuySwapQuote).makerAssetFillAmount,
|
||||
);
|
||||
const orderSignatures = marketBuySwapQuote.orders.map(order => order.signature);
|
||||
expect(signatures).to.deep.equal(orderSignatures);
|
||||
expect(feePercentage).to.bignumber.equal(new BigNumber(0.05).multipliedBy(ONE_ETH_IN_WEI));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getCalldataOrThrow', () => {
|
||||
describe('validation', () => {
|
||||
it('should throw if swap quote provided is not a valid forwarder SwapQuote (taker asset is WETH)', async () => {
|
||||
|
@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"version": "3.4.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Update all artifacts.",
|
||||
"pr": 2432
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.3.0",
|
||||
"changes": [
|
||||
|
File diff suppressed because one or more lines are too long
@ -47,16 +47,16 @@
|
||||
},
|
||||
"evm": {
|
||||
"bytecode": {
|
||||
"object": "0x608060405234801561001057600080fd5b506103e9806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80635b2388be1461003b5780636c90fedb146100ad575b600080fd5b6100ab6004803603602081101561005157600080fd5b81019060208101813564010000000081111561006c57600080fd5b82018360208201111561007e57600080fd5b803590602001918460018302840111640100000000831117156100a057600080fd5b509092509050610155565b005b6100e0600480360360208110156100c357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610227565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561011a578181015183820152602001610102565b50505050905090810190601f1680156101475780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b33600081815260208190526040902061016f9084846102fb565b507fd060052768902f3eecb84b8eae9d3a2608a1a9e60811a33968b46b8d552f266e818484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001806020018281038252848482818152602001925080828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201829003965090945050505050a1505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081815260409182902080548351601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001861615020190931692909204918201849004840281018401909452808452606093928301828280156102ef5780601f106102c4576101008083540402835291602001916102ef565b820191906000526020600020905b8154815290600101906020018083116102d257829003601f168201915b50505050509050919050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035a578280017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00823516178555610387565b82800160010185558215610387579182015b8281111561038757823582559160200191906001019061036c565b50610393929150610397565b5090565b6103b191905b80821115610393576000815560010161039d565b9056fea265627a7a723158201e5700868fc146b88ffb53f2aacd9f9684387be927a7cb4fdb2da136413c17f964736f6c634300050d0032"
|
||||
"object": "0x608060405234801561001057600080fd5b506103e9806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80635b2388be1461003b5780636c90fedb146100ad575b600080fd5b6100ab6004803603602081101561005157600080fd5b81019060208101813564010000000081111561006c57600080fd5b82018360208201111561007e57600080fd5b803590602001918460018302840111640100000000831117156100a057600080fd5b509092509050610155565b005b6100e0600480360360208110156100c357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610227565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561011a578181015183820152602001610102565b50505050905090810190601f1680156101475780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b33600081815260208190526040902061016f9084846102fb565b507fd060052768902f3eecb84b8eae9d3a2608a1a9e60811a33968b46b8d552f266e818484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001806020018281038252848482818152602001925080828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201829003965090945050505050a1505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081815260409182902080548351601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001861615020190931692909204918201849004840281018401909452808452606093928301828280156102ef5780601f106102c4576101008083540402835291602001916102ef565b820191906000526020600020905b8154815290600101906020018083116102d257829003601f168201915b50505050509050919050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035a578280017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00823516178555610387565b82800160010185558215610387579182015b8281111561038757823582559160200191906001019061036c565b50610393929150610397565b5090565b6103b191905b80821115610393576000815560010161039d565b9056fea265627a7a72315820e93b5d7674acdd9933b6d0a1751b8cbceb8b51d6f0182e77f449213a4d321fc264736f6c63430005100032"
|
||||
},
|
||||
"deployedBytecode": {
|
||||
"object": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80635b2388be1461003b5780636c90fedb146100ad575b600080fd5b6100ab6004803603602081101561005157600080fd5b81019060208101813564010000000081111561006c57600080fd5b82018360208201111561007e57600080fd5b803590602001918460018302840111640100000000831117156100a057600080fd5b509092509050610155565b005b6100e0600480360360208110156100c357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610227565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561011a578181015183820152602001610102565b50505050905090810190601f1680156101475780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b33600081815260208190526040902061016f9084846102fb565b507fd060052768902f3eecb84b8eae9d3a2608a1a9e60811a33968b46b8d552f266e818484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001806020018281038252848482818152602001925080828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201829003965090945050505050a1505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081815260409182902080548351601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001861615020190931692909204918201849004840281018401909452808452606093928301828280156102ef5780601f106102c4576101008083540402835291602001916102ef565b820191906000526020600020905b8154815290600101906020018083116102d257829003601f168201915b50505050509050919050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035a578280017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00823516178555610387565b82800160010185558215610387579182015b8281111561038757823582559160200191906001019061036c565b50610393929150610397565b5090565b6103b191905b80821115610393576000815560010161039d565b9056fea265627a7a723158201e5700868fc146b88ffb53f2aacd9f9684387be927a7cb4fdb2da136413c17f964736f6c634300050d0032"
|
||||
"object": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80635b2388be1461003b5780636c90fedb146100ad575b600080fd5b6100ab6004803603602081101561005157600080fd5b81019060208101813564010000000081111561006c57600080fd5b82018360208201111561007e57600080fd5b803590602001918460018302840111640100000000831117156100a057600080fd5b509092509050610155565b005b6100e0600480360360208110156100c357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610227565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561011a578181015183820152602001610102565b50505050905090810190601f1680156101475780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b33600081815260208190526040902061016f9084846102fb565b507fd060052768902f3eecb84b8eae9d3a2608a1a9e60811a33968b46b8d552f266e818484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001806020018281038252848482818152602001925080828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201829003965090945050505050a1505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081815260409182902080548351601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001861615020190931692909204918201849004840281018401909452808452606093928301828280156102ef5780601f106102c4576101008083540402835291602001916102ef565b820191906000526020600020905b8154815290600101906020018083116102d257829003601f168201915b50505050509050919050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061035a578280017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00823516178555610387565b82800160010185558215610387579182015b8281111561038757823582559160200191906001019061036c565b50610393929150610397565b5090565b6103b191905b80821115610393576000815560010161039d565b9056fea265627a7a72315820e93b5d7674acdd9933b6d0a1751b8cbceb8b51d6f0182e77f449213a4d321fc264736f6c63430005100032"
|
||||
}
|
||||
}
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "soljson-v0.5.13+commit.5b0b510c.js",
|
||||
"version": "soljson-v0.5.16+commit.9c3226ce.js",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": true,
|
||||
@ -75,7 +75,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"evmVersion": "constantinople"
|
||||
"evmVersion": "istanbul"
|
||||
}
|
||||
},
|
||||
"chains": {}
|
||||
|
12
packages/contract-artifacts/artifacts/DevUtils.json
generated
12
packages/contract-artifacts/artifacts/DevUtils.json
generated
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
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
135
packages/contract-artifacts/artifacts/ERC20Proxy.json
generated
135
packages/contract-artifacts/artifacts/ERC20Proxy.json
generated
File diff suppressed because one or more lines are too long
@ -3,6 +3,38 @@
|
||||
"contractName": "ERC20Token",
|
||||
"compilerOutput": {
|
||||
"abi": [
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{ "indexed": true, "internalType": "address", "name": "_owner", "type": "address" },
|
||||
{ "indexed": true, "internalType": "address", "name": "_spender", "type": "address" },
|
||||
{ "indexed": false, "internalType": "uint256", "name": "_value", "type": "uint256" }
|
||||
],
|
||||
"name": "Approval",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{ "indexed": true, "internalType": "address", "name": "_from", "type": "address" },
|
||||
{ "indexed": true, "internalType": "address", "name": "_to", "type": "address" },
|
||||
{ "indexed": false, "internalType": "uint256", "name": "_value", "type": "uint256" }
|
||||
],
|
||||
"name": "Transfer",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{ "internalType": "address", "name": "_owner", "type": "address" },
|
||||
{ "internalType": "address", "name": "_spender", "type": "address" }
|
||||
],
|
||||
"name": "allowance",
|
||||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
@ -17,30 +49,17 @@
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "totalSupply",
|
||||
"inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }],
|
||||
"name": "balanceOf",
|
||||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{ "internalType": "address", "name": "_from", "type": "address" },
|
||||
{ "internalType": "address", "name": "_to", "type": "address" },
|
||||
{ "internalType": "uint256", "name": "_value", "type": "uint256" }
|
||||
],
|
||||
"name": "transferFrom",
|
||||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }],
|
||||
"name": "balanceOf",
|
||||
"inputs": [],
|
||||
"name": "totalSupply",
|
||||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
@ -59,36 +78,17 @@
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{ "internalType": "address", "name": "_owner", "type": "address" },
|
||||
{ "internalType": "address", "name": "_spender", "type": "address" }
|
||||
{ "internalType": "address", "name": "_from", "type": "address" },
|
||||
{ "internalType": "address", "name": "_to", "type": "address" },
|
||||
{ "internalType": "uint256", "name": "_value", "type": "uint256" }
|
||||
],
|
||||
"name": "allowance",
|
||||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||
"name": "transferFrom",
|
||||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{ "indexed": true, "internalType": "address", "name": "_from", "type": "address" },
|
||||
{ "indexed": true, "internalType": "address", "name": "_to", "type": "address" },
|
||||
{ "indexed": false, "internalType": "uint256", "name": "_value", "type": "uint256" }
|
||||
],
|
||||
"name": "Transfer",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{ "indexed": true, "internalType": "address", "name": "_owner", "type": "address" },
|
||||
{ "indexed": true, "internalType": "address", "name": "_spender", "type": "address" },
|
||||
{ "indexed": false, "internalType": "uint256", "name": "_value", "type": "uint256" }
|
||||
],
|
||||
"name": "Approval",
|
||||
"type": "event"
|
||||
}
|
||||
],
|
||||
"devdoc": {
|
||||
@ -135,16 +135,16 @@
|
||||
},
|
||||
"evm": {
|
||||
"bytecode": {
|
||||
"object": "0x608060405234801561001057600080fd5b506106bf806100206000396000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c806370a082311161005057806370a0823114610121578063a9059cbb14610154578063dd62ed3e1461018d57610072565b8063095ea7b31461007757806318160ddd146100c457806323b872dd146100de575b600080fd5b6100b06004803603604081101561008d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356101c8565b604080519115158252519081900360200190f35b6100cc61023b565b60408051918252519081900360200190f35b6100b0600480360360608110156100f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610241565b6100cc6004803603602081101561013757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661049d565b6100b06004803603604081101561016a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356104c5565b6100cc600480360360408110156101a357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610652565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260408120548211156102d557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604080832033845290915290205482111561037457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f45524332305f494e53554646494349454e545f414c4c4f57414e434500000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902054828101101561040a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff80841660008181526020818152604080832080548801905593881680835284832080548890039055600182528483203384528252918490208054879003905583518681529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b3360009081526020819052604081205482111561054357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110156105d957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b336000818152602081815260408083208054879003905573ffffffffffffffffffffffffffffffffffffffff871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff91821660009081526001602090815260408083209390941682529190915220549056fea265627a7a723158205713efa92f66e67a8d01b80af8500df66bd6e9862dcf791e587181109d8ab0c464736f6c634300050b0032"
|
||||
"object": "0x608060405234801561001057600080fd5b506106bf806100206000396000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c806370a082311161005057806370a0823114610121578063a9059cbb14610154578063dd62ed3e1461018d57610072565b8063095ea7b31461007757806318160ddd146100c457806323b872dd146100de575b600080fd5b6100b06004803603604081101561008d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356101c8565b604080519115158252519081900360200190f35b6100cc61023b565b60408051918252519081900360200190f35b6100b0600480360360608110156100f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610241565b6100cc6004803603602081101561013757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661049d565b6100b06004803603604081101561016a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356104c5565b6100cc600480360360408110156101a357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610652565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260408120548211156102d557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604080832033845290915290205482111561037457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f45524332305f494e53554646494349454e545f414c4c4f57414e434500000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902054828101101561040a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff80841660008181526020818152604080832080548801905593881680835284832080548890039055600182528483203384528252918490208054879003905583518681529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b3360009081526020819052604081205482111561054357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110156105d957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b336000818152602081815260408083208054879003905573ffffffffffffffffffffffffffffffffffffffff871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff91821660009081526001602090815260408083209390941682529190915220549056fea265627a7a723158202ec4258d9cc44c3c6b86d5f8b40d57549ae0a8d26d000de443ed7eb3f5fd6cf064736f6c63430005100032"
|
||||
},
|
||||
"deployedBytecode": {
|
||||
"object": "0x608060405234801561001057600080fd5b50600436106100725760003560e01c806370a082311161005057806370a0823114610121578063a9059cbb14610154578063dd62ed3e1461018d57610072565b8063095ea7b31461007757806318160ddd146100c457806323b872dd146100de575b600080fd5b6100b06004803603604081101561008d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356101c8565b604080519115158252519081900360200190f35b6100cc61023b565b60408051918252519081900360200190f35b6100b0600480360360608110156100f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610241565b6100cc6004803603602081101561013757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661049d565b6100b06004803603604081101561016a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356104c5565b6100cc600480360360408110156101a357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610652565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260408120548211156102d557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604080832033845290915290205482111561037457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f45524332305f494e53554646494349454e545f414c4c4f57414e434500000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902054828101101561040a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff80841660008181526020818152604080832080548801905593881680835284832080548890039055600182528483203384528252918490208054879003905583518681529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b3360009081526020819052604081205482111561054357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110156105d957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b336000818152602081815260408083208054879003905573ffffffffffffffffffffffffffffffffffffffff871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff91821660009081526001602090815260408083209390941682529190915220549056fea265627a7a723158205713efa92f66e67a8d01b80af8500df66bd6e9862dcf791e587181109d8ab0c464736f6c634300050b0032"
|
||||
"object": "0x608060405234801561001057600080fd5b50600436106100725760003560e01c806370a082311161005057806370a0823114610121578063a9059cbb14610154578063dd62ed3e1461018d57610072565b8063095ea7b31461007757806318160ddd146100c457806323b872dd146100de575b600080fd5b6100b06004803603604081101561008d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356101c8565b604080519115158252519081900360200190f35b6100cc61023b565b60408051918252519081900360200190f35b6100b0600480360360608110156100f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610241565b6100cc6004803603602081101561013757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661049d565b6100b06004803603604081101561016a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356104c5565b6100cc600480360360408110156101a357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610652565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260408120548211156102d557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8416600090815260016020908152604080832033845290915290205482111561037457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f45524332305f494e53554646494349454e545f414c4c4f57414e434500000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8316600090815260208190526040902054828101101561040a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff80841660008181526020818152604080832080548801905593881680835284832080548890039055600182528483203384528252918490208054879003905583518681529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b3360009081526020819052604081205482111561054357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f45524332305f494e53554646494349454e545f42414c414e4345000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110156105d957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f55494e543235365f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b336000818152602081815260408083208054879003905573ffffffffffffffffffffffffffffffffffffffff871680845292819020805487019055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff91821660009081526001602090815260408083209390941682529190915220549056fea265627a7a723158202ec4258d9cc44c3c6b86d5f8b40d57549ae0a8d26d000de443ed7eb3f5fd6cf064736f6c63430005100032"
|
||||
}
|
||||
}
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "soljson-v0.5.11+commit.c082d0b4.js",
|
||||
"version": "soljson-v0.5.16+commit.9c3226ce.js",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": true,
|
||||
@ -164,8 +164,8 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"evmVersion": "constantinople"
|
||||
"evmVersion": "istanbul"
|
||||
}
|
||||
},
|
||||
"networks": {}
|
||||
"chains": {}
|
||||
}
|
||||
|
135
packages/contract-artifacts/artifacts/ERC721Proxy.json
generated
135
packages/contract-artifacts/artifacts/ERC721Proxy.json
generated
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
69
packages/contract-artifacts/artifacts/Exchange.json
generated
69
packages/contract-artifacts/artifacts/Exchange.json
generated
File diff suppressed because one or more lines are too long
52
packages/contract-artifacts/artifacts/Forwarder.json
generated
52
packages/contract-artifacts/artifacts/Forwarder.json
generated
File diff suppressed because one or more lines are too long
@ -3,6 +3,15 @@
|
||||
"contractName": "IAssetProxy",
|
||||
"compilerOutput": {
|
||||
"abi": [
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "getProxyId",
|
||||
"outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }],
|
||||
"payable": false,
|
||||
"stateMutability": "pure",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
@ -16,15 +25,6 @@
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "getProxyId",
|
||||
"outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }],
|
||||
"payable": false,
|
||||
"stateMutability": "pure",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"devdoc": {
|
||||
@ -48,7 +48,7 @@
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "soljson-v0.5.11+commit.c082d0b4.js",
|
||||
"version": "soljson-v0.5.16+commit.9c3226ce.js",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": true,
|
||||
@ -67,8 +67,8 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"evmVersion": "constantinople"
|
||||
"evmVersion": "istanbul"
|
||||
}
|
||||
},
|
||||
"networks": {}
|
||||
"chains": {}
|
||||
}
|
||||
|
@ -242,7 +242,7 @@
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "soljson-v0.5.13+commit.5b0b510c.js",
|
||||
"version": "soljson-v0.5.16+commit.9c3226ce.js",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": true,
|
||||
@ -261,7 +261,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"evmVersion": "constantinople"
|
||||
"evmVersion": "istanbul"
|
||||
}
|
||||
},
|
||||
"chains": {}
|
||||
|
@ -29,7 +29,7 @@
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "soljson-v0.5.11+commit.c082d0b4.js",
|
||||
"version": "soljson-v0.5.16+commit.9c3226ce.js",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": true,
|
||||
@ -48,8 +48,8 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"evmVersion": "constantinople"
|
||||
"evmVersion": "istanbul"
|
||||
}
|
||||
},
|
||||
"networks": {}
|
||||
"chains": {}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
33
packages/contract-artifacts/artifacts/Staking.json
generated
33
packages/contract-artifacts/artifacts/Staking.json
generated
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -3,6 +3,15 @@
|
||||
"contractName": "StaticCallProxy",
|
||||
"compilerOutput": {
|
||||
"abi": [
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "getProxyId",
|
||||
"outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }],
|
||||
"payable": false,
|
||||
"stateMutability": "pure",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
@ -16,15 +25,6 @@
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "getProxyId",
|
||||
"outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }],
|
||||
"payable": false,
|
||||
"stateMutability": "pure",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"devdoc": {
|
||||
@ -46,16 +46,16 @@
|
||||
},
|
||||
"evm": {
|
||||
"bytecode": {
|
||||
"object": "0x608060405234801561001057600080fd5b50610505806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063a85e59e41461003b578063ae25532e146100d3575b600080fd5b6100d16004803603608081101561005157600080fd5b81019060208101813564010000000081111561006c57600080fd5b82018360208201111561007e57600080fd5b803590602001918460018302840111640100000000831117156100a057600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610110565b005b6100db6103a5565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b6000606060006101656004898990508a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092949392505063ffffffff6103c5169050565b806020019051606081101561017957600080fd5b8151602083018051604051929492938301929190846401000000008211156101a057600080fd5b9083019060208201858111156101b557600080fd5b82516401000000008111828201881017156101cf57600080fd5b82525081516020918201929091019080838360005b838110156101fc5781810151838201526020016101e4565b50505050905090810190601f1680156102295780820380516001836020036101000a031916815260200191505b5060405260200180519060200190929190505050925092509250600060608473ffffffffffffffffffffffffffffffffffffffff16846040518082805190602001908083835b602083106102ac57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161026f565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d806000811461030c576040519150601f19603f3d011682016040523d82523d6000602084013e610311565b606091505b50915091508161032357805160208201fd5b8051602082012083811461039857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f554e45585045435445445f5354415449435f43414c4c5f524553554c54000000604482015290519081900360640190fd5b5050505050505050505050565b600060405180806104b06021913960210190506040518091039020905090565b6060818311156103e3576103e36103de60008585610408565b6104a7565b83518211156103fc576103fc6103de6001848751610408565b50819003910190815290565b6060632800659560e01b8484846040516024018084600781111561042857fe5b60ff1681526020018381526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090509392505050565b805160208201fdfe53746174696343616c6c28616464726573732c62797465732c6279746573333229a265627a7a72315820c55cf13cfcaaf322238d786911313ce7d45854692241ae9b56709bdbfed4f54c64736f6c634300050b0032"
|
||||
"object": "0x608060405234801561001057600080fd5b50610505806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063a85e59e41461003b578063ae25532e146100d3575b600080fd5b6100d16004803603608081101561005157600080fd5b81019060208101813564010000000081111561006c57600080fd5b82018360208201111561007e57600080fd5b803590602001918460018302840111640100000000831117156100a057600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610110565b005b6100db6103a5565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b6000606060006101656004898990508a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092949392505063ffffffff6103c5169050565b806020019051606081101561017957600080fd5b8151602083018051604051929492938301929190846401000000008211156101a057600080fd5b9083019060208201858111156101b557600080fd5b82516401000000008111828201881017156101cf57600080fd5b82525081516020918201929091019080838360005b838110156101fc5781810151838201526020016101e4565b50505050905090810190601f1680156102295780820380516001836020036101000a031916815260200191505b5060405260200180519060200190929190505050925092509250600060608473ffffffffffffffffffffffffffffffffffffffff16846040518082805190602001908083835b602083106102ac57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161026f565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d806000811461030c576040519150601f19603f3d011682016040523d82523d6000602084013e610311565b606091505b50915091508161032357805160208201fd5b8051602082012083811461039857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f554e45585045435445445f5354415449435f43414c4c5f524553554c54000000604482015290519081900360640190fd5b5050505050505050505050565b600060405180806104b06021913960210190506040518091039020905090565b6060818311156103e3576103e36103de60008585610408565b6104a7565b83518211156103fc576103fc6103de6001848751610408565b50819003910190815290565b6060632800659560e01b8484846040516024018084600781111561042857fe5b60ff1681526020018381526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090509392505050565b805160208201fdfe53746174696343616c6c28616464726573732c62797465732c6279746573333229a265627a7a72315820810f2cccbd051a63dec5e6c05ccc9a965c4ae8a93e1c2d15b511b833529dfa1064736f6c63430005100032"
|
||||
},
|
||||
"deployedBytecode": {
|
||||
"object": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063a85e59e41461003b578063ae25532e146100d3575b600080fd5b6100d16004803603608081101561005157600080fd5b81019060208101813564010000000081111561006c57600080fd5b82018360208201111561007e57600080fd5b803590602001918460018302840111640100000000831117156100a057600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610110565b005b6100db6103a5565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b6000606060006101656004898990508a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092949392505063ffffffff6103c5169050565b806020019051606081101561017957600080fd5b8151602083018051604051929492938301929190846401000000008211156101a057600080fd5b9083019060208201858111156101b557600080fd5b82516401000000008111828201881017156101cf57600080fd5b82525081516020918201929091019080838360005b838110156101fc5781810151838201526020016101e4565b50505050905090810190601f1680156102295780820380516001836020036101000a031916815260200191505b5060405260200180519060200190929190505050925092509250600060608473ffffffffffffffffffffffffffffffffffffffff16846040518082805190602001908083835b602083106102ac57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161026f565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d806000811461030c576040519150601f19603f3d011682016040523d82523d6000602084013e610311565b606091505b50915091508161032357805160208201fd5b8051602082012083811461039857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f554e45585045435445445f5354415449435f43414c4c5f524553554c54000000604482015290519081900360640190fd5b5050505050505050505050565b600060405180806104b06021913960210190506040518091039020905090565b6060818311156103e3576103e36103de60008585610408565b6104a7565b83518211156103fc576103fc6103de6001848751610408565b50819003910190815290565b6060632800659560e01b8484846040516024018084600781111561042857fe5b60ff1681526020018381526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090509392505050565b805160208201fdfe53746174696343616c6c28616464726573732c62797465732c6279746573333229a265627a7a72315820c55cf13cfcaaf322238d786911313ce7d45854692241ae9b56709bdbfed4f54c64736f6c634300050b0032"
|
||||
"object": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063a85e59e41461003b578063ae25532e146100d3575b600080fd5b6100d16004803603608081101561005157600080fd5b81019060208101813564010000000081111561006c57600080fd5b82018360208201111561007e57600080fd5b803590602001918460018302840111640100000000831117156100a057600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610110565b005b6100db6103a5565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b6000606060006101656004898990508a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092949392505063ffffffff6103c5169050565b806020019051606081101561017957600080fd5b8151602083018051604051929492938301929190846401000000008211156101a057600080fd5b9083019060208201858111156101b557600080fd5b82516401000000008111828201881017156101cf57600080fd5b82525081516020918201929091019080838360005b838110156101fc5781810151838201526020016101e4565b50505050905090810190601f1680156102295780820380516001836020036101000a031916815260200191505b5060405260200180519060200190929190505050925092509250600060608473ffffffffffffffffffffffffffffffffffffffff16846040518082805190602001908083835b602083106102ac57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161026f565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d806000811461030c576040519150601f19603f3d011682016040523d82523d6000602084013e610311565b606091505b50915091508161032357805160208201fd5b8051602082012083811461039857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f554e45585045435445445f5354415449435f43414c4c5f524553554c54000000604482015290519081900360640190fd5b5050505050505050505050565b600060405180806104b06021913960210190506040518091039020905090565b6060818311156103e3576103e36103de60008585610408565b6104a7565b83518211156103fc576103fc6103de6001848751610408565b50819003910190815290565b6060632800659560e01b8484846040516024018084600781111561042857fe5b60ff1681526020018381526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090509392505050565b805160208201fdfe53746174696343616c6c28616464726573732c62797465732c6279746573333229a265627a7a72315820810f2cccbd051a63dec5e6c05ccc9a965c4ae8a93e1c2d15b511b833529dfa1064736f6c63430005100032"
|
||||
}
|
||||
}
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "soljson-v0.5.11+commit.c082d0b4.js",
|
||||
"version": "soljson-v0.5.16+commit.9c3226ce.js",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": true,
|
||||
@ -74,8 +74,8 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"evmVersion": "constantinople"
|
||||
"evmVersion": "istanbul"
|
||||
}
|
||||
},
|
||||
"networks": {}
|
||||
"chains": {}
|
||||
}
|
||||
|
189
packages/contract-artifacts/artifacts/WETH9.json
generated
189
packages/contract-artifacts/artifacts/WETH9.json
generated
@ -4,28 +4,52 @@
|
||||
"compilerOutput": {
|
||||
"abi": [
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "name",
|
||||
"outputs": [{ "name": "", "type": "string" }],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{ "indexed": true, "internalType": "address", "name": "_owner", "type": "address" },
|
||||
{ "indexed": true, "internalType": "address", "name": "_spender", "type": "address" },
|
||||
{ "indexed": false, "internalType": "uint256", "name": "_value", "type": "uint256" }
|
||||
],
|
||||
"name": "Approval",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [{ "name": "guy", "type": "address" }, { "name": "wad", "type": "uint256" }],
|
||||
"name": "approve",
|
||||
"outputs": [{ "name": "", "type": "bool" }],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{ "indexed": true, "internalType": "address", "name": "_owner", "type": "address" },
|
||||
{ "indexed": false, "internalType": "uint256", "name": "_value", "type": "uint256" }
|
||||
],
|
||||
"name": "Deposit",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{ "indexed": true, "internalType": "address", "name": "_from", "type": "address" },
|
||||
{ "indexed": true, "internalType": "address", "name": "_to", "type": "address" },
|
||||
{ "indexed": false, "internalType": "uint256", "name": "_value", "type": "uint256" }
|
||||
],
|
||||
"name": "Transfer",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{ "indexed": true, "internalType": "address", "name": "_owner", "type": "address" },
|
||||
{ "indexed": false, "internalType": "uint256", "name": "_value", "type": "uint256" }
|
||||
],
|
||||
"name": "Withdrawal",
|
||||
"type": "event"
|
||||
},
|
||||
{ "payable": true, "stateMutability": "payable", "type": "fallback" },
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "totalSupply",
|
||||
"outputs": [{ "name": "", "type": "uint256" }],
|
||||
"inputs": [
|
||||
{ "internalType": "address", "name": "", "type": "address" },
|
||||
{ "internalType": "address", "name": "", "type": "address" }
|
||||
],
|
||||
"name": "allowance",
|
||||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
@ -33,61 +57,33 @@
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{ "name": "src", "type": "address" },
|
||||
{ "name": "dst", "type": "address" },
|
||||
{ "name": "wad", "type": "uint256" }
|
||||
{ "internalType": "address", "name": "guy", "type": "address" },
|
||||
{ "internalType": "uint256", "name": "wad", "type": "uint256" }
|
||||
],
|
||||
"name": "transferFrom",
|
||||
"outputs": [{ "name": "", "type": "bool" }],
|
||||
"name": "approve",
|
||||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [{ "name": "wad", "type": "uint256" }],
|
||||
"name": "withdraw",
|
||||
"outputs": [],
|
||||
"constant": true,
|
||||
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
||||
"name": "balanceOf",
|
||||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "decimals",
|
||||
"outputs": [{ "name": "", "type": "uint8" }],
|
||||
"outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [{ "name": "", "type": "address" }],
|
||||
"name": "balanceOf",
|
||||
"outputs": [{ "name": "", "type": "uint256" }],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "symbol",
|
||||
"outputs": [{ "name": "", "type": "string" }],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [{ "name": "dst", "type": "address" }, { "name": "wad", "type": "uint256" }],
|
||||
"name": "transfer",
|
||||
"outputs": [{ "name": "", "type": "bool" }],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
@ -99,66 +95,79 @@
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [{ "name": "", "type": "address" }, { "name": "", "type": "address" }],
|
||||
"name": "allowance",
|
||||
"outputs": [{ "name": "", "type": "uint256" }],
|
||||
"inputs": [],
|
||||
"name": "name",
|
||||
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{ "payable": true, "stateMutability": "payable", "type": "fallback" },
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{ "indexed": true, "name": "_owner", "type": "address" },
|
||||
{ "indexed": true, "name": "_spender", "type": "address" },
|
||||
{ "indexed": false, "name": "_value", "type": "uint256" }
|
||||
],
|
||||
"name": "Approval",
|
||||
"type": "event"
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "symbol",
|
||||
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{ "indexed": true, "name": "_from", "type": "address" },
|
||||
{ "indexed": true, "name": "_to", "type": "address" },
|
||||
{ "indexed": false, "name": "_value", "type": "uint256" }
|
||||
],
|
||||
"name": "Transfer",
|
||||
"type": "event"
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "totalSupply",
|
||||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{ "indexed": true, "name": "_owner", "type": "address" },
|
||||
{ "indexed": false, "name": "_value", "type": "uint256" }
|
||||
{ "internalType": "address", "name": "dst", "type": "address" },
|
||||
{ "internalType": "uint256", "name": "wad", "type": "uint256" }
|
||||
],
|
||||
"name": "Deposit",
|
||||
"type": "event"
|
||||
"name": "transfer",
|
||||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{ "indexed": true, "name": "_owner", "type": "address" },
|
||||
{ "indexed": false, "name": "_value", "type": "uint256" }
|
||||
{ "internalType": "address", "name": "src", "type": "address" },
|
||||
{ "internalType": "address", "name": "dst", "type": "address" },
|
||||
{ "internalType": "uint256", "name": "wad", "type": "uint256" }
|
||||
],
|
||||
"name": "Withdrawal",
|
||||
"type": "event"
|
||||
"name": "transferFrom",
|
||||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [{ "internalType": "uint256", "name": "wad", "type": "uint256" }],
|
||||
"name": "withdraw",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"devdoc": { "methods": {} },
|
||||
"evm": {
|
||||
"bytecode": {
|
||||
"object": "0x60c0604052600d60808190527f577261707065642045746865720000000000000000000000000000000000000060a090815261003e91600091906100a3565b506040805180820190915260048082527f57455448000000000000000000000000000000000000000000000000000000006020909201918252610083916001916100a3565b506002805460ff1916601217905534801561009d57600080fd5b5061013e565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100e457805160ff1916838001178555610111565b82800160010185558215610111579182015b828111156101115782518255916020019190600101906100f6565b5061011d929150610121565b5090565b61013b91905b8082111561011d5760008155600101610127565b90565b61074c8061014d6000396000f3006080604052600436106100925760003560e01c63ffffffff16806306fdde031461009c578063095ea7b31461012657806318160ddd1461016b57806323b872dd146101925780632e1a7d4d146101c9578063313ce567146101e157806370a082311461020c57806395d89b411461023a578063a9059cbb1461024f578063d0e30db014610092578063dd62ed3e14610280575b61009a6102b4565b005b3480156100a857600080fd5b506100b1610303565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100eb5781810151838201526020016100d3565b50505050905090810190601f1680156101185780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561013257600080fd5b5061015773ffffffffffffffffffffffffffffffffffffffff600435166024356103af565b604080519115158252519081900360200190f35b34801561017757600080fd5b50610180610422565b60408051918252519081900360200190f35b34801561019e57600080fd5b5061015773ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610427565b3480156101d557600080fd5b5061009a6004356105c7565b3480156101ed57600080fd5b506101f661065c565b6040805160ff9092168252519081900360200190f35b34801561021857600080fd5b5061018073ffffffffffffffffffffffffffffffffffffffff60043516610665565b34801561024657600080fd5b506100b1610677565b34801561025b57600080fd5b5061015773ffffffffffffffffffffffffffffffffffffffff600435166024356106ef565b34801561028c57600080fd5b5061018073ffffffffffffffffffffffffffffffffffffffff60043581169060243516610703565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156103a75780601f1061037c576101008083540402835291602001916103a7565b820191906000526020600020905b81548152906001019060200180831161038a57829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b303190565b73ffffffffffffffffffffffffffffffffffffffff831660009081526003602052604081205482111561045957600080fd5b73ffffffffffffffffffffffffffffffffffffffff841633148015906104cf575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b156105495773ffffffffffffffffffffffffffffffffffffffff8416600090815260046020908152604080832033845290915290205482111561051157600080fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020805483900390555b73ffffffffffffffffffffffffffffffffffffffff808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b336000908152600360205260409020548111156105e357600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f19350505050158015610622573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156103a75780601f1061037c576101008083540402835291602001916103a7565b60006106fc338484610427565b9392505050565b6004602090815260009283526040808420909152908252902054815600a165627a7a723058201ebe888a6b56dd871f599adbe0f19ec3c29c28aec0685788dfac9b37a99fc9d20029"
|
||||
"object": "0x60c0604052600d60808190526c2bb930b83832b21022ba3432b960991b60a090815261002e916000919061007a565b50604080518082019091526004808252630ae8aa8960e31b602090920191825261005a9160019161007a565b506002805460ff1916601217905534801561007457600080fd5b50610115565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100bb57805160ff19168380011785556100e8565b828001600101855582156100e8579182015b828111156100e85782518255916020019190600101906100cd565b506100f49291506100f8565b5090565b61011291905b808211156100f457600081556001016100fe565b90565b6107f9806101246000396000f3fe6080604052600436106100bc5760003560e01c8063313ce56711610074578063a9059cbb1161004e578063a9059cbb146102cb578063d0e30db0146100bc578063dd62ed3e14610311576100bc565b8063313ce5671461024b57806370a082311461027657806395d89b41146102b6576100bc565b806318160ddd116100a557806318160ddd146101aa57806323b872dd146101d15780632e1a7d4d14610221576100bc565b806306fdde03146100c6578063095ea7b314610150575b6100c4610359565b005b3480156100d257600080fd5b506100db6103a8565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101155781810151838201526020016100fd565b50505050905090810190601f1680156101425780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015c57600080fd5b506101966004803603604081101561017357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610454565b604080519115158252519081900360200190f35b3480156101b657600080fd5b506101bf6104c7565b60408051918252519081900360200190f35b3480156101dd57600080fd5b50610196600480360360608110156101f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013590911690604001356104cb565b34801561022d57600080fd5b506100c46004803603602081101561024457600080fd5b503561066b565b34801561025757600080fd5b50610260610700565b6040805160ff9092168252519081900360200190f35b34801561028257600080fd5b506101bf6004803603602081101561029957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610709565b3480156102c257600080fd5b506100db61071b565b3480156102d757600080fd5b50610196600480360360408110156102ee57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610793565b34801561031d57600080fd5b506101bf6004803603604081101561033457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160200135166107a7565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b820191906000526020600020905b81548152906001019060200180831161042f57829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b4790565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600360205260408120548211156104fd57600080fd5b73ffffffffffffffffffffffffffffffffffffffff84163314801590610573575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b156105ed5773ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020548211156105b557600080fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020805483900390555b73ffffffffffffffffffffffffffffffffffffffff808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b3360009081526003602052604090205481111561068757600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f193505050501580156106c6573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b60006107a03384846104cb565b9392505050565b60046020908152600092835260408084209091529082529020548156fea265627a7a723158201d2ffc56fd216e25b5193800153d8fc3a68d6c94bdd8d1320a5a64ec406bf7a564736f6c63430005100032"
|
||||
},
|
||||
"deployedBytecode": {
|
||||
"object": "0x6080604052600436106100925760003560e01c63ffffffff16806306fdde031461009c578063095ea7b31461012657806318160ddd1461016b57806323b872dd146101925780632e1a7d4d146101c9578063313ce567146101e157806370a082311461020c57806395d89b411461023a578063a9059cbb1461024f578063d0e30db014610092578063dd62ed3e14610280575b61009a6102b4565b005b3480156100a857600080fd5b506100b1610303565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100eb5781810151838201526020016100d3565b50505050905090810190601f1680156101185780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561013257600080fd5b5061015773ffffffffffffffffffffffffffffffffffffffff600435166024356103af565b604080519115158252519081900360200190f35b34801561017757600080fd5b50610180610422565b60408051918252519081900360200190f35b34801561019e57600080fd5b5061015773ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610427565b3480156101d557600080fd5b5061009a6004356105c7565b3480156101ed57600080fd5b506101f661065c565b6040805160ff9092168252519081900360200190f35b34801561021857600080fd5b5061018073ffffffffffffffffffffffffffffffffffffffff60043516610665565b34801561024657600080fd5b506100b1610677565b34801561025b57600080fd5b5061015773ffffffffffffffffffffffffffffffffffffffff600435166024356106ef565b34801561028c57600080fd5b5061018073ffffffffffffffffffffffffffffffffffffffff60043581169060243516610703565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156103a75780601f1061037c576101008083540402835291602001916103a7565b820191906000526020600020905b81548152906001019060200180831161038a57829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b303190565b73ffffffffffffffffffffffffffffffffffffffff831660009081526003602052604081205482111561045957600080fd5b73ffffffffffffffffffffffffffffffffffffffff841633148015906104cf575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b156105495773ffffffffffffffffffffffffffffffffffffffff8416600090815260046020908152604080832033845290915290205482111561051157600080fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020805483900390555b73ffffffffffffffffffffffffffffffffffffffff808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b336000908152600360205260409020548111156105e357600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f19350505050158015610622573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156103a75780601f1061037c576101008083540402835291602001916103a7565b60006106fc338484610427565b9392505050565b6004602090815260009283526040808420909152908252902054815600a165627a7a723058201ebe888a6b56dd871f599adbe0f19ec3c29c28aec0685788dfac9b37a99fc9d20029"
|
||||
"object": "0x6080604052600436106100bc5760003560e01c8063313ce56711610074578063a9059cbb1161004e578063a9059cbb146102cb578063d0e30db0146100bc578063dd62ed3e14610311576100bc565b8063313ce5671461024b57806370a082311461027657806395d89b41146102b6576100bc565b806318160ddd116100a557806318160ddd146101aa57806323b872dd146101d15780632e1a7d4d14610221576100bc565b806306fdde03146100c6578063095ea7b314610150575b6100c4610359565b005b3480156100d257600080fd5b506100db6103a8565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101155781810151838201526020016100fd565b50505050905090810190601f1680156101425780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015c57600080fd5b506101966004803603604081101561017357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610454565b604080519115158252519081900360200190f35b3480156101b657600080fd5b506101bf6104c7565b60408051918252519081900360200190f35b3480156101dd57600080fd5b50610196600480360360608110156101f457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013590911690604001356104cb565b34801561022d57600080fd5b506100c46004803603602081101561024457600080fd5b503561066b565b34801561025757600080fd5b50610260610700565b6040805160ff9092168252519081900360200190f35b34801561028257600080fd5b506101bf6004803603602081101561029957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610709565b3480156102c257600080fd5b506100db61071b565b3480156102d757600080fd5b50610196600480360360408110156102ee57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610793565b34801561031d57600080fd5b506101bf6004803603604081101561033457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160200135166107a7565b33600081815260036020908152604091829020805434908101909155825190815291517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9281900390910190a2565b6000805460408051602060026001851615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b820191906000526020600020905b81548152906001019060200180831161042f57829003601f168201915b505050505081565b33600081815260046020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b4790565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600360205260408120548211156104fd57600080fd5b73ffffffffffffffffffffffffffffffffffffffff84163314801590610573575073ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14155b156105ed5773ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020548211156105b557600080fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526004602090815260408083203384529091529020805483900390555b73ffffffffffffffffffffffffffffffffffffffff808516600081815260036020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060019392505050565b3360009081526003602052604090205481111561068757600080fd5b33600081815260036020526040808220805485900390555183156108fc0291849190818181858888f193505050501580156106c6573d6000803e3d6000fd5b5060408051828152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250565b60025460ff1681565b60036020526000908152604090205481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f8101849004840282018401909252818152929183018282801561044c5780601f106104215761010080835404028352916020019161044c565b60006107a03384846104cb565b9392505050565b60046020908152600092835260408084209091529082529020548156fea265627a7a723158201d2ffc56fd216e25b5193800153d8fc3a68d6c94bdd8d1320a5a64ec406bf7a564736f6c63430005100032"
|
||||
}
|
||||
}
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "soljson-v0.4.26+commit.4563c3fc.js",
|
||||
"version": "soljson-v0.5.16+commit.9c3226ce.js",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": true,
|
||||
@ -178,8 +187,8 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"evmVersion": "constantinople"
|
||||
"evmVersion": "istanbul"
|
||||
}
|
||||
},
|
||||
"networks": {}
|
||||
"chains": {}
|
||||
}
|
||||
|
@ -116,10 +116,10 @@
|
||||
},
|
||||
"evm": {
|
||||
"bytecode": {
|
||||
"object": "0x60606040526b033b2e3c9fd0803ce8000000600355341561001c57fe5b5b600354600160a060020a0333166000908152602081905260409020555b5b61078d8061004a6000396000f300606060405236156100965763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610098578063095ea7b31461014657806318160ddd1461018657806323b872dd146101a8578063313ce567146101ee57806370a082311461021457806395d89b411461024f578063a9059cbb146102fd578063dd62ed3e1461033d575bfe5b34156100a057fe5b6100a861037e565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014e57fe5b61017273ffffffffffffffffffffffffffffffffffffffff600435166024356103b5565b604080519115158252519081900360200190f35b341561018e57fe5b61019661042d565b60408051918252519081900360200190f35b34156101b057fe5b61017273ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610433565b604080519115158252519081900360200190f35b34156101f657fe5b6101fe6105d4565b6040805160ff9092168252519081900360200190f35b341561021c57fe5b61019673ffffffffffffffffffffffffffffffffffffffff600435166105d9565b60408051918252519081900360200190f35b341561025757fe5b6100a8610605565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561030557fe5b61017273ffffffffffffffffffffffffffffffffffffffff6004351660243561063c565b604080519115158252519081900360200190f35b341561034557fe5b61019673ffffffffffffffffffffffffffffffffffffffff60043581169060243516610727565b60408051918252519081900360200190f35b60408051808201909152601181527f30782050726f746f636f6c20546f6b656e000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60035481565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906104835750828110155b80156104b6575073ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090205483810110155b156105c65773ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220805487019055918716815220805484900390557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156105585773ffffffffffffffffffffffffffffffffffffffff808616600090815260016020908152604080832033909416835292905220805484900390555b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191506105cb565b600091505b5b509392505050565b601281565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b60408051808201909152600381527f5a52580000000000000000000000000000000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff3316600090815260208190526040812054829010801590610699575073ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110155b156107185773ffffffffffffffffffffffffffffffffffffffff33811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610427565b506000610427565b5b92915050565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600160209081526040808320938516835292905220545b929150505600a165627a7a72305820d984298155c708a8164f1cbf83c7275bcc6851dd082c0404013c1f4463b238fa0029"
|
||||
"object": "0x60606040526b033b2e3c9fd0803ce8000000600355341561001c57fe5b5b600354600160a060020a0333166000908152602081905260409020555b5b61078d8061004a6000396000f300606060405236156100965763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610098578063095ea7b31461014657806318160ddd1461018657806323b872dd146101a8578063313ce567146101ee57806370a082311461021457806395d89b411461024f578063a9059cbb146102fd578063dd62ed3e1461033d575bfe5b34156100a057fe5b6100a861037e565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014e57fe5b61017273ffffffffffffffffffffffffffffffffffffffff600435166024356103b5565b604080519115158252519081900360200190f35b341561018e57fe5b61019661042d565b60408051918252519081900360200190f35b34156101b057fe5b61017273ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610433565b604080519115158252519081900360200190f35b34156101f657fe5b6101fe6105d4565b6040805160ff9092168252519081900360200190f35b341561021c57fe5b61019673ffffffffffffffffffffffffffffffffffffffff600435166105d9565b60408051918252519081900360200190f35b341561025757fe5b6100a8610605565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561030557fe5b61017273ffffffffffffffffffffffffffffffffffffffff6004351660243561063c565b604080519115158252519081900360200190f35b341561034557fe5b61019673ffffffffffffffffffffffffffffffffffffffff60043581169060243516610727565b60408051918252519081900360200190f35b60408051808201909152601181527f30782050726f746f636f6c20546f6b656e000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60035481565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906104835750828110155b80156104b6575073ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090205483810110155b156105c65773ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220805487019055918716815220805484900390557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156105585773ffffffffffffffffffffffffffffffffffffffff808616600090815260016020908152604080832033909416835292905220805484900390555b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191506105cb565b600091505b5b509392505050565b601281565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b60408051808201909152600381527f5a52580000000000000000000000000000000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff3316600090815260208190526040812054829010801590610699575073ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110155b156107185773ffffffffffffffffffffffffffffffffffffffff33811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610427565b506000610427565b5b92915050565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600160209081526040808320938516835292905220545b929150505600a165627a7a72305820da020366d75ca3a9f2ac8c2e8caa46722a6f27bae293974b944c9572e028e1790029"
|
||||
},
|
||||
"deployedBytecode": {
|
||||
"object": "0x606060405236156100965763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610098578063095ea7b31461014657806318160ddd1461018657806323b872dd146101a8578063313ce567146101ee57806370a082311461021457806395d89b411461024f578063a9059cbb146102fd578063dd62ed3e1461033d575bfe5b34156100a057fe5b6100a861037e565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014e57fe5b61017273ffffffffffffffffffffffffffffffffffffffff600435166024356103b5565b604080519115158252519081900360200190f35b341561018e57fe5b61019661042d565b60408051918252519081900360200190f35b34156101b057fe5b61017273ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610433565b604080519115158252519081900360200190f35b34156101f657fe5b6101fe6105d4565b6040805160ff9092168252519081900360200190f35b341561021c57fe5b61019673ffffffffffffffffffffffffffffffffffffffff600435166105d9565b60408051918252519081900360200190f35b341561025757fe5b6100a8610605565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561030557fe5b61017273ffffffffffffffffffffffffffffffffffffffff6004351660243561063c565b604080519115158252519081900360200190f35b341561034557fe5b61019673ffffffffffffffffffffffffffffffffffffffff60043581169060243516610727565b60408051918252519081900360200190f35b60408051808201909152601181527f30782050726f746f636f6c20546f6b656e000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60035481565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906104835750828110155b80156104b6575073ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090205483810110155b156105c65773ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220805487019055918716815220805484900390557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156105585773ffffffffffffffffffffffffffffffffffffffff808616600090815260016020908152604080832033909416835292905220805484900390555b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191506105cb565b600091505b5b509392505050565b601281565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b60408051808201909152600381527f5a52580000000000000000000000000000000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff3316600090815260208190526040812054829010801590610699575073ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110155b156107185773ffffffffffffffffffffffffffffffffffffffff33811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610427565b506000610427565b5b92915050565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600160209081526040808320938516835292905220545b929150505600a165627a7a72305820d984298155c708a8164f1cbf83c7275bcc6851dd082c0404013c1f4463b238fa0029"
|
||||
"object": "0x606060405236156100965763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610098578063095ea7b31461014657806318160ddd1461018657806323b872dd146101a8578063313ce567146101ee57806370a082311461021457806395d89b411461024f578063a9059cbb146102fd578063dd62ed3e1461033d575bfe5b34156100a057fe5b6100a861037e565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014e57fe5b61017273ffffffffffffffffffffffffffffffffffffffff600435166024356103b5565b604080519115158252519081900360200190f35b341561018e57fe5b61019661042d565b60408051918252519081900360200190f35b34156101b057fe5b61017273ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610433565b604080519115158252519081900360200190f35b34156101f657fe5b6101fe6105d4565b6040805160ff9092168252519081900360200190f35b341561021c57fe5b61019673ffffffffffffffffffffffffffffffffffffffff600435166105d9565b60408051918252519081900360200190f35b341561025757fe5b6100a8610605565b60408051602080825283518183015283519192839290830191850190808383821561010c575b80518252602083111561010c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016100ce565b505050905090810190601f1680156101385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561030557fe5b61017273ffffffffffffffffffffffffffffffffffffffff6004351660243561063c565b604080519115158252519081900360200190f35b341561034557fe5b61019673ffffffffffffffffffffffffffffffffffffffff60043581169060243516610727565b60408051918252519081900360200190f35b60408051808201909152601181527f30782050726f746f636f6c20546f6b656e000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60035481565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906104835750828110155b80156104b6575073ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090205483810110155b156105c65773ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220805487019055918716815220805484900390557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8110156105585773ffffffffffffffffffffffffffffffffffffffff808616600090815260016020908152604080832033909416835292905220805484900390555b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191506105cb565b600091505b5b509392505050565b601281565b73ffffffffffffffffffffffffffffffffffffffff81166000908152602081905260409020545b919050565b60408051808201909152600381527f5a52580000000000000000000000000000000000000000000000000000000000602082015281565b73ffffffffffffffffffffffffffffffffffffffff3316600090815260208190526040812054829010801590610699575073ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205482810110155b156107185773ffffffffffffffffffffffffffffffffffffffff33811660008181526020818152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610427565b506000610427565b5b92915050565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600160209081526040808320938516835292905220545b929150505600a165627a7a72305820da020366d75ca3a9f2ac8c2e8caa46722a6f27bae293974b944c9572e028e1790029"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -145,8 +145,8 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"evmVersion": "constantinople"
|
||||
"evmVersion": "istanbul"
|
||||
}
|
||||
},
|
||||
"networks": {}
|
||||
"chains": {}
|
||||
}
|
||||
|
11
packages/contract-artifacts/artifacts/ZrxVault.json
generated
11
packages/contract-artifacts/artifacts/ZrxVault.json
generated
File diff suppressed because one or more lines are too long
@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"version": "13.4.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Update all wrappers.",
|
||||
"pr": 2432
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "13.3.0",
|
||||
"changes": [
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -34,17 +34,11 @@ import { assert } from '@0x/assert';
|
||||
import * as ethers from 'ethers';
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
export type ERC20TokenEventArgs = ERC20TokenTransferEventArgs | ERC20TokenApprovalEventArgs;
|
||||
export type ERC20TokenEventArgs = ERC20TokenApprovalEventArgs | ERC20TokenTransferEventArgs;
|
||||
|
||||
export enum ERC20TokenEvents {
|
||||
Transfer = 'Transfer',
|
||||
Approval = 'Approval',
|
||||
}
|
||||
|
||||
export interface ERC20TokenTransferEventArgs extends DecodedLogArgs {
|
||||
_from: string;
|
||||
_to: string;
|
||||
_value: BigNumber;
|
||||
Transfer = 'Transfer',
|
||||
}
|
||||
|
||||
export interface ERC20TokenApprovalEventArgs extends DecodedLogArgs {
|
||||
@ -53,6 +47,12 @@ export interface ERC20TokenApprovalEventArgs extends DecodedLogArgs {
|
||||
_value: BigNumber;
|
||||
}
|
||||
|
||||
export interface ERC20TokenTransferEventArgs extends DecodedLogArgs {
|
||||
_from: string;
|
||||
_to: string;
|
||||
_value: BigNumber;
|
||||
}
|
||||
|
||||
/* istanbul ignore next */
|
||||
// tslint:disable:no-parameter-reassignment
|
||||
// tslint:disable-next-line:class-name
|
||||
@ -135,6 +135,75 @@ export class ERC20TokenContract extends BaseContract {
|
||||
*/
|
||||
public static ABI(): ContractAbi {
|
||||
const abi = [
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
name: '_owner',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_spender',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_value',
|
||||
type: 'uint256',
|
||||
indexed: false,
|
||||
},
|
||||
],
|
||||
name: 'Approval',
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
name: '_from',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_to',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_value',
|
||||
type: 'uint256',
|
||||
indexed: false,
|
||||
},
|
||||
],
|
||||
name: 'Transfer',
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [
|
||||
{
|
||||
name: '_owner',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: '_spender',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'allowance',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
@ -160,8 +229,13 @@ export class ERC20TokenContract extends BaseContract {
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'totalSupply',
|
||||
inputs: [
|
||||
{
|
||||
name: '_owner',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'balanceOf',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
@ -172,42 +246,10 @@ export class ERC20TokenContract extends BaseContract {
|
||||
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',
|
||||
inputs: [],
|
||||
name: 'totalSupply',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
@ -242,73 +284,31 @@ export class ERC20TokenContract extends BaseContract {
|
||||
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,
|
||||
constant: false,
|
||||
inputs: [
|
||||
{
|
||||
name: '_from',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_to',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_value',
|
||||
type: 'uint256',
|
||||
indexed: false,
|
||||
},
|
||||
],
|
||||
name: 'Transfer',
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
name: 'transferFrom',
|
||||
outputs: [
|
||||
{
|
||||
name: '_owner',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_spender',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_value',
|
||||
type: 'uint256',
|
||||
indexed: false,
|
||||
name: '',
|
||||
type: 'bool',
|
||||
},
|
||||
],
|
||||
name: 'Approval',
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
] as ContractAbi;
|
||||
return abi;
|
||||
@ -341,6 +341,27 @@ export class ERC20TokenContract extends BaseContract {
|
||||
return abiEncoder.getSelector();
|
||||
}
|
||||
|
||||
public allowance(_owner: string, _spender: string): ContractFunctionObj<BigNumber> {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
assert.isString('_owner', _owner);
|
||||
assert.isString('_spender', _spender);
|
||||
const functionSignature = 'allowance(address,address)';
|
||||
|
||||
return {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, [_owner.toLowerCase(), _spender.toLowerCase()]);
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* `msg.sender` approves `_spender` to spend `_value` tokens
|
||||
* @param _spender The address of the account able to transfer the tokens
|
||||
@ -394,84 +415,6 @@ export class ERC20TokenContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Query total supply of token
|
||||
* @returns Total supply of token
|
||||
*/
|
||||
public totalSupply(): ContractFunctionObj<BigNumber> {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const functionSignature = 'totalSupply()';
|
||||
|
||||
return {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, []);
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* send `value` token to `to` from `from` on the condition it is approved by `from`
|
||||
* @param _from The address of the sender
|
||||
* @param _to The address of the recipient
|
||||
* @param _value The amount of token to be transferred
|
||||
* @returns True if transfer was successful
|
||||
*/
|
||||
public transferFrom(_from: string, _to: string, _value: BigNumber): ContractTxFunctionObj<boolean> {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
assert.isString('_from', _from);
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const functionSignature = 'transferFrom(address,address,uint256)';
|
||||
|
||||
return {
|
||||
async sendTransactionAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
opts: SendTransactionOpts = { shouldValidate: true },
|
||||
): Promise<string> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(
|
||||
{ ...txData, data: this.getABIEncodedTransactionData() },
|
||||
this.estimateGasAsync.bind(this),
|
||||
);
|
||||
if (opts.shouldValidate !== false) {
|
||||
await this.callAsync(txDataWithDefaults);
|
||||
}
|
||||
return self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
txData?: Partial<TxData>,
|
||||
opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
return self._promiseWithTransactionHash(this.sendTransactionAsync(txData, opts), opts);
|
||||
},
|
||||
async estimateGasAsync(txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
...txData,
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<boolean> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, [_from.toLowerCase(), _to.toLowerCase(), _value]);
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Query the balance of owner
|
||||
* @param _owner The address from which the balance will be retrieved
|
||||
@ -497,6 +440,29 @@ export class ERC20TokenContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Query total supply of token
|
||||
* @returns Total supply of token
|
||||
*/
|
||||
public totalSupply(): ContractFunctionObj<BigNumber> {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
const functionSignature = 'totalSupply()';
|
||||
|
||||
return {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, []);
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* send `value` token to `to` from `msg.sender`
|
||||
* @param _to The address of the recipient
|
||||
@ -550,24 +516,58 @@ export class ERC20TokenContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
}
|
||||
public allowance(_owner: string, _spender: string): ContractFunctionObj<BigNumber> {
|
||||
/**
|
||||
* send `value` token to `to` from `from` on the condition it is approved by `from`
|
||||
* @param _from The address of the sender
|
||||
* @param _to The address of the recipient
|
||||
* @param _value The amount of token to be transferred
|
||||
* @returns True if transfer was successful
|
||||
*/
|
||||
public transferFrom(_from: string, _to: string, _value: BigNumber): ContractTxFunctionObj<boolean> {
|
||||
const self = (this as any) as ERC20TokenContract;
|
||||
assert.isString('_owner', _owner);
|
||||
assert.isString('_spender', _spender);
|
||||
const functionSignature = 'allowance(address,address)';
|
||||
assert.isString('_from', _from);
|
||||
assert.isString('_to', _to);
|
||||
assert.isBigNumber('_value', _value);
|
||||
const functionSignature = 'transferFrom(address,address,uint256)';
|
||||
|
||||
return {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
async sendTransactionAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
opts: SendTransactionOpts = { shouldValidate: true },
|
||||
): Promise<string> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(
|
||||
{ ...txData, data: this.getABIEncodedTransactionData() },
|
||||
this.estimateGasAsync.bind(this),
|
||||
);
|
||||
if (opts.shouldValidate !== false) {
|
||||
await this.callAsync(txDataWithDefaults);
|
||||
}
|
||||
return self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
txData?: Partial<TxData>,
|
||||
opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
return self._promiseWithTransactionHash(this.sendTransactionAsync(txData, opts), opts);
|
||||
},
|
||||
async estimateGasAsync(txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
...txData,
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<boolean> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||
return abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, [_owner.toLowerCase(), _spender.toLowerCase()]);
|
||||
return self._strictEncodeArguments(functionSignature, [_from.toLowerCase(), _to.toLowerCase(), _value]);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ export type ExchangeEventArgs =
|
||||
| ExchangeCancelEventArgs
|
||||
| ExchangeCancelUpToEventArgs
|
||||
| ExchangeFillEventArgs
|
||||
| ExchangeOwnershipTransferredEventArgs
|
||||
| ExchangeProtocolFeeCollectorAddressEventArgs
|
||||
| ExchangeProtocolFeeMultiplierEventArgs
|
||||
| ExchangeSignatureValidatorApprovalEventArgs
|
||||
@ -49,6 +50,7 @@ export enum ExchangeEvents {
|
||||
Cancel = 'Cancel',
|
||||
CancelUpTo = 'CancelUpTo',
|
||||
Fill = 'Fill',
|
||||
OwnershipTransferred = 'OwnershipTransferred',
|
||||
ProtocolFeeCollectorAddress = 'ProtocolFeeCollectorAddress',
|
||||
ProtocolFeeMultiplier = 'ProtocolFeeMultiplier',
|
||||
SignatureValidatorApproval = 'SignatureValidatorApproval',
|
||||
@ -92,6 +94,11 @@ export interface ExchangeFillEventArgs extends DecodedLogArgs {
|
||||
protocolFeePaid: BigNumber;
|
||||
}
|
||||
|
||||
export interface ExchangeOwnershipTransferredEventArgs extends DecodedLogArgs {
|
||||
previousOwner: string;
|
||||
newOwner: string;
|
||||
}
|
||||
|
||||
export interface ExchangeProtocolFeeCollectorAddressEventArgs extends DecodedLogArgs {
|
||||
oldProtocolFeeCollector: string;
|
||||
updatedProtocolFeeCollector: string;
|
||||
@ -369,6 +376,24 @@ export class ExchangeContract extends BaseContract {
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'previousOwner',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: 'newOwner',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
],
|
||||
name: 'OwnershipTransferred',
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
@ -601,7 +626,7 @@ export class ExchangeContract extends BaseContract {
|
||||
name: 'batchExecuteTransactions',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
name: 'returnData',
|
||||
type: 'bytes[]',
|
||||
},
|
||||
],
|
||||
@ -1467,6 +1492,15 @@ export class ExchangeContract extends BaseContract {
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [],
|
||||
name: 'detachProtocolFeeCollector',
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
@ -1756,7 +1790,7 @@ export class ExchangeContract extends BaseContract {
|
||||
name: 'getAssetProxy',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
name: 'assetProxy',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
@ -3238,7 +3272,7 @@ export class ExchangeContract extends BaseContract {
|
||||
* @param transactions Array of 0x transaction structures.
|
||||
* @param signatures Array of proofs that transactions have been signed by
|
||||
* signer(s).
|
||||
* @returns Array containing ABI encoded return data for each of the underlying Exchange function calls.
|
||||
* @returns returnData Array containing ABI encoded return data for each of the underlying Exchange function calls.
|
||||
*/
|
||||
public batchExecuteTransactions(
|
||||
transactions: Array<{
|
||||
@ -3302,7 +3336,7 @@ export class ExchangeContract extends BaseContract {
|
||||
* @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell
|
||||
* in orders.
|
||||
* @param signatures Proofs that orders have been created by makers.
|
||||
* @returns Array of amounts filled and fees paid by makers and taker.
|
||||
* @returns fillResults Array of amounts filled and fees paid by makers and taker.
|
||||
*/
|
||||
public batchFillOrKillOrders(
|
||||
orders: Array<{
|
||||
@ -3405,7 +3439,7 @@ export class ExchangeContract extends BaseContract {
|
||||
* @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell
|
||||
* in orders.
|
||||
* @param signatures Proofs that orders have been created by makers.
|
||||
* @returns Array of amounts filled and fees paid by makers and taker.
|
||||
* @returns fillResults Array of amounts filled and fees paid by makers and taker.
|
||||
*/
|
||||
public batchFillOrders(
|
||||
orders: Array<{
|
||||
@ -3508,7 +3542,7 @@ export class ExchangeContract extends BaseContract {
|
||||
* @param takerAssetFillAmounts Array of desired amounts of takerAsset to sell
|
||||
* in orders.
|
||||
* @param signatures Proofs that orders have been created by makers.
|
||||
* @returns Array of amounts filled and fees paid by makers and taker.
|
||||
* @returns fillResults Array of amounts filled and fees paid by makers and taker.
|
||||
*/
|
||||
public batchFillOrdersNoThrow(
|
||||
orders: Array<{
|
||||
@ -4075,6 +4109,55 @@ export class ExchangeContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Sets the protocolFeeCollector contract address to 0.
|
||||
* Only callable by owner.
|
||||
*/
|
||||
public detachProtocolFeeCollector(): ContractTxFunctionObj<void> {
|
||||
const self = (this as any) as ExchangeContract;
|
||||
const functionSignature = 'detachProtocolFeeCollector()';
|
||||
|
||||
return {
|
||||
async sendTransactionAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
opts: SendTransactionOpts = { shouldValidate: true },
|
||||
): Promise<string> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(
|
||||
{ ...txData, data: this.getABIEncodedTransactionData() },
|
||||
this.estimateGasAsync.bind(this),
|
||||
);
|
||||
if (opts.shouldValidate !== false) {
|
||||
await this.callAsync(txDataWithDefaults);
|
||||
}
|
||||
return self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
txData?: Partial<TxData>,
|
||||
opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
return self._promiseWithTransactionHash(this.sendTransactionAsync(txData, opts), opts);
|
||||
},
|
||||
async estimateGasAsync(txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
...txData,
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, []);
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Executes an Exchange method call in the context of signer.
|
||||
* @param transaction 0x transaction structure.
|
||||
@ -4138,10 +4221,11 @@ export class ExchangeContract extends BaseContract {
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Fills the input order. Reverts if exact takerAssetFillAmount not filled.
|
||||
* Fills the input order. Reverts if exact `takerAssetFillAmount` not filled.
|
||||
* @param order Order struct containing order specifications.
|
||||
* @param takerAssetFillAmount Desired amount of takerAsset to sell.
|
||||
* @param signature Proof that order has been created by maker.
|
||||
* @returns fillResults Amounts filled and fees paid.
|
||||
*/
|
||||
public fillOrKillOrder(
|
||||
order: {
|
||||
@ -4237,7 +4321,7 @@ export class ExchangeContract extends BaseContract {
|
||||
* @param order Order struct containing order specifications.
|
||||
* @param takerAssetFillAmount Desired amount of takerAsset to sell.
|
||||
* @param signature Proof that order has been created by maker.
|
||||
* @returns Amounts filled and fees paid by maker and taker.
|
||||
* @returns fillResults Amounts filled and fees paid by maker and taker.
|
||||
*/
|
||||
public fillOrder(
|
||||
order: {
|
||||
@ -4351,7 +4435,7 @@ export class ExchangeContract extends BaseContract {
|
||||
/**
|
||||
* Gets an asset proxy.
|
||||
* @param assetProxyId Id of the asset proxy.
|
||||
* @returns The asset proxy registered to assetProxyId. Returns 0x0 if no proxy is registered.
|
||||
* @returns assetProxy The asset proxy address registered to assetProxyId. Returns 0x0 if no proxy is registered.
|
||||
*/
|
||||
public getAssetProxy(assetProxyId: string): ContractFunctionObj<string> {
|
||||
const self = (this as any) as ExchangeContract;
|
||||
@ -4376,7 +4460,7 @@ export class ExchangeContract extends BaseContract {
|
||||
/**
|
||||
* Gets information about an order: status, hash, and amount filled.
|
||||
* @param order Order to gather information on.
|
||||
* @returns OrderInfo Information about the order and its state. See LibOrder.OrderInfo for a complete description.
|
||||
* @returns orderInfo Information about the order and its state. See LibOrder.OrderInfo for a complete description.
|
||||
*/
|
||||
public getOrderInfo(order: {
|
||||
makerAddress: string;
|
||||
@ -4538,7 +4622,7 @@ export class ExchangeContract extends BaseContract {
|
||||
* @param orders Array of order specifications.
|
||||
* @param makerAssetFillAmount Minimum amount of makerAsset to buy.
|
||||
* @param signatures Proofs that orders have been signed by makers.
|
||||
* @returns Amounts filled and fees paid by makers and taker.
|
||||
* @returns fillResults Amounts filled and fees paid by makers and taker.
|
||||
*/
|
||||
public marketBuyOrdersFillOrKill(
|
||||
orders: Array<{
|
||||
@ -4636,7 +4720,7 @@ export class ExchangeContract extends BaseContract {
|
||||
* @param orders Array of order specifications.
|
||||
* @param makerAssetFillAmount Desired amount of makerAsset to buy.
|
||||
* @param signatures Proofs that orders have been signed by makers.
|
||||
* @returns Amounts filled and fees paid by makers and taker.
|
||||
* @returns fillResults Amounts filled and fees paid by makers and taker.
|
||||
*/
|
||||
public marketBuyOrdersNoThrow(
|
||||
orders: Array<{
|
||||
@ -4733,7 +4817,7 @@ export class ExchangeContract extends BaseContract {
|
||||
* @param orders Array of order specifications.
|
||||
* @param takerAssetFillAmount Minimum amount of takerAsset to sell.
|
||||
* @param signatures Proofs that orders have been signed by makers.
|
||||
* @returns Amounts filled and fees paid by makers and taker.
|
||||
* @returns fillResults Amounts filled and fees paid by makers and taker.
|
||||
*/
|
||||
public marketSellOrdersFillOrKill(
|
||||
orders: Array<{
|
||||
@ -4831,7 +4915,7 @@ export class ExchangeContract extends BaseContract {
|
||||
* @param orders Array of order specifications.
|
||||
* @param takerAssetFillAmount Desired amount of takerAsset to sell.
|
||||
* @param signatures Proofs that orders have been signed by makers.
|
||||
* @returns Amounts filled and fees paid by makers and taker.
|
||||
* @returns fillResults Amounts filled and fees paid by makers and taker.
|
||||
*/
|
||||
public marketSellOrdersNoThrow(
|
||||
orders: Array<{
|
||||
@ -5671,6 +5755,10 @@ export class ExchangeContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Change the owner of this contract.
|
||||
* @param newOwner New owner address.
|
||||
*/
|
||||
public transferOwnership(newOwner: string): ContractTxFunctionObj<void> {
|
||||
const self = (this as any) as ExchangeContract;
|
||||
assert.isString('newOwner', newOwner);
|
||||
|
@ -62,6 +62,7 @@ export class ForwarderContract extends BaseContract {
|
||||
txDefaults: Partial<TxData>,
|
||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||
_exchange: string,
|
||||
_exchangeV2: string,
|
||||
_weth: string,
|
||||
): Promise<ForwarderContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
@ -88,6 +89,7 @@ export class ForwarderContract extends BaseContract {
|
||||
txDefaults,
|
||||
logDecodeDependenciesAbiOnly,
|
||||
_exchange,
|
||||
_exchangeV2,
|
||||
_weth,
|
||||
);
|
||||
}
|
||||
@ -98,6 +100,7 @@ export class ForwarderContract extends BaseContract {
|
||||
txDefaults: Partial<TxData>,
|
||||
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||
_exchange: string,
|
||||
_exchangeV2: string,
|
||||
_weth: string,
|
||||
): Promise<ForwarderContract> {
|
||||
assert.isHexString('bytecode', bytecode);
|
||||
@ -108,14 +111,14 @@ export class ForwarderContract extends BaseContract {
|
||||
]);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[_exchange, _weth] = BaseContract._formatABIDataItemList(
|
||||
[_exchange, _exchangeV2, _weth] = BaseContract._formatABIDataItemList(
|
||||
constructorAbi.inputs,
|
||||
[_exchange, _weth],
|
||||
[_exchange, _exchangeV2, _weth],
|
||||
BaseContract._bigNumberToString,
|
||||
);
|
||||
const iface = new ethers.utils.Interface(abi);
|
||||
const deployInfo = iface.deployFunction;
|
||||
const txData = deployInfo.encode(bytecode, [_exchange, _weth]);
|
||||
const txData = deployInfo.encode(bytecode, [_exchange, _exchangeV2, _weth]);
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToContractTxDataAsync(
|
||||
{
|
||||
@ -134,7 +137,7 @@ export class ForwarderContract extends BaseContract {
|
||||
txDefaults,
|
||||
logDecodeDependencies,
|
||||
);
|
||||
contractInstance.constructorArgs = [_exchange, _weth];
|
||||
contractInstance.constructorArgs = [_exchange, _exchangeV2, _weth];
|
||||
return contractInstance;
|
||||
}
|
||||
|
||||
@ -149,6 +152,10 @@ export class ForwarderContract extends BaseContract {
|
||||
name: '_exchange',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: '_exchangeV2',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: '_weth',
|
||||
type: 'address',
|
||||
@ -184,6 +191,20 @@ export class ForwarderContract extends BaseContract {
|
||||
stateMutability: 'payable',
|
||||
type: 'fallback',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'EXCHANGE_V2_ORDER_ID',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'bytes4',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
@ -272,12 +293,12 @@ export class ForwarderContract extends BaseContract {
|
||||
type: 'bytes[]',
|
||||
},
|
||||
{
|
||||
name: 'feePercentage',
|
||||
type: 'uint256',
|
||||
name: 'ethFeeAmounts',
|
||||
type: 'uint256[]',
|
||||
},
|
||||
{
|
||||
name: 'feeRecipient',
|
||||
type: 'address',
|
||||
name: 'feeRecipients',
|
||||
type: 'address[]',
|
||||
},
|
||||
],
|
||||
name: 'marketBuyOrdersWithEth',
|
||||
@ -290,10 +311,6 @@ export class ForwarderContract extends BaseContract {
|
||||
name: 'makerAssetAcquiredAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'ethFeePaid',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
payable: true,
|
||||
stateMutability: 'payable',
|
||||
@ -369,12 +386,12 @@ export class ForwarderContract extends BaseContract {
|
||||
type: 'bytes[]',
|
||||
},
|
||||
{
|
||||
name: 'feePercentage',
|
||||
type: 'uint256',
|
||||
name: 'ethFeeAmounts',
|
||||
type: 'uint256[]',
|
||||
},
|
||||
{
|
||||
name: 'feeRecipient',
|
||||
type: 'address',
|
||||
name: 'feeRecipients',
|
||||
type: 'address[]',
|
||||
},
|
||||
],
|
||||
name: 'marketSellOrdersWithEth',
|
||||
@ -387,10 +404,6 @@ export class ForwarderContract extends BaseContract {
|
||||
name: 'makerAssetAcquiredAmount',
|
||||
type: 'uint256',
|
||||
},
|
||||
{
|
||||
name: 'ethFeePaid',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
payable: true,
|
||||
stateMutability: 'payable',
|
||||
@ -473,6 +486,25 @@ export class ForwarderContract extends BaseContract {
|
||||
return abiEncoder.getSelector();
|
||||
}
|
||||
|
||||
public EXCHANGE_V2_ORDER_ID(): ContractFunctionObj<string> {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
const functionSignature = 'EXCHANGE_V2_ORDER_ID()';
|
||||
|
||||
return {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, []);
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Approves the respective proxy for a given asset to transfer tokens on the Forwarder contract's behalf.
|
||||
* This is necessary because an order fee denominated in the maker asset (i.e. a percentage fee) is sent by the
|
||||
@ -536,10 +568,10 @@ export class ForwarderContract extends BaseContract {
|
||||
* makerAsset and WETH as takerAsset.
|
||||
* @param makerAssetBuyAmount Desired amount of makerAsset to purchase.
|
||||
* @param signatures Proofs that orders have been created by makers.
|
||||
* @param feePercentage Percentage of WETH sold that will payed as fee to
|
||||
* forwarding contract feeRecipient.
|
||||
* @param feeRecipient Address that will receive ETH when orders are filled.
|
||||
* @returns wethSpentAmount Amount of WETH spent on the given set of orders.makerAssetAcquiredAmount Amount of maker asset acquired from the given set of orders.ethFeePaid Amount of ETH spent on the given forwarder fee.
|
||||
* @param ethFeeAmounts Amounts of ETH, denominated in Wei, that are paid to
|
||||
* corresponding feeRecipients.
|
||||
* @param feeRecipients Addresses that will receive ETH when orders are filled.
|
||||
* @returns wethSpentAmount Amount of WETH spent on the given set of orders.makerAssetAcquiredAmount Amount of maker asset acquired from the given set of orders.
|
||||
*/
|
||||
public marketBuyOrdersWithEth(
|
||||
orders: Array<{
|
||||
@ -560,17 +592,17 @@ export class ForwarderContract extends BaseContract {
|
||||
}>,
|
||||
makerAssetBuyAmount: BigNumber,
|
||||
signatures: string[],
|
||||
feePercentage: BigNumber,
|
||||
feeRecipient: string,
|
||||
): ContractTxFunctionObj<[BigNumber, BigNumber, BigNumber]> {
|
||||
ethFeeAmounts: BigNumber[],
|
||||
feeRecipients: string[],
|
||||
): ContractTxFunctionObj<[BigNumber, BigNumber]> {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
assert.isArray('orders', orders);
|
||||
assert.isBigNumber('makerAssetBuyAmount', makerAssetBuyAmount);
|
||||
assert.isArray('signatures', signatures);
|
||||
assert.isBigNumber('feePercentage', feePercentage);
|
||||
assert.isString('feeRecipient', feeRecipient);
|
||||
assert.isArray('ethFeeAmounts', ethFeeAmounts);
|
||||
assert.isArray('feeRecipients', feeRecipients);
|
||||
const functionSignature =
|
||||
'marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,bytes,bytes)[],uint256,bytes[],uint256,address)';
|
||||
'marketBuyOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,bytes,bytes)[],uint256,bytes[],uint256[],address[])';
|
||||
|
||||
return {
|
||||
async sendTransactionAsync(
|
||||
@ -602,22 +634,22 @@ export class ForwarderContract extends BaseContract {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<[BigNumber, BigNumber, BigNumber]> {
|
||||
): Promise<[BigNumber, BigNumber]> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<[BigNumber, BigNumber, BigNumber]>(rawCallResult);
|
||||
return abiEncoder.strictDecodeReturnValue<[BigNumber, BigNumber]>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, [
|
||||
orders,
|
||||
makerAssetBuyAmount,
|
||||
signatures,
|
||||
feePercentage,
|
||||
feeRecipient.toLowerCase(),
|
||||
ethFeeAmounts,
|
||||
feeRecipients,
|
||||
]);
|
||||
},
|
||||
};
|
||||
@ -628,10 +660,10 @@ export class ForwarderContract extends BaseContract {
|
||||
* @param orders Array of order specifications used containing desired
|
||||
* makerAsset and WETH as takerAsset.
|
||||
* @param signatures Proofs that orders have been created by makers.
|
||||
* @param feePercentage Percentage of WETH sold that will payed as fee to
|
||||
* forwarding contract feeRecipient.
|
||||
* @param feeRecipient Address that will receive ETH when orders are filled.
|
||||
* @returns wethSpentAmount Amount of WETH spent on the given set of orders.makerAssetAcquiredAmount Amount of maker asset acquired from the given set of orders.ethFeePaid Amount of ETH spent on the given forwarder fee.
|
||||
* @param ethFeeAmounts Amounts of ETH, denominated in Wei, that are paid to
|
||||
* corresponding feeRecipients.
|
||||
* @param feeRecipients Addresses that will receive ETH when orders are filled.
|
||||
* @returns wethSpentAmount Amount of WETH spent on the given set of orders.makerAssetAcquiredAmount Amount of maker asset acquired from the given set of orders.
|
||||
*/
|
||||
public marketSellOrdersWithEth(
|
||||
orders: Array<{
|
||||
@ -651,16 +683,16 @@ export class ForwarderContract extends BaseContract {
|
||||
takerFeeAssetData: string;
|
||||
}>,
|
||||
signatures: string[],
|
||||
feePercentage: BigNumber,
|
||||
feeRecipient: string,
|
||||
): ContractTxFunctionObj<[BigNumber, BigNumber, BigNumber]> {
|
||||
ethFeeAmounts: BigNumber[],
|
||||
feeRecipients: string[],
|
||||
): ContractTxFunctionObj<[BigNumber, BigNumber]> {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
assert.isArray('orders', orders);
|
||||
assert.isArray('signatures', signatures);
|
||||
assert.isBigNumber('feePercentage', feePercentage);
|
||||
assert.isString('feeRecipient', feeRecipient);
|
||||
assert.isArray('ethFeeAmounts', ethFeeAmounts);
|
||||
assert.isArray('feeRecipients', feeRecipients);
|
||||
const functionSignature =
|
||||
'marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,bytes,bytes)[],bytes[],uint256,address)';
|
||||
'marketSellOrdersWithEth((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,bytes,bytes)[],bytes[],uint256[],address[])';
|
||||
|
||||
return {
|
||||
async sendTransactionAsync(
|
||||
@ -692,21 +724,21 @@ export class ForwarderContract extends BaseContract {
|
||||
async callAsync(
|
||||
callData: Partial<CallData> = {},
|
||||
defaultBlock?: BlockParam,
|
||||
): Promise<[BigNumber, BigNumber, BigNumber]> {
|
||||
): Promise<[BigNumber, BigNumber]> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<[BigNumber, BigNumber, BigNumber]>(rawCallResult);
|
||||
return abiEncoder.strictDecodeReturnValue<[BigNumber, BigNumber]>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, [
|
||||
orders,
|
||||
signatures,
|
||||
feePercentage,
|
||||
feeRecipient.toLowerCase(),
|
||||
ethFeeAmounts,
|
||||
feeRecipients,
|
||||
]);
|
||||
},
|
||||
};
|
||||
@ -730,6 +762,10 @@ export class ForwarderContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Change the owner of this contract.
|
||||
* @param newOwner New owner address.
|
||||
*/
|
||||
public transferOwnership(newOwner: string): ContractTxFunctionObj<void> {
|
||||
const self = (this as any) as ForwarderContract;
|
||||
assert.isString('newOwner', newOwner);
|
||||
|
@ -180,8 +180,6 @@ export class StakingContract extends BaseContract {
|
||||
supportedProvider: SupportedProvider,
|
||||
txDefaults: Partial<TxData>,
|
||||
logDecodeDependencies: { [contractName: string]: ContractArtifact | SimpleContractArtifact },
|
||||
wethAddress: string,
|
||||
zrxVaultAddress: string,
|
||||
): Promise<StakingContract> {
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
schemas.addressSchema,
|
||||
@ -200,15 +198,7 @@ export class StakingContract extends BaseContract {
|
||||
logDecodeDependenciesAbiOnly[key] = logDecodeDependencies[key].compilerOutput.abi;
|
||||
}
|
||||
}
|
||||
return StakingContract.deployAsync(
|
||||
bytecode,
|
||||
abi,
|
||||
provider,
|
||||
txDefaults,
|
||||
logDecodeDependenciesAbiOnly,
|
||||
wethAddress,
|
||||
zrxVaultAddress,
|
||||
);
|
||||
return StakingContract.deployAsync(bytecode, abi, provider, txDefaults, logDecodeDependenciesAbiOnly);
|
||||
}
|
||||
public static async deployAsync(
|
||||
bytecode: string,
|
||||
@ -216,8 +206,6 @@ export class StakingContract extends BaseContract {
|
||||
supportedProvider: SupportedProvider,
|
||||
txDefaults: Partial<TxData>,
|
||||
logDecodeDependencies: { [contractName: string]: ContractAbi },
|
||||
wethAddress: string,
|
||||
zrxVaultAddress: string,
|
||||
): Promise<StakingContract> {
|
||||
assert.isHexString('bytecode', bytecode);
|
||||
assert.doesConformToSchema('txDefaults', txDefaults, schemas.txDataSchema, [
|
||||
@ -227,14 +215,10 @@ export class StakingContract extends BaseContract {
|
||||
]);
|
||||
const provider = providerUtils.standardizeOrThrow(supportedProvider);
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[wethAddress, zrxVaultAddress] = BaseContract._formatABIDataItemList(
|
||||
constructorAbi.inputs,
|
||||
[wethAddress, zrxVaultAddress],
|
||||
BaseContract._bigNumberToString,
|
||||
);
|
||||
[] = BaseContract._formatABIDataItemList(constructorAbi.inputs, [], BaseContract._bigNumberToString);
|
||||
const iface = new ethers.utils.Interface(abi);
|
||||
const deployInfo = iface.deployFunction;
|
||||
const txData = deployInfo.encode(bytecode, [wethAddress, zrxVaultAddress]);
|
||||
const txData = deployInfo.encode(bytecode, []);
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToContractTxDataAsync(
|
||||
{
|
||||
@ -253,7 +237,7 @@ export class StakingContract extends BaseContract {
|
||||
txDefaults,
|
||||
logDecodeDependencies,
|
||||
);
|
||||
contractInstance.constructorArgs = [wethAddress, zrxVaultAddress];
|
||||
contractInstance.constructorArgs = [];
|
||||
return contractInstance;
|
||||
}
|
||||
|
||||
@ -262,22 +246,6 @@ export class StakingContract extends BaseContract {
|
||||
*/
|
||||
public static ABI(): ContractAbi {
|
||||
const abi = [
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
name: 'wethAddress',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'zrxVaultAddress',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
outputs: [],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'constructor',
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
@ -2480,7 +2448,8 @@ export class StakingContract extends BaseContract {
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Returns the current weth contract address
|
||||
* An overridable way to access the deployed WETH contract.
|
||||
* Must be view to allow overrides to access state.
|
||||
* @returns wethContract The WETH contract instance.
|
||||
*/
|
||||
public getWethContract(): ContractFunctionObj<string> {
|
||||
@ -2503,7 +2472,8 @@ export class StakingContract extends BaseContract {
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Returns the current zrxVault address.
|
||||
* An overridable way to access the deployed zrxVault.
|
||||
* Must be view to allow overrides to access state.
|
||||
* @returns zrxVault The zrxVault contract.
|
||||
*/
|
||||
public getZrxVault(): ContractFunctionObj<string> {
|
||||
@ -2667,9 +2637,9 @@ export class StakingContract extends BaseContract {
|
||||
* Moves stake between statuses: 'undelegated' or 'delegated'.
|
||||
* Delegated stake can also be moved between pools.
|
||||
* This change comes into effect next epoch.
|
||||
* @param from status to move stake out of.
|
||||
* @param to status to move stake into.
|
||||
* @param amount of stake to move.
|
||||
* @param from Status to move stake out of.
|
||||
* @param to Status to move stake into.
|
||||
* @param amount Amount of stake to move.
|
||||
*/
|
||||
public moveStake(
|
||||
from: { status: number | BigNumber; poolId: string },
|
||||
@ -3120,7 +3090,7 @@ export class StakingContract extends BaseContract {
|
||||
/**
|
||||
* Stake ZRX tokens. Tokens are deposited into the ZRX Vault.
|
||||
* Unstake to retrieve the ZRX. Stake is in the 'Active' status.
|
||||
* @param amount of ZRX to stake.
|
||||
* @param amount Amount of ZRX to stake.
|
||||
*/
|
||||
public stake(amount: BigNumber): ContractTxFunctionObj<void> {
|
||||
const self = (this as any) as StakingContract;
|
||||
@ -3187,6 +3157,10 @@ export class StakingContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Change the owner of this contract.
|
||||
* @param newOwner New owner address.
|
||||
*/
|
||||
public transferOwnership(newOwner: string): ContractTxFunctionObj<void> {
|
||||
const self = (this as any) as StakingContract;
|
||||
assert.isString('newOwner', newOwner);
|
||||
@ -3237,7 +3211,7 @@ export class StakingContract extends BaseContract {
|
||||
* Unstake. Tokens are withdrawn from the ZRX Vault and returned to
|
||||
* the staker. Stake must be in the 'undelegated' status in both the
|
||||
* current and next epoch in order to be unstaked.
|
||||
* @param amount of ZRX to unstake.
|
||||
* @param amount Amount of ZRX to unstake.
|
||||
*/
|
||||
public unstake(amount: BigNumber): ContractTxFunctionObj<void> {
|
||||
const self = (this as any) as StakingContract;
|
||||
|
@ -1399,6 +1399,10 @@ export class StakingProxyContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Change the owner of this contract.
|
||||
* @param newOwner New owner address.
|
||||
*/
|
||||
public transferOwnership(newOwner: string): ContractTxFunctionObj<void> {
|
||||
const self = (this as any) as StakingProxyContract;
|
||||
assert.isString('newOwner', newOwner);
|
||||
|
@ -36,14 +36,14 @@ import * as ethers from 'ethers';
|
||||
|
||||
export type WETH9EventArgs =
|
||||
| WETH9ApprovalEventArgs
|
||||
| WETH9TransferEventArgs
|
||||
| WETH9DepositEventArgs
|
||||
| WETH9TransferEventArgs
|
||||
| WETH9WithdrawalEventArgs;
|
||||
|
||||
export enum WETH9Events {
|
||||
Approval = 'Approval',
|
||||
Transfer = 'Transfer',
|
||||
Deposit = 'Deposit',
|
||||
Transfer = 'Transfer',
|
||||
Withdrawal = 'Withdrawal',
|
||||
}
|
||||
|
||||
@ -53,14 +53,14 @@ export interface WETH9ApprovalEventArgs extends DecodedLogArgs {
|
||||
_value: BigNumber;
|
||||
}
|
||||
|
||||
export interface WETH9TransferEventArgs extends DecodedLogArgs {
|
||||
_from: string;
|
||||
_to: string;
|
||||
export interface WETH9DepositEventArgs extends DecodedLogArgs {
|
||||
_owner: string;
|
||||
_value: BigNumber;
|
||||
}
|
||||
|
||||
export interface WETH9DepositEventArgs extends DecodedLogArgs {
|
||||
_owner: string;
|
||||
export interface WETH9TransferEventArgs extends DecodedLogArgs {
|
||||
_from: string;
|
||||
_to: string;
|
||||
_value: BigNumber;
|
||||
}
|
||||
|
||||
@ -152,13 +152,111 @@ export class WETH9Contract extends BaseContract {
|
||||
public static ABI(): ContractAbi {
|
||||
const abi = [
|
||||
{
|
||||
constant: true,
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
name: '_owner',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_spender',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_value',
|
||||
type: 'uint256',
|
||||
indexed: false,
|
||||
},
|
||||
],
|
||||
name: 'Approval',
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
name: '_owner',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_value',
|
||||
type: 'uint256',
|
||||
indexed: false,
|
||||
},
|
||||
],
|
||||
name: 'Deposit',
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
name: '_from',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_to',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_value',
|
||||
type: 'uint256',
|
||||
indexed: false,
|
||||
},
|
||||
],
|
||||
name: 'Transfer',
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
name: '_owner',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_value',
|
||||
type: 'uint256',
|
||||
indexed: false,
|
||||
},
|
||||
],
|
||||
name: 'Withdrawal',
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: 'name',
|
||||
outputs: [],
|
||||
payable: true,
|
||||
stateMutability: 'payable',
|
||||
type: 'fallback',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [
|
||||
{
|
||||
name: 'index_0',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'index_1',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'allowance',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'string',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
@ -188,6 +286,76 @@ export class WETH9Contract extends BaseContract {
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [
|
||||
{
|
||||
name: 'index_0',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'balanceOf',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'decimals',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'uint8',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [],
|
||||
name: 'deposit',
|
||||
outputs: [],
|
||||
payable: true,
|
||||
stateMutability: 'payable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'name',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'string',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'symbol',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'string',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
@ -202,6 +370,29 @@ export class WETH9Contract extends BaseContract {
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'dst',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'wad',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
name: 'transfer',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'bool',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
@ -243,197 +434,6 @@ export class WETH9Contract extends BaseContract {
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'decimals',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'uint8',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [
|
||||
{
|
||||
name: 'index_0',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'balanceOf',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [],
|
||||
name: 'symbol',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'string',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [
|
||||
{
|
||||
name: 'dst',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'wad',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
name: 'transfer',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'bool',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'nonpayable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: false,
|
||||
inputs: [],
|
||||
name: 'deposit',
|
||||
outputs: [],
|
||||
payable: true,
|
||||
stateMutability: 'payable',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
constant: true,
|
||||
inputs: [
|
||||
{
|
||||
name: 'index_0',
|
||||
type: 'address',
|
||||
},
|
||||
{
|
||||
name: 'index_1',
|
||||
type: 'address',
|
||||
},
|
||||
],
|
||||
name: 'allowance',
|
||||
outputs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'uint256',
|
||||
},
|
||||
],
|
||||
payable: false,
|
||||
stateMutability: 'view',
|
||||
type: 'function',
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
outputs: [],
|
||||
payable: true,
|
||||
stateMutability: 'payable',
|
||||
type: 'fallback',
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
name: '_owner',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_spender',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_value',
|
||||
type: 'uint256',
|
||||
indexed: false,
|
||||
},
|
||||
],
|
||||
name: 'Approval',
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
name: '_from',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_to',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_value',
|
||||
type: 'uint256',
|
||||
indexed: false,
|
||||
},
|
||||
],
|
||||
name: 'Transfer',
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
name: '_owner',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_value',
|
||||
type: 'uint256',
|
||||
indexed: false,
|
||||
},
|
||||
],
|
||||
name: 'Deposit',
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
name: '_owner',
|
||||
type: 'address',
|
||||
indexed: true,
|
||||
},
|
||||
{
|
||||
name: '_value',
|
||||
type: 'uint256',
|
||||
indexed: false,
|
||||
},
|
||||
],
|
||||
name: 'Withdrawal',
|
||||
outputs: [],
|
||||
type: 'event',
|
||||
},
|
||||
] as ContractAbi;
|
||||
return abi;
|
||||
}
|
||||
@ -465,22 +465,24 @@ export class WETH9Contract extends BaseContract {
|
||||
return abiEncoder.getSelector();
|
||||
}
|
||||
|
||||
public name(): ContractFunctionObj<string> {
|
||||
public allowance(index_0: string, index_1: string): ContractFunctionObj<BigNumber> {
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const functionSignature = 'name()';
|
||||
assert.isString('index_0', index_0);
|
||||
assert.isString('index_1', index_1);
|
||||
const functionSignature = 'allowance(address,address)';
|
||||
|
||||
return {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
return abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, []);
|
||||
return self._strictEncodeArguments(functionSignature, [index_0.toLowerCase(), index_1.toLowerCase()]);
|
||||
},
|
||||
};
|
||||
}
|
||||
@ -531,6 +533,128 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
};
|
||||
}
|
||||
public balanceOf(index_0: string): ContractFunctionObj<BigNumber> {
|
||||
const self = (this as any) as WETH9Contract;
|
||||
assert.isString('index_0', index_0);
|
||||
const functionSignature = 'balanceOf(address)';
|
||||
|
||||
return {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, [index_0.toLowerCase()]);
|
||||
},
|
||||
};
|
||||
}
|
||||
public decimals(): ContractFunctionObj<number> {
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const functionSignature = 'decimals()';
|
||||
|
||||
return {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<number> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<number>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, []);
|
||||
},
|
||||
};
|
||||
}
|
||||
public deposit(): ContractTxFunctionObj<void> {
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const functionSignature = 'deposit()';
|
||||
|
||||
return {
|
||||
async sendTransactionAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
opts: SendTransactionOpts = { shouldValidate: true },
|
||||
): Promise<string> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(
|
||||
{ ...txData, data: this.getABIEncodedTransactionData() },
|
||||
this.estimateGasAsync.bind(this),
|
||||
);
|
||||
if (opts.shouldValidate !== false) {
|
||||
await this.callAsync(txDataWithDefaults);
|
||||
}
|
||||
return self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
txData?: Partial<TxData>,
|
||||
opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
return self._promiseWithTransactionHash(this.sendTransactionAsync(txData, opts), opts);
|
||||
},
|
||||
async estimateGasAsync(txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
...txData,
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, []);
|
||||
},
|
||||
};
|
||||
}
|
||||
public name(): ContractFunctionObj<string> {
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const functionSignature = 'name()';
|
||||
|
||||
return {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, []);
|
||||
},
|
||||
};
|
||||
}
|
||||
public symbol(): ContractFunctionObj<string> {
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const functionSignature = 'symbol()';
|
||||
|
||||
return {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, []);
|
||||
},
|
||||
};
|
||||
}
|
||||
public totalSupply(): ContractFunctionObj<BigNumber> {
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const functionSignature = 'totalSupply()';
|
||||
@ -550,6 +674,53 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
};
|
||||
}
|
||||
public transfer(dst: string, wad: BigNumber): ContractTxFunctionObj<boolean> {
|
||||
const self = (this as any) as WETH9Contract;
|
||||
assert.isString('dst', dst);
|
||||
assert.isBigNumber('wad', wad);
|
||||
const functionSignature = 'transfer(address,uint256)';
|
||||
|
||||
return {
|
||||
async sendTransactionAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
opts: SendTransactionOpts = { shouldValidate: true },
|
||||
): Promise<string> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(
|
||||
{ ...txData, data: this.getABIEncodedTransactionData() },
|
||||
this.estimateGasAsync.bind(this),
|
||||
);
|
||||
if (opts.shouldValidate !== false) {
|
||||
await this.callAsync(txDataWithDefaults);
|
||||
}
|
||||
return self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
txData?: Partial<TxData>,
|
||||
opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
return self._promiseWithTransactionHash(this.sendTransactionAsync(txData, opts), opts);
|
||||
},
|
||||
async estimateGasAsync(txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
...txData,
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<boolean> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, [dst.toLowerCase(), wad]);
|
||||
},
|
||||
};
|
||||
}
|
||||
public transferFrom(src: string, dst: string, wad: BigNumber): ContractTxFunctionObj<boolean> {
|
||||
const self = (this as any) as WETH9Contract;
|
||||
assert.isString('src', src);
|
||||
@ -644,177 +815,6 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
};
|
||||
}
|
||||
public decimals(): ContractFunctionObj<number> {
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const functionSignature = 'decimals()';
|
||||
|
||||
return {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<number> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<number>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, []);
|
||||
},
|
||||
};
|
||||
}
|
||||
public balanceOf(index_0: string): ContractFunctionObj<BigNumber> {
|
||||
const self = (this as any) as WETH9Contract;
|
||||
assert.isString('index_0', index_0);
|
||||
const functionSignature = 'balanceOf(address)';
|
||||
|
||||
return {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, [index_0.toLowerCase()]);
|
||||
},
|
||||
};
|
||||
}
|
||||
public symbol(): ContractFunctionObj<string> {
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const functionSignature = 'symbol()';
|
||||
|
||||
return {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<string> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<string>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, []);
|
||||
},
|
||||
};
|
||||
}
|
||||
public transfer(dst: string, wad: BigNumber): ContractTxFunctionObj<boolean> {
|
||||
const self = (this as any) as WETH9Contract;
|
||||
assert.isString('dst', dst);
|
||||
assert.isBigNumber('wad', wad);
|
||||
const functionSignature = 'transfer(address,uint256)';
|
||||
|
||||
return {
|
||||
async sendTransactionAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
opts: SendTransactionOpts = { shouldValidate: true },
|
||||
): Promise<string> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(
|
||||
{ ...txData, data: this.getABIEncodedTransactionData() },
|
||||
this.estimateGasAsync.bind(this),
|
||||
);
|
||||
if (opts.shouldValidate !== false) {
|
||||
await this.callAsync(txDataWithDefaults);
|
||||
}
|
||||
return self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
txData?: Partial<TxData>,
|
||||
opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
return self._promiseWithTransactionHash(this.sendTransactionAsync(txData, opts), opts);
|
||||
},
|
||||
async estimateGasAsync(txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
...txData,
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<boolean> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<boolean>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, [dst.toLowerCase(), wad]);
|
||||
},
|
||||
};
|
||||
}
|
||||
public deposit(): ContractTxFunctionObj<void> {
|
||||
const self = (this as any) as WETH9Contract;
|
||||
const functionSignature = 'deposit()';
|
||||
|
||||
return {
|
||||
async sendTransactionAsync(
|
||||
txData?: Partial<TxData> | undefined,
|
||||
opts: SendTransactionOpts = { shouldValidate: true },
|
||||
): Promise<string> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(
|
||||
{ ...txData, data: this.getABIEncodedTransactionData() },
|
||||
this.estimateGasAsync.bind(this),
|
||||
);
|
||||
if (opts.shouldValidate !== false) {
|
||||
await this.callAsync(txDataWithDefaults);
|
||||
}
|
||||
return self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
|
||||
},
|
||||
awaitTransactionSuccessAsync(
|
||||
txData?: Partial<TxData>,
|
||||
opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
|
||||
): PromiseWithTransactionHash<TransactionReceiptWithDecodedLogs> {
|
||||
return self._promiseWithTransactionHash(this.sendTransactionAsync(txData, opts), opts);
|
||||
},
|
||||
async estimateGasAsync(txData?: Partial<TxData> | undefined): Promise<number> {
|
||||
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync({
|
||||
...txData,
|
||||
data: this.getABIEncodedTransactionData(),
|
||||
});
|
||||
return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);
|
||||
},
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<void> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<void>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, []);
|
||||
},
|
||||
};
|
||||
}
|
||||
public allowance(index_0: string, index_1: string): ContractFunctionObj<BigNumber> {
|
||||
const self = (this as any) as WETH9Contract;
|
||||
assert.isString('index_0', index_0);
|
||||
assert.isString('index_1', index_1);
|
||||
const functionSignature = 'allowance(address,address)';
|
||||
|
||||
return {
|
||||
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber> {
|
||||
BaseContract._assertCallParams(callData, defaultBlock);
|
||||
const rawCallResult = await self._performCallAsync(
|
||||
{ ...callData, data: this.getABIEncodedTransactionData() },
|
||||
defaultBlock,
|
||||
);
|
||||
const abiEncoder = self._lookupAbiEncoder(functionSignature);
|
||||
return abiEncoder.strictDecodeReturnValue<BigNumber>(rawCallResult);
|
||||
},
|
||||
getABIEncodedTransactionData(): string {
|
||||
return self._strictEncodeArguments(functionSignature, [index_0.toLowerCase(), index_1.toLowerCase()]);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to an event type emitted by the WETH9 contract.
|
||||
|
@ -27,6 +27,7 @@ export {
|
||||
ExchangeCancelUpToEventArgs,
|
||||
ExchangeAssetProxyRegisteredEventArgs,
|
||||
ExchangeContract,
|
||||
ExchangeOwnershipTransferredEventArgs,
|
||||
ExchangeProtocolFeeCollectorAddressEventArgs,
|
||||
ExchangeProtocolFeeMultiplierEventArgs,
|
||||
ExchangeTransactionExecutionEventArgs,
|
||||
|
@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"version": "3.1.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Set default `hardfork` option for ganache provider to `\"istanbul\"`",
|
||||
"pr": 2432
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.1.0",
|
||||
"changes": [
|
||||
|
@ -25,7 +25,7 @@ export interface Web3Config {
|
||||
blockTime?: number;
|
||||
locked?: boolean;
|
||||
unlocked_accounts?: string[];
|
||||
hardfork?: string;
|
||||
hardfork?: string; // default: istanbul
|
||||
}
|
||||
|
||||
export const web3Factory = {
|
||||
@ -82,7 +82,7 @@ export const web3Factory = {
|
||||
blockTime: config.blockTime,
|
||||
locked: config.locked,
|
||||
unlocked_accounts: config.unlocked_accounts,
|
||||
hardfork: config.hardfork,
|
||||
hardfork: config.hardfork || 'istanbul',
|
||||
} as any), // TODO remove any once types are merged in DefinitelyTyped
|
||||
);
|
||||
} else {
|
||||
|
@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"version": "6.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Update Forwarder deployment",
|
||||
"pr": 2432
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "5.1.0",
|
||||
"changes": [
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ContractAddresses } from '@0x/contract-addresses';
|
||||
import { ContractAddresses, getContractAddressesForChainOrThrow } from '@0x/contract-addresses';
|
||||
import * as artifacts from '@0x/contract-artifacts';
|
||||
import { ForwarderContract } from '@0x/contract-wrappers';
|
||||
import {
|
||||
@ -15,7 +15,12 @@ import { ERC1155MintableContract } from '@0x/contracts-erc1155';
|
||||
import { DummyERC20TokenContract, WETH9Contract } from '@0x/contracts-erc20';
|
||||
import { DummyERC721TokenContract } from '@0x/contracts-erc721';
|
||||
import { ExchangeContract } from '@0x/contracts-exchange';
|
||||
import { StakingProxyContract, TestStakingContract, ZrxVaultContract } from '@0x/contracts-staking';
|
||||
import {
|
||||
artifacts as stakingArtifacts,
|
||||
StakingProxyContract,
|
||||
TestStakingContract,
|
||||
ZrxVaultContract,
|
||||
} from '@0x/contracts-staking';
|
||||
import { Web3ProviderEngine } from '@0x/subproviders';
|
||||
import { BigNumber, providerUtils } from '@0x/utils';
|
||||
import { SupportedProvider, TxData } from 'ethereum-types';
|
||||
@ -204,7 +209,7 @@ export async function runMigrationsAsync(
|
||||
// Note we use TestStakingContract as the deployed bytecode of a StakingContract
|
||||
// has the tokens hardcoded
|
||||
const stakingLogic = await TestStakingContract.deployFrom0xArtifactAsync(
|
||||
artifacts.Staking,
|
||||
stakingArtifacts.TestStaking,
|
||||
provider,
|
||||
txDefaults,
|
||||
{},
|
||||
@ -237,12 +242,14 @@ export async function runMigrationsAsync(
|
||||
// Forwarder
|
||||
// Deployed after Exchange and Staking is configured as it queries
|
||||
// in the constructor
|
||||
const { exchangeV2: exchangeV2Address } = getContractAddressesForChainOrThrow(chainId.toNumber());
|
||||
const forwarder = await ForwarderContract.deployFrom0xArtifactAsync(
|
||||
artifacts.Forwarder,
|
||||
provider,
|
||||
txDefaults,
|
||||
artifacts,
|
||||
exchange.address,
|
||||
exchangeV2Address || constants.NULL_ADDRESS,
|
||||
etherToken.address,
|
||||
);
|
||||
|
||||
@ -257,12 +264,14 @@ export async function runMigrationsAsync(
|
||||
erc20BridgeProxy: erc20BridgeProxy.address,
|
||||
zeroExGovernor: constants.NULL_ADDRESS,
|
||||
forwarder: forwarder.address,
|
||||
orderValidator: constants.NULL_ADDRESS,
|
||||
dutchAuction: constants.NULL_ADDRESS,
|
||||
coordinatorRegistry: coordinatorRegistry.address,
|
||||
coordinator: coordinator.address,
|
||||
multiAssetProxy: multiAssetProxy.address,
|
||||
staticCallProxy: staticCallProxy.address,
|
||||
devUtils: devUtils.address,
|
||||
exchangeV2: exchange.address,
|
||||
exchangeV2: exchangeV2Address || constants.NULL_ADDRESS,
|
||||
zrxVault: zrxVault.address,
|
||||
staking: stakingLogic.address,
|
||||
stakingProxy: stakingProxy.address,
|
||||
|
Loading…
x
Reference in New Issue
Block a user