diff --git a/packages/rln/src/contract/constants.ts b/packages/rln/src/contract/constants.ts index 636e4e16bc..a45a7b2b61 100644 --- a/packages/rln/src/contract/constants.ts +++ b/packages/rln/src/contract/constants.ts @@ -1,7 +1,7 @@ import { RLN_ABI } from "./abi.js"; export const LINEA_CONTRACT = { - chainId: 59141, + chainId: "59141", address: "0xb9cd878c90e49f797b4431fbf4fb333108cb90e6", abi: RLN_ABI }; diff --git a/packages/rln/src/contract/rln_contract.ts b/packages/rln/src/contract/rln_contract.ts index 0aa0d81fb8..253ab65031 100644 --- a/packages/rln/src/contract/rln_contract.ts +++ b/packages/rln/src/contract/rln_contract.ts @@ -477,7 +477,7 @@ export class RLNContract { membership: { address, treeIndex: membershipId, - chainId: network.chainId, + chainId: network.chainId.toString(), rateLimit: decodedData.membershipRateLimit.toNumber() } }; @@ -603,7 +603,7 @@ export class RLNContract { membership: { address, treeIndex: membershipId, - chainId: network.chainId, + chainId: network.chainId.toString(), rateLimit: decodedData.membershipRateLimit.toNumber() } }; diff --git a/packages/rln/src/contract/rln_light_contract.ts b/packages/rln/src/contract/rln_light_contract.ts index 2205c704f9..f3469f6d74 100644 --- a/packages/rln/src/contract/rln_light_contract.ts +++ b/packages/rln/src/contract/rln_light_contract.ts @@ -396,7 +396,7 @@ export class RLNLightContract { membership: { address, treeIndex: membershipId, - chainId: network.chainId, + chainId: network.chainId.toString(), rateLimit: decodedData.membershipRateLimit.toNumber() } }; @@ -527,7 +527,7 @@ export class RLNLightContract { membership: { address, treeIndex: membershipId, - chainId: network.chainId, + chainId: network.chainId.toString(), rateLimit: decodedData.membershipRateLimit.toNumber() } }; diff --git a/packages/rln/src/keystore/types.ts b/packages/rln/src/keystore/types.ts index a14867c1e1..89d240edfe 100644 --- a/packages/rln/src/keystore/types.ts +++ b/packages/rln/src/keystore/types.ts @@ -8,7 +8,7 @@ export type Password = string | Uint8Array; // see reference // https://github.com/waku-org/nwaku/blob/f05528d4be3d3c876a8b07f9bb7dfaae8aa8ec6e/waku/waku_keystore/protocol_types.nim#L111 export type MembershipInfo = { - chainId: number; + chainId: string; address: string; treeIndex: number; rateLimit: number; diff --git a/packages/rln/src/rln.ts b/packages/rln/src/rln.ts index ec16f79e7f..1610f1c918 100644 --- a/packages/rln/src/rln.ts +++ b/packages/rln/src/rln.ts @@ -197,7 +197,7 @@ export class RLNInstance { } const signer = options.signer || (await extractMetaMaskSigner()); - const currentChainId = await signer.getChainId(); + const currentChainId = (await signer.getChainId()).toString(); if (chainId && chainId !== currentChainId) { throw Error( @@ -312,7 +312,7 @@ export class RLNInstance { const chainId = credentials.membership.chainId; const network = await this._contract.provider.getNetwork(); - const currentChainId = network.chainId; + const currentChainId = network.chainId.toString(); if (chainId !== currentChainId) { throw Error( `Failed to verify chain coordinates: credentials chainID=${chainId} is not equal to registryContract chainID=${currentChainId}` diff --git a/packages/rln/src/rln_light.ts b/packages/rln/src/rln_light.ts index 1c2fde41be..1e9fc185e1 100644 --- a/packages/rln/src/rln_light.ts +++ b/packages/rln/src/rln_light.ts @@ -127,7 +127,7 @@ export class RLNLightInstance { } const signer = options.signer || (await extractMetaMaskSigner()); - const currentChainId = await signer.getChainId(); + const currentChainId = (await signer.getChainId()).toString(); if (chainId && chainId !== currentChainId) { throw Error(