revm_interpreter/instructions/
tx_info.rs1use crate::{
2 interpreter_types::{InterpreterTypes, RuntimeFlag, StackTr},
3 Host,
4};
5use primitives::U256;
6
7use crate::InstructionContext;
8
9pub fn gasprice<WIRE: InterpreterTypes, H: Host + ?Sized>(
13 context: InstructionContext<'_, H, WIRE>,
14) {
15 push!(
17 context.interpreter,
18 U256::from(context.host.effective_gas_price())
19 );
20}
21
22pub fn origin<WIRE: InterpreterTypes, H: Host + ?Sized>(context: InstructionContext<'_, H, WIRE>) {
26 push!(
28 context.interpreter,
29 context.host.caller().into_word().into()
30 );
31}
32
33pub fn blob_hash<WIRE: InterpreterTypes, H: Host + ?Sized>(
37 context: InstructionContext<'_, H, WIRE>,
38) {
39 check!(context.interpreter, CANCUN);
40 popn_top!([], index, context.interpreter);
42 let i = as_usize_saturated!(index);
43 *index = context.host.blob_hash(i).unwrap_or_default();
44}