-
Notifications
You must be signed in to change notification settings - Fork 53
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 input #246
Amount input #246
Conversation
I'll never tell you it's my secret sauce |
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.
IMO the best solution
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.
This is not so dirty to use a variable for a second usage. We use a specific int value (maxUint256) as a boolean. This is precisely what Ethereum does with the empty to
field in a tx:
if to == undefined, then I call CREATE opcode, else call the code at the specified address.
The point is that this method is reducing the number of possibilities, such as "I want to withdraw 40% of my position"
If you care about some wei yes. Also another option is taking the max between the balance of the user and the |
Well I've tried to create an alternative solution using the min between the amount passed and the balance of the user, but I'm facing to many roundings to make it a creadible alternative |
ciao |
Gas diff (sorry I don't know how @Rubilmax does his ones):