Skip to content

Commit

Permalink
fix(abi_fetcher): ensure fallback to Heimdall when Etherscan fails
Browse files Browse the repository at this point in the history
- Modify getABI function to continue to Heimdall if Etherscan API call fails
  • Loading branch information
portdeveloper committed Aug 13, 2024
1 parent 19ebc7d commit 94cfae9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions abi_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ func (af *ABIFetcher) getABI(chainId string, targetAddress string, rpcURL string

if ok {
abi, err := api.GetABIFromEtherscan(targetAddress)
if err != nil {
fmt.Printf("Error fetching ABI from Etherscan: %v\n", err)
return "", false, err
if err == nil {
return abi, false, nil
}
return abi, false, nil
fmt.Printf("Error fetching ABI from Etherscan: %v\n", err)
// Fall through to Heimdall if Etherscan fails
}

abi, err := getABIFromHeimdall(targetAddress, rpcURL)
Expand Down

0 comments on commit 94cfae9

Please sign in to comment.