diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index e410522ac8bf..1d9b0e2104fe 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.go @@ -793,6 +793,7 @@ type callMsg struct { ethereum.CallMsg } +func (m callMsg) UnderlyingTransaction() *types.Transaction { return nil } func (m callMsg) From() common.Address { return m.CallMsg.From } func (m callMsg) Nonce() uint64 { return 0 } func (m callMsg) IsFake() bool { return true } diff --git a/core/evm.go b/core/evm.go index bbead8f9bec2..23e2e4eedd3f 100644 --- a/core/evm.go +++ b/core/evm.go @@ -66,14 +66,12 @@ func NewEVMBlockContext(header *types.Header, chain ChainContext, author *common // NewEVMTxContext creates a new transaction context for a single transaction. func NewEVMTxContext(msg Message) vm.TxContext { - return vm.TxContext{ - Origin: msg.From(), - GasPrice: new(big.Int).Set(msg.GasPrice()), + originWasRemapped := false + tx := msg.UnderlyingTransaction() + if tx != nil { + txType := tx.Type() + originWasRemapped = txType == types.ArbitrumUnsignedTxType || txType == types.ArbitrumContractTxType } -} - -// NewEVMTxContextWithRemapInfo creates a new transaction context for a single transaction. -func NewEVMTxContextWithRemapInfo(msg Message, originWasRemapped bool) vm.TxContext { return vm.TxContext{ Origin: msg.From(), GasPrice: new(big.Int).Set(msg.GasPrice()), diff --git a/core/state_transition.go b/core/state_transition.go index 72a41e18f6f4..f8e5fe2d69ef 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -73,6 +73,7 @@ type StateTransition struct { // Message represents a message sent to a contract. type Message interface { + UnderlyingTransaction() *types.Transaction From() common.Address To() *common.Address