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
Feat/morpho is borrowing any #123
Conversation
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.
Looks good to me, changes have been discussed with Auditor as well. The only thing I might ask for is to add a couple of lines in the main PR message here of what the intent of this PR is for future reference.
@@ -97,12 +97,10 @@ contract MorphoAaveV2ATokenAdaptor is BaseAdaptor, MorphoRewardHandler { | |||
/** | |||
* @notice Uses configuration data to determine if the position is liquid or not. | |||
*/ |
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.
This natSpec comment is not longer accurate
) public view override returns (uint256) { | ||
bool isLiquid = abi.decode(configData, (bool)); | ||
if (!isLiquid) return 0; | ||
function withdrawableFrom(bytes memory adaptorData, bytes memory) public view override returns (uint256) { |
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.
@kingofclubstroyDev comment is right. Also please add params descriptions.
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.
Looks good to me other than one change request on nat spec. You can address that with the other fixes from the audit. :)
This PR fixes the Morpho Aave V2 debt token adaptor logic so that calling the strategist repay function will always repay the full amount of debt, where as before it would sometimes leave 1 wei of debt behind.
In addition to the above it also removes the
isLiquid
configuration bool from the Morpho Aave V2 aToken adaptor, and instead reads the cellarsuserMarkets
to determine if the cellar has any active loans. If the cellar has no active loans, the aToken position is liquid, otherwise the aToken position is illiquid.