Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@xtools-at/hardhat-sourcify

xtools-at27MIT0.2.0TypeScript support: included

Improved fork of zoey-t's Sourcify contract verification plugin for Hardhat

ethereum, smart-contracts, hardhat, hardhat-plugin, sourcify, verify

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 in contracts/NFT.sol:
    npx hardhat --network beam verify-sourcify --contract "NFT" --address 0x12345...
  • verify contract NFT in contracts/NFT.sol, overriding the network's chain id:
    npx hardhat verify-sourcify --chain-id 4337 --contract "NFT" --address 0x12345...
  • verify contract NFT in contracts/extensions/NFT.sol:
    npx hardhat --network beam verify-sourcify --contract "NFT" --path "extensions" --address 0x12345...
  • verify contract NFT in contracts/extensions/OtherFilename.sol:
    npx hardhat --network beam verify-sourcify --contract "NFT" --path "extensions/OtherFilename.sol" --address 0x12345...
  • verify contract NFT in contracts-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