MetaMask / metamask-mobile

Mobile web browser providing access to websites that use the Ethereum blockchain
https://metamask.io
Other
2.16k stars 1.11k forks source link

Android: Approves waaaay more DAI than it should #1243

Closed auryn-macmillan closed 4 years ago

auryn-macmillan commented 4 years ago

Tried buying a sponsorship from sp.brightid.org from the metamask mobile app today, and noticed that it wanted me to approve 10^18 DAI :grimacing:

Needless to say, I rejected the transaction.

At first I thought it was an issue with their code, but when I tried it on my desktop it behaved as expected.

Here is the relevant code snippet.

dai = parseFloat($("#spDai").val()) * 10 ** 18;
  ptContract.approve.sendTransaction(addresses.sp_minter, dai, function (error, result) {}

On desktop it asks to approve 1DAI Screenshot from 2019-12-10 10-19-40

On mobile it asks to approve 1,000,000,000,000,000,000 DAI image

estebanmino commented 4 years ago

Hi @auryn-macmillan, thanks for reporting! we're aware of this and we're working to get it up to date with the extension behavior.