Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(EOF): add DATACOPY copy gas #1510

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion crates/interpreter/src/instructions/data.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -70,6 +70,8 @@ pub fn data_copy<H: Host + ?Sized>(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();

Expand Down
Loading