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

Fix rounding error issue in tapEth calculation #22

Open
Mars12-dev opened this issue Oct 20, 2023 · 0 comments
Open

Fix rounding error issue in tapEth calculation #22

Mars12-dev opened this issue Oct 20, 2023 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Mars12-dev
Copy link
Contributor

Mars12-dev commented Oct 20, 2023

One can get a rounding error when executing function transfer or function burnSharesFrom from the contract TapETH, when the input _tokenAmount is small.

Exemple
let's consider the following exemple:

  • totalSupply: 189804710086258501256 wei

  • totalShares: 189804710086258501256 wei

  • The Balance of Bob in tapETH is 0 wei.

  • Alice sends25 *10^18 weitapEth to Bob. Bob receives 24999999999999999999 wei tapETH. So, there is a rounding error of 1 wei tapETH.

  • Now, Bob burns his total balance of tapETH (24999999999999999999 wei). Bob keeps 1 wei tapETH and 1 wei shares. So, there is a rounding error of 1 wei.

@Mars12-dev Mars12-dev self-assigned this Oct 20, 2023
@azat-hafizov azat-hafizov added the bug Something isn't working label Oct 30, 2023
@azat-hafizov azat-hafizov added this to the Tapio v1.5 milestone Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants