Skip to content

Commit 80c6636

Browse files
authored
Merge pull request #253 from eosnetworkfoundation/elmato/allow-zero-gas-price-in-refund-v3
Allow zero gas price in refund v3
2 parents 211d9ab + 1c0fcfa commit 80c6636

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

eosevm/refund_v3.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ std::tuple<silkworm::ExecutionResult, intx::uint256, uint64_t, uint64_t> gas_ref
3636
if(gas_prices.storage_price >= gas_prices.overhead_price) {
3737
intx::uint256 gas_refund = intx::uint256(total_cpu_gas_consumed);
3838
gas_refund *= intx::uint256(gas_prices.storage_price-gas_prices.overhead_price);
39-
gas_refund /= price;
39+
if(price > 0) {
40+
gas_refund /= price;
41+
} else {
42+
gas_refund = 0;
43+
}
4044

4145
SILKWORM_ASSERT(gas_refund <= gas_used);
4246
gas_left += static_cast<uint64_t>(gas_refund);

0 commit comments

Comments
 (0)