Add deployment scripts and config refactor#17
Merged
Conversation
381f757 to
5a6bd68
Compare
_countJsonArrayElements2 only adjusted depth on '['/']', so the nested
tokenOnIMX object inside each mapping was counted alongside the outer
object at depth 1, producing a count of 2x the real number of entries.
When a lookup in _findMappingById missed every entry, the loop iterated
past the true array bounds and vm.parseJsonUint reverted on the
non-existent index. Include '{'/'}' in the depth tracking so only
outer objects are counted.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The first pass of _countJsonArrayElements increments depth on every
'{' or '[', so the subsequent 'else if (c == "{" && depth == 1)'
branch is unreachable and count is always 0. The second pass (with
depth tracking only for '['/']') is what actually produces the count.
Drop the dead first loop. imx_tokens.json entries are flat, so the
remaining logic correctly counts top-level array objects.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Piping jq into while ran the loop in a subshell, so increments to SUCCESS_COUNT, SKIP_COUNT, and FAIL_COUNT were discarded when the subshell exited. The final summary always printed 0 for all three. Drive the loop with process substitution instead so the counters live in the parent shell and the summary reflects actual results. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4b5a11e. Configure here.
ermyas
approved these changes
Apr 17, 2026
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.

Summary
DeployEthContracts.s.sol,DeployZkEVMContracts.s.sol) and extract token mapping registration intoRegisterTokenMappings.s.solconfig/deploy/andconfig/operate/for mainnet/sandbox, add anvil fork setup scripts, and addMigrateHoldings.s.sol,GenerateAssetMappings.s.sol,VerifyAssetMappings.s.solfor phase execution and verificationmain; four commits that overlapped with the already-merged audit feedback (Address audit feedback #8) were dropped as upstream, and conflicts with the newervault_root_provider/VCO changes were resolved to match the branch's final intentTest plan
forge buildpasses (verified locally)forge test --no-match-path 'test/integration/**'passes (126/128 locally; 2 requireZKEVM_RPC_URLand pass in CI)forge fmt --check,forge build --sizes, and tests passNote
Medium Risk
Mostly adds/rewires operational scripts and configuration used for real deployments and migrations; mistakes here could lead to deploying wrong addresses or sending incorrect on-chain calls despite minimal changes to core contract code.
Overview
Introduces new Foundry scripts to deploy migration components per chain (zkEVM:
VaultEscapeProofVerifier,VaultRootReceiverAdapter,VaultWithdrawalProcessor; Ethereum:VaultRootSenderAdapter+StarkExchangeMigrationimplementation) and to separate token mapping registration intoRegisterTokenMappings.s.sol, with scripts writing updated “deployed” JSON outputs.Adds operational utilities to generate and verify
asset_mappings(GenerateAssetMappings.s.sol,VerifyAssetMappings.s.sol) and to execute phased holdings migrations viamigrateHoldings()(MigrateHoldings.s.sol), plus extensive new config data underconfig/deploy/andconfig/operate/for mainnet/sandbox (tokens, mappings, phase data).Updates legacy
DeployL2Contracts.s.solto stop registering mappings during deployment and to emit an output config, tweaks integration tests to use real Axelar sender-adapter expectations and to assert vault root updates, and adjusts tooling (foundry.tomlwrite permissions,.gitignorefordata/).Reviewed by Cursor Bugbot for commit 4b5a11e. Bugbot is set up for automated code reviews on this repo. Configure here.