Skip to content

gibsfinance/example-hardhat-project

Repository files navigation

Sample Hardhat Project for PulseChain

This project demonstrates a basic Hardhat use case when interacting with PulseChain. It comes with a sample contract, a test for that contract, and a Hardhat Ignition module that deploys that contract.

Setup

Copy the .example.env file and change the requisite variables. Source the file appropriately or export the vars so they are passed down to internal node processes if not passing them directly.

Exploration

Try running some of the following tasks:

npx hardhat help
npx hardhat test
REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat ignition deploy ./ignition/modules/Lock.ts

Development

Notice that the pulsechain networks have been preconfigured with merge and shanghai hardfork histories turned on. This allows you to run hardhat in a forked mode when commands are provided a CHAIN and FORK_BLOCK_NUMBER environment variable.

For example, the following command will run tests against PulseChain on the hardhat network as a fork:

CHAIN=pulsechain FORK_BLOCK_NUMBER=23479220 npm run test

Caveats

Note that currently, the TSTORE+TLOAD opcodes are not supported by PulseChain. While this may change in the future, running solidity code with this opcode in it will result in an error when run on PulseChain.

Verification

Verify your contracts using the verify module

npx hardhat --network pulsechainV4 verify 0x....

About

an example hardhat repo to show how easy it is to create contracts on pulsechain

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages