Add new gas price for deployed bytecode (EIP2028)

This commit is contained in:
Alex Beregszaszi
2019-11-19 17:09:18 +01:00
parent 21312f52f2
commit 840aba8929
9 changed files with 44 additions and 32 deletions
+2 -2
View File
@@ -266,13 +266,13 @@ unsigned GasMeter::runGas(Instruction _instruction)
return 0;
}
u256 GasMeter::dataGas(bytes const& _data, bool _inCreation)
u256 GasMeter::dataGas(bytes const& _data, bool _inCreation, langutil::EVMVersion _evmVersion)
{
bigint gas = 0;
if (_inCreation)
{
for (auto b: _data)
gas += (b != 0) ? GasCosts::txDataNonZeroGas : GasCosts::txDataZeroGas;
gas += (b != 0) ? GasCosts::txDataNonZeroGas(_evmVersion) : GasCosts::txDataZeroGas;
}
else
gas = bigint(GasCosts::createDataGas) * _data.size();