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

Offer an option to create a higher approval for investing and insuring #97

Open
christoph2806 opened this issue Dec 12, 2022 · 2 comments
Labels
blockchain enhancement New feature or request good first issue Good for newcomers mumbai test instance Polygon Mumbai test instance

Comments

@christoph2806
Copy link
Member

Currently, you are asked to approve token transfers each time you purchase a policy or fund a riskpool.
In DeFi it's pretty standard to give a high approval one time and use it many times afterwards.
This comes at a certain risk because in case of a smart contract exploit, users funds would be at risk.
Therefore I propose the following implementation:

  1. The current approval is displayed somewhere on the page. If the approval is higher than the current token balance, the balance is displayed in warning color or with a warning hint.
  2. Each time the user is asked for approval, a dialog offers the following three options:
    • Approve only the amount necessary for the next transaction
    • Approve the full current token balance
    • Approve an infinite amount, ie. maxInt

The user can select one of the options and then the approval is processed.

@christoph2806 christoph2806 added enhancement New feature or request good first issue Good for newcomers blockchain mumbai test instance Polygon Mumbai test instance labels Dec 12, 2022
@doerfli
Copy link
Contributor

doerfli commented Jan 20, 2023

This should also be done for the staking-ui

@gebunu
Copy link

gebunu commented Jan 26, 2023

agree with @doerfli this also happens in staking-ui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blockchain enhancement New feature or request good first issue Good for newcomers mumbai test instance Polygon Mumbai test instance
Projects
None yet
Development

No branches or pull requests

3 participants