This project was bootstrapped with Hardhat V3. I've edited the default smart contract somewhat, but my version does basically the same thing - increments a counter.
- Clone this repo
- Run
yarnto install dependencies touch .env- Create a .env file to place your secrets (gitignored)- In your new
.envfile, place the following variables:SEPOLIA_PRIVATE_KEY(your private wallet key for the sepolia network),SEPOLIA_RPC_URL(for example:https://sepolia.infura.io/v3/MY_API_KEY) - To run tests,
yarn test - To call the function with your wallet, run
yarn call:sepolia. This will call the various functions exposed by the contract and print some output.
- Make your changes to the contract or add a new one in the
contractsfolder - Update the associated tests. Note that there are both solidity tests AND typescript unit tests you'll need to update.
- To deploy, assuming you've got your variables above in the
.envfile, run:npx hardhat ignition deploy --network sepolia ignition/modules/MyContract.ts(replacingMyContractwith your file name) - Adjust the contract address and deployment JSON in the
scripts/send-sepolia-tx.tsfile as needed. - Run
yarn call:sepoliato execute the new contract (presuming you adjusted the ts file correctly in the previous step!)