1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-24 09:18:09 +00:00

Token amount decimals fix

This commit is contained in:
Szymon Lesisz 2018-05-10 13:24:42 +02:00
parent 1007477bae
commit 94c58d0b13

View File

@ -739,7 +739,9 @@ export const onSend = (): AsyncAction => {
if (!token) return; if (!token) return;
const contract = web3instance.erc20.at(token.address); const contract = web3instance.erc20.at(token.address);
data = contract.transfer.getData(currentState.address, currentState.amount, { const amountValue: string = new BigNumber(currentState.amount).times( Math.pow(10, token.decimals) ).toString();
data = contract.transfer.getData(currentState.address, amountValue, {
from: account.address, from: account.address,
gasLimit: currentState.gasLimit, gasLimit: currentState.gasLimit,
gasPrice: currentState.gasPrice gasPrice: currentState.gasPrice