aboutsummaryrefslogtreecommitdiffstats
path: root/packages/deployer/src
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-05-07 19:57:03 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-05-07 19:57:03 +0800
commit2d30183d658c9d178544e1c14fb779306e5d2778 (patch)
treeca12663ec8cf6ed879c43c7c6f09305ca8214a44 /packages/deployer/src
parentfcb0a05880f6217f5b5942ec419fcf4df490551d (diff)
downloaddexon-sol-tools-2d30183d658c9d178544e1c14fb779306e5d2778.tar.gz
dexon-sol-tools-2d30183d658c9d178544e1c14fb779306e5d2778.tar.zst
dexon-sol-tools-2d30183d658c9d178544e1c14fb779306e5d2778.zip
CHeck if ABI exists
Diffstat (limited to 'packages/deployer/src')
-rw-r--r--packages/deployer/src/deployer.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/deployer/src/deployer.ts b/packages/deployer/src/deployer.ts
index fe959e405..c8c3a9a06 100644
--- a/packages/deployer/src/deployer.ts
+++ b/packages/deployer/src/deployer.ts
@@ -82,6 +82,9 @@ export class Deployer {
data,
gas,
};
+ if (_.isUndefined(compilerOutput.abi)) {
+ throw new Error(`ABI not found in ${contractName} artifacts`);
+ }
const abi = compilerOutput.abi;
const constructorAbi = _.find(abi, { type: AbiType.Constructor }) as ConstructorAbi;
const constructorArgs = _.isUndefined(constructorAbi) ? [] : constructorAbi.inputs;
@@ -151,6 +154,9 @@ export class Deployer {
): Promise<void> {
const contractArtifactIfExists: ContractArtifact = this._loadContractArtifactIfExists(contractName);
const compilerOutput = Deployer._getContractCompilerOutputFromArtifactIfExists(contractArtifactIfExists);
+ if (_.isUndefined(compilerOutput.abi)) {
+ throw new Error(`ABI not found in ${contractName} artifacts`);
+ }
const abi = compilerOutput.abi;
const encodedConstructorArgs = encoder.encodeConstructorArgsFromAbi(args, abi);
const newContractData: ContractNetworkData = {