danielssonn / blockstars

Web3 application on Ethereum. Stake in success of others, using smart contracts on blockchain. Get rewarded together.
0 stars 0 forks source link

dApp UI - Staking amount digits #35

Closed danielssonn closed 2 years ago

danielssonn commented 2 years ago

The number of tokens in the app and in the wallet has to look the same. The wallet shows 'whole tokens' 10**18, while the wallet asks to approve 18 decimal values

rccrc commented 2 years ago

try token * (10 ** 18) got overflown error

danielssonn commented 2 years ago

That overflow is a javascript number issue creating BigNumbers for ethers. Use something like this: web3.utils.toBN(amount*(10**18))