fix: fix default account to use hardhat key

This commit is contained in:
Saleel
2023-03-07 23:28:20 +05:30
parent 78e9b20460
commit 81cca05a76
4 changed files with 13 additions and 13 deletions

View File

@@ -205,8 +205,8 @@ docker-compose -f docker-compose.dev.yml up -d
The ethereum node (ganache) started on port `8545` will have the following accounts pre-funded with 100 ETH:
```sh
0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1
Private Key: 0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d
0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
Private Key: 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
```
This is the same first account generated by hardhat network as well.
@@ -214,17 +214,16 @@ This is the same first account generated by hardhat network as well.
Deploy the contracts to the local network using the below command:
```sh
#PWD /apps/contracts
yarn deploy:zkgroups-semaphore --network local
yarn workspace contracts deploy:zkgroups-semaphore --network local
```
The addresses of contracts deployed in a fresh local network would be:
```sh
Pairing library has been deployed to: 0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab
SemaphoreVerifier contract has been deployed to: 0x5b1869D9A4C187F2EAa108f3062412ecf0526b24
ZKGroups contract has been deployed to: 0xCfEB869F69431e42cdB54A4F4f105C19C080A601
ZKGroupsSemaphore contract has been deployed to: 0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B
Pairing library has been deployed to: 0x5FbDB2315678afecb367f032d93F642f64180aa3
SemaphoreVerifier contract has been deployed to: 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
ZKGroups contract has been deployed to: 0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0
ZKGroupsSemaphore contract has been deployed to: 0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9
```
These values are set as defaults in `libs/utils/src/contract-addresses.ts`. If you change the contract and deploy again, new address need to be set here.

View File

@@ -3,6 +3,7 @@
"private": true,
"scripts": {
"compile": "hardhat compile",
"local-node": "yarn compile && hardhat node & yarn deploy:zkgroups --network localhost",
"deploy:zkgroups": "hardhat deploy:zkgroups",
"deploy:zkgroups-semaphore": "hardhat deploy:zkgroups-semaphore",
"test": "hardhat test",

View File

@@ -14,7 +14,7 @@ services:
[
"sh",
"-c",
"npm install ganache-cli && npx ganache-cli -h 0.0.0.0 -i 1337 -l 8000000 --account 0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d,1000000000000000000 -p 8545"
"npm install ganache-cli && npx ganache-cli -h 0.0.0.0 -i 1337 -l 8000000 --account 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80,100000000000000000000 -p 8545"
]
networks:
- zk-groups-dev

View File

@@ -3,12 +3,12 @@ import { ContractName, Network } from "./types"
const CONTRACT_ADDRESSES: { [K in Network]: { [Y in ContractName]: string } } =
{
localhost: {
Semaphore: "0x5b1869D9A4C187F2EAa108f3062412ecf0526b24",
ZKGroups: "0xCfEB869F69431e42cdB54A4F4f105C19C080A601"
Semaphore: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
ZKGroups: "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0"
},
goerli: {
Semaphore: "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0",
ZKGroups: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9"
Semaphore: "0x89490c95eD199D980Cdb4FF8Bac9977EDb41A7E7",
ZKGroups: "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0"
}
}