aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-12-21 06:36:58 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-12-21 09:37:18 +0800
commit9ced63584bc93cf6ac82786dec0984b5022346ae (patch)
treeea647fd9c1d55a1404a2684c4f87976e477ba337 /ui
parent5fe3c5aae6756f225edd0f8646ac0a23c264a81c (diff)
downloadtangerine-wallet-browser-9ced63584bc93cf6ac82786dec0984b5022346ae.tar.gz
tangerine-wallet-browser-9ced63584bc93cf6ac82786dec0984b5022346ae.tar.zst
tangerine-wallet-browser-9ced63584bc93cf6ac82786dec0984b5022346ae.zip
Add constanst for token transfer function signature.
Diffstat (limited to 'ui')
-rw-r--r--ui/app/components/send/send-constants.js3
-rw-r--r--ui/app/send-v2.js3
2 files changed, 5 insertions, 1 deletions
diff --git a/ui/app/components/send/send-constants.js b/ui/app/components/send/send-constants.js
index 9c240972f..b3ee0899a 100644
--- a/ui/app/components/send/send-constants.js
+++ b/ui/app/components/send/send-constants.js
@@ -20,6 +20,8 @@ const MIN_GAS_TOTAL = multiplyCurrencies(MIN_GAS_LIMIT_HEX, MIN_GAS_PRICE_HEX, {
multiplierBase: 16,
})
+const TOKEN_TRANSFER_FUNCTION_SIGNATURE = '0xa9059cbb'
+
module.exports = {
MIN_GAS_PRICE_GWEI,
MIN_GAS_PRICE_HEX,
@@ -27,4 +29,5 @@ module.exports = {
MIN_GAS_LIMIT_HEX,
MIN_GAS_LIMIT_DEC,
MIN_GAS_TOTAL,
+ TOKEN_TRANSFER_FUNCTION_SIGNATURE,
}
diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js
index 1c0ff3aea..cf9e709d4 100644
--- a/ui/app/send-v2.js
+++ b/ui/app/send-v2.js
@@ -14,6 +14,7 @@ const GasFeeDisplay = require('./components/send/gas-fee-display-v2')
const {
MIN_GAS_TOTAL,
+ TOKEN_TRANSFER_FUNCTION_SIGNATURE,
} = require('./components/send/send-constants')
const {
@@ -574,7 +575,7 @@ SendTransactionScreen.prototype.getEditedTx = function () {
}
if (selectedToken) {
- const data = '0xa9059cbb' + Array.prototype.map.call(
+ const data = TOKEN_TRANSFER_FUNCTION_SIGNATURE + Array.prototype.map.call(
ethAbi.rawEncode(['address', 'uint256'], [to, ethUtil.addHexPrefix(amount)]),
x => ('00' + x.toString(16)).slice(-2)
).join('')