-
Notifications
You must be signed in to change notification settings - Fork 3
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/repay wrapper #23
base: feat/susds-wrappers
Are you sure you want to change the base?
Conversation
foodaka
commented
Oct 7, 2024
- Adds repay and repaywithpermit wrapper functionality
|
require(amountWrapped > 0, 'INSUFFICIENT_WRAPPED_TOKEN_RECEIVED'); | ||
|
||
SafeERC20.safeApprove(IERC20(TOKEN_OUT), address(POOL), amountWrapped); | ||
POOL.repay(TOKEN_OUT, amountWrapped, 2, onBehalfOf); |
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.
POOL.repay(TOKEN_OUT, amountWrapped, 2, onBehalfOf); | |
POOL.repay(TOKEN_OUT, amountWrapped, VARIABLE_INTEREST_RATE_MODE, onBehalfOf); |
@@ -240,6 +269,23 @@ abstract contract BaseTokenWrapper is Ownable, IBaseTokenWrapper { | |||
IERC20(TOKEN_IN).transfer(onBehalfOf, amountIn); | |||
} | |||
|
|||
function _repayToken( | |||
uint256 amount, |
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.
we need to handle max repayment here
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.
so retrieve the outstanding debt of the user, and repay all if amount
is higher.
we must do the same thing for withdraw
@@ -878,11 +878,16 @@ abstract contract BaseTokenWrapperTest is Test { | |||
} | |||
} | |||
|
|||
function testFuzzBorrowToken(uint256 borrowAmount) public { | |||
function testFuzzRepayToken( |
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.
you are replacing testFuzzBorrowToken
test?