@@ -59,6 +59,10 @@ namespace GasCosts
59
59
}
60
60
static unsigned const keccak256Gas = 30 ;
61
61
static unsigned const keccak256WordGas = 6 ;
62
+ // / Corresponds to ACCESS_LIST_ADDRESS_COST from EIP-2930
63
+ static unsigned const accessListAddressCost = 2400 ;
64
+ // / Corresponds to ACCESS_LIST_STORAGE_COST from EIP-2930
65
+ static unsigned const accessListStorageKeyCost = 1900 ;
62
66
// / Corresponds to COLD_SLOAD_COST from EIP-2929
63
67
static unsigned const coldSloadCost = 2100 ;
64
68
// / Corresponds to COLD_ACCOUNT_ACCESS_COST from EIP-2929
@@ -80,7 +84,15 @@ namespace GasCosts
80
84
static unsigned const sstoreSetGas = 20000 ;
81
85
// / Corresponds to SSTORE_RESET_GAS from EIP-2929
82
86
static unsigned const sstoreResetGas = 5000 - coldSloadCost;
83
- static unsigned const sstoreRefundGas = 15000 ;
87
+ // / Corresponds to SSTORE_CLEARS_SCHEDULE from EIP-2200
88
+ inline static unsigned sstoreClearsSchedule (langutil::EVMVersion _evmVersion)
89
+ {
90
+ // Changes from EIP-3529
91
+ if (_evmVersion >= langutil::EVMVersion::london ())
92
+ return sstoreResetGas + accessListStorageKeyCost;
93
+ else
94
+ return 15000 ;
95
+ }
84
96
inline static unsigned totalSstoreSetGas (langutil::EVMVersion _evmVersion)
85
97
{
86
98
if (_evmVersion >= langutil::EVMVersion::berlin ())
@@ -144,7 +156,14 @@ namespace GasCosts
144
156
else
145
157
return 0 ;
146
158
}
147
- static unsigned const selfdestructRefundGas = 24000 ;
159
+ inline unsigned selfdestructRefundGas (langutil::EVMVersion _evmVersion)
160
+ {
161
+ // Changes from EIP-3529
162
+ if (_evmVersion >= langutil::EVMVersion::london ())
163
+ return 0 ;
164
+ else
165
+ return 24000 ;
166
+ }
148
167
static unsigned const memoryGas = 3 ;
149
168
static unsigned const quadCoeffDiv = 512 ;
150
169
static unsigned const createDataGas = 200 ;
0 commit comments