Skip to main content


To simplifiy the development of applications based on Unlock Protocol, we created a simple library for Hardhat. It allows to easily deploy the protocol locally to test things, or manipulate existing locks and contracts from scripts and the command line.


npm i @unlock-protocol/hardhat-plugin


yarn install @unlock-protocol/hardhat-plugin

Import the plugin in your hardhat.config.js:


Or if you are using TypeScript, in your hardhat.config.ts:

import "@unlock-protocol/hardhat-plugin";



Info about already deployed Unlock contracts (on mainnet, rinkeby, optimism, bsc, xdai/gnosis, etc.) are added to the unlock param of the hardhat config. You can pass custom info about your own Unlock deployments directly in hardhat.config.js.

Config example

import "@unlock-protocol/hardhat-plugin";

const config: HardhatUserConfig = {
solidity: "0.8.7",
unlock: {
12345: {
name: "My New Network",
unlockAddress: "0x...", // your own unlock deployment address

For more check the plugin page or the example repo.