diff --git a/src/rln_contract.ts b/src/rln_contract.ts index 58091e9..798f370 100644 --- a/src/rln_contract.ts +++ b/src/rln_contract.ts @@ -1,3 +1,4 @@ +import { hexToBytes } from "@waku/utils/bytes"; import { ethers } from "ethers"; import { RLN_REGISTRY_ABI, RLN_STORAGE_ABI } from "./constants.js"; @@ -169,15 +170,11 @@ export class RLNContract { return; } - const idCommitment = ethers.utils.zeroPad( - ethers.utils.arrayify(_idCommitment), - 32 - ); + const idCommitment = hexToBytes(_idCommitment?._hex); rlnInstance.insertMember(idCommitment); this._members.set(index.toNumber(), { index, - idCommitment: - _idCommitment?._hex || ethers.utils.hexlify(idCommitment), + idCommitment: _idCommitment?._hex, }); });