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.handlebars3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/contract_templates/contract.handlebars b/packages/contract_templates/contract.handlebars
index 0f6151690..1fa9508f5 100644
--- a/packages/contract_templates/contract.handlebars
+++ b/packages/contract_templates/contract.handlebars
@@ -46,6 +46,9 @@ export class {{contractName}}Contract extends BaseContract {
defaults: Partial<TxData>,
{{> typed_params inputs=ctor.inputs}}
): Promise<{{contractName}}Contract> {
+ if (_.isUndefined(artifact.compilerOutput)) {
+ throw new Error('Compiler output not found in the artifact file');
+ }
const bytecode = artifact.compilerOutput.evm.bytecode.object;
const abi = artifact.compilerOutput.abi;
return {{contractName}}Contract.deployAsync(bytecode, abi, provider, defaults, {{> params inputs=ctor.inputs}});