Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public withdraw(wad: BigNumber): ContractTxFunctionObj {
const self = (this as any) as AbiGenDummyContract;
assert.isBigNumber('wad', wad);
const functionSignature = 'withdraw(uint256)';
return {
async sendTransactionAsync(
txData?: Partial | undefined,
opts: SendTransactionOpts = { shouldValidate: true },
): Promise {
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);
},
public withAddressInput(
x: string,
a: BigNumber,
b: BigNumber,
y: string,
c: BigNumber,
): ContractFunctionObj {
const self = (this as any) as AbiGenDummyContract;
assert.isString('x', x);
assert.isBigNumber('a', a);
assert.isBigNumber('b', b);
assert.isString('y', y);
assert.isBigNumber('c', c);
const functionSignature = 'withAddressInput(address,uint256,uint256,address,uint256)';
return {
async callAsync(callData: Partial = {}, defaultBlock?: BlockParam): Promise {
BaseContract._assertCallParams(callData, defaultBlock);
const rawCallResult = await self._evmExecAsync(this.getABIEncodedTransactionData());
const abiEncoder = self._lookupAbiEncoder(functionSignature);
return abiEncoder.strictDecodeReturnValue(rawCallResult);
},
getABIEncodedTransactionData(): string {
return self._strictEncodeArguments(functionSignature, [x.toLowerCase(), a, b, y.toLowerCase(), c]);
},
};
}
public withdraw(wad: BigNumber): ContractTxFunctionObj {
public maxIndex(index_0: BigNumber): ContractFunctionObj {
const self = (this as any) as ERC1155MintableContract;
assert.isBigNumber('index_0', index_0);
const functionSignature = 'maxIndex(uint256)';
return {
async callAsync(callData: Partial = {}, defaultBlock?: BlockParam): Promise {
BaseContract._assertCallParams(callData, defaultBlock);
const rawCallResult = await self._performCallAsync(
{ ...callData, data: this.getABIEncodedTransactionData() },
defaultBlock,
);
const abiEncoder = self._lookupAbiEncoder(functionSignature);
return abiEncoder.strictDecodeReturnValue(rawCallResult);
},
getABIEncodedTransactionData(): string {
return self._strictEncodeArguments(functionSignature, [index_0]);
},
};
public approve(_approved: string, _tokenId: BigNumber): ContractTxFunctionObj {
const self = (this as any) as DummyERC721TokenContract;
assert.isString('_approved', _approved);
assert.isBigNumber('_tokenId', _tokenId);
const functionSignature = 'approve(address,uint256)';
return {
async sendTransactionAsync(
txData?: Partial | undefined,
opts: SendTransactionOpts = { shouldValidate: true },
): Promise {
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);
},
getABIEncodedTransactionData(assetData: string, from: string, to: string, amount: BigNumber): string {
assert.isString('assetData', assetData);
assert.isString('from', from);
assert.isString('to', to);
assert.isBigNumber('amount', amount);
const self = (this as any) as ERC1155ProxyContract;
const abiEncodedTransactionData = self._strictEncodeArguments(
'transferFrom(bytes,address,address,uint256)',
[assetData, from.toLowerCase(), to.toLowerCase(), amount],
);
return abiEncodedTransactionData;
},
/**
async callAsync(
assetData: string,
from: string,
to: string,
amount: BigNumber,
callData: Partial = {},
defaultBlock?: BlockParam,
): Promise {
assert.isString('assetData', assetData);
assert.isString('from', from);
assert.isString('to', to);
assert.isBigNumber('amount', amount);
assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
schemas.addressSchema,
schemas.numberSchema,
schemas.jsNumber,
]);
if (defaultBlock !== undefined) {
assert.isBlockParam('defaultBlock', defaultBlock);
}
const self = (this as any) as StaticCallProxyContract;
const encodedData = self._strictEncodeArguments('transferFrom(bytes,address,address,uint256)', [
assetData,
from.toLowerCase(),
to.toLowerCase(),
amount,
]);
const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
public transferFrom(_from: string, _to: string, _value: BigNumber): ContractTxFunctionObj {
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 | undefined,
opts: SendTransactionOpts = { shouldValidate: true },
): Promise {
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);
},
isValidSwapQuote(variableName: string, swapQuote: SwapQuote): void {
sharedAssert.isHexString(`${variableName}.takerAssetData`, swapQuote.takerAssetData);
sharedAssert.isHexString(`${variableName}.makerAssetData`, swapQuote.makerAssetData);
sharedAssert.doesConformToSchema(`${variableName}.orders`, swapQuote.orders, schemas.signedOrdersSchema);
sharedAssert.doesConformToSchema(`${variableName}.feeOrders`, swapQuote.feeOrders, schemas.signedOrdersSchema);
assert.isValidSwapQuoteInfo(`${variableName}.bestCaseQuoteInfo`, swapQuote.bestCaseQuoteInfo);
assert.isValidSwapQuoteInfo(`${variableName}.worstCaseQuoteInfo`, swapQuote.worstCaseQuoteInfo);
if (utils.isSwapQuoteMarketBuy(swapQuote)) {
sharedAssert.isBigNumber(`${variableName}.makerAssetFillAmount`, swapQuote.makerAssetFillAmount);
} else if (utils.isSwapQuoteMarketSell(swapQuote)) {
sharedAssert.isBigNumber(`${variableName}.takerAssetFillAmount`, swapQuote.takerAssetFillAmount);
} else {
throw new Error(SwapQuoteConsumerError.InvalidMarketSellOrMarketBuySwapQuote);
}
},
isValidForwarderSwapQuote(variableName: string, swapQuote: SwapQuote, wethAssetData: string): void {
public aggregatedStatsByEpoch(
index_0: BigNumber,
): ContractFunctionObj<[BigNumber, BigNumber, BigNumber, BigNumber, BigNumber]> {
const self = (this as any) as StakingProxyContract;
assert.isBigNumber('index_0', index_0);
const functionSignature = 'aggregatedStatsByEpoch(uint256)';
return {
async callAsync(
callData: Partial = {},
defaultBlock?: BlockParam,
): Promise<[BigNumber, BigNumber, BigNumber, 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, BigNumber, BigNumber]>(
rawCallResult,
);
public safeTransferFrom(
from: string,
to: string,
id: BigNumber,
value: BigNumber,
data: string,
): ContractTxFunctionObj {
const self = (this as any) as ERC1155MintableContract;
assert.isString('from', from);
assert.isString('to', to);
assert.isBigNumber('id', id);
assert.isBigNumber('value', value);
assert.isString('data', data);
const functionSignature = 'safeTransferFrom(address,address,uint256,uint256,bytes)';
return {
async sendTransactionAsync(
txData?: Partial | undefined,
opts: SendTransactionOpts = { shouldValidate: true },
): Promise {
const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(
{ ...txData, data: this.getABIEncodedTransactionData() },
this.estimateGasAsync.bind(this),
);
if (opts.shouldValidate !== false) {
await this.callAsync(txDataWithDefaults);
}