File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,8 @@ string toHex(evm_uint256be const& value) {
188188 HERA_DEBUG << " useGas " << gas << " \n " ;
189189
190190 takeGas (gas);
191+ // FIXME: this may overflow
192+ takeGas (gas * memory.size () / GasSchedule::memoryPageSize * GasSchedule::memoryCostPerPage);
191193
192194 return Literal ();
193195 }
Original file line number Diff line number Diff line change @@ -113,9 +113,13 @@ struct EthereumInterface : ShellExternalInterface {
113113 evm_message const & msg;
114114 std::vector<uint8_t > lastReturnData;
115115 ExecutionResult & result;
116+
116117};
117118
118119struct GasSchedule {
120+ static constexpr unsigned memoryPageSize = 65536 ;
121+ static constexpr unsigned memoryCostPerPage = 1 ;
122+
119123 static constexpr unsigned storageLoad = 200 ;
120124 static constexpr unsigned storageStoreCreate = 20000 ;
121125 static constexpr unsigned storageStoreChange = 5000 ;
You can’t perform that action at this time.
0 commit comments