-
Notifications
You must be signed in to change notification settings - Fork 8
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
Prevent users to tunnel less than the minimum amount allowed by the token decimals #895
Comments
@gndelia How would you like this carried out? If the user tries to pass 0, do we disable the button or prompt a toast. What's the intended solution? |
@qgatssdev The minimum is dictated by the amount of decimals defined in the Token contract.
TBD by @dvnahuel how we would show to users that the amount is invalid |
Okay I get what you mean, please assign this to me. I'll love feedback from @dvnahuel so I know how we want to present the error. |
@gndelia Any update on this? I have a branch fixing this but currently don't know how the data is to be presented. |
Hey @qgatssdev ! Still working on how to fix this issue, as it’s more about how we showcase the warning across various use cases in the tunnel rather than just one solution. I should have this figured out in the next couple of days. |
@dvnahuel Hey! no problem, Just tag me when it's ready. |
I’ll tag you as soon as it’s ready. Thanks! |
Let's say a token, like USDC, has 6 decimals in the contract definition. That means the smaller amount of USDC possible is
0.000001
. Currently, there's no restriction on the minimum amount to tunnel. So users could try to tunnel0.00000000000001 USDC
, which the UI parses as0
.The contracts do allow trying to tunnel 0, see this tunnel deposit.
However, allowing this kind of transaction is useless, as no tokens are minted on Hemi, and they are only a waste of fees. We should prevent that
We should restrict the amount to tunnel to/from Hemi, preventing it from operating less than the minimum amount. This needs to be validated in the tunnel form as well.
The text was updated successfully, but these errors were encountered: