Skip to content

Commit b0e5b21

Browse files
snarioampcode-com
andauthored
docs: add Hardhat verification, deployment artifacts, and proxy contract guidance (#113)
Adds concise coverage for the three gaps in verification docs: - Verify with Hardhat: hardhat-verify plugin Sourcify config + usage - Verify from deployment artifacts: how to extract metadata from hardhat-deploy JSON files and map fields to the API request - Proxy contracts: each contract verified separately, may use different compiler versions - Removes deprecated andantino from supported chains table Amp-Thread-ID: https://ampcode.com/threads/T-019c7634-cb49-73e3-971f-fce5d6d67030 Co-authored-by: Amp <amp@ampcode.com>
1 parent a36703d commit b0e5b21

1 file changed

Lines changed: 39 additions & 1 deletion

File tree

src/pages/quickstart/verify-contracts.mdx

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,45 @@ This retries verification up to 10 times with a 10-second delay between attempts
7575

7676
For more details on deployment and verification options, see the [Foundry documentation](https://getfoundry.sh/forge/deploying).
7777

78+
## Verify with Hardhat
79+
80+
If you deployed with Hardhat, add Sourcify verification to your `hardhat.config.ts` using [`@nomicfoundation/hardhat-verify`](https://hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-verify):
81+
82+
```ts
83+
import "@nomicfoundation/hardhat-verify";
84+
85+
const config: HardhatUserConfig = {
86+
// ... your existing config
87+
sourcify: {
88+
enabled: true,
89+
apiUrl: "https://contracts.tempo.xyz",
90+
browserUrl: "https://explore.tempo.xyz",
91+
},
92+
};
93+
```
94+
95+
Then verify:
96+
97+
```bash
98+
npx hardhat verify --network tempo <CONTRACT_ADDRESS> [constructor args...]
99+
```
100+
101+
### Verify from deployment artifacts
102+
103+
If you have Hardhat deployment JSON files (from `hardhat-deploy` or `hardhat-ignition`) but no longer have the project set up, you can still verify. These files contain embedded compiler metadata with full source code (when compiled with `useLiteralContent: true`, the default for `hardhat-deploy`).
104+
105+
Extract the `metadata` field, parse it as JSON, then construct a [verification API request](#verify-with-the-api) using:
106+
- `metadata.sources``stdJsonInput.sources`
107+
- `metadata.settings` (optimizer, evmVersion, remappings) → `stdJsonInput.settings`
108+
- `metadata.compiler.version``compilerVersion`
109+
- `metadata.settings.compilationTarget``contractIdentifier` (format: `path/to/File.sol:ContractName`)
110+
111+
## Proxy Contracts
112+
113+
OpenZeppelin proxy deployments (e.g., `TransparentUpgradeableProxy`) create multiple contracts — typically an implementation, a proxy, and a `ProxyAdmin`. Each must be verified **separately** and may use **different compiler versions** (e.g., your contract uses `solc 0.8.22` while the OZ proxy uses `solc 0.8.10`).
114+
115+
If you have the deployment artifact for each contract, the correct compiler version and settings are already embedded in each file's metadata.
116+
78117
## Verify with the API
79118

80119
You can also verify contracts directly using the REST API. Verification is asynchronous—you submit a request, then poll for the result.
@@ -193,7 +232,6 @@ View the full API documentation at [contracts.tempo.xyz/docs](https://contracts.
193232
:::info
194233
The `andantino` testnet (chain ID `42429`) has been deprecated. Use `moderato` (chain ID `42431`) for testnet development.
195234
:::
196-
197235
## Troubleshooting
198236

199237
:::tip

0 commit comments

Comments
 (0)