aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/util.js')
-rw-r--r--ui/app/util.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/app/util.js b/ui/app/util.js
index e058dc92b..6596ebafb 100644
--- a/ui/app/util.js
+++ b/ui/app/util.js
@@ -1,3 +1,4 @@
+const abi = require('human-standard-token-abi')
const ethUtil = require('ethereumjs-util')
const hexToBn = require('../../app/scripts/lib/hex-to-bn')
const vreme = new (require('vreme'))()
@@ -51,6 +52,7 @@ module.exports = {
bnMultiplyByFraction,
getTxFeeBn,
shortenBalance,
+ getContractAtAddress,
}
function valuesFor (obj) {
@@ -244,3 +246,7 @@ function getTxFeeBn (gas, gasPrice = MIN_GAS_PRICE_BN.toString(16), blockGasLimi
return txFeeBn.toString(16)
}
+
+function getContractAtAddress (tokenAddress) {
+ return global.eth.contract(abi).at(tokenAddress)
+}