diff --git a/src/boilerplate/contract/solidity/raw/ContractBoilerplateGenerator.ts b/src/boilerplate/contract/solidity/raw/ContractBoilerplateGenerator.ts index 4b9637e5..911c7dbf 100644 --- a/src/boilerplate/contract/solidity/raw/ContractBoilerplateGenerator.ts +++ b/src/boilerplate/contract/solidity/raw/ContractBoilerplateGenerator.ts @@ -218,7 +218,7 @@ class ContractBoilerplateGenerator { 'customInputs.length', ...(newNullifiers ? ['newNullifiers.length'] : []), ...(checkNullifiers ? ['checkNullifiers.length']: []), - ...(commitmentRoot ? ['(newNullifiers.length > 0 ? 1 : 0)'] : []), // If there are new nullifiers then we need the nullier root, the latest nullifier root and the commitment root, but if the nullifier root is included but not the latest nullifier root (i.e. there is an accessed only state variable) then we only need 2 inputs. + ...(commitmentRoot ? ['(newNullifiers.length > 0 ? 1 : 0)'] : []), ...(newCommitments ? ['newCommitments.length'] : []), ...(encryptionRequired ? ['encInputsLen'] : []), ].join(' + ')});`, diff --git a/src/boilerplate/orchestration/javascript/raw/toOrchestration.ts b/src/boilerplate/orchestration/javascript/raw/toOrchestration.ts index 18a5350f..2340578d 100644 --- a/src/boilerplate/orchestration/javascript/raw/toOrchestration.ts +++ b/src/boilerplate/orchestration/javascript/raw/toOrchestration.ts @@ -909,7 +909,7 @@ export const OrchestrationCodeBoilerPlate: any = (node: any) => { // params[3] = arr of commitments (params[0][0][0]) ? params[0][0] = ` [${params[0][0]}],` : params[0][0] = ` [], `; // nullifiers - array (params[0][1][0]) ? params[0][1] = ` ${params[0][1][0]}, ` : params[0][1] = ` 0, `; // commitmentRoot - (params[0][2][0]) ? params[0][2] = ` [${params[0][2][0]}],` : params[0][2] = ` [] , ` ; // commitment -array + (params[0][2][0]) ? params[0][2] = ` [${params[0][2]}],` : params[0][2] = ` [] , ` ; // commitment -array (params[0][3][0]) ? params[0][3] = `[${params[0][3]}],` : params[0][3] = ` [], `; // accessed nullifiers -array (params[0][4][0]) ? params[0][4] = `[${params[0][4]}],` : params[0][4] = ` [], `; // cipherText - array of arrays (params[0][5][0]) ? params[0][5] = `[${params[0][5]}],`: params[0][5] = ` [], `;// cipherText - array of arrays