Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions migration/.env.mainnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Network Configuration
INFURA_API_KEY=your_infura_key
NETWORK_ETH=mainnet
NETWORK_NEAR=mainnet
CHAIN_ID=1 # Mainnet chain ID

# RPC URLs (derived from other settings, but can be overridden)
# ETH_RPC_URL=https://mainnet.infura.io/v3/${INFURA_API_KEY}

# ======= ETHEREUM CONTRACTS =======

# OmniBridge Ethereum
OMNI_BRIDGE_ETH=
OMNI_BRIDGE_ADMIN=

# Bridge Token Factory
BRIDGE_TOKEN_FACTORY=0x252e87862A3A720287E7fd527cE6e8d0738427A2
BRIDGE_TOKEN_FACTORY_ADMIN=

# ERC20 Locker
ERC20_LOCKER=0x23ddd3e3692d1861ed57ede224608875809e127f

# ETH Custodian
ETH_CUSTODIAN=0x6BFaD42cFC4EfC96f529D786D643Ff4A8B89FA52
ETH_CUSTODIAN_PROXY=
ETH_CUSTODIAN_ADMIN=0x2468603819Bf09Ed3Fb6f3EFeff24B1955f3CDE1

# E-NEAR (Ethereum)
E_NEAR_ADDRESS=0x85F17Cf997934a597031b2E18a9aB6ebD4B9f6a4
E_NEAR_ADMIN=0x2468603819Bf09Ed3Fb6f3EFeff24B1955f3CDE1 # Aurora multi-sig?

# Ethereum Multisig
SAFE_ADDRESS=0x2468603819Bf09Ed3Fb6f3EFeff24B1955f3CDE1

# Ethereum Prover
ETH_PROVER=0x051ad3f020274910065dcb421629cd2e6e5b46c4

# ======= NEAR CONTRACTS =======

# OmniBridge NEAR
OMNI_BRIDGE_NEAR=omni.bridge.near # Same as OMNI_BRIDGE_ACCOUNT_ID
OMNI_BRIDGE_ACCOUNT_ID=omni.bridge.near
OMNI_PROVER=omni-prover.bridge.near

# Bridge Token Factory (NEAR)
BRIDGE_TOKEN_FACTORY_ACCOUNT_ID=factory.bridge.near

# Token Locker
TOKEN_LOCKER=ft-locker.bridge.near
TOKEN_LOCKER_ADMIN=ft-locker.bridge.near
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value doesn't seem correct

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got it from here: https://github.com/Near-One/bridge-ops

Not sure what the right one is - we already have something for the Omni Bridge. I thought the Token Locker was slightly different?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But why is FT_LOCKED_ADMIN same address?


# E-NEAR (NEAR)
E_NEAR_ACCOUNT_ID=e-near.near

# NEAR Protocol
ETH_LIGHT_CLIENT=client-eth2.bridge.near
ETH_ACCOUNT_ID= # If needed
WRAPPED_NEAR_ID=wrap.near
DAO_ACCOUNT_ID=rainbowbridge.sputnik-dao.near

# ======= PRIVATE KEYS (don't commit to git) =======
# BRIDGE_TOKEN_FACTORY_ADMIN_PRIVATE_KEY=
# OMNI_BRIDGE_ADMIN_PRIVATE_KEY=
# ETH_CUST_ADMIN_PRIVATE_KEY=
# E_NEAR_ADMIN_PRIVATE_KEY=
# SIGNER_ACCOUNT_ID=
66 changes: 66 additions & 0 deletions migration/.env.testnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Network Configuration
INFURA_API_KEY=your_infura_key
NETWORK_ETH=sepolia
NETWORK_NEAR=testnet
CHAIN_ID=11155111 # Sepolia chain ID

# RPC URLs (derived from other settings, but can be overridden)
# ETH_RPC_URL=https://sepolia.infura.io/v3/${INFURA_API_KEY}

# ======= ETHEREUM CONTRACTS =======

# OmniBridge Ethereum
OMNI_BRIDGE_ETH=0x68a86e0Ea5B1d39F385c1326e4d493526dFe4401
OMNI_BRIDGE_ADMIN=0xD9cB077700AA4D32d30bDA5e99bb171549b5a382

# Bridge Token Factory
BRIDGE_TOKEN_FACTORY=0xa9108f7f83fb661e611991116d526fca1a9585ab
BRIDGE_TOKEN_FACTORY_ADMIN=0x92c03c92735167939036274301a2ac208aA4E6BD

