mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add new gas price for deployed bytecode (EIP2028)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user