This repository was archived by the owner on Apr 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
bus-mapping/src/evm/opcodes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use crate::{
44 operation:: CallContextField ,
55 Error ,
66} ;
7- use eth_types:: GethExecStep ;
7+ use eth_types:: { GethExecStep , ToWord } ;
88
99#[ derive( Debug , Copy , Clone ) ]
1010pub ( crate ) struct Origin ;
@@ -17,7 +17,7 @@ impl Opcode for Origin {
1717 let geth_step = & geth_steps[ 0 ] ;
1818 let mut exec_step = state. new_step ( geth_step) ?;
1919 // TODO: Get origin result
20- let value = geth_steps [ 1 ] . stack . last ( ) ? ;
20+ let value = state . tx . from . to_word ( ) ;
2121 let tx_id = state. tx_ctx . id ( ) ;
2222
2323 // CallContext read of the TxId
@@ -29,6 +29,8 @@ impl Opcode for Origin {
2929 ) ?;
3030
3131 // Stack write of the origin address value
32+ #[ cfg( feature = "stack-check" ) ]
33+ assert_eq ! ( value, geth_steps[ 1 ] . stack. last( ) ?) ;
3234 state. stack_push ( & mut exec_step, value) ?;
3335
3436 Ok ( vec ! [ exec_step] )
You can’t perform that action at this time.
0 commit comments