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

Bug: Max amount button rounds up #1929

Open
plor opened this issue Jun 22, 2022 · 4 comments
Open

Bug: Max amount button rounds up #1929

plor opened this issue Jun 22, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@plor
Copy link
Contributor

plor commented Jun 22, 2022

Describe the bug

On the Minion transfer, if you click the max button it reduces some precision for the ERC-20 and rounds up, sometimes resulting in failed transactions.

I've loaded a test DAO with 0.00555555555555 WETH on rinkeby. If you need membership let me know and I'll vote you in (or reproduce yourself).

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://app.daohaus.club/dao/0x4/0x3259342eed7cfa03fab8b0854fe6836a40bd1e93/vaults/minion/0x7605789454f0845b55a5fe0284d3a675aef7fb26
  2. Click on Transfer > Max > Submit
  3. See payment rounded up
  4. If you try to execute, see it fail

Expected behavior

Max should transfer exactly what is available in the vault (at correct precision).

Actual behavior

Max button rounds up and exceeds actual max if number after precision cutoff is 5 or higher.

Screenshots

Image

Application area

Where in the app is this happening?

  • FrontEnd (please include route/section if possible)

Additional context
Can see original proposal where this came up here: https://app.daohaus.club/dao/0x64/0x046d1c324cd5ca0115e04ea1e4feecfaf44a8bf5/proposals/6

@plor plor added the bug Something isn't working label Jun 22, 2022
@plor plor moved this from Needs Triage to Ready For Dev in DAOhaus v2: Robot Apartments Jun 22, 2022
@plor
Copy link
Contributor Author

plor commented Jul 2, 2022

Link is at the bottom, this has since been moved. Amount was:

PARAM2: wad
TYPE: uint256
VALUE: 8724462353742896000000

I believe it is there was about 8724462353742895500000 which is where the issue came from, since it seems to be rounding to 12 decimal places. I'm not sure if it matters that this was WXDAI.

@plor
Copy link
Contributor Author

plor commented Jul 3, 2022

Trying to reproduce more, this proposal seemed to round up the 18th decimal place, resulting in a failing proposal.

https://app.daohaus.club/dao/0x4/0x3259342eed7cfa03fab8b0854fe6836a40bd1e93/proposals/10

@plor
Copy link
Contributor Author

plor commented Jul 18, 2022

Related to #1773

@plor
Copy link
Contributor Author

plor commented Nov 3, 2022

One solution suggested is to remove this button from the minion proposal flow.

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
No open projects
Status: Ready For Dev
Development

No branches or pull requests

1 participant