0.0.4 • Published 1 year ago

@ahsouissitest/contracts v0.0.4

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Sample Hardhat Project

This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a script that deploys that contract.

Running AccountCreation and AccountCreationHRE:

The mnemonic for test is hardcoded in the hardhat.config for simplification.

-- AccountCreationHRE

This test can be run stand alone, without the need to run a local hardhat node on the side. It use the Hardat Runtime Enviroment objet with hardhat helper for ethers.js that add some new api on top of the one from ethers.js Each test will restart a new hardhat node.

npx hardhat test test/AccountCreationHRE.js

-- AccountCreation

This test need a hardhat node that run on a seperate terminal. The state of the node persiste after each test.

npx hardhat node
npx hardhat test test/AccountCreation.js

Fun fact: You can run both test at the same time, the HRE doesn't use the same mechanisme or same port as the stand alone hardhat node (localhost:8545)

Try running some of the following tasks:

npx hardhat help
npx hardhat test
REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat run scripts/deploy.js