Skip to content

Fix deal mock celo using mint()#50

Open
Mouradif wants to merge 4 commits intomainfrom
fix/deal-mock-celo
Open

Fix deal mock celo using mint()#50
Mouradif wants to merge 4 commits intomainfrom
fix/deal-mock-celo

Conversation

@Mouradif
Copy link
Copy Markdown
Contributor

@Mouradif Mouradif commented Mar 17, 2026

dealFork was failing for mock Celo because foundry couldn't find the storage slot for some reason. This PR uses the mint() function on Celo instead

Also: fixed a variable name shadowing in a test

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.

Stale comment

This PR switches CELO mock funding in SetupFork from dealFork(..., true) to explicit mint() calls, and refactors WeekendSituationTest to avoid repeated local casting of the factory.

Findings

test/integration/WeekendSituationTest.t.sol

  • 🔴 CriticalL35, L42, L54: fpmmFactory is declared as address in V3IntegrationBase, but this PR treats it as IFPMMFactory. This introduces a compile-time regression (member deployedFPMMAddresses not found in address) and blocks the test suite.

Suggested fix (pick one):

// Option A: keep base state var as address and cast locally
fpmmFactory = lookupProxyOrFail("FPMMFactory");
...
IFPMMFactory factory = IFPMMFactory(fpmmFactory);
address[] memory fpmms = factory.deployedFPMMAddresses();
// Option B: change base type once (broader impact)
IFPMMFactory internal fpmmFactory;

Final verdict: 🚫 Needs changes

Open in Web View Automation 

Sent by Cursor Automation: PR Review

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.

Stale comment

This PR switches fork CELO funding from dealFork(...) to explicit mint() on the etched MockCELO, removes local fpmmFactory shadowing in weekend integration tests, and updates foundry.lock revisions.

test/integration/WeekendSituationTest.t.sol

  • 🔴 CRITICAL
  • line 35 (with downstream impact at lines 42 and 54): fpmmFactory is inherited from V3IntegrationBase as address, but this change treats it as IFPMMFactory and then calls fpmmFactory.deployedFPMMAddresses(). This is a type-level regression that will fail compilation (Member "deployedFPMMAddresses" not found in address).
  • Fix by either:
    1. Keeping fpmmFactory as address and using a non-shadowing local typed alias (e.g. IFPMMFactory factory = IFPMMFactory(fpmmFactory);), or
    2. Promoting the base-state variable type to IFPMMFactory consistently where it is declared and consumed.

Final verdict: 🚫 Needs changes

Open in Web View Automation 

Sent by Cursor Automation: PR Review

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.

This PR replaces the CELO fork funding path in SetupFork to use mint() on the etched mock token and cleans up the FPMM factory access pattern in the weekend integration test. The changes are small, targeted, and aligned with the PR goal.

No findings.

Final verdict: ✅ LGTM

Open in Web View Automation 

Sent by Cursor Automation: PR Review

@Mouradif Mouradif requested a review from philbow61 March 27, 2026 10:27
Copy link
Copy Markdown
Contributor

@philbow61 philbow61 left a comment

Choose a reason for hiding this comment

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

For me, the SetupFork script is still failing on celo mainnet?

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.

2 participants