Skip to content

Conversation

@imthatcarlos
Copy link
Contributor

@imthatcarlos imthatcarlos commented Oct 22, 2025

changes

  • integration + unit tests for ChainlinkOEVWrapper and ChainlinkOEVMorphoWrapper
  • mip-x37

todo

  • update integration tests to loop over every token wrapper and execute assertions
  • update script to only deploy one implementation
  • proper liquidation setup in integration tests
  • for core oev wrapperrs, use _addReserves on the collateral mtoken as the fee recipient (ie no need for feeRecipient)
  • for morpho oev wrappers, use the equivalent core market as the feeRecipient on deployment
  • update integration tests
  • add integration tests against real 10/10 liquidations to get the fees that would've been collected if these oev wrappers were up
  • confirm we call setFeed for all markets

@imthatcarlos imthatcarlos marked this pull request as draft October 23, 2025 16:15
@imthatcarlos imthatcarlos marked this pull request as ready for review October 29, 2025 22:08
@imthatcarlos imthatcarlos changed the base branch from fix/oev-wrapper to main November 18, 2025 14:37
@imthatcarlos imthatcarlos changed the title ChainlinkOEVWrapper tests + proposal mip-x37: ChainlinkOEVWrapper + ChainlinkOEVMorphoWrapper Nov 18, 2025
morpho.supplyCollateral(params, collateralAmount, BORROWER, "");

// Try to borrow - if it fails due to insufficient liquidity, skip the test
try morpho.borrow(params, borrowAmount, 0, BORROWER, BORROWER) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would be great to mock liqudity on morpho so we always execute the test no matter the onchain state

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i removed the try...catch and it seems the borrow goes through for all of them.

@imthatcarlos imthatcarlos changed the title mip-x37: ChainlinkOEVWrapper + ChainlinkOEVMorphoWrapper ChainlinkOEVWrapper + ChainlinkOEVMorphoWrapper Nov 19, 2025
* @notice Allows anyone to redeem this contract's mTokens and add the reserves to the mToken
* @param _mToken Address of the mToken to redeem and add reserves to
*/
function redeemAndAddReserves(address _mToken) external {
Copy link
Collaborator

@anajuliabit anajuliabit Nov 19, 2025

Choose a reason for hiding this comment

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

Allowing the caller to pass the mToken looks dangeours to me because they can deploy a fake mToken and try to steal the contract money.

What are yours thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, we need to whitelist those mTokens

MOONWELL_WETH = _moonwellWETH;
whitelistedMarkets[_moonwellWETH] = true;

_transferOwnership(msg.sender);
Copy link
Collaborator

Choose a reason for hiding this comment

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

lets not use msg.sender here, add the owner as a parameter, this should be the temporal goverrnor

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I transfer ownership in the proposal script, after whitelisting all the markets

@moonwell-fi moonwell-fi deleted a comment from openzeppelin-code bot Nov 21, 2025
@openzeppelin-code
Copy link

openzeppelin-code bot commented Nov 21, 2025

ChainlinkOEVWrapper + ChainlinkOEVMorphoWrapper

Generated at commit: 427b23414928078ad68a3745ec8c479ea9ca712b

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
4
4
0
12
46
66
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

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.

3 participants