-
Notifications
You must be signed in to change notification settings - Fork 20
Migration Verification Script: Check Paused Methods #299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
70cabd9
feat: Add verification script
r-near 9cec3fb
Add screenshot
r-near fa9f1ad
Add sample env file
r-near 6ac3ebc
Split to mainnet and testnet
r-near eac8344
top level dotenv
r-near 74e3824
Add more mainnet addresses
r-near 69c63f0
Minor address fixes
r-near File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
| # 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= | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
|  | ||
|
|
||
|
|
||
| ### 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` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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_ADMINsame address?