Documentation
¶
Overview ¶
Package etherscan implements the client side of Tenderly's Etherscan-compatible contract verification API — the same protocol Foundry and hardhat-verify speak. Verification is synchronous: a verifysourcecode call returns the outcome directly.
Index ¶
Constants ¶
const CodeFormatStandardJSON = "solidity-standard-json-input"
CodeFormatStandardJSON submits the full solc standard-JSON input, so the server recompiles with exactly the submitted compiler settings.
Variables ¶
This section is empty.
Functions ¶
func BuildStandardJSONInput ¶
func BuildStandardJSONInput(contracts []providers.Contract, config *payloads.Config) (string, error)
BuildStandardJSONInput assembles the compilation input from the provider build artifacts (all sources, including undeployed library/interface contracts) and the parsed compiler configuration.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to a single verifier URL: either the dashboard API (.../etherscan/verify/network/{networkId}[/public]) or a Virtual TestNet ({rpc}/verify, where the RPC URL itself authenticates).
func (*Client) VerifySourceCode ¶
func (c *Client) VerifySourceCode(request *VerifyRequest) (*Response, error)
type Optimizer ¶
type Optimizer struct {
Enabled *bool `json:"enabled,omitempty"`
Runs *int `json:"runs,omitempty"`
Details *payloads.ConfigDetails `json:"details,omitempty"`
}
type Response ¶
type SourceContent ¶
type SourceContent struct {
Content string `json:"content"`
}
type StandardJSONInput ¶
type StandardJSONInput struct {
Language string `json:"language"`
Sources map[string]SourceContent `json:"sources"`
Settings Settings `json:"settings"`
}
StandardJSONInput is the solc standard-JSON compilation input. The settings are passed through to solc verbatim server-side, so a verification compiles with exactly the submitted configuration.
type VerifyRequest ¶
type VerifyRequest struct {
// ContractAddress is the deployed address to verify.
ContractAddress string
// ContractName is fully qualified: "contracts/Foo.sol:Foo".
ContractName string
// CompilerVersion is an exact solc version, e.g. "0.8.20+commit.a1b79de6".
CompilerVersion string
// SourceCode is the marshaled solc standard-JSON input.
SourceCode string
}