aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract_templates/contract.handlebars
diff options
context:
space:
mode:
Diffstat (limited to 'packages/contract_templates/contract.handlebars')
-rw-r--r--packages/contract_templates/contract.handlebars14
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/contract_templates/contract.handlebars b/packages/contract_templates/contract.handlebars
index 1fa9508f5..ed11ac8d2 100644
--- a/packages/contract_templates/contract.handlebars
+++ b/packages/contract_templates/contract.handlebars
@@ -43,7 +43,7 @@ export class {{contractName}}Contract extends BaseContract {
public static async deployFrom0xArtifactAsync(
artifact: ContractArtifact,
provider: Provider,
- defaults: Partial<TxData>,
+ txDefaults: Partial<TxData>,
{{> typed_params inputs=ctor.inputs}}
): Promise<{{contractName}}Contract> {
if (_.isUndefined(artifact.compilerOutput)) {
@@ -51,13 +51,13 @@ export class {{contractName}}Contract extends BaseContract {
}
const bytecode = artifact.compilerOutput.evm.bytecode.object;
const abi = artifact.compilerOutput.abi;
- return {{contractName}}Contract.deployAsync(bytecode, abi, provider, defaults, {{> params inputs=ctor.inputs}});
+ return {{contractName}}Contract.deployAsync(bytecode, abi, provider, txDefaults, {{> params inputs=ctor.inputs}});
}
public static async deployAsync(
bytecode: string,
abi: ContractAbi,
provider: Provider,
- defaults: Partial<TxData>,
+ txDefaults: Partial<TxData>,
{{> typed_params inputs=ctor.inputs}}
): Promise<{{contractName}}Contract> {
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
@@ -70,19 +70,19 @@ export class {{contractName}}Contract extends BaseContract {
const web3Wrapper = new Web3Wrapper(provider);
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
txData,
- defaults,
+ txDefaults,
web3Wrapper.estimateGasAsync.bind(web3Wrapper),
);
const txHash = await web3Wrapper.sendTransactionAsync(txDataWithDefaults);
logUtils.log(`transactionHash: ${txHash}`);
const txReceipt = await web3Wrapper.awaitTransactionMinedAsync(txHash);
logUtils.log(`{{contractName}} successfully deployed at ${txReceipt.contractAddress}`);
- const contractInstance = new {{contractName}}Contract(abi, txReceipt.contractAddress as string, provider, defaults);
+ const contractInstance = new {{contractName}}Contract(abi, txReceipt.contractAddress as string, provider, txDefaults);
contractInstance.constructorArgs = [{{> params inputs=ctor.inputs}}];
return contractInstance;
}
- constructor(abi: ContractAbi, address: string, provider: Provider, defaults?: Partial<TxData>) {
- super("{{contractName}}", abi, address, provider, defaults);
+ constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
+ super("{{contractName}}", abi, address, provider, txDefaults);
classUtils.bindAll(this, ['_ethersInterfacesByFunctionSignature', 'address', 'abi', '_web3Wrapper']);
}
} // tslint:disable:max-file-line-count