@xtools-at/hardhat-sourcify
v0.2.0
Published
Improved fork of zoey-t's Sourcify contract verification plugin for Hardhat
Downloads
78
Maintainers
Readme
hardhat-sourcify
Verify smart contracts with Sourcify using Hardhat.
Install
- install plugin
yarn add -D @xtools-at/hardhat-sourcify
- import plugin in
hardhat.config
import "@xtools-at/hardhat-sourcify";
// or
require("@xtools-at/hardhat-sourcify");
- CLI help
npx hardhat help verify-sourcify
Use
- verify contract
NFT
incontracts/NFT.sol
:
npx hardhat --network beam verify-sourcify --contract "NFT" --address 0x12345...
- verify contract
NFT
incontracts/NFT.sol
, overriding the network's chain id:
npx hardhat verify-sourcify --chain-id 4337 --contract "NFT" --address 0x12345...
- verify contract
NFT
incontracts/extensions/NFT.sol
:
npx hardhat --network beam verify-sourcify --contract "NFT" --path "extensions" --address 0x12345...
- verify contract
NFT
incontracts/extensions/OtherFilename.sol
:
npx hardhat --network beam verify-sourcify --contract "NFT" --path "extensions/OtherFilename.sol" --address 0x12345...
- verify contract
NFT
incontracts-custom42/extensions/OtherFilename.sol
:
npx hardhat --network beam verify-sourcify --contract "NFT" --full-path "contracts-custom42/extensions/OtherFilename.sol" --address 0x12345...
Build and publish lib
- sign up and get access token from npmjs
via Github actions
- add
NPM_TOKEN
to Github actions secrets - create a Github access token and add it to the secrets as
RELEASE_TOKEN
- bump the package version in
package.json
- add annotated tag to branch:
git tag -a v0.2.0 -m "release 0.2.0"
- push all tags
git push --follow-tags
manually
- install Node.js v16+
- install repo dependencies using
npm i
(not yarn) - bump the package version in
package.json
- build
npm run build
- publish to npm
NPM_TOKEN=yourNpmAccessToken npm publish --access public
History
0.2.0
- new streamlined interface (backwards compatible), less typing necessary
0.1.1 - 0.1.2
- fixed minor build issue with yarn, improved log messages
0.1.0
- fork of zoey-t's hardhat-sourcify including prebuilt package and published latest version to npm