8000 Internalize share to amount logic · Issue #64 · morpho-org/morpho-blue · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Internalize share to amount logic #64

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

Closed
pakim249CAL opened this issue Jul 5, 2023 · 7 comments · Fixed by #94 or #109
Closed

Internalize share to amount logic #64

pakim249CAL opened this issue Jul 5, 2023 · 7 comments · Fixed by #94 or #109
Assignees

Comments

@pakim249CAL
Copy link
Contributor

No description provided.

@QGarchery
Copy link
Contributor

I'm for this, having a library that handles shares will make our code more robust because we will be able to verify it independently of any other code

@MathisGD
Copy link
Contributor
MathisGD commented Jul 6, 2023

I have an idea for a branchless way to do that

@MathisGD
Copy link
Contributor
MathisGD commented Jul 6, 2023

From @Rubilmax (#66)

See how I did it:
https://github.com/morpho-labs/blue/blob/poc/rubilmax/src/libraries/SharesMath.sol

@pakim249CAL
Copy link
Contributor Author

I like @Rubilmax's solution except that it should also include rounding up or down. And we should be explicit in the code every time whether we round up or down.

@MerlinEgalite
Copy link
Contributor

Assigning @Rubilmax to this one as well since it goes with #71 I think

@Rubilmax
Copy link
Collaborator
Rubilmax commented Jul 10, 2023

Regarding #83 (comment):

Would you rather prefer relying on OZ's general-purpose solution (works for any asset, with VIRTUAL_SHARES = 10 ** 0), or on a solution with DEFAULT_SHARES = 1e18 which can work for all assets with less than 18 decimals?

@MerlinEgalite
Copy link
Contributor

Given that blue should work for every asset on earth we may prefer the OZ solution (even though we decided not doing this for ma3's vault).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants
0