@appliedblockchain/silentdatarollup-hardhat3-plugin
v1.1.0
Published
Hardhat 3 plugin for Silent Data
Maintainers
Readme
Silent Data Providers - Hardhat 3 Plugin Package
Table of Contents
Introduction
Custom providers for integrating Silent Data with Hardhat 3.
Note: This plugin is for Hardhat 3. For Hardhat 2, use
@appliedblockchain/silentdatarollup-hardhat-plugin.
Prerequisites
- Node.js (version 22 or higher)
- Hardhat v3
- pnpm
- Basic knowledge of Ethereum and smart contracts
Integration
Hardhat Integration
Installing Hardhat Integration Dependencies
pnpm add @appliedblockchain/silentdatarollup-core @appliedblockchain/silentdatarollup-hardhat3-plugin @nomicfoundation/hardhat-ignition-viemHardhat Integration Example
To integrate the Silent Data Provider with Hardhat 3, you need to:
- Import and add the plugin to the
pluginsarray (Hardhat 3's declarative pattern) - Configure your Silent Data network with the
silentdataproperty
Note that Hardhat 3 uses ESM by default and requires a declarative configuration.
import { defineConfig } from 'hardhat/config'
import hardhatIgnitionViemPlugin from '@nomicfoundation/hardhat-ignition-viem'
import { SignatureType } from '@appliedblockchain/silentdatarollup-core'
import silentDataPlugin from '@appliedblockchain/silentdatarollup-hardhat3-plugin'
const RPC_URL = 'SILENT_DATA_ROLLUP_RPC_URL'
const PRIVATE_KEY = process.env.PRIVATE_KEY
export default defineConfig({
plugins: [silentDataPlugin],
solidity: '0.8.21',
networks: {
sdr: {
type: 'http',
url: RPC_URL,
accounts: [PRIVATE_KEY], // Note: Currently, only one private key can be passed to the network accounts configuration.
silentdata: {
authSignatureType: SignatureType.EIP712, // Optional, defaults to RAW
},
},
},
})Note: With the above configuration, you can deploy a contract using Hardhat Ignition. For a detailed example, including a sample contract and an Ignition module, please refer to the Hardhat Ignition Getting Started Guide.
To deploy your contract using Hardhat Ignition, run the following command:
npx hardhat ignition deploy ignition/modules/Apollo.ts --network sdrTroubleshooting
If you encounter any issues, please check the following:
- Ensure you're using the correct RPC URL for your desired network.
- Verify that your private key is correctly set.
- Ensure that your token is still active on the SilentData AppChains dashboard.
- Make sure your Hardhat config file uses ESM syntax (Hardhat 3 requirement).
- Make sure you're using Node.js v22.10.0 or later (Hardhat 3 requirement).
License
This project is licensed under the MIT License.
