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.
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.
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.tsNotice 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 testNote 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.
Verify your contracts using the verify module
npx hardhat --network pulsechainV4 verify 0x....