-
Notifications
You must be signed in to change notification settings - Fork 84
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: LiquityV2 #419
base: improvement/upgrade-hardhat
Are you sure you want to change the base?
feat: LiquityV2 #419
Conversation
…racts into feat/liquity-V2
// when pulling max amount, we need to leave some WETH for gas compensation | ||
if (isMaxPull) { | ||
_params.collAmount = _collToken.pullTokensIfNeeded(_params.from, _params.collAmount); | ||
if (_params.collAmount <= ETH_GAS_COMPENSATION) { |
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.
Do we need this check as it's going to revert on the underflow either way, also if the amount is slightly bigger it's still going to revert because it's not going to be enough collateral for min_debt.
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.
It’s not necessary; it was more of a sanity check to communicate more explicitly to the caller that WETH compensation is required and that the max uint256 will account for this. It’s true that this would need to be significantly higher than just the WETH gas compensation amount to cover the debt on the Liquity side.
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.
Overall looking good a few minor change requests, will take a second look when we're ready for deployment
This PR includes following contracts:
Also, new strategies are introduced:
Things left to do:
SDK PR: defisaver/defisaver-sdk#122
AUTOMATION SDK PR: defisaver/automation-sdk#26