CommonsSwarm / tec-convert

Convert between your Aragon tokens
https://convert.tecommons.org
3 stars 11 forks source link

Catch issue if tokens sold > total supply #38

Open PabloCGL opened 3 years ago

PabloCGL commented 3 years ago

Right now, if the user inputs a number of Tec Tokens to sell higher than the total supply Metamask throws an error (since 'calculatePurchaseReturn' in the bonding curve reverts), but the interface doesn't change and just continues showing the last valid number introduced. Realistically, if somebody tries something like that it will just fail, but for completeness' sake it would be nice to catch the error and notify the user.