0.2.0 • Published 2 years ago
@xtools-at/hardhat-sourcify v0.2.0
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-sourcifyUse
- verify contract
NFTincontracts/NFT.sol:
npx hardhat --network beam verify-sourcify --contract "NFT" --address 0x12345...- verify contract
NFTincontracts/NFT.sol, overriding the network's chain id:
npx hardhat verify-sourcify --chain-id 4337 --contract "NFT" --address 0x12345...- verify contract
NFTincontracts/extensions/NFT.sol:
npx hardhat --network beam verify-sourcify --contract "NFT" --path "extensions" --address 0x12345...- verify contract
NFTincontracts/extensions/OtherFilename.sol:
npx hardhat --network beam verify-sourcify --contract "NFT" --path "extensions/OtherFilename.sol" --address 0x12345...- verify contract
NFTincontracts-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_TOKENto 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-tagsmanually
- 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 publicHistory
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