Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: include hardhat-verify plugin verification instructions #127

Merged
merged 2 commits into from
Jan 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions docs/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,41 @@ forge create --rpc-url http://localhost:7546 \
--verifier sourcify \
--verifier-url http://localhost:5002
```

## Hardhat

You can also verify contracts using Hardhat with the [`hardhat-verify`](https://hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-verify#verifying-on-sourcify) plugin using our verification service.

> There is currently a minor issue that might confuse users but that does not affect Sourcify verification <https://github.com/NomicFoundation/hardhat/issues/4776>.

Create a new Hardhat project, install its dependencies and use the following `hardhat.config.js`

```js
require("@nomicfoundation/hardhat-toolbox");

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.19",
networks: {
testnet: {
url: 'https://testnet.hashio.io/api',
accounts: ["<your account id, go to https://portal.hedera.com/ to setup one>"],
acuarica marked this conversation as resolved.
Show resolved Hide resolved
chainId: 296,
},
},
sourcify: {
enabled: true,
apiUrl: "https://server-verify.hashscan.io",
browserUrl: "https://repository-verify.hashscan.io",
}
};
```

Then run

```console
npx hardhat run --network testnet scripts/deploy.js
npx hardhat verify --network testnet <CONTRACT_ADDR>
```

Your contract should be now verified.
Loading