Hardhat Arbitrum Stylus Plugin¶
Hardhat plugin suite for Arbitrum Stylus development.
Alpha Status
This suite is under active development. APIs and workflows may evolve between releases.
What's Included¶
@cobuilders/hardhat-arbitrum-stylus is a plugin bundler that includes all the individual plugins:
@cobuilders/hardhat-arb-node: Run a local Arbitrum node.@cobuilders/hardhat-arb-compile: Compile Stylus contracts.@cobuilders/hardhat-arb-deploy: Deploy Solidity and Stylus contracts.@cobuilders/hardhat-arb-test: Run tests across Solidity and Stylus.
Prerequisites¶
- Hardhat v3 (Hardhat v2 is not supported).
- Node.js v22+: nodejs.org or
nvm install 22. - Docker: latest version from docker.com.
- npm: bundled with Node.js.
Hardhat 3 Required
This plugin uses Hardhat 3's plugin system. It is not compatible with Hardhat v2.
Installation¶
You can add this plugin to an existing Hardhat 3 project or create a new one.
New Hardhat Project¶
If you are starting from scratch, use the Stylus initializer:
This command scaffolds a Hardhat 3 + viem project and wires the Arbitrum Stylus setup.
Add to Existing Hardhat Project¶
If you already have a Hardhat 3 project, install the plugin and required dependencies:
Configure Hardhat¶
Add the plugin to your hardhat.config.ts:
import type { HardhatUserConfig } from 'hardhat/config';
import hardhatToolboxViemPlugin from '@nomicfoundation/hardhat-toolbox-viem';
import hardhatArbitrumStylus from '@cobuilders/hardhat-arbitrum-stylus';
const config: HardhatUserConfig = {
plugins: [hardhatToolboxViemPlugin, hardhatArbitrumStylus],
};
export default config;
Verify Installation¶
Quick Start¶
Start a local Arbitrum node:
You'll see pre-funded accounts and the RPC endpoint: