diff --git a/app/src/config.js b/app/src/config.js index d02182515..deb48735b 100644 --- a/app/src/config.js +++ b/app/src/config.js @@ -1,3 +1,5 @@ +import log from 'loglevel' + import { APPLE, APPLE_LINKED_VERIFIER, @@ -63,6 +65,8 @@ const { VUE_APP_KAKAO_CLIENT_ID, } = process.env +log.info('baseurl', VUE_APP_BASE_ROUTE) + const baseUrl = VUE_APP_BASE_ROUTE || 'https://localhost:3000' const baseRoute = baseUrl + process.env.BASE_URL diff --git a/app/src/store/preferencesActions.js b/app/src/store/preferencesActions.js index c1e3fba13..fea621c68 100644 --- a/app/src/store/preferencesActions.js +++ b/app/src/store/preferencesActions.js @@ -1,3 +1,4 @@ +import BigNumber from 'bignumber.js' import log from 'loglevel' import { fromWei, isAddress, toBN, toChecksumAddress } from 'web3-utils' @@ -111,12 +112,13 @@ export default { ;[amountTo, amountValue] = methodParams || [] } } - const { symbol: contractSymbol, name, logo } = contractParams + const { symbol: contractSymbol, name, logo, decimals } = contractParams symbol = contractSymbol type = 'erc20' typeName = name || 'ERC20' typeImageLink = logo - totalAmount = fromWei(toBN(amountValue && amountValue.value ? amountValue.value : txParams.value || 0)) + const bnAmount = new BigNumber(amountValue && amountValue.value ? amountValue.value : txParams.value || 0) + totalAmount = decimals ? bnAmount.div(new BigNumber(10).pow(new BigNumber(decimals))).toString() : fromWei(bnAmount) finalTo = amountTo && isAddress(amountTo.value) && toChecksumAddress(amountTo.value) } else { tokenRate = 1