umbra-protocol
umbra-protocol copied to clipboard
"send max" robustness improvements
one issue we'd run into [when using the "Max" button on the send page] is with the native token: Gas price might change from the time you fill in the max to the time you send your transaction, resulting in either (1) an insufficient balance error if gas price increases, or (2) dust leftover if gas price decreases. So for the native token we'll need a flag that indicates the user clicked the "Max" button and recompute the the actual max at the time of the send transaction.
We also might want to throw an error if the amount changes by some threshold (+/- 1-2% maybe?) to prevent the user from sending a lot less than they expect if gas prices quickly change, but that might not be worth the added complexity for now.
originally posted in https://github.com/ScopeLift/umbra-protocol/pull/375#discussion_r942698351