# ERC20 Locker
ERC20_LOCKER=0xd42c7b1d5c014c66e0dd31dca0e53758bb19ed16

# ETH Custodian
ETH_CUSTODIAN=
ETH_CUSTODIAN_PROXY=
ETH_CUSTODIAN_ADMIN=

# E-NEAR (Ethereum)
E_NEAR_ADDRESS=0x1f89e263159F541182f875AC05d773657D24eB92
E_NEAR_ADMIN=0x92c03c92735167939036274301a2ac208aA4E6BD

# Ethereum Multisig
SAFE_ADDRESS=0x65ea089438FfcD4C0E3152Bdaf46EDda45432048

# Ethereum Prover
ETH_PROVER=0x847821f85b675c5fce9fe53cf79f623d1a039579

# ======= NEAR CONTRACTS =======

# OmniBridge NEAR
OMNI_BRIDGE_NEAR=omni.n-bridge.testnet # Same as OMNI_BRIDGE_ACCOUNT_ID
OMNI_BRIDGE_ACCOUNT_ID=omni.n-bridge.testnet
OMNI_PROVER=omni-prover.testnet

# Bridge Token Factory (NEAR)
BRIDGE_TOKEN_FACTORY_ACCOUNT_ID=factory.sepolia.testnet

# Token Locker
TOKEN_LOCKER=ft-locker.sepolia.testnet
TOKEN_LOCKER_ADMIN=ft-locker.sepolia.testnet

# E-NEAR (NEAR)
E_NEAR_ACCOUNT_ID=e-near.sepolia.testnet

# NEAR Protocol
ETH_LIGHT_CLIENT=client-eth2.sepolia.testnet
ETH_ACCOUNT_ID=eth.sepolia.testnet # If needed
WRAPPED_NEAR_ID=wrap.testnet
DAO_ACCOUNT_ID=rainbow-bridge.sputnikv2.testnet

# ======= PRIVATE KEYS (don't commit to git) =======
# BRIDGE_TOKEN_FACTORY_ADMIN_PRIVATE_KEY=
# OMNI_BRIDGE_ADMIN_PRIVATE_KEY=
# ETH_CUST_ADMIN_PRIVATE_KEY=
# E_NEAR_ADMIN_PRIVATE_KEY=
# SIGNER_ACCOUNT_ID=
75 changes: 75 additions & 0 deletions migration/verification/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Migration Verification Scripts

A collection of scripts to verify different aspects of the bridge migration process.

## Verify Paused Methods

This script checks that necessary contract methods are properly paused before proceeding with migration.

### Features

- Verifies pause status for all Ethereum and NEAR contracts
- Handles transparent proxy contracts correctly
- Provides color-coded, clear output with detailed explanations
- Includes a migration checklist showing what should be paused

### Setup

1. **Clone the repo**:
```bash
git clone https://github.com/near-one/omni-bridge.git
git checkout migration
cd migration/verification
```

2. **Install dependencies**:
```bash
pnpm install
```

3. **Configure environment**:
Create a `.env` file with contract addresses. Copy the `.env.testnet` or `.env.mainnet` file into `.env` in this directory

```bash
# Ethereum network configuration
NETWORK_ETH=sepolia

# NEAR network configuration
NETWORK_NEAR=testnet

# Contract addresses are included from the main migration .env
# No need to configure separate .env files for each script
```

### Running the script

```bash
pnpm start
```

Or run directly with:

```bash
pnpm tsx verify-paused-methods.ts
```

### Output

The script provides a clear status report showing:
- Which contracts are being checked
- If methods are paused (✓) or not paused (✗)
- A checklist for what should be paused for a safe migration

### Screenshot

![freeze](https://github.com/user-attachments/assets/774a66fe-7200-4c50-ae35-7981a4420fef)


### Next steps

After verifying the pause status, you can proceed with the migration process by following the next steps in the migration checklist.

## Development

- Formatting: `pnpm format`
- Linting: `pnpm lint`
26 changes: 26 additions & 0 deletions migration/verification/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "verification",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "biome lint . --fix",
"format": "biome format . --fix",
"start": "tsx verify-paused-methods.ts"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"tsx": "^4.19.3",
"typescript": "^5.8.2"
},
"dependencies": {
"chalk": "^5.4.1",
"dotenv": "^16.4.7",
"ethers": "^6.13.5",
"near-api-js": "^5.1.0"
}
}
Loading
Loading