diff --git a/pkg/contractManager/contractManager.go b/pkg/contractManager/contractManager.go index 0a770e1b..9c007f12 100644 --- a/pkg/contractManager/contractManager.go +++ b/pkg/contractManager/contractManager.go @@ -43,64 +43,3 @@ func (cm *ContractManager) GetContractWithProxy( return contract, nil } - -func (cm *ContractManager) CreateProxyContract( - contractAddress string, - proxyContractAddress string, - blockNumber uint64, - reindexContract bool, -) (*contractStore.ProxyContract, error) { - proxyContract, found, err := cm.ContractStore.FindOrCreateProxyContract(blockNumber, contractAddress, proxyContractAddress) - if err != nil { - cm.Logger.Sugar().Errorw("Failed to create proxy contract", - zap.Error(err), - zap.String("contractAddress", contractAddress), - zap.String("proxyContractAddress", proxyContractAddress), - ) - } else { - if found { - cm.Logger.Sugar().Debugw("Found existing proxy contract", - zap.String("contractAddress", contractAddress), - zap.String("proxyContractAddress", proxyContractAddress), - ) - } else { - cm.Logger.Sugar().Debugw("Created proxy contract", - zap.String("contractAddress", contractAddress), - zap.String("proxyContractAddress", proxyContractAddress), - ) - } - } - // Check to see if the contract we're proxying to is already in the database - proxiedContract, err := cm.ContractStore.GetContractForAddress(proxyContractAddress) - if err != nil { - cm.Logger.Sugar().Errorw("Failed to get contract for address", - zap.Error(err), - zap.String("contractAddress", proxyContractAddress), - ) - } - if proxiedContract != nil { - cm.Logger.Sugar().Debugw("Found proxied contract", - zap.String("contractAddress", proxyContractAddress), - zap.String("proxiedContractAddress", proxiedContract.ContractAddress), - ) - if proxiedContract.ContractAbi == "" { - updatedContract := cm.FindAndSetContractAbi(proxyContractAddress) - if updatedContract != nil { - proxiedContract = updatedContract - } - } - } else { - _, err := cm.CreateContract(proxyContractAddress, "", reindexContract) - if err != nil { - cm.Logger.Sugar().Errorw("Failed to create contract", - zap.Error(err), - zap.String("contractAddress", proxyContractAddress), - ) - } else { - cm.Logger.Sugar().Debugw("Created contract", - zap.String("contractAddress", proxyContractAddress), - ) - } - } - return proxyContract, nil -} diff --git a/pkg/fetcher/fetcher.go b/pkg/fetcher/fetcher.go index a5f1f107..eec600b4 100644 --- a/pkg/fetcher/fetcher.go +++ b/pkg/fetcher/fetcher.go @@ -4,6 +4,7 @@ import ( "context" "github.com/Layr-Labs/sidecar/internal/config" "github.com/Layr-Labs/sidecar/pkg/clients/ethereum" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/pkg/errors" "go.uber.org/zap" "slices"