verify

package
v1.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyVerified   = fmt.Errorf("contract already verified")
	ErrPartiallyVerified = fmt.Errorf("contract is partially verified but cannot be upgraded to full verification")
)

Functions

func AutoVerify

func AutoVerify(ctx context.Context, logger log.Logger, rpcUrl string, chainID uint64, stateFile string, artifactsLocator *artifacts.Locator, verifierTypes string, verifierUrl string, apiKey string) error

func ContractPathToName

func ContractPathToName(contractPath string) string

func GetArtifactPath

func GetArtifactPath(name string) string

GetArtifactPath returns the artifact path for a given contract name

func GetBundleFromFile

func GetBundleFromFile(filepath string) (map[string]common.Address, error)

func VerifyCLI

func VerifyCLI(cliCtx *cli.Context) error

Types

type APIChecker

type APIChecker interface {
	CanCheck() bool
	CheckStatus(ctx context.Context, address common.Address) (*VerificationStatus, error)
	GetDefaultURL(chainID uint64) (string, error)
	GetChainArg(chainID uint64) (string, error)
}

type ArtifactMetadata

type ArtifactMetadata struct {
	ContractPath    string
	CompilerVersion string
	Optimizer       OptimizerSettings
	EVMVersion      string
	Sources         map[string]SourceContent
}

ArtifactMetadata contains processed artifact information

type BlockscoutChecker

type BlockscoutChecker struct {
	// contains filtered or unexported fields
}

func NewBlockscoutChecker

func NewBlockscoutChecker(verifierUrl string, chainID uint64, logger log.Logger) *BlockscoutChecker

func (*BlockscoutChecker) CanCheck

func (b *BlockscoutChecker) CanCheck() bool

func (*BlockscoutChecker) CheckStatus

func (b *BlockscoutChecker) CheckStatus(ctx context.Context, address common.Address) (*VerificationStatus, error)

func (*BlockscoutChecker) GetChainArg

func (b *BlockscoutChecker) GetChainArg(chainID uint64) (string, error)

func (*BlockscoutChecker) GetDefaultURL

func (b *BlockscoutChecker) GetDefaultURL(chainID uint64) (string, error)

type EtherscanChecker

type EtherscanChecker struct {
	// contains filtered or unexported fields
}

func NewEtherscanChecker

func NewEtherscanChecker(apiKey string, chainID uint64, logger log.Logger) *EtherscanChecker

func (*EtherscanChecker) CanCheck

func (e *EtherscanChecker) CanCheck() bool

func (*EtherscanChecker) CheckStatus

func (e *EtherscanChecker) CheckStatus(ctx context.Context, address common.Address) (*VerificationStatus, error)

func (*EtherscanChecker) GetChainArg

func (e *EtherscanChecker) GetChainArg(chainID uint64) (string, error)

func (*EtherscanChecker) GetDefaultURL

func (e *EtherscanChecker) GetDefaultURL(chainID uint64) (string, error)

type ForgeVerifier

type ForgeVerifier struct {
	// contains filtered or unexported fields
}

func NewForgeVerifier

func NewForgeVerifier(opts ForgeVerifierOpts) (*ForgeVerifier, error)

func (*ForgeVerifier) VerifyContract

func (v *ForgeVerifier) VerifyContract(ctx context.Context, address common.Address, contractName string) error

func (*ForgeVerifier) VerifyContractWithConstructorArgs

func (v *ForgeVerifier) VerifyContractWithConstructorArgs(ctx context.Context, address common.Address, contractName string, constructorArgs string) error

func (*ForgeVerifier) VerifyContracts

func (v *ForgeVerifier) VerifyContracts(ctx context.Context, contracts map[string]common.Address) (verified, skipped, partiallyVerified, failed int, failedContracts, partiallyVerifiedContracts []string)

type ForgeVerifierOpts

type ForgeVerifierOpts struct {
	RpcUrl       string
	VerifierType string
	VerifierUrl  string
	ApiKey       string
	ChainID      uint64
	ArtifactsFS  foundry.StatDirFs
	Logger       log.Logger
}

type OptimizerSettings

type OptimizerSettings struct {
	Enabled bool `json:"enabled"`
	Runs    int  `json:"runs"`
}

OptimizerSettings represents compiler optimizer configuration

type SourceContent

type SourceContent struct {
	Content string
}

SourceContent represents the content of a source file

type VerificationStatus

type VerificationStatus struct {
	IsVerified          bool
	IsFullyVerified     bool
	IsPartiallyVerified bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL