aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract_templates/contract.handlebars
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-05-10 21:09:33 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-05-10 23:47:38 +0800
commita5fea3b9c3a004b5e2740a9a2d70eb3170aa6b73 (patch)
tree0bc81855dbad08379146f5d4046d43fe6b3284ab /packages/contract_templates/contract.handlebars
parent62f1430a2c53cb983c28f156bd0dd6409821ad5a (diff)
downloaddexon-sol-tools-a5fea3b9c3a004b5e2740a9a2d70eb3170aa6b73.tar
dexon-sol-tools-a5fea3b9c3a004b5e2740a9a2d70eb3170aa6b73.tar.gz
dexon-sol-tools-a5fea3b9c3a004b5e2740a9a2d70eb3170aa6b73.tar.bz2
dexon-sol-tools-a5fea3b9c3a004b5e2740a9a2d70eb3170aa6b73.tar.lz
dexon-sol-tools-a5fea3b9c3a004b5e2740a9a2d70eb3170aa6b73.tar.xz
dexon-sol-tools-a5fea3b9c3a004b5e2740a9a2d70eb3170aa6b73.tar.zst
dexon-sol-tools-a5fea3b9c3a004b5e2740a9a2d70eb3170aa6b73.zip
Add a check for compiler output
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}});