Skip to content

Commit

Permalink
Fix undefined constructor params length when constructor doesn't have…
Browse files Browse the repository at this point in the history
… any parameters. (#67)
  • Loading branch information
saeed-zil authored Sep 9, 2024
1 parent 63c9cf5 commit 50940d4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/deployer/ScillaContractDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,9 @@ export async function deploy(
}

let txParamsForContractDeployment = {};
if (
contractInfo.parsedContract.constructorParams &&
args.length === contractInfo.parsedContract.constructorParams.length + 1
) {
const constructorParamsLength =
contractInfo.parsedContract.constructorParams?.length || 0;
if (args.length === constructorParamsLength + 1) {
// The last param is Tx info such as amount, nonce, gasPrice
txParamsForContractDeployment = args.pop();
}
Expand Down

0 comments on commit 50940d4

Please sign in to comment.