Skip to content

Deploy swarms production improvements#105

Merged
aliXsed merged 4 commits intomainfrom
aliX/deploy-swarms-production
Apr 7, 2026
Merged

Deploy swarms production improvements#105
aliXsed merged 4 commits intomainfrom
aliX/deploy-swarms-production

Conversation

@aliXsed
Copy link
Copy Markdown
Collaborator

@aliXsed aliXsed commented Apr 7, 2026

Summary

Consolidates deployment and configuration improvements for production swarm deployment on ZkSync.

Changes

  • Use flatten for ZkSync source code verification
  • Allow whitelisting users at construction of paymaster
  • Use NODL_ADMIN as universal owner env var across deploy scripts

aliXsed added 4 commits April 7, 2026 21:45
…ipts

- Rename PAYMASTER_ADMIN/OWNER → NODL_ADMIN in both L1 and ZkSync Forge
  scripts and shell wrappers since the owner role applies to all contracts
  (ServiceProvider, FleetIdentity, SwarmRegistry), not just the paymaster
- Keep PAYMASTER_WITHDRAWER for the paymaster-specific withdrawer role
- Fix undefined $deployer fallback: derive DEPLOYER_ADDRESS via cast wallet
  address in both shell scripts
- Fix print_summary referencing nonexistent $OWNER/$NODLE_SWARM_OPERATOR
  variables in ZkSync shell script
- Add COUNTRY_MULTIPLIER to env var documentation in all scripts
- Add 0x prefix normalization and deployer address derivation to L1 shell
  script for consistency with ZkSync script
forge script --verify sends absolute source paths which the ZkSync
block explorer verifier rejects ('import with absolute or traversal
path'). Replace with a separate verify_source_code() step that:

1. Flattens each contract into a single .sol file (no imports)
2. Copies flat files into src/ temporarily
3. Runs forge verify-contract with the flat source
4. Extracts constructor args from the broadcast JSON automatically
5. Cleans up temporary files

Also:
- Add per-network VERIFIER_URL and FORGE_CHAIN in config section
  (mainnet: zksync2-mainnet-explorer.zksync.io/contract_verification,
   testnet: explorer.sepolia.era.zksync.dev/contract_verification)
- Remove --verify from forge script args (broken on ZkSync)
- Wire verify_source_code into main() between verify_deployment and
  update_env_file
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

LCOV of commit 54c8791 during checks #638

Summary coverage rate:
  lines......: 32.2% (769 of 2390 lines)
  functions..: 28.9% (108 of 374 functions)
  branches...: 37.8% (139 of 368 branches)

Files changed coverage rate:
                                                  |Lines       |Functions  |Branches    
  Filename                                        |Rate     Num|Rate    Num|Rate     Num
  ======================================================================================
  script/DeploySwarmUpgradeable.s.sol             | 0.0%     45| 0.0%     1|    -      0
  script/DeploySwarmUpgradeableZkSync.s.sol       | 0.0%     64| 0.0%     1|    -      0
  src/paymasters/BondTreasuryPaymaster.sol        | 0.0%     28| 0.0%     3| 0.0%      6
  test/paymasters/BondTreasuryPaymaster.t.sol     | 0.0%     12| 0.0%     5|    -      0

@aliXsed aliXsed merged commit 242af5f into main Apr 7, 2026
3 checks passed
@aliXsed aliXsed deleted the aliX/deploy-swarms-production branch April 7, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant