Skip to content

Commit 454dbe8

Browse files
authored
Add Rarimo Beta network. Fix type errors (#29)
* Added Rarimo Beta network. Fixed type errors * Fixed typo * Added deployment script
1 parent 54271eb commit 454dbe8

File tree

6 files changed

+37
-18
lines changed

6 files changed

+37
-18
lines changed

deploy/config/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@ export async function getConfig() {
1313
return await import("./rarimo-dev");
1414
}
1515

16+
if (hre.network.name == "rarimo-beta") {
17+
return await import("./rarimo-beta");
18+
}
19+
1620
throw new Error(`Config for network ${hre.network.name} is not specified`);
1721
}

deploy/config/rarimo-beta.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export const treeSize = 80;
2+
export const owner = "0xD2D15f650654d69F4dFd3aF41c49412c62BD616F";
3+
4+
export const evidenceRegistry = "0x156C5fb747638F18264080e1f17A15B76E938e73";
5+
6+
export const icaoMasterTreeMerkleRoot = "0x0eef24f25513eb3d3e13856805319553013158c347209287d090d3100e33c55b";
7+
8+
export const registrationName = "SecondRegistration";
9+
export const simpleRegistrationName = "SimpleRegistration";
10+
export const simpleRegistrationSigners = ["0xD2D15f650654d69F4dFd3aF41c49412c62BD616F"];
11+
12+
export const registration2 = "0x0000000000000000000000000000000000000000";
13+
export const stateKeeper = "0x0000000000000000000000000000000000000000";

hardhat.config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ const config: HardhatUserConfig = {
6161
url: "http://34.134.193.127:8545",
6262
gasMultiplier: 1.2,
6363
},
64+
"rarimo-beta": {
65+
url: "https://rpc.evm.mainnet.rarimo.com",
66+
gasPrice: 0,
67+
gasMultiplier: 1.2,
68+
},
6469
},
6570
solidity: {
6671
version: "0.8.28",
@@ -75,8 +80,17 @@ const config: HardhatUserConfig = {
7580
etherscan: {
7681
apiKey: {
7782
"rarimo-l2": "abc",
83+
"rarimo-beta": "abc",
7884
},
7985
customChains: [
86+
{
87+
network: "rarimo-beta",
88+
chainId: 201411,
89+
urls: {
90+
apiURL: "https://api.evmscan.rarimo.com/api",
91+
browserURL: "https://evmscan.rarimo.com",
92+
},
93+
},
8094
{
8195
network: "rarimo-l2",
8296
chainId: 7368,

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@
3232
"private-network-fork": "npx hardhat node --fork https://mainnet.infura.io/v3/$(grep INFURA_KEY .env | cut -d '\"' -f2)",
3333
"deploy-rarimo-l2": "npx hardhat migrate --network rarimo-l2 --verify",
3434
"deploy-rarimo-dev": "npx hardhat migrate --network rarimo-dev --verify",
35+
"deploy-rarimo-beta": "npx hardhat migrate --network rarimo-beta --verify",
3536
"generate-types": "TYPECHAIN_FORCE=true npx hardhat typechain && npx hardhat gobind",
3637
"generate-docs": "npx hardhat markup",
3738
"solhint-check": "solhint \"./contracts/**/*.sol\"",
3839
"lint-fix": "npm run lint-sol-fix && npm run lint-ts-fix && npm run lint-json-fix && npm run solhint-check",
3940
"lint-json-fix": "prettier --write \"./**/*.json\"",
40-
"lint-ts-fix": "prettier --write \"./**/*.ts\"",
41+
"lint-ts-fix": "prettier --write \"./**/*.ts\" --ignore-path .prettierignore",
4142
"lint-sol-fix": "prettier --write \"contracts/**/*.sol\"",
4243
"publish-to-npm": "npm run lint-fix && bash ./scripts/publish.sh --public"
4344
},

test/registration/Registration.test.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,10 @@ import { HDNodeWallet } from "ethers";
55
import { time } from "@nomicfoundation/hardhat-network-helpers";
66
import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
77

8-
import {
9-
Z_UNIVERSAL_2048,
10-
Z_UNIVERSAL_4096,
11-
C_RSA_SHA2_4096,
12-
P_ECDSA_SHA1_2704,
13-
P_RSA_SHA1_2688,
14-
P_NO_AA,
15-
} from "@/scripts/utils/types";
8+
import { Z_UNIVERSAL_4096, C_RSA_SHA2_4096, P_ECDSA_SHA1_2704, P_RSA_SHA1_2688, P_NO_AA } from "@/scripts/utils/types";
169

1710
import {
1811
StateKeeperMock,
19-
PUniversal2048Verifier,
20-
PUniversal4096Verifier,
2112
CRSADispatcher,
2213
PNOAADispatcher,
2314
PRSASHADispatcher,
@@ -26,7 +17,6 @@ import {
2617
Registration2Mock,
2718
Registration2,
2819
} from "@ethers-v6";
29-
3020
import { Groth16VerifierHelper } from "@/generated-types/ethers/contracts/registration/Registration2";
3121

3222
import { MerkleTreeHelper } from "@/test/helpers";
@@ -62,9 +52,6 @@ describe("Registration2", () => {
6252
let SECOND: SignerWithAddress;
6353
let SIGNER: HDNodeWallet;
6454

65-
let pUniversal2048Verifier: PUniversal2048Verifier;
66-
let pUniversal4096Verifier: PUniversal4096Verifier;
67-
6855
let pNoAaDispatcher: PNOAADispatcher;
6956
let pRsaSha1Dispatcher: PRSASHADispatcher;
7057
let pEcdsaSha1Dispatcher: PECDSASHA1Dispatcher;

test/registration/RegistrationSimple.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
ProofRegisterIdentityLight256Groth16,
1818
RegisterIdentityLight256,
1919
} from "@/generated-types/zkit";
20-
import { VerifierHelper } from "@/generated-types/ethers/contracts/registration/Registration";
20+
import { Groth16VerifierHelper } from "@/generated-types/ethers/contracts/registration/Registration2";
2121

2222
const treeSize = 80;
2323

@@ -205,7 +205,7 @@ describe("RegistrationSimple", () => {
205205
});
206206

207207
it("should revert if invalid proof is provided", async () => {
208-
const localProof: VerifierHelper.ProofPointsStruct = JSON.parse(JSON.stringify(formatProof(proof.proof)));
208+
const localProof: Groth16VerifierHelper.ProofPointsStruct = JSON.parse(JSON.stringify(formatProof(proof.proof)));
209209

210210
localProof.a[0] = 0n;
211211

@@ -281,7 +281,7 @@ describe("RegistrationSimple", () => {
281281
});
282282
});
283283

284-
function formatProof(data: Groth16Proof): VerifierHelper.ProofPointsStruct {
284+
function formatProof(data: Groth16Proof): Groth16VerifierHelper.ProofPointsStruct {
285285
return {
286286
a: [data.pi_a[0], data.pi_a[1]],
287287
b: [

0 commit comments

Comments
 (0)