diff --git a/libevmasm/GasMeter.cpp b/libevmasm/GasMeter.cpp index c6bd0737142d..9194d5987251 100644 --- a/libevmasm/GasMeter.cpp +++ b/libevmasm/GasMeter.cpp @@ -223,6 +223,10 @@ GasMeter::GasConsumption GasMeter::estimateMax(AssemblyItem const& _item, bool _ break; case Instruction::NATIVEVOTE: gas = GasCosts::voteGas; + // NATIVEVOTE reads two memory ranges (see SemanticInformation::readWriteOperations). + // With args == 4, the ranges are (offset, size) = (-3, -2) and (-1, 0) on the stack. + gas += memoryGas(-3, -2); + gas += memoryGas(-1, 0); break; case Instruction::NATIVEWITHDRAWREWARD: gas = GasCosts::withdrawGas; @@ -231,9 +235,12 @@ GasMeter::GasConsumption GasMeter::estimateMax(AssemblyItem const& _item, bool _ case Instruction::NATIVEUNFREEZEBALANCEV2: case Instruction::NATIVECANCELALLUNFREEZEV2: case Instruction::NATIVEWITHDRAWEXPIREUNFREEZE: + gas = GasCosts::freezeV2Gas; + break; case Instruction::NATIVEDELEGATERESOURCE: case Instruction::NATIVEUNDELEGATERESOURCE: gas = GasCosts::freezeV2Gas; + gas += GasCosts::callNewAccountGas; // Delegating to a non-existent address may create a new account. break; case Instruction::CHAINID: gas = runGas(Instruction::CHAINID, m_evmVersion);