We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f452ae9 + ef12ed5 commit 7169992Copy full SHA for 7169992
lib/opFns.js
@@ -88,16 +88,15 @@ module.exports = {
88
}
89
},
90
EXP: function (base, exponent, runState) {
91
- var m = BN.red(utils.TWO_POW256)
92
-
93
- base = base.toRed(m)
94
95
- if (!exponent.isZero()) {
+ if (exponent.isZero()) {
+ return new BN(1)
+ } else {
96
var bytes = 1 + logTable(exponent)
97
subGas(runState, new BN(bytes).muln(runState._common.param('gasPrices', 'expByte')))
+
+ var m = BN.red(utils.TWO_POW256)
98
+ base = base.toRed(m)
99
return base.redPow(exponent)
- } else {
100
- return new BN(1)
101
102
103
SIGNEXTEND: function (k, val, runState) {
0 commit comments