Skip to content

Commit

Permalink
[[FIX]] add return for get evm tx recevier
Browse files Browse the repository at this point in the history
  • Loading branch information
bysomeone authored and mdj33 committed Jan 31, 2023
1 parent bc97fc6 commit 533f35a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugin/dapp/evm/executor/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ func (evm *EVMExecutor) GetMessage(tx *types.Transaction, index int, fromPtr *co
from = *fromPtr
}

addressFork := evm.GetAPI().GetConfig().IsDappFork(evm.GetHeight(), "evm", evmtypes.ForkEVMMixAddress)
to := getReceiver(&action, addressFork)
mixAddressFork := evm.GetAPI().GetConfig().IsDappFork(evm.GetHeight(), "evm", evmtypes.ForkEVMMixAddress)
to := getReceiver(&action, mixAddressFork)
if to == nil {
return msg, types.ErrInvalidAddress
}
Expand Down Expand Up @@ -366,12 +366,12 @@ func getCaller(tx *types.Transaction) common.Address {
}

// 从交易信息中获取交易目标地址,在创建合约交易中,此地址为空
func getReceiver(action *evmtypes.EVMContractAction, addressFork bool) *common.Address {
func getReceiver(action *evmtypes.EVMContractAction, mixAddressFork bool) *common.Address {
if action.ContractAddr == "" {
return nil
}
if addressFork {
common.StringToAddress(action.ContractAddr)
if mixAddressFork {
return common.StringToAddress(action.ContractAddr)
}
return common.StringToAddressLegacy(action.ContractAddr)
}

0 comments on commit 533f35a

Please sign in to comment.