Skip to content

Commit

Permalink
Short circuits call to Etherscan when searching for ABI of EOA.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjayrush committed Sep 10, 2023
1 parent 763ba19 commit 02face7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/apps/chifra/pkg/abi/load_abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ import (
"strings"

"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/colors"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/config"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/file"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/logger"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/rpc"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types"
"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/walk"
Expand Down Expand Up @@ -802,6 +804,12 @@ func GetAbi(chain string, address base.Address) (simpleAbis []types.SimpleFuncti

// LoadAbi tries to load ABI from any source (local file, cache, download from 3rd party)
func LoadAbi(chain string, address base.Address, destination *FunctionSyncMap) (err error) {
tmp := rpc.TempConnection(chain)
if err = tmp.IsContractAt(address, nil); err == rpc.ErrNotAContract {
logger.Progress(true, fmt.Sprintf("Skipping EOA %s", colors.Cyan+address.Hex()+colors.Off))
return nil
}

// If there was no error, the abi was loaded...
err = LoadAbiFromAddress(chain, address, destination)
if err == nil {
Expand Down

0 comments on commit 02face7

Please sign in to comment.