feat: Add guard configuration event scanner for multichain Lagoon deployments#785
Merged
feat: Add guard configuration event scanner for multichain Lagoon deployments#785
Conversation
…loyments Adds a new module `config_event_scanner.py` that decodes the full cross-chain TradingStrategyModuleV0 guard configuration by scanning on-chain events. Follows CCTP destination chains automatically to build a multichain picture. Key features: - `fetch_guard_config_events()` — raw decoded events per chain via Hypersync or web3 - `build_multichain_guard_config()` — structured dataclass output - `resolve_address_label()` — generic contract name resolution with Safe labelling - `format_guard_config_report()` — human-readable output with token/vault name resolution - Diagnostic script `read-guard-config.py` for manual inspection - Config readback step added to `deploy-lagoon-multichain.py` Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix root chain detection: chains with Lagoon vaults are always roots, CCTP destinations are nested under them - Add rendered_chains tracking to prevent circular nesting in bidirectional CCTP setups - Fix mixed-case vault address in flag.py that broke assertions - Add tree report assertions to multichain guard config test Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The `CCTP_DOMAIN_TO_CHAIN_ID.get(domain) or TESTNET_CCTP_DOMAIN_TO_CHAIN_ID.get(domain)` pattern was broken — mainnet dict returns a truthy (but wrong) chain ID for shared domain numbers (e.g. domain 6 → 8453 instead of 84532), so the testnet dict was never consulted. Now checks `TESTNET_CHAIN_IDS` to select the correct mapping, matching the pattern already used in `_decode_cctp_destination_approved()`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
config_event_scanner.pymodule that decodes the full cross-chain TradingStrategyModuleV0 guard configuration by scanning on-chain events emitted during deploymentweb3.eth.get_logs()(Anvil fork testing) backendsresolve_address_label()for generic contract name resolution — labels the Safe as<our multisig>, resolves vaults/tokens byname(), falls back to<unknown>read-guard-config.pydiagnostic script and config readback step todeploy-lagoon-multichain.py🤖 Generated with Claude Code