diff --git a/crates/interpreter/src/instructions/data.rs b/crates/interpreter/src/instructions/data.rs index 5d18a89899..65df8a702e 100644 --- a/crates/interpreter/src/instructions/data.rs +++ b/crates/interpreter/src/instructions/data.rs @@ -1,5 +1,5 @@ use crate::{ - gas::{BASE, DATA_LOAD_GAS, VERYLOW}, + gas::{cost_per_word, BASE, DATA_LOAD_GAS, VERYLOW}, instructions::utility::read_u16, interpreter::Interpreter, primitives::U256, @@ -70,6 +70,8 @@ pub fn data_copy(interpreter: &mut Interpreter, _host: &mut H) let mem_offset = as_usize_or_fail!(interpreter, mem_offset); resize_memory!(interpreter, mem_offset, size); + gas_or_fail!(interpreter, cost_per_word(size as u64, VERYLOW)); + let offset = as_usize_saturated!(offset); let data = interpreter.contract.bytecode.eof().expect("EOF").data();