A Hardhat 3 plugin that automatically launches the OpenScan Explorer webapp and adds clickable OpenScan links to transaction logs in your terminal.
Learn more at https://openscan.eth.link
npm install --save-dev @openscan/hardhat-pluginIn your hardhat.config.ts, import the plugin and add it to the plugins array:
import openScanPlugin from "@openscan/hardhat-plugin";
import { defineConfig } from "hardhat/config";
export default defineConfig({
plugins: [openScanPlugin],
solidity: "0.8.29",
networks: {
localhost: {
type: "http",
url: "http://127.0.0.1:8545",
},
},
openScan: {
url: "http://localhost:3030", // default
chainId: 31337, // default
},
});| Option | Type | Default | Description |
|---|---|---|---|
url |
string |
"http://localhost:3030" |
URL where the explorer is served |
chainId |
number |
31337 |
Chain ID for the explorer links |
When the first network connection is established (e.g. via npx hardhat node), the plugin:
- Checks if port 3030 is available
- Starts a local HTTP server serving the OpenScan Explorer webapp
- Opens your default browser to the explorer
The explorer serves contract artifacts (ABIs, source code, deployment addresses) so you can inspect deployed contracts directly in the browser. It supports both Hardhat Ignition deployments and raw deployment scripts.
The plugin intercepts JSON-RPC requests and logs clickable terminal links (via OSC 8 hyperlinks) for:
eth_sendTransaction— logs links to the transaction, sender, and recipient addresseseth_getTransactionReceipt— logs links to the transaction, block, sender, recipient, and deployed contract address (if applicable)eth_accounts— logs links to each account address
When contracts are deployed (transactions with no to address), the plugin matches the creation bytecode against compiled artifacts in your project. This allows the explorer to display the contract name, ABI, and source code for deployed contracts — even without Hardhat Ignition.
npx hardhat nodeThe OpenScan Explorer will automatically launch and your browser will open.
With Hardhat Ignition:
npx hardhat ignition deploy ignition/modules/Counter.ts --network localhostOr with a script:
npx hardhat run scripts/deploy.ts --network localhostnpx hardhat run scripts/send-tx.ts --network localhostAll transactions will be logged with clickable OpenScan links in the terminal.
- Hardhat 3.x
- Node.js 24
- Port 3030 must be available (the explorer is hardcoded to this port — the
urloption only affects terminal link URLs, not the server port)
If the explorer fails to start, check what is using the port:
lsof -i :3030Then stop the conflicting process, or if it's a leftover Hardhat/OpenScan process:
kill $(lsof -t -i:3030)MIT