Skip to content

feat: EUROP/EURm FPMM pool on Polygon#76

Open
nvtaveras wants to merge 14 commits into
mainfrom
feat/europPolygon
Open

feat: EUROP/EURm FPMM pool on Polygon#76
nvtaveras wants to merge 14 commits into
mainfrom
feat/europPolygon

Conversation

@nvtaveras

@nvtaveras nvtaveras commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

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 migrationOwner multisig is whitelisted as the sole oracle and reports a fixed 1.0 rate with a ~unlimited (1 year) expiry. A ValueDeltaBreaker (same config as the Base EURC/EUR pool) lets the multisig halt trading by reporting a rate that deviates beyond the threshold from 1.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 fixed 1e24 median the regular FPMM normalizes to a bit-identical 1:1 rate. Keeping the regular implementation also avoids deploying/registering a new implementation and making fpmmImplementation per-pool.

Changes

  • MentoConfig_polygon.sol
    • Register EUROP as collateral + ReserveV2 collateral.
    • Add the EURm/EUROP FPMM pool (ReserveLiquidityStrategy, EURm as debt token), with params copied from the Base EURm/EURC pool and marked with TODO for review before deployment.
    • Add the relayer-less EUROP/EUR rate feed with a 1-year expiry and a ValueDeltaBreaker (0.5% threshold, reference 1.0).
  • MentoConfig_polygon_testnet.sol (Amoy): register a mock EUROP collateral (6 decimals, matching the real token). Pool/feed/breaker config is inherited; DeployMockCollaterals deploys 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 because AddRateFeed only sets expiries for relayer-backed feeds), and reports the 1.0 rate. Re-running refreshes the report before it expires.

Deployment notes

  • SetupEuropRateFeed and AddRateFeed can run in either order, but both must run before CreateFPMM (which seeds initial liquidity at the oracle rate).
  • No changes needed to AddRateFeed or CreateFPMMAddRateFeed skips relayer deployment for relayer-less feeds but still wires the BreakerBox + ValueDeltaBreaker from config.
  • The 1-year expiry acts as a dead-man switch: if the report lapses, swaps revert with NoRecentRate (funds safe), and re-running SetupEuropRateFeed resumes 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, SetupEuropRateFeed whitelists migrationOwner as 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. AddRateFeed still wires BreakerBox for relayer-less feeds.

NTTConfig removes Base from EURm burn-mint lanes (Celo, Monad, Polygon only). SetupFork gains Polygon mainnet Safe 1-of-1 setup; OracleHelper skips 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 (NTTBridgeHarness and 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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bed220c. Configure here.

nvtaveras added 11 commits July 2, 2026 15:28
- 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
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