Skip to content

Commit 9b64936

Browse files
authored
Migration Verification Script: Check Paused Methods (#299)
* feat: Add verification script * Add screenshot * Add sample env file * Split to mainnet and testnet * top level dotenv * Add more mainnet addresses * Minor address fixes
1 parent 62141c0 commit 9b64936

6 files changed

Lines changed: 1631 additions & 0 deletions

File tree

migration/.env.mainnet

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Network Configuration
2+
INFURA_API_KEY=your_infura_key
3+
NETWORK_ETH=mainnet
4+
NETWORK_NEAR=mainnet
5+
CHAIN_ID=1 # Mainnet chain ID
6+
7+
# RPC URLs (derived from other settings, but can be overridden)
8+
# ETH_RPC_URL=https://mainnet.infura.io/v3/${INFURA_API_KEY}
9+
10+
# ======= ETHEREUM CONTRACTS =======
11+
12+
# OmniBridge Ethereum
13+
OMNI_BRIDGE_ETH=
14+
OMNI_BRIDGE_ADMIN=
15+
16+
# Bridge Token Factory
17+
BRIDGE_TOKEN_FACTORY=0x252e87862A3A720287E7fd527cE6e8d0738427A2
18+
BRIDGE_TOKEN_FACTORY_ADMIN=
19+
20+
# ERC20 Locker
21+
ERC20_LOCKER=0x23ddd3e3692d1861ed57ede224608875809e127f
22+
23+
# ETH Custodian
24+
ETH_CUSTODIAN=0x6BFaD42cFC4EfC96f529D786D643Ff4A8B89FA52
25+
ETH_CUSTODIAN_PROXY=
26+
ETH_CUSTODIAN_ADMIN=0x2468603819Bf09Ed3Fb6f3EFeff24B1955f3CDE1
27+
28+
# E-NEAR (Ethereum)
29+
E_NEAR_ADDRESS=0x85F17Cf997934a597031b2E18a9aB6ebD4B9f6a4
30+
E_NEAR_ADMIN=0x2468603819Bf09Ed3Fb6f3EFeff24B1955f3CDE1 # Aurora multi-sig?
31+
32+
# Ethereum Multisig
33+
SAFE_ADDRESS=0x2468603819Bf09Ed3Fb6f3EFeff24B1955f3CDE1
34+
35+
# Ethereum Prover
36+
ETH_PROVER=0x051ad3f020274910065dcb421629cd2e6e5b46c4
37+
38+
# ======= NEAR CONTRACTS =======
39+
40+
# OmniBridge NEAR
41+
OMNI_BRIDGE_NEAR=omni.bridge.near # Same as OMNI_BRIDGE_ACCOUNT_ID
42+
OMNI_BRIDGE_ACCOUNT_ID=omni.bridge.near
43+
OMNI_PROVER=omni-prover.bridge.near
44+
45+
# Bridge Token Factory (NEAR)
46+
BRIDGE_TOKEN_FACTORY_ACCOUNT_ID=factory.bridge.near
47+
48+
# Token Locker
49+
TOKEN_LOCKER=ft-locker.bridge.near
50+
TOKEN_LOCKER_ADMIN=ft-locker.bridge.near
51+
52+
# E-NEAR (NEAR)
53+
E_NEAR_ACCOUNT_ID=e-near.near
54+
55+
# NEAR Protocol
56+
ETH_LIGHT_CLIENT=client-eth2.bridge.near
57+
ETH_ACCOUNT_ID= # If needed
58+
WRAPPED_NEAR_ID=wrap.near
59+
DAO_ACCOUNT_ID=rainbowbridge.sputnik-dao.near
60+
61+
# ======= PRIVATE KEYS (don't commit to git) =======
62+
# BRIDGE_TOKEN_FACTORY_ADMIN_PRIVATE_KEY=
63+
# OMNI_BRIDGE_ADMIN_PRIVATE_KEY=
64+
# ETH_CUST_ADMIN_PRIVATE_KEY=
65+
# E_NEAR_ADMIN_PRIVATE_KEY=
66+
# SIGNER_ACCOUNT_ID=

migration/.env.testnet

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Network Configuration
2+
INFURA_API_KEY=your_infura_key
3+
NETWORK_ETH=sepolia
4+
NETWORK_NEAR=testnet
5+
CHAIN_ID=11155111 # Sepolia chain ID
6+
7+
# RPC URLs (derived from other settings, but can be overridden)
8+
# ETH_RPC_URL=https://sepolia.infura.io/v3/${INFURA_API_KEY}
9+
10+
# ======= ETHEREUM CONTRACTS =======
11+
12+
# OmniBridge Ethereum
13+
OMNI_BRIDGE_ETH=0x68a86e0Ea5B1d39F385c1326e4d493526dFe4401
14+
OMNI_BRIDGE_ADMIN=0xD9cB077700AA4D32d30bDA5e99bb171549b5a382
15+
16+
# Bridge Token Factory
17+
BRIDGE_TOKEN_FACTORY=0xa9108f7f83fb661e611991116d526fca1a9585ab
18+
BRIDGE_TOKEN_FACTORY_ADMIN=0x92c03c92735167939036274301a2ac208aA4E6BD
19+
20+
# ERC20 Locker
21+
ERC20_LOCKER=0xd42c7b1d5c014c66e0dd31dca0e53758bb19ed16
22+
23+
# ETH Custodian
24+
ETH_CUSTODIAN=
25+
ETH_CUSTODIAN_PROXY=
26+
ETH_CUSTODIAN_ADMIN=
27+
28+
# E-NEAR (Ethereum)
29+
E_NEAR_ADDRESS=0x1f89e263159F541182f875AC05d773657D24eB92
30+
E_NEAR_ADMIN=0x92c03c92735167939036274301a2ac208aA4E6BD
31+
32+
# Ethereum Multisig
33+
SAFE_ADDRESS=0x65ea089438FfcD4C0E3152Bdaf46EDda45432048
34+
35+
# Ethereum Prover
36+
ETH_PROVER=0x847821f85b675c5fce9fe53cf79f623d1a039579
37+
38+
# ======= NEAR CONTRACTS =======
39+
40+
# OmniBridge NEAR
41+
OMNI_BRIDGE_NEAR=omni.n-bridge.testnet # Same as OMNI_BRIDGE_ACCOUNT_ID
42+
OMNI_BRIDGE_ACCOUNT_ID=omni.n-bridge.testnet
43+
OMNI_PROVER=omni-prover.testnet
44+
45+
# Bridge Token Factory (NEAR)
46+
BRIDGE_TOKEN_FACTORY_ACCOUNT_ID=factory.sepolia.testnet
47+
48+
# Token Locker
49+
TOKEN_LOCKER=ft-locker.sepolia.testnet
50+
TOKEN_LOCKER_ADMIN=ft-locker.sepolia.testnet
51+
52+
# E-NEAR (NEAR)
53+
E_NEAR_ACCOUNT_ID=e-near.sepolia.testnet
54+
55+
# NEAR Protocol
56+
ETH_LIGHT_CLIENT=client-eth2.sepolia.testnet
57+
ETH_ACCOUNT_ID=eth.sepolia.testnet # If needed
58+
WRAPPED_NEAR_ID=wrap.testnet
59+
DAO_ACCOUNT_ID=rainbow-bridge.sputnikv2.testnet
60+
61+
# ======= PRIVATE KEYS (don't commit to git) =======
62+
# BRIDGE_TOKEN_FACTORY_ADMIN_PRIVATE_KEY=
63+
# OMNI_BRIDGE_ADMIN_PRIVATE_KEY=
64+
# ETH_CUST_ADMIN_PRIVATE_KEY=
65+
# E_NEAR_ADMIN_PRIVATE_KEY=
66+
# SIGNER_ACCOUNT_ID=

migration/verification/README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Migration Verification Scripts
2+
3+
A collection of scripts to verify different aspects of the bridge migration process.
4+
5+
## Verify Paused Methods
6+
7+
This script checks that necessary contract methods are properly paused before proceeding with migration.
8+
9+
### Features
10+
11+
- Verifies pause status for all Ethereum and NEAR contracts
12+
- Handles transparent proxy contracts correctly
13+
- Provides color-coded, clear output with detailed explanations
14+
- Includes a migration checklist showing what should be paused
15+
16+
### Setup
17+
18+
1. **Clone the repo**:
19+
```bash
20+
git clone https://github.com/near-one/omni-bridge.git
21+
git checkout migration
22+
cd migration/verification
23+
```
24+
25+
2. **Install dependencies**:
26+
```bash
27+
pnpm install
28+
```
29+
30+
3. **Configure environment**:
31+
Create a `.env` file with contract addresses. Copy the `.env.testnet` or `.env.mainnet` file into `.env` in this directory
32+
33+
```bash
34+
# Ethereum network configuration
35+
NETWORK_ETH=sepolia
36+
37+
# NEAR network configuration
38+
NETWORK_NEAR=testnet
39+
40+
# Contract addresses are included from the main migration .env
41+
# No need to configure separate .env files for each script
42+
```
43+
44+
### Running the script
45+
46+
```bash
47+
pnpm start
48+
```
49+
50+
Or run directly with:
51+
52+
```bash
53+
pnpm tsx verify-paused-methods.ts
54+
```
55+
56+
### Output
57+
58+
The script provides a clear status report showing:
59+
- Which contracts are being checked
60+
- If methods are paused (✓) or not paused (✗)
61+
- A checklist for what should be paused for a safe migration
62+
63+
### Screenshot
64+
65+
![freeze](https://github.com/user-attachments/assets/774a66fe-7200-4c50-ae35-7981a4420fef)
66+
67+
68+
### Next steps
69+
70+
After verifying the pause status, you can proceed with the migration process by following the next steps in the migration checklist.
71+
72+
## Development
73+
74+
- Formatting: `pnpm format`
75+
- Linting: `pnpm lint`
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "verification",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1",
8+
"lint": "biome lint . --fix",
9+
"format": "biome format . --fix",
10+
"start": "tsx verify-paused-methods.ts"
11+
},
12+
"keywords": [],
13+
"author": "",
14+
"license": "ISC",
15+
"devDependencies": {
16+
"@biomejs/biome": "^1.9.4",
17+
"tsx": "^4.19.3",
18+
"typescript": "^5.8.2"
19+
},
20+
"dependencies": {
21+
"chalk": "^5.4.1",
22+
"dotenv": "^16.4.7",
23+
"ethers": "^6.13.5",
24+
"near-api-js": "^5.1.0"
25+
}
26+
}

0 commit comments

Comments
 (0)