core/vm, params: EIP160: EXP reprice

This commit is contained in:
Jeffrey Wilcke
2016-10-20 14:27:47 +02:00
parent 445feaeef5
commit 779ddb1832
2 changed files with 6 additions and 9 deletions

View File

@ -313,7 +313,8 @@ func calculateGasAndSize(gasTable params.GasTable, env Environment, contract *Co
quadMemGas(mem, newMemSize, gas)
case EXP:
gas.Add(gas, new(big.Int).Mul(big.NewInt(int64(len(stack.data[stack.len()-2].Bytes()))), params.ExpByteGas))
expByteLen := int64((stack.data[stack.len()-2].BitLen() + 7) / 8)
gas.Add(gas, new(big.Int).Mul(big.NewInt(expByteLen), gasTable.ExpByte))
case SSTORE:
err := stack.require(2)
if err != nil {