aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-10-18 05:48:25 +0800
committerDan Finlay <dan@danfinlay.com>2016-10-18 05:48:25 +0800
commit049705004f306bb83ad1bc0b7315d322becf8263 (patch)
tree49c732a4b8369209ef15a07b03ec9757e311752b /app/scripts
parent0f0951ba549c294222421ef8508294165e9b5fdd (diff)
downloadtangerine-wallet-browser-049705004f306bb83ad1bc0b7315d322becf8263.tar
tangerine-wallet-browser-049705004f306bb83ad1bc0b7315d322becf8263.tar.gz
tangerine-wallet-browser-049705004f306bb83ad1bc0b7315d322becf8263.tar.bz2
tangerine-wallet-browser-049705004f306bb83ad1bc0b7315d322becf8263.tar.lz
tangerine-wallet-browser-049705004f306bb83ad1bc0b7315d322becf8263.tar.xz
tangerine-wallet-browser-049705004f306bb83ad1bc0b7315d322becf8263.tar.zst
tangerine-wallet-browser-049705004f306bb83ad1bc0b7315d322becf8263.zip
Reproduced issue 743 in test case
This contract hex does include the value `f4`, but it was compiled from a contract with no instance of `.delegatecall`. I believe `f4` in this case is part of some other value or contract address, and `ethBinToOps` has some error in how it skips pushed data. @kumavis
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/lib/idStore.js23
1 files changed, 14 insertions, 9 deletions
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js
index 9d0ca7f19..402a5e612 100644
--- a/app/scripts/lib/idStore.js
+++ b/app/scripts/lib/idStore.js
@@ -249,15 +249,9 @@ IdentityStore.prototype.addUnconfirmedTransaction = function (txParams, onTxDone
if (txParams.to) {
query.getCode(txParams.to, function (err, result) {
if (err) return cb(err)
- var code = ethUtil.toBuffer(result)
- if (code !== '0x') {
- var ops = ethBinToOps(code)
- var containsDelegateCall = ops.some((op) => op.name === 'DELEGATECALL')
- txData.containsDelegateCall = containsDelegateCall
- cb()
- } else {
- cb()
- }
+ var containsDelegateCall = this.checkForDelegateCall(result)
+ txData.containsDelegateCall = containsDelegateCall
+ cb()
})
} else {
cb()
@@ -282,6 +276,17 @@ IdentityStore.prototype.addUnconfirmedTransaction = function (txParams, onTxDone
}
}
+IdentityStore.prototype.checkForDelegateCall = function (codeHex) {
+ const code = ethUtil.toBuffer(codeHex)
+ if (code !== '0x') {
+ const ops = ethBinToOps(code)
+ const containsDelegateCall = ops.some((op) => op.name === 'DELEGATECALL')
+ return containsDelegateCall
+ } else {
+ return false
+ }
+}
+
IdentityStore.prototype.addGasBuffer = function (gasHex) {
var gas = new BN(gasHex, 16)
var buffer = new BN('100000', 10)