-
Notifications
You must be signed in to change notification settings - Fork 33
ChainlinkOEVWrapper + ChainlinkOEVMorphoWrapper #536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…tracts-v2 into fix/oev-wrapper
7640667 to
37ec3f7
Compare
…tor keeps 40% of remaining collateral seized after repay amoutn
test/integration/oracle/ChainlinkOEVMorphoWrapperIntegration.t.sol
Outdated
Show resolved
Hide resolved
| 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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
…r underlying or native); update mip deployment and tests
src/OEVProtocolFeeRedeemer.sol
Outdated
| * @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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
ChainlinkOEVWrapper + ChainlinkOEVMorphoWrapper
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
changes
ChainlinkOEVWrapperandChainlinkOEVMorphoWrappertodo
_addReserveson the collateral mtoken as the fee recipient (ie no need forfeeRecipient)feeRecipienton deploymentsetFeedfor all markets