diff --git a/libevmasm/ConstantOptimiser.cpp b/libevmasm/ConstantOptimiser.cpp index b56415a95..76e96aa5f 100644 --- a/libevmasm/ConstantOptimiser.cpp +++ b/libevmasm/ConstantOptimiser.cpp @@ -129,7 +129,7 @@ bigint LiteralMethod::gasNeeded() const return combineGas( simpleRunGas({Instruction::PUSH1}), // PUSHX plus data - (m_params.isCreation ? GasCosts::txDataNonZeroGas : GasCosts::createDataGas) + dataGas(), + (m_params.isCreation ? GasCosts::txDataNonZeroGas : GasCosts::createDataGas) + dataGas(toCompactBigEndian(m_value, 1)), 0 ); } diff --git a/libevmasm/ConstantOptimiser.h b/libevmasm/ConstantOptimiser.h index 9108e0397..ff14a916e 100644 --- a/libevmasm/ConstantOptimiser.h +++ b/libevmasm/ConstantOptimiser.h @@ -79,8 +79,6 @@ protected: static bigint simpleRunGas(AssemblyItems const& _items); /// @returns the gas needed to store the given data literally bigint dataGas(bytes const& _data) const; - /// @returns the gas needed to store the value literally - bigint dataGas() const { return dataGas(toCompactBigEndian(m_value, 1)); } static size_t bytesRequired(AssemblyItems const& _items); /// @returns the combined estimated gas usage taking @a m_params into account. bigint combineGas(