Skip to content

Add deployment scripts and config refactor#17

Merged
lfportal merged 13 commits intomainfrom
add-deployment-configs
Apr 19, 2026
Merged

Add deployment scripts and config refactor#17
lfportal merged 13 commits intomainfrom
add-deployment-configs

Conversation

@lfportal
Copy link
Copy Markdown
Contributor

@lfportal lfportal commented Apr 17, 2026

Summary

  • Refactor deployment scripts into per-chain entry points (DeployEthContracts.s.sol, DeployZkEVMContracts.s.sol) and extract token mapping registration into RegisterTokenMappings.s.sol
  • Restructure configs under config/deploy/ and config/operate/ for mainnet/sandbox, add anvil fork setup scripts, and add MigrateHoldings.s.sol, GenerateAssetMappings.s.sol, VerifyAssetMappings.s.sol for phase execution and verification
  • Rebased onto current main; four commits that overlapped with the already-merged audit feedback (Address audit feedback #8) were dropped as upstream, and conflicts with the newer vault_root_provider/VCO changes were resolved to match the branch's final intent

Test plan

  • forge build passes (verified locally)
  • forge test --no-match-path 'test/integration/**' passes (126/128 locally; 2 require ZKEVM_RPC_URL and pass in CI)
  • CI forge fmt --check, forge build --sizes, and tests pass

Note

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 + StarkExchangeMigration implementation) and to separate token mapping registration into RegisterTokenMappings.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 via migrateHoldings() (MigrateHoldings.s.sol), plus extensive new config data under config/deploy/ and config/operate/ for mainnet/sandbox (tokens, mappings, phase data).

Updates legacy DeployL2Contracts.s.sol to 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.toml write permissions, .gitignore for data/).

Reviewed by Cursor Bugbot for commit 4b5a11e. Bugbot is set up for automated code reviews on this repo. Configure here.

@lfportal lfportal requested a review from a team as a code owner April 17, 2026 05:49
@lfportal lfportal force-pushed the add-deployment-configs branch from 381f757 to 5a6bd68 Compare April 17, 2026 05:53
Comment thread script/VerifyAssetMappings.s.sol
Comment thread script/GenerateAssetMappings.s.sol
Comment thread scripts/anvil_mint_tokens.sh
lfportal and others added 3 commits April 17, 2026 16:04
_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>
@lfportal lfportal requested a review from ermyas April 17, 2026 06:06
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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.

Comment thread script/DeployEthContracts.s.sol
Comment thread config/operate/sandbox/token_mappings.json
@lfportal lfportal merged commit df46f3d into main Apr 19, 2026
5 checks passed
@lfportal lfportal deleted the add-deployment-configs branch April 19, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants