Skip to content
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

repay/withdraw shares input #194

Merged
merged 34 commits into from
Aug 5, 2023
Merged

Conversation

MathisGD
Copy link
Contributor

@MathisGD MathisGD commented Jul 28, 2023

withdraw/repay exact amount maths:
main.pdf

Rubilmax

This comment was marked as resolved.

Copy link
Collaborator

@Rubilmax Rubilmax left a comment

Choose a reason for hiding this comment

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

100% in favor of this suggestion similar to EIP4626, though @QGarchery was not when we talked about it if I recall correctly

src/Blue.sol Outdated Show resolved Hide resolved
@Rubilmax
Copy link
Collaborator

Also fixes #177 for repay/withdraw (but not liquidate)

@makcandrov
Copy link
Contributor

makcandrov commented Aug 1, 2023

Imo, for this version to be viable, supply, supplyCollateral & borrow should return the new shares minted, and withdraw, withdrawCollateral & repay should return (and send in the callback) the amount withdrawn/repaid

edit: mb supplyCollateral & withdrawCollateral should be exempt from this treatment

@MathisGD
Copy link
Contributor Author

MathisGD commented Aug 1, 2023

the collateral is stored in underlying so I don't think that supplyCollateral and withdrawCollateral need it. For other functions I'll think about it.

@MathisGD MathisGD changed the base branch from feat/repay-withdraw-all to main August 1, 2023 10:10
@MathisGD MathisGD changed the base branch from main to feat/repay-withdraw-all August 1, 2023 10:14
src/Blue.sol Outdated Show resolved Hide resolved
@MathisGD MathisGD changed the base branch from feat/repay-withdraw-all to main August 4, 2023 15:48
@MathisGD MathisGD dismissed stale reviews from Rubilmax and julien-devatom August 4, 2023 15:48

The base branch was changed.

@MathisGD MathisGD mentioned this pull request Aug 4, 2023
Rubilmax
Rubilmax previously approved these changes Aug 4, 2023
Copy link
Collaborator

@Rubilmax Rubilmax left a comment

Choose a reason for hiding this comment

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

There are still things that deserve a discussion (or additional thoughts on my end) but we can merge like so and I'll think about it afterwards

@MathisGD MathisGD changed the title Repay withdraw max alternative repay/withdraw shares input Aug 4, 2023
Jean-Grimal
Jean-Grimal previously approved these changes Aug 4, 2023
src/libraries/BlueLib.sol Outdated Show resolved Hide resolved
src/libraries/BlueLib.sol Outdated Show resolved Hide resolved
pakim249CAL
pakim249CAL previously approved these changes Aug 4, 2023
@MathisGD MathisGD dismissed stale reviews from pakim249CAL, Jean-Grimal, and Rubilmax via 9be7701 August 4, 2023 18:12
pakim249CAL
pakim249CAL previously approved these changes Aug 4, 2023
@MerlinEgalite MerlinEgalite merged commit bd93076 into main Aug 5, 2023
@MerlinEgalite MerlinEgalite deleted the feat/repay-withdraw-max-alternative branch August 5, 2023 09:27
test/hardhat/Blue.spec.ts Show resolved Hide resolved
@MathisGD MathisGD mentioned this pull request Aug 5, 2023
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.

Require shares > 0 upon supply/withdraw/borrow/repay? Repay/Withdraw max
7 participants