File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,8 @@ namespace hera {
132132 ensureCondition (gas >= 0 , ArgumentOutOfRange, " Negative gas supplied." );
133133
134134 takeGas (gas);
135+ // FIXME: this may overflow
136+ takeGas (gas * memory.size () / GasSchedule::memoryPageSize * GasSchedule::memoryCostPerPage);
135137 }
136138
137139 int64_t EthereumInterface::eeiGetGasLeft ()
Original file line number Diff line number Diff line change @@ -163,6 +163,9 @@ class EthereumInterface {
163163};
164164
165165struct GasSchedule {
166+ static constexpr unsigned memoryPageSize = 65536 ;
167+ static constexpr unsigned memoryCostPerPage = 1 ;
168+
166169 static constexpr unsigned storageLoad = 200 ;
167170 static constexpr unsigned storageStoreCreate = 20000 ;
168171 static constexpr unsigned storageStoreChange = 5000 ;
You can’t perform that action at this time.
0 commit comments