feat: EUROP/EURm FPMM pool on Polygon#76
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bed220c. Configure here.
| console.log(unicode" ⏭️ Skipped MockERC20 (%s), already exists", symbol); | ||
| console.log(" at %s\n", predicted); | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Skip bypasses mock collateral setup
Medium Severity
The idempotency check for mock collaterals uses continue. If a mock was previously deployed but mint and transferOwnership didn't complete, subsequent runs skip these steps, leaving the deployer as owner and no test liquidity for migrationOwner. This breaks dependent flows.
Reviewed by Cursor Bugbot for commit bed220c. Configure here.
- NTTBridgeOneWay: negative test for the partial celo<>polygon config window - asserts celo->polygon reverts at source (InvalidPeerDecimals) and polygon->celo delivery is rejected on celo (InvalidWormholePeer) - NTTBridgeHarness: split _bridge into _sendLeg + _mockVaaDelivery so negative tests can expectRevert on delivery; move _chainByName in from the lane test; log burned/locked and minted/unlocked based on the live NttManager mode - SetupFork: support polygon (137) - converts deployer/migrationOwner safes to 1/1 so fork runs don't queue multisig proposals


Summary
Adds a new EUROP/EURm FPMM pool to Polygon (and Polygon Amoy testnet), replacing the previously planned EURC/EUR pool on Base.
Unlike other pools, EUROP/EUR has no Chainlink relayer available. Instead of an automated oracle, the
migrationOwnermultisig is whitelisted as the sole oracle and reports a fixed1.0rate with a ~unlimited (1 year) expiry. AValueDeltaBreaker(same config as the Base EURC/EUR pool) lets the multisig halt trading by reporting a rate that deviates beyond the threshold from1.0, providing a manual-intervention kill switch in case of a depeg.The pool uses the regular FPMM implementation (
FPMM:v3.0.0), not the one-to-one implementation. The one-to-one variant still validates the oracle feed (trading mode + rate freshness) rather than removing the oracle dependency, so it requires the exact same setup while offering no practical benefit; with a fixed1e24median the regular FPMM normalizes to a bit-identical1:1rate. Keeping the regular implementation also avoids deploying/registering a new implementation and makingfpmmImplementationper-pool.Changes
MentoConfig_polygon.solTODOfor review before deployment.EUROP/EURrate feed with a 1-year expiry and aValueDeltaBreaker(0.5% threshold, reference1.0).MentoConfig_polygon_testnet.sol(Amoy): register a mock EUROP collateral (6 decimals, matching the real token). Pool/feed/breaker config is inherited;DeployMockCollateralsdeploys the mock automatically..treb/addressbook.json: add EUROP token address for chain 137.script/actions/SetupEuropRateFeed.s.sol(new): idempotent,migrationOwner-only script that whitelists the multisig as the feed's oracle, sets the per-feed report expiry from config (required becauseAddRateFeedonly sets expiries for relayer-backed feeds), and reports the1.0rate. Re-running refreshes the report before it expires.Deployment notes
SetupEuropRateFeedandAddRateFeedcan run in either order, but both must run beforeCreateFPMM(which seeds initial liquidity at the oracle rate).AddRateFeedorCreateFPMM—AddRateFeedskips relayer deployment for relayer-less feeds but still wires the BreakerBox + ValueDeltaBreaker from config.NoRecentRate(funds safe), and re-runningSetupEuropRateFeedresumes trading.Note
Medium Risk
New trading pool depends on multisig-reported oracle rates and long expiry (operational dead-man switch); EURm NTT topology change removes Base and must stay aligned with on-chain peer config before bridges go live.
Overview
Introduces an EURm/EUROP FPMM on Polygon (and mock EUROP on Amoy): EUROP is registered as collateral/ReserveV2 collateral, the pool uses the EUROP/EUR rate feed, and several pool/breaker parameters are copied from the former Base EURC setup with TODO review flags.
Because there is no Chainlink feed,
SetupEuropRateFeedwhitelistsmigrationOwneras the sole SortedOracles reporter, sets the per-feed expiry from config (1 year), and idempotently posts a fixed 1.0 rate; a ValueDeltaBreaker on that feed allows halting swaps via off-peg reports.AddRateFeedstill wires BreakerBox for relayer-less feeds.NTTConfigremoves Base from EURm burn-mint lanes (Celo, Monad, Polygon only).SetupForkgains Polygon mainnet Safe 1-of-1 setup;OracleHelperskips stale-only Anvil re-reports and fixes duplicate rate-feed collection / refresh ordering to avoid treb nonce desync on long-expiry EUROP/EUR.New fork-based NTT integration tests (
NTTBridgeHarnessand sweep/lane/topology/one-way suites) validate live ConfigureNTT wiring; deploy scripts get clearer logging and mock collateral skip-if-exists behavior.Reviewed by Cursor Bugbot for commit 3907cd7. Bugbot is set up for automated code reviews on this repo. Configure here.