Skip to content

Commit

Permalink
add defensive logic to chain id check
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed Jul 6, 2023
1 parent 9fa9e11 commit 2a8b29d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zetaclient/evm_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,10 @@ func (ob *EVMChainClient) observeInTX() error {
continue
}
destAddr := clienttypes.BytesToEthHex(event.DestinationAddress)

if ob.cfg.EVMChainConfigs[destChain.ChainId] == nil {
ob.logger.ExternalChainWatcher.Warn().Msgf("chain id not present in EVMChainConfigs %d", event.DestinationChainId.Int64())
continue
}
if strings.EqualFold(destAddr, ob.cfg.EVMChainConfigs[destChain.ChainId].CoreParams.ZETATokenContractAddress) {
ob.logger.ExternalChainWatcher.Warn().Msgf("potential attack attempt: %s destination address is ZETA token contract address %s", destChain, destAddr)
continue
Expand Down

0 comments on commit 2a8b29d

Please sign in to comment.