import type { GetRequest, PostRequest } from './get-request.js'; import type { EtherscanResponse } from './types.js'; import type { ContractCreation, ContractSource } from './results.js'; /** Common fields shared by the contract-verification endpoints. */ export interface VerifyParams { /** Address the contract is deployed at. */ contractaddress: string; /** The source, or a standard-json-input string. */ sourceCode: string; /** Contract name (or `path:Name` for standard-json-input). */ contractname: string; optimizationUsed?: 0 | 1 | string; runs?: number | string; /** ABI-encoded constructor arguments (without the leading `0x`). */ constructorArguements?: string; licenseType?: number | string; /** Any further endpoint-specific fields are passed through. */ [key: string]: string | number | undefined; } /** Parameters for `contract.verifysourcecode` (Solidity). */ export interface VerifySourceCodeParams extends VerifyParams { /** e.g. `'solidity-single-file'` or `'solidity-standard-json-input'`. */ codeformat?: string; /** Full compiler version, e.g. `'v0.8.24+commit.e11b9ed9'`. */ compilerversion: string; evmversion?: string; } export declare function contract(getRequest: GetRequest, postRequest: PostRequest): { /** * Returns the creator address and creation transaction hash for one or more * contracts (up to 5). * @param contractaddresses - A single contract address or an array of up to 5 */ getcontractcreation(contractaddresses: string | string[]): Promise>; /** * Returns the ABI of a verified contract (JSON encoded as a string). * @param address - Contract address */ getabi(address: string): Promise>; /** * Returns the source code of a verified contract. * @param address - Contract address */ getsourcecode(address: string): Promise>; /** * Submits a contract's source code for verification (POST). Resolves with a * GUID (string) you can poll with `checkverifystatus`. * @param params - Verification fields ({@link VerifySourceCodeParams}) */ verifysourcecode(params: VerifySourceCodeParams): Promise>; /** * Submits Vyper source code for verification (POST). Resolves with a GUID. * @param params - Verification fields ({@link VerifyParams}) */ verifyvyper(params: VerifyParams): Promise>; /** * Submits Stylus (Rust/WASM) source code for verification (POST). Resolves with a GUID. * @param params - Verification fields ({@link VerifyParams}) */ verifystylus(params: VerifyParams): Promise>; /** * Submits zkSync-compiled source code for verification (POST). Resolves with a GUID. * @param params - Verification fields ({@link VerifyParams}); include `compilerversion` */ verifyzksyncsourcecode(params: VerifyParams): Promise>; /** * Checks the status of a source-code verification request. * @param guid - The GUID returned by `verifysourcecode` */ checkverifystatus(guid: string): Promise>; /** * Submits a proxy contract for verification (POST). Resolves with a GUID * (string) you can poll with `checkproxyverification`. * @param address - Proxy contract address * @param expectedimplementation - (optional) expected implementation address */ verifyproxycontract(address: string, expectedimplementation?: string): Promise>; /** * Checks the status of a proxy-contract verification request. * @param guid - The GUID returned by `verifyproxycontract` */ checkproxyverification(guid: string): Promise>; };