-
Notifications
You must be signed in to change notification settings - Fork 66
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
Amount and shares as input #248
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.
I'm not a real fan of this solution as it complexifies integrator's understanding
Come on, a simple NATSPEC and everyone understands that you either need to provide Even with this change, Blue is still the simplest protocol to integrate |
Ok but which one I choose? Why? In which configuration should I use amount instead of shares? Those are questions that you now need to ask yourself when integrating Blue while you did not before. This is not easing integration for sure. |
We could have the following NATSPECs: /// @notice Supplies the given amount of assets or shares to the given market on behalf of `onBehalf`,
/// optionally calling back the caller's `onBlueSupply` function with the given bytes of data.
/// @dev Either `amount` or `shares` should be zero.
/// Most usecases should rely on `amount` as an input so the caller
/// is guaranteed to have `amount` tokens pulled from their balance,
/// but the possibility to mint a specific amount of shares is given
/// for full compatibility and precision. |
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.
Also thought about this solution yesterday, but actually it looks very weird tbh
IMO only the amount/share check looks weird, which is resolved well by @makcandrov 's solution. |
I'm still not convinced by this. The integrator still needs to reflect more. What's the upside of this solution? |
We are sure it fits any usecase |
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.
The most permissive interface. Finally, I find interdependency between arguments not so bad. This is easy to do or verify.
For integrators, you can still provide a library with 2 different interfaces, supplyShares
& supplyAmount
, but the primitive permits both.
091f320
Signed-off-by: MathisGD <[email protected]>
… into feat/amount-and-shares-as-input
No description provided.