feat: add multi chain upgrade script#136
Draft
PierrickGT wants to merge 4 commits into
Draft
Conversation
Replace the decommissioned protocol-api WMHolders/WMHoldersL2 resolvers with zero-indexer's per-(chain, account) wm_earner table (is_earning), resolved over Hasura by probing the wm_earner / indexer_wm_earner field names. - enrich the balance column on-chain via balanceOf: Alchemy for supported networks, verified public RPCs (citrea, mantra, 0g, fluent, moca, plume) for the rest so they get balances without an Alchemy key - auto-load .env at startup, with shell-exported values taking precedence - sort CSV rows by balance descending (cosmetic; every consumer re-sorts by address)
Make earners/*.csv the single source of truth for the wM v1->v2 migration earner set and derive the on-chain list from it. - get-earners.ts: de-duplicate accounts (wm_earner can return an account in multiple rows) and write a header-only CSV for zero-earner networks. - generate-earners-array.ts: read earners/*.csv instead of protocol-api, emit a get<Network>Earners() per network (empty array when no earners) and a getEarners(chainId) dispatcher mapping each chain id to its function. - EarnersAddresses.sol: regenerated for all 16 zero-indexer networks. - DeployUpgradeMainnet: resolve earners via the generated dispatcher. - package.json: add generate-earners-array script; prettier now covers script/.
- get-earners.ts: de-duplicate accounts by address (wm_earner can return an account in multiple rows, which would break the strictly-ascending invariant), and add monad (chain 143) now that zero-indexer covers it. - generate-earners-array.ts: mirror the monad chain id in the dispatcher map and drop the stale optimism entry. - EarnersAddresses.sol: regenerated for the current 16-network CSV set.
…ication - DeployConfig.sol: per-chain config (governance roles, migration admin, excess destination) keyed by chain id; reverts for unconfigured chains. - DeployUpgrade.s.sol: generic across chains — shared constants, earners from the EarnersAddresses dispatcher, migrator addresses derived from the deployer's current nonce. Replaces DeployUpgradeMainnet.s.sol; no deployer/nonce pinning since the migration admin performs the migration via migrate(migrator). - Makefile: per-network deploy-upgrade-* targets passing the right verifier per chain (etherscan vs blockscout); drop invalid --show-standard-json-input. - foundry.toml: Etherscan V2 endpoints and per-network rpc/verifier config. chore(earners): remove zero-indexer issue notes from the repo
Changes to gas cost
🧾 Summary (20% most significant diffs)
Full diff report 👇
|
LCOV of commit
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.