mirror of
https://github.com/vacp2p/rln-interep-contract.git
synced 2026-01-08 21:27:58 -05:00
chore: create e2e script that adds member via interep
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -7,3 +7,5 @@ typechain
|
||||
#Hardhat files
|
||||
cache
|
||||
artifacts
|
||||
|
||||
test_proof.json
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"address": "0xAb02186E87E040198a06D2A53c438BdD5a2673fA",
|
||||
"address": "0x0b8AC9ca6a6a6a3644Dcd72bF89421aD8378bAf4",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
@@ -253,18 +253,18 @@
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"transactionHash": "0x05ef9573c1ff3effedd29c55c2dcd01d6a2ae69cab7ecf095c5be6b50f71d223",
|
||||
"transactionHash": "0x1d22a4c9ac3aa353a7a031954e00cb1da43f7b65dee6a374200db3514e16d23b",
|
||||
"receipt": {
|
||||
"to": null,
|
||||
"from": "0xabD73e893D0398772f1a679B86C3148f724546ec",
|
||||
"contractAddress": "0xAb02186E87E040198a06D2A53c438BdD5a2673fA",
|
||||
"from": "0x426cecD107f309E0C20717e0d48656799806789E",
|
||||
"contractAddress": "0x0b8AC9ca6a6a6a3644Dcd72bF89421aD8378bAf4",
|
||||
"transactionIndex": 0,
|
||||
"gasUsed": "1097158",
|
||||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
"blockHash": "0x467aad50b8f0f2c2c7bfc14dd3d6667099f8274210c42c8a5a2cb8fd6a0575d1",
|
||||
"transactionHash": "0x05ef9573c1ff3effedd29c55c2dcd01d6a2ae69cab7ecf095c5be6b50f71d223",
|
||||
"blockHash": "0xd6b272d19228ffbf4763b1f095555907c4964b054fe03cf4b4db20fa946c626e",
|
||||
"transactionHash": "0x1d22a4c9ac3aa353a7a031954e00cb1da43f7b65dee6a374200db3514e16d23b",
|
||||
"logs": [],
|
||||
"blockNumber": 574,
|
||||
"blockNumber": 16,
|
||||
"cumulativeGasUsed": "1097158",
|
||||
"status": 1,
|
||||
"byzantium": true
|
||||
@@ -272,7 +272,7 @@
|
||||
"args": [
|
||||
[
|
||||
{
|
||||
"contractAddress": "0xF9fcC94b5DFe817AEa619B09c44B0563e618826B",
|
||||
"contractAddress": "0x265b14357e6aF9C9115F9175e3e48a1Bb0fe5f6d",
|
||||
"merkleTreeDepth": 20
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"address": "0xbcc4dA7926008ee090e156ccCdaD400A1557c043",
|
||||
"address": "0x9DcFeeA01aACc227930C107533eAD3457B58FaB5",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
@@ -34,18 +34,18 @@
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"transactionHash": "0x8d971dd8937c14e47e8a314c3b76473e79b82587bac728ca6af80d7ce7987534",
|
||||
"transactionHash": "0x815197b4172b95632dcf0cade0674f2b7d3865b603a627fb61c1f14611b159a5",
|
||||
"receipt": {
|
||||
"to": null,
|
||||
"from": "0xabD73e893D0398772f1a679B86C3148f724546ec",
|
||||
"contractAddress": "0xbcc4dA7926008ee090e156ccCdaD400A1557c043",
|
||||
"from": "0x426cecD107f309E0C20717e0d48656799806789E",
|
||||
"contractAddress": "0x9DcFeeA01aACc227930C107533eAD3457B58FaB5",
|
||||
"transactionIndex": 0,
|
||||
"gasUsed": "3507975",
|
||||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
"blockHash": "0x022448d80bc6a78f2ab1554338663e8d1cada59385a3b6bec49b302b76e4992f",
|
||||
"transactionHash": "0x8d971dd8937c14e47e8a314c3b76473e79b82587bac728ca6af80d7ce7987534",
|
||||
"blockHash": "0xfcb1273b5415f46beda1ef0bc0eea5cf14debf9657e392cdda5f4e2ff2de1405",
|
||||
"transactionHash": "0x815197b4172b95632dcf0cade0674f2b7d3865b603a627fb61c1f14611b159a5",
|
||||
"logs": [],
|
||||
"blockNumber": 535,
|
||||
"blockNumber": 8,
|
||||
"cumulativeGasUsed": "3507975",
|
||||
"status": 1,
|
||||
"byzantium": true
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"address": "0x19C150e45e6FAdC2910525bA5bFad1a757A1aF82",
|
||||
"address": "0x7ab458e421B4292B9453763e3E59f562F8A346de",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
@@ -302,18 +302,18 @@
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"transactionHash": "0x743563bfbb4b8fb8c041c0236bba43cff8ed13b8e35bade5e6432242d2f521f3",
|
||||
"transactionHash": "0xa1ea6d8dea11fd91943cf8a11ee963c099d9fc602b0a4544d4ac1bd7d94a4dfe",
|
||||
"receipt": {
|
||||
"to": null,
|
||||
"from": "0xabD73e893D0398772f1a679B86C3148f724546ec",
|
||||
"contractAddress": "0x19C150e45e6FAdC2910525bA5bFad1a757A1aF82",
|
||||
"from": "0x426cecD107f309E0C20717e0d48656799806789E",
|
||||
"contractAddress": "0x7ab458e421B4292B9453763e3E59f562F8A346de",
|
||||
"transactionIndex": 0,
|
||||
"gasUsed": "1837815",
|
||||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
"blockHash": "0xc9b11ce5882258f4f47a3b4aaa94de652856cd2708bf9b34f893c77a9f46321a",
|
||||
"transactionHash": "0x743563bfbb4b8fb8c041c0236bba43cff8ed13b8e35bade5e6432242d2f521f3",
|
||||
"blockHash": "0xb46a362ed47f5cad13926b331f9171cb2a8e7b581e8bd6c997abefa670c351d8",
|
||||
"transactionHash": "0xa1ea6d8dea11fd91943cf8a11ee963c099d9fc602b0a4544d4ac1bd7d94a4dfe",
|
||||
"logs": [],
|
||||
"blockNumber": 577,
|
||||
"blockNumber": 28,
|
||||
"cumulativeGasUsed": "1837815",
|
||||
"status": 1,
|
||||
"byzantium": true
|
||||
@@ -321,8 +321,8 @@
|
||||
"args": [
|
||||
1000000000000000,
|
||||
20,
|
||||
"0xbcc4dA7926008ee090e156ccCdaD400A1557c043",
|
||||
"0x1702136505262BD649f9FeDaD7f7075D97ADA301"
|
||||
"0x9DcFeeA01aACc227930C107533eAD3457B58FaB5",
|
||||
"0x8785643D4908eC672f007d61a610A8ba6AbaE8C0"
|
||||
],
|
||||
"numDeployments": 1,
|
||||
"solcInputHash": "b8e33ba299e95051cdf4858cd81bbca9",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"address": "0x1702136505262BD649f9FeDaD7f7075D97ADA301",
|
||||
"address": "0x8785643D4908eC672f007d61a610A8ba6AbaE8C0",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
@@ -81,24 +81,24 @@
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"transactionHash": "0x42c1f005c7873318a24c376ddfa0ca8e5acb696538ddc1be9399839ffcebb780",
|
||||
"transactionHash": "0x48265678b66017a69608e3ee361c525cd2684e1d71e6e0d778afa3dfc2388c40",
|
||||
"receipt": {
|
||||
"to": null,
|
||||
"from": "0xabD73e893D0398772f1a679B86C3148f724546ec",
|
||||
"contractAddress": "0x1702136505262BD649f9FeDaD7f7075D97ADA301",
|
||||
"from": "0x426cecD107f309E0C20717e0d48656799806789E",
|
||||
"contractAddress": "0x8785643D4908eC672f007d61a610A8ba6AbaE8C0",
|
||||
"transactionIndex": 0,
|
||||
"gasUsed": "397310",
|
||||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
"blockHash": "0x3c90653b425a1d05a3784f01a14a9fc141e18bc9f63d4bb8e5de237ab79bc64c",
|
||||
"transactionHash": "0x42c1f005c7873318a24c376ddfa0ca8e5acb696538ddc1be9399839ffcebb780",
|
||||
"blockHash": "0x5183981c52b36326c03bc0f8f36bcfa94e1b5476f068dfd65c6b4b6ed62ed2b4",
|
||||
"transactionHash": "0x48265678b66017a69608e3ee361c525cd2684e1d71e6e0d778afa3dfc2388c40",
|
||||
"logs": [],
|
||||
"blockNumber": 576,
|
||||
"blockNumber": 24,
|
||||
"cumulativeGasUsed": "397310",
|
||||
"status": 1,
|
||||
"byzantium": true
|
||||
},
|
||||
"args": [
|
||||
"0xAb02186E87E040198a06D2A53c438BdD5a2673fA",
|
||||
"0x0b8AC9ca6a6a6a3644Dcd72bF89421aD8378bAf4",
|
||||
[
|
||||
{
|
||||
"provider": "0x6769746875620000000000000000000000000000000000000000000000000000",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"address": "0xF9fcC94b5DFe817AEa619B09c44B0563e618826B",
|
||||
"address": "0x265b14357e6aF9C9115F9175e3e48a1Bb0fe5f6d",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
@@ -35,18 +35,18 @@
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"transactionHash": "0x9871f224c4234207eec0650a966ff4be56d69a2fff13e51b34b9cf0ed8da0a96",
|
||||
"transactionHash": "0xe17018e6e38070d1a2ebb9c6d03a942c14203093d43534b8d5749565539722a1",
|
||||
"receipt": {
|
||||
"to": null,
|
||||
"from": "0xabD73e893D0398772f1a679B86C3148f724546ec",
|
||||
"contractAddress": "0xF9fcC94b5DFe817AEa619B09c44B0563e618826B",
|
||||
"from": "0x426cecD107f309E0C20717e0d48656799806789E",
|
||||
"contractAddress": "0x265b14357e6aF9C9115F9175e3e48a1Bb0fe5f6d",
|
||||
"transactionIndex": 0,
|
||||
"gasUsed": "1383001",
|
||||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
"blockHash": "0x495b343006fd27f93d7939fb700ddae05318fb35fb1d4de451cf49a4412f56ac",
|
||||
"transactionHash": "0x9871f224c4234207eec0650a966ff4be56d69a2fff13e51b34b9cf0ed8da0a96",
|
||||
"blockHash": "0xd3a867f3f8e52668595543c1ee7cbf47738ce152747b6b10fc9381a9a7284654",
|
||||
"transactionHash": "0xe17018e6e38070d1a2ebb9c6d03a942c14203093d43534b8d5749565539722a1",
|
||||
"logs": [],
|
||||
"blockNumber": 536,
|
||||
"blockNumber": 12,
|
||||
"cumulativeGasUsed": "1383001",
|
||||
"status": 1,
|
||||
"byzantium": true
|
||||
|
||||
97
e2e/e2e.ts
97
e2e/e2e.ts
@@ -1,58 +1,70 @@
|
||||
import { ethers } from "ethers";
|
||||
import createProof from "@interep/proof";
|
||||
import createIdentity from "@interep/identity";
|
||||
import dotenv from "dotenv";
|
||||
import { ethers } from "ethers";
|
||||
import { createInterepProof, sToBytes32 } from "../common";
|
||||
// @ts-ignore circom
|
||||
import { poseidon } from "circomlibjs";
|
||||
import fs from "fs";
|
||||
|
||||
import { abi, address } from "../deployments/goerli/RLN.json";
|
||||
import { sToBytes32 } from "../common";
|
||||
import { address, abi } from "../deployments/localhost_integration/RLN.json";
|
||||
|
||||
dotenv.config();
|
||||
import { seedTree } from "./seed-tree";
|
||||
import { updateMerkleRoot } from "./update-merkle-root";
|
||||
|
||||
const privateKey = process.argv[2];
|
||||
const rawExistingMembers = process.argv[3] || "[]";
|
||||
|
||||
const existingMembers = JSON.parse(rawExistingMembers);
|
||||
|
||||
if (!privateKey) {
|
||||
console.log("Usage: yarn ts-node e2e/e2e <privateKey>");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// This function does the following -
|
||||
// 1. Creates an identity using createIdentity
|
||||
// 2. Creates a proof using createProof
|
||||
// 3. Calls the register function on the RLN contract, with the proof that was generated
|
||||
// !!!NOTE!!!
|
||||
// Interep has not updated their verifiers, so the proof generated by createProof will not work :( Have raised the issue with their team
|
||||
async function main() {
|
||||
if (!process.env.PRIVATE_KEY_TO_GENERATE_SECRET) {
|
||||
throw new Error("PRIVATE_KEY_TO_GENERATE_SECRET not set");
|
||||
}
|
||||
if (!process.env.PRIVATE_KEY) {
|
||||
throw new Error("PRIVATE_KEY not set");
|
||||
}
|
||||
const provider = new ethers.providers.JsonRpcProvider(process.env.GOERLI_URL);
|
||||
const wallet = new ethers.Wallet(
|
||||
process.env.PRIVATE_KEY_TO_GENERATE_SECRET,
|
||||
provider
|
||||
const provider = new ethers.providers.JsonRpcProvider(
|
||||
"http://localhost:8545"
|
||||
);
|
||||
const signer = provider.getSigner(0);
|
||||
const rlnContract = new ethers.Contract(address, abi, signer);
|
||||
|
||||
// Seed test tree
|
||||
await seedTree(rlnContract);
|
||||
|
||||
const wallet = new ethers.Wallet(privateKey);
|
||||
const identity = await createIdentity(
|
||||
(msg) => wallet.signMessage(msg),
|
||||
"Github"
|
||||
);
|
||||
|
||||
const proof = await createProof(
|
||||
const proof = await createInterepProof({
|
||||
identity,
|
||||
"github",
|
||||
"bronze",
|
||||
1,
|
||||
sToBytes32("foo"),
|
||||
{
|
||||
members: [...existingMembers, identity.getCommitment()],
|
||||
groupProvider: "github",
|
||||
groupTier: "bronze",
|
||||
signal: sToBytes32("foo"),
|
||||
externalNullifier: 1,
|
||||
snarkArtifacts: {
|
||||
wasmFilePath: "./test/snarkArtifacts/semaphore.wasm",
|
||||
zkeyFilePath: "./test/snarkArtifacts/semaphore.zkey",
|
||||
},
|
||||
"goerli"
|
||||
});
|
||||
console.log("Proof generated for registration");
|
||||
|
||||
const identitySecretHash = poseidon([
|
||||
identity.getNullifier(),
|
||||
identity.getTrapdoor(),
|
||||
]).toString(16);
|
||||
const identityCommitment = identity.getCommitment().toString(16);
|
||||
|
||||
// Update on-chain merkle root to include new member
|
||||
await updateMerkleRoot(
|
||||
signer,
|
||||
"github",
|
||||
"bronze",
|
||||
proof.publicSignals.merkleRoot
|
||||
);
|
||||
|
||||
console.log(address);
|
||||
const rlnContract = new ethers.Contract(
|
||||
address,
|
||||
abi,
|
||||
new ethers.Wallet(process.env.PRIVATE_KEY, provider)
|
||||
);
|
||||
|
||||
const tx = await rlnContract[
|
||||
// Register new member
|
||||
const registerTx = await rlnContract[
|
||||
"register(uint256,bytes32,uint256,uint256,uint256[8],uint256)"
|
||||
](
|
||||
proof.groupId,
|
||||
@@ -62,11 +74,12 @@ async function main() {
|
||||
proof.solidityProof,
|
||||
identity.getCommitment()
|
||||
);
|
||||
const txData = await registerTx.wait();
|
||||
const rlnIndex = txData.events[1].args.index.toNumber();
|
||||
|
||||
console.log(tx.hash);
|
||||
await tx.wait();
|
||||
|
||||
console.log("done");
|
||||
console.log(
|
||||
`New member registered: \nID COMMITMENT: ${identityCommitment}\nID KEY: ${identitySecretHash}\nRLN INDEX: ${rlnIndex}`
|
||||
);
|
||||
}
|
||||
|
||||
main()
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
import createIdentity from "@interep/identity";
|
||||
import { ethers } from "ethers";
|
||||
import { createInterepProof, sToBytes32 } from "../common";
|
||||
// @ts-ignore circom
|
||||
import { poseidon } from "circomlibjs";
|
||||
|
||||
const privateKey = process.argv[2];
|
||||
const rawExistingMembers = process.argv[3] || "[]";
|
||||
|
||||
const existingMembers = JSON.parse(rawExistingMembers);
|
||||
|
||||
if (!privateKey) {
|
||||
console.log("Usage: node generate-proof.js <privateKey>");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const wallet = new ethers.Wallet(privateKey);
|
||||
const identity = await createIdentity(
|
||||
(msg) => wallet.signMessage(msg),
|
||||
"Github"
|
||||
);
|
||||
const proof = await createInterepProof({
|
||||
identity,
|
||||
members: [...existingMembers, identity.getCommitment()],
|
||||
groupProvider: "github",
|
||||
groupTier: "bronze",
|
||||
signal: sToBytes32("foo"),
|
||||
externalNullifier: 1,
|
||||
snarkArtifacts: {
|
||||
wasmFilePath: "./test/snarkArtifacts/semaphore.wasm",
|
||||
zkeyFilePath: "./test/snarkArtifacts/semaphore.zkey",
|
||||
},
|
||||
});
|
||||
const identitySecretHash = poseidon([
|
||||
identity.getNullifier(),
|
||||
identity.getTrapdoor(),
|
||||
]);
|
||||
const returnObj = {};
|
||||
Object.assign(returnObj, {
|
||||
identitySecretHash: identitySecretHash.toString(16),
|
||||
identityCommitment: identity.getCommitment().toString(16),
|
||||
groupId: proof.groupId,
|
||||
signal: proof.signal,
|
||||
nullifierHash: proof.publicSignals.nullifierHash,
|
||||
externalNullifier: proof.publicSignals.externalNullifier,
|
||||
solidityProof: proof.solidityProof,
|
||||
});
|
||||
console.log(returnObj);
|
||||
}
|
||||
|
||||
main()
|
||||
.then(() => process.exit(0))
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
16
e2e/seed-tree.ts
Normal file
16
e2e/seed-tree.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Contract, ethers } from "ethers";
|
||||
|
||||
// Only meant to be ran locally
|
||||
export async function seedTree(rlnContract: Contract) {
|
||||
const price = await rlnContract.MEMBERSHIP_DEPOSIT();
|
||||
for (let i = 0; i < 10; i++) {
|
||||
const idCommitment = `0x0c3ac305f6a4fe9bfeb3eba978bc876e2a99208b8b56c80160cfb54ba8f${i}234f`;
|
||||
console.log(`Seeding ${idCommitment}`);
|
||||
const tx = await rlnContract["register(uint256)"](
|
||||
ethers.BigNumber.from(idCommitment),
|
||||
{ value: price }
|
||||
);
|
||||
await tx.wait();
|
||||
}
|
||||
console.log("Seeded tree!");
|
||||
}
|
||||
25
e2e/update-merkle-root.ts
Normal file
25
e2e/update-merkle-root.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { BigNumberish, ethers, Signer } from "ethers";
|
||||
import { sToBytes32 } from "../common";
|
||||
import {
|
||||
address,
|
||||
abi,
|
||||
} from "../deployments/localhost_integration/InterepTest.json";
|
||||
|
||||
export async function updateMerkleRoot(
|
||||
signer: Signer,
|
||||
groupProvider: string,
|
||||
groupName: string,
|
||||
merkleRoot: BigNumberish
|
||||
) {
|
||||
const interepContract = new ethers.Contract(address, abi, signer);
|
||||
const tx = await interepContract.updateGroups([
|
||||
{
|
||||
provider: sToBytes32(groupProvider),
|
||||
name: sToBytes32(groupName),
|
||||
root: merkleRoot,
|
||||
depth: 20,
|
||||
},
|
||||
]);
|
||||
await tx.wait();
|
||||
console.log("Updated Interep group Merkle Root!");
|
||||
}
|
||||
@@ -9,6 +9,8 @@
|
||||
"deploy": "hardhat deploy --network",
|
||||
"deploy:goerli": "yarn deploy goerli",
|
||||
"deploy:localhost": "yarn deploy localhost",
|
||||
"deploy:localhost_integration": "yarn deploy localhost_integration --reset",
|
||||
"e2e": "yarn ts-node ./e2e/e2e",
|
||||
"coverage": "hardhat coverage",
|
||||
"fmt": "prettier --write \"**/*.{js,ts}\"",
|
||||
"lint": "prettier --check \"**/*.{js,ts}\"",
|
||||
|
||||
@@ -331,16 +331,16 @@
|
||||
|
||||
generateCredsButton.disabled = !rlnInstance;
|
||||
|
||||
importExternalButton.disabled = !(
|
||||
externalIdKeyInput.value && externalCommitmentKeyInput.value
|
||||
);
|
||||
|
||||
registerButton.disabled = !(
|
||||
membershipKey &&
|
||||
retrievedRLNEvents &&
|
||||
!membershipId
|
||||
);
|
||||
|
||||
importExternalButton.disabled = !(
|
||||
externalIdKeyInput.value && externalCommitmentKeyInput.value
|
||||
);
|
||||
|
||||
importButton.disabled = !(
|
||||
membershipIdInput.value &&
|
||||
identityKeyInput.value &&
|
||||
@@ -386,13 +386,13 @@
|
||||
const checkChain = async (chainId) => {
|
||||
retrieveRLNDetailsButton.disabled = retrievedRLNEvents || chainId !== 5;
|
||||
registerButton.disabled = !(chainId === 5 && retrievedRLNEvents);
|
||||
if (chainId !== 5) {
|
||||
alert("Switch to Goerli");
|
||||
if (chainId !== 31337) {
|
||||
alert("Switch to Localhost");
|
||||
}
|
||||
};
|
||||
|
||||
const rlnDeployBlk = 8059744;
|
||||
const rlnAddress = "0xCd41a0aC28c5c025779eAC3208D0bF23baa3a5b6";
|
||||
const rlnDeployBlk = 0;
|
||||
const rlnAddress = "0x962a95edCDdcEBbB5A703f1357494009F1A10244";
|
||||
const rlnAbi = [
|
||||
{
|
||||
inputs: [
|
||||
|
||||
Reference in New Issue
Block a user