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

Rounding Error Analysis #112

Open
d-xo opened this issue May 12, 2021 · 1 comment
Open

Rounding Error Analysis #112

d-xo opened this issue May 12, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@d-xo
Copy link
Collaborator

d-xo commented May 12, 2021

Understanding the impact of rounding error in a smart contract is a critical task for secure development.

There are two properties of interest:

  1. The direction of the rounding error (who loses out)
  2. The size of the rounding error (by how much do they lose)

For example in the case of a smart contract that holds a pool of tokens, it is a critical property that any rounding error is always in favour of the pool. If this property does not hold the pool will slowly bleed tokens as it is used.

We can allow users to specify properties relating to rounding by introducing a new operator (exact, or toReal), which would indicate that the numeric expression contained within should be expressed in various backends using Real's instead of Int's.

For a manual example of a very similar procedure, see the uniswap v1 model produced by Runtime Verification.

For a little more discussion relating to some earlier syntax see: #35

@d-xo d-xo added the enhancement New feature or request label May 12, 2021
@rdotterer09
Copy link

I don't get much time to work on this and I really don't understand code, I just need help to access the storage address's, I would like to leave the rest of the assets within the contract because I don't know how to maintain it by myself and I would like it to continue to function as it has been

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants