capofficial / client

CAP protocol web client built with Svelte
https://cap.io
Other
2 stars 4 forks source link

Max Staking CAP Causes MetaMask Error #60

Open ModernForays opened 1 year ago

ModernForays commented 1 year ago

Users have reported that when using the max stake shortcut, the rounding up of the wallet balance triggers a MetaMask error.

Wanted to see which approach you preferred to resolve this @kappacappa, or if you have another idea.

Add separate Stake/Unstake All buttons to the main staking page that bypass the modals (and rounding) entirely:

cap_stake_all_unstake_all_buttons

Since the current modal is also where CAP approval takes place if needed, might need to add a new ApproveCAP modal to popup if needed.

Add "Stake All" and "Unstake All" buttons to the modals which directly trigger the staking/unstaking with exact balances instead of populating the Input component with a rounded value:

cap_stake_all_modal

It would probably also make sense to update the modal to display just the "Approve CAP" button and nothing else when the modal opens if CAP allowance is not non-zero.

Keep the current design as-is, but do not round up CAP wallet balance.

This would be the simplest fix but also probably the least good from user's perspective IMO.

kappacappa commented 1 year ago

@ModernForays this might be a contract side fix, to deal with the max amount sent appropriately.