Skip to content

Commit 7975ec7

Browse files
authored
Switch horizen testnet (#36)
* Switch from sepolia to horizen testnet * Update backend to support transfer ERC20 * Deploy new contract to horizen testnet * format application
1 parent 34d2a02 commit 7975ec7

File tree

28 files changed

+1645
-831
lines changed

28 files changed

+1645
-831
lines changed

docs/developer-documentation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ This section covers:
2323
## Quick Links
2424

2525
- [GitHub Repository](https://github.com/Poly-pay/polypay_app)
26-
- [Smart Contract on Sepolia](https://sepolia.etherscan.io)
26+
- [Smart Contract on Horizen testnet](https://horizen-testnet.explorer.caldera.xyz/)

docs/how-to-use-polipay-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Polypay App (Beta v0.1)
44

5-
Polypay app beta v0.1 is an initial release of the Polypay platform. It is a web application that allows you to create and manage a multisig wallet on **Ethereum Sepolia testnet** with a focus on privacy. It is not yet production ready. Current version includes the following features:
5+
Polypay app beta v0.1 is an initial release of the Polypay platform. It is a web application that allows you to create and manage a multisig wallet on **Horizen testnet** with a focus on privacy. It is not yet production ready. Current version includes the following features:
66

77
- Create and manage a multisig wallet
88
- Hide signers(multisig wallet owners) identities with ZK proofs

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"scripts": {
1111
"chain": "yarn hardhat:chain",
1212
"compile": "yarn hardhat:compile",
13-
"deploy": "yarn hardhat:deploy",
13+
"deploy": "yarn workspace @se-2/hardhat deploy",
1414
"fork": "yarn hardhat:fork",
1515
"generate": "yarn account:generate",
1616
"postinstall": "husky install",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- AlterTable
2+
ALTER TABLE "Vote" ALTER COLUMN "domainId" SET DEFAULT 175;

packages/backend/prisma/schema.prisma

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ model Vote {
122122
proofStatus ProofStatus?
123123
124124
// Aggregation data
125-
aggregationId String?
126-
domainId Int? @default(0)
127-
merkleProof String[]
128-
leafCount Int?
129-
leafIndex Int?
125+
aggregationId String?
126+
domainId Int? @default(175)
127+
merkleProof String[]
128+
leafCount Int?
129+
leafIndex Int?
130130
131131
createdAt DateTime @default(now())
132132
updatedAt DateTime @updatedAt

packages/backend/src/relayer-wallet/relayer-wallet.service.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import {
66
decodeFunctionData,
77
} from 'viem';
88
import { privateKeyToAccount } from 'viem/accounts';
9-
import { sepolia } from 'viem/chains';
9+
import { horizenTestnet } from '@polypay/shared';
1010
import {
1111
METAMULTISIG_ABI,
1212
METAMULTISIG_BYTECODE,
1313
METAMULTISIG_CONSTANTS,
14-
} from '@/common/contracts/MetaMultiSigWallet';
14+
} from '@polypay/shared';
1515

1616
@Injectable()
1717
export class RelayerService {
@@ -30,13 +30,13 @@ export class RelayerService {
3030
this.account = privateKeyToAccount(privateKey);
3131

3232
this.publicClient = createPublicClient({
33-
chain: sepolia,
33+
chain: horizenTestnet,
3434
transport: http(),
3535
});
3636

3737
this.walletClient = createWalletClient({
3838
account: this.account,
39-
chain: sepolia,
39+
chain: horizenTestnet,
4040
transport: http(),
4141
});
4242

@@ -66,7 +66,7 @@ export class RelayerService {
6666
BigInt(threshold),
6767
],
6868
account: this.account,
69-
chain: sepolia,
69+
chain: horizenTestnet,
7070
});
7171

7272
this.logger.log(`Deploy tx sent: ${txHash}`);
@@ -297,7 +297,7 @@ export class RelayerService {
297297
functionName: 'execute',
298298
args,
299299
account: this.account,
300-
chain: sepolia,
300+
chain: horizenTestnet,
301301
gas: gasEstimate + 50000n,
302302
});
303303

packages/backend/src/zkverify/zkverify.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
ZkVerifyJobStatusResponse,
1414
} from './dto';
1515
import { PrismaService } from '@/database/prisma.service';
16+
import { horizenTestnet } from '@polypay/shared';
1617

1718
@Injectable()
1819
export class ZkVerifyService {
@@ -83,7 +84,7 @@ export class ZkVerifyService {
8384
const params = {
8485
proofType: 'ultraplonk',
8586
vkRegistered: true,
86-
chainId: 11155111,
87+
chainId: horizenTestnet.id,
8788
proofOptions: {
8889
numberOfPublicInputs,
8990
},

packages/hardhat/deploy/00_deploy_meta_multisig_wallet.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ const deployMetaMultiSigWallet: DeployFunction = async function (hre: HardhatRun
6060
await deploy("MetaMultiSigWallet", {
6161
from: deployer,
6262
args: [
63-
"0xEA0A0f1EfB1088F4ff0Def03741Cb2C64F89361E", // zkVerify contract address
63+
"0xCC02D0A54F3184dF4c88811E5b9FAb7ff8131e4a", // zkVerify contract address
6464
"0x104717314e0c94ef15d6992292b713aa2ffc48c74e0c41f7344a611caa606dde", //vkhash
6565
// 31337, //chainId localhost
66-
11155111, //chainId
66+
2651420, //chainId for horizen testnet
6767
[BigInt("7777412979265397193925220040726445950599854595059203997869095364409346949110"), BigInt("3893960714193187677642727159938790123674441621624357680276520538080166792249")], //list commitments testnet
6868
2, //signatures required
6969
],
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2651420

0 commit comments

Comments
 (0)