Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tutorials/simple-counter/hardhat-simple-counter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
node_modules
.env

# Hardhat files
/cache
/artifacts

# TypeChain files
/typechain
/typechain-types

# solidity-coverage files
/coverage
/coverage.json

# Hardhat Ignition default folder for deployments against a local node
ignition/deployments/chain-31337
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;

contract Counter {
uint256 public countPC;
event CountIncremented(uint256 indexed countPC, address indexed caller);

function increment() public {
countPC += 1;
emit CountIncremented(countPC, msg.sender);
}
}
67 changes: 67 additions & 0 deletions tutorials/simple-counter/hardhat-simple-counter/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import "dotenv/config";
import "@nomicfoundation/hardhat-toolbox";
import "@nomicfoundation/hardhat-verify";

const ACCOUNTS = process.env.PRIVATE_KEY
? [`${process.env.PRIVATE_KEY}`]
: [];

export default {
defaultNetwork: "hardhat",

gasReporter: {
enabled: false,
},

networks: {
// βœ… Local testing network (IMPORTANT)
hardhat: {
chainId: 31337,
},

// 🌐 :contentReference[oaicite:0]{index=0}
pushTestnet: {
chainId: 42101,
url: "https://evm.donut.rpc.push.org/",
accounts: ACCOUNTS,
},
},

etherscan: {
apiKey: {
pushTestnet: "NO_API_KEY_REQUIRED",
},
customChains: [
{
network: "pushTestnet",
chainId: 42101,
urls: {
apiURL: "https://donut.push.network/api",
browserURL: "https://donut.push.network",
},
},
],
},

sourcify: {
enabled: false,
},

solidity: {
version: "0.8.28",
settings: {
evmVersion: "paris",
optimizer: {
enabled: true,
runs: 200,
},
},
},

paths: {
sources: "./contracts",
tests: "./test",
cache: "./cache",
artifacts: "./artifacts",
},
};
12 changes: 12 additions & 0 deletions tutorials/simple-counter/hardhat-simple-counter/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "hardhat-counter-project",
"devDependencies": {
"@nomicfoundation/hardhat-ethers": "^3.0.0",
"@nomicfoundation/hardhat-toolbox": "^6.1.0",
"@nomicfoundation/hardhat-verify": "^2.0.0",
"dotenv": "^16.0.0",
"hardhat": "^2.28.4"
},
"dependencies": {
}
}
Loading