diff --git a/core/services/relay/evm/chain_reader.go b/core/services/relay/evm/chain_reader.go index f42c57c9bb4..e4da4cc1a49 100644 --- a/core/services/relay/evm/chain_reader.go +++ b/core/services/relay/evm/chain_reader.go @@ -3,6 +3,7 @@ package evm import ( "context" "fmt" + "slices" "strings" "github.com/ethereum/go-ethereum/accounts/abi" @@ -144,14 +145,7 @@ func validateMethods(abi abi.ABI, chainReaderDefinition types.ChainReaderDefinit func areChainReaderArgumentsValid(contractArgs []abi.Argument, chainReaderArgs []string) bool { for _, contractArg := range contractArgs { - found := false - for _, chArgName := range chainReaderArgs { - if chArgName == contractArg.Name { - found = true - break - } - } - if !found { + if !slices.Contains(chainReaderArgs, contractArg.Name) { return false } }