refactor: move brother_node development artifact to dev/test-nodes subdirectory
Development Artifact Cleanup: ✅ BROTHER_NODE REORGANIZATION: Moved development test node to appropriate location - dev/test-nodes/brother_node/: Moved from root directory for better organization - Contains development configuration, test logs, and test chain data - No impact on production systems - purely development/testing artifact ✅ DEVELOPMENT ARTIFACTS IDENTIFIED: - Chain ID: aitbc-brother-chain (test/development chain) - Ports: 8010 (P2P) and 8011 (RPC) - different from production - Environment: .env file with test configuration - Logs: rpc.log and node.log from development testing session (March 15, 2026) ✅ ROOT DIRECTORY CLEANUP: Removed development clutter from production directory - brother_node/ moved to dev/test-nodes/brother_node/ - Root directory now contains only production-ready components - Development artifacts properly organized in dev/ subdirectory DIRECTORY STRUCTURE IMPROVEMENT: 📁 dev/test-nodes/: Development and testing node configurations 🏗️ Root Directory: Clean production structure with only essential components 🧪 Development Isolation: Test environments separated from production BENEFITS: ✅ Clean Production Directory: No development artifacts in root ✅ Better Organization: Development nodes grouped in dev/ subdirectory ✅ Clear Separation: Production vs development environments clearly distinguished ✅ Maintainability: Easier to identify and manage development components RESULT: Successfully moved brother_node development artifact to dev/test-nodes/ subdirectory, cleaning up the root directory while preserving development testing environment for future use.
This commit is contained in:
57
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/README.md
generated
vendored
Executable file
57
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/README.md
generated
vendored
Executable file
@@ -0,0 +1,57 @@
|
||||
# Sample Hardhat 3 Beta Project (`node:test` and `viem`)
|
||||
|
||||
This project showcases a Hardhat 3 Beta project using the native Node.js test runner (`node:test`) and the `viem` library for Ethereum interactions.
|
||||
|
||||
To learn more about the Hardhat 3 Beta, please visit the [Getting Started guide](https://hardhat.org/docs/getting-started#getting-started-with-hardhat-3). To share your feedback, join our [Hardhat 3 Beta](https://hardhat.org/hardhat3-beta-telegram-group) Telegram group or [open an issue](https://github.com/NomicFoundation/hardhat/issues/new) in our GitHub issue tracker.
|
||||
|
||||
## Project Overview
|
||||
|
||||
This example project includes:
|
||||
|
||||
- A simple Hardhat configuration file.
|
||||
- Foundry-compatible Solidity unit tests.
|
||||
- TypeScript integration tests using [`node:test`](nodejs.org/api/test.html), the new Node.js native test runner, and [`viem`](https://viem.sh/).
|
||||
- Examples demonstrating how to connect to different types of networks, including locally simulating OP mainnet.
|
||||
|
||||
## Usage
|
||||
|
||||
### Running Tests
|
||||
|
||||
To run all the tests in the project, execute the following command:
|
||||
|
||||
```shell
|
||||
npx hardhat test
|
||||
```
|
||||
|
||||
You can also selectively run the Solidity or `node:test` tests:
|
||||
|
||||
```shell
|
||||
npx hardhat test solidity
|
||||
npx hardhat test nodejs
|
||||
```
|
||||
|
||||
### Make a deployment to Sepolia
|
||||
|
||||
This project includes an example Ignition module to deploy the contract. You can deploy this module to a locally simulated chain or to Sepolia.
|
||||
|
||||
To run the deployment to a local chain:
|
||||
|
||||
```shell
|
||||
npx hardhat ignition deploy ignition/modules/Counter.ts
|
||||
```
|
||||
|
||||
To run the deployment to Sepolia, you need an account with funds to send the transaction. The provided Hardhat configuration includes a Configuration Variable called `SEPOLIA_PRIVATE_KEY`, which you can use to set the private key of the account you want to use.
|
||||
|
||||
You can set the `SEPOLIA_PRIVATE_KEY` variable using the `hardhat-keystore` plugin or by setting it as an environment variable.
|
||||
|
||||
To set the `SEPOLIA_PRIVATE_KEY` config variable using `hardhat-keystore`:
|
||||
|
||||
```shell
|
||||
npx hardhat keystore set SEPOLIA_PRIVATE_KEY
|
||||
```
|
||||
|
||||
After setting the variable, you can run the deployment with the Sepolia network:
|
||||
|
||||
```shell
|
||||
npx hardhat ignition deploy --network sepolia ignition/modules/Counter.ts
|
||||
```
|
||||
19
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/contracts/Counter.sol
generated
vendored
Executable file
19
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/contracts/Counter.sol
generated
vendored
Executable file
@@ -0,0 +1,19 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity ^0.8.28;
|
||||
|
||||
contract Counter {
|
||||
uint public x;
|
||||
|
||||
event Increment(uint by);
|
||||
|
||||
function inc() public {
|
||||
x++;
|
||||
emit Increment(1);
|
||||
}
|
||||
|
||||
function incBy(uint by) public {
|
||||
require(by > 0, "incBy: increment should be positive");
|
||||
x += by;
|
||||
emit Increment(by);
|
||||
}
|
||||
}
|
||||
29
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/contracts/Counter.t.sol
generated
vendored
Executable file
29
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/contracts/Counter.t.sol
generated
vendored
Executable file
@@ -0,0 +1,29 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity ^0.8.28;
|
||||
|
||||
import {Counter} from "./Counter.sol";
|
||||
import {Test} from "forge-std/Test.sol";
|
||||
|
||||
contract CounterTest is Test {
|
||||
Counter counter;
|
||||
|
||||
function setUp() public {
|
||||
counter = new Counter();
|
||||
}
|
||||
|
||||
function test_InitialValue() public view {
|
||||
require(counter.x() == 0, "Initial value should be 0");
|
||||
}
|
||||
|
||||
function testFuzz_Inc(uint8 x) public {
|
||||
for (uint8 i = 0; i < x; i++) {
|
||||
counter.inc();
|
||||
}
|
||||
require(counter.x() == x, "Value after calling inc x times should be x");
|
||||
}
|
||||
|
||||
function test_IncByZero() public {
|
||||
vm.expectRevert();
|
||||
counter.incBy(0);
|
||||
}
|
||||
}
|
||||
20
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/gitignore
generated
vendored
Executable file
20
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/gitignore
generated
vendored
Executable file
@@ -0,0 +1,20 @@
|
||||
# Node modules
|
||||
/node_modules
|
||||
|
||||
# Compilation output
|
||||
/dist
|
||||
|
||||
# pnpm deploy output
|
||||
/bundle
|
||||
|
||||
# Hardhat Build Artifacts
|
||||
/artifacts
|
||||
|
||||
# Hardhat compilation (v2) support directory
|
||||
/cache
|
||||
|
||||
# Typechain output
|
||||
/types
|
||||
|
||||
# Hardhat coverage reports
|
||||
/coverage
|
||||
38
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/hardhat.config.ts
generated
vendored
Executable file
38
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/hardhat.config.ts
generated
vendored
Executable file
@@ -0,0 +1,38 @@
|
||||
import hardhatToolboxViemPlugin from "@nomicfoundation/hardhat-toolbox-viem";
|
||||
import { configVariable, defineConfig } from "hardhat/config";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [hardhatToolboxViemPlugin],
|
||||
solidity: {
|
||||
profiles: {
|
||||
default: {
|
||||
version: "0.8.28",
|
||||
},
|
||||
production: {
|
||||
version: "0.8.28",
|
||||
settings: {
|
||||
optimizer: {
|
||||
enabled: true,
|
||||
runs: 200,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
networks: {
|
||||
hardhatMainnet: {
|
||||
type: "edr-simulated",
|
||||
chainType: "l1",
|
||||
},
|
||||
hardhatOp: {
|
||||
type: "edr-simulated",
|
||||
chainType: "op",
|
||||
},
|
||||
sepolia: {
|
||||
type: "http",
|
||||
chainType: "l1",
|
||||
url: configVariable("SEPOLIA_RPC_URL"),
|
||||
accounts: [configVariable("SEPOLIA_PRIVATE_KEY")],
|
||||
},
|
||||
},
|
||||
});
|
||||
9
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/ignition/modules/Counter.ts
generated
vendored
Executable file
9
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/ignition/modules/Counter.ts
generated
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
||||
|
||||
export default buildModule("CounterModule", (m) => {
|
||||
const counter = m.contract("Counter");
|
||||
|
||||
m.call(counter, "incBy", [5n]);
|
||||
|
||||
return { counter };
|
||||
});
|
||||
26
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/package.json
generated
vendored
Executable file
26
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/package.json
generated
vendored
Executable file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "template-node-test-runner-viem",
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"description": "A TypeScript Hardhat project using Node Test Runner and Viem",
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"hardhat": "workspace:^3.1.10",
|
||||
"@nomicfoundation/hardhat-toolbox-viem": "workspace:^5.0.2",
|
||||
"@nomicfoundation/hardhat-ignition": "workspace:^3.0.8",
|
||||
"@types/node": "^22.8.5",
|
||||
"forge-std": "foundry-rs/forge-std#v1.9.4",
|
||||
"typescript": "~5.8.0",
|
||||
"viem": "^2.43.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@nomicfoundation/hardhat-ignition-viem": "workspace:^3.0.8",
|
||||
"@nomicfoundation/hardhat-keystore": "workspace:^3.0.5",
|
||||
"@nomicfoundation/hardhat-network-helpers": "workspace:^3.0.4",
|
||||
"@nomicfoundation/hardhat-node-test-runner": "workspace:^3.0.9",
|
||||
"@nomicfoundation/hardhat-viem": "workspace:^3.0.3",
|
||||
"@nomicfoundation/hardhat-viem-assertions": "workspace:^3.0.6",
|
||||
"@nomicfoundation/hardhat-verify": "workspace:^3.0.11",
|
||||
"@nomicfoundation/ignition-core": "workspace:^3.0.8"
|
||||
}
|
||||
}
|
||||
31
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/scripts/send-op-tx.ts
generated
vendored
Executable file
31
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/scripts/send-op-tx.ts
generated
vendored
Executable file
@@ -0,0 +1,31 @@
|
||||
import { network } from "hardhat";
|
||||
|
||||
const { viem } = await network.connect({
|
||||
network: "hardhatOp",
|
||||
chainType: "op",
|
||||
});
|
||||
|
||||
console.log("Sending transaction using the OP chain type");
|
||||
|
||||
const publicClient = await viem.getPublicClient();
|
||||
const [senderClient] = await viem.getWalletClients();
|
||||
|
||||
console.log("Sending 1 wei from", senderClient.account.address, "to itself");
|
||||
|
||||
const l1Gas = await publicClient.estimateL1Gas({
|
||||
account: senderClient.account.address,
|
||||
to: senderClient.account.address,
|
||||
value: 1n,
|
||||
});
|
||||
|
||||
console.log("Estimated L1 gas:", l1Gas);
|
||||
|
||||
console.log("Sending L2 transaction");
|
||||
const tx = await senderClient.sendTransaction({
|
||||
to: senderClient.account.address,
|
||||
value: 1n,
|
||||
});
|
||||
|
||||
await publicClient.waitForTransactionReceipt({ hash: tx });
|
||||
|
||||
console.log("Transaction sent successfully");
|
||||
46
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/test/Counter.ts
generated
vendored
Executable file
46
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/test/Counter.ts
generated
vendored
Executable file
@@ -0,0 +1,46 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { describe, it } from "node:test";
|
||||
|
||||
import { network } from "hardhat";
|
||||
|
||||
describe("Counter", async function () {
|
||||
const { viem } = await network.connect();
|
||||
const publicClient = await viem.getPublicClient();
|
||||
|
||||
it("Should emit the Increment event when calling the inc() function", async function () {
|
||||
const counter = await viem.deployContract("Counter");
|
||||
|
||||
await viem.assertions.emitWithArgs(
|
||||
counter.write.inc(),
|
||||
counter,
|
||||
"Increment",
|
||||
[1n],
|
||||
);
|
||||
});
|
||||
|
||||
it("The sum of the Increment events should match the current value", async function () {
|
||||
const counter = await viem.deployContract("Counter");
|
||||
const deploymentBlockNumber = await publicClient.getBlockNumber();
|
||||
|
||||
// run a series of increments
|
||||
for (let i = 1n; i <= 10n; i++) {
|
||||
await counter.write.incBy([i]);
|
||||
}
|
||||
|
||||
const events = await publicClient.getContractEvents({
|
||||
address: counter.address,
|
||||
abi: counter.abi,
|
||||
eventName: "Increment",
|
||||
fromBlock: deploymentBlockNumber,
|
||||
strict: true,
|
||||
});
|
||||
|
||||
// check that the aggregated events match the current value
|
||||
let total = 0n;
|
||||
for (const event of events) {
|
||||
total += event.args.by;
|
||||
}
|
||||
|
||||
assert.equal(total, await counter.read.x());
|
||||
});
|
||||
});
|
||||
13
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/tsconfig.json
generated
vendored
Executable file
13
dev/env/node_modules/hardhat/templates/hardhat-3/01-node-test-runner-viem/tsconfig.json
generated
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
/* Based on https://github.com/tsconfig/bases/blob/501da2bcd640cf95c95805783e1012b992338f28/bases/node22.json */
|
||||
{
|
||||
"compilerOptions": {
|
||||
"lib": ["es2023"],
|
||||
"module": "node16",
|
||||
"target": "es2022",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"moduleResolution": "node16",
|
||||
"outDir": "dist"
|
||||
}
|
||||
}
|
||||
57
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/README.md
generated
vendored
Executable file
57
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/README.md
generated
vendored
Executable file
@@ -0,0 +1,57 @@
|
||||
# Sample Hardhat 3 Beta Project (`mocha` and `ethers`)
|
||||
|
||||
This project showcases a Hardhat 3 Beta project using `mocha` for tests and the `ethers` library for Ethereum interactions.
|
||||
|
||||
To learn more about the Hardhat 3 Beta, please visit the [Getting Started guide](https://hardhat.org/docs/getting-started#getting-started-with-hardhat-3). To share your feedback, join our [Hardhat 3 Beta](https://hardhat.org/hardhat3-beta-telegram-group) Telegram group or [open an issue](https://github.com/NomicFoundation/hardhat/issues/new) in our GitHub issue tracker.
|
||||
|
||||
## Project Overview
|
||||
|
||||
This example project includes:
|
||||
|
||||
- A simple Hardhat configuration file.
|
||||
- Foundry-compatible Solidity unit tests.
|
||||
- TypeScript integration tests using `mocha` and ethers.js
|
||||
- Examples demonstrating how to connect to different types of networks, including locally simulating OP mainnet.
|
||||
|
||||
## Usage
|
||||
|
||||
### Running Tests
|
||||
|
||||
To run all the tests in the project, execute the following command:
|
||||
|
||||
```shell
|
||||
npx hardhat test
|
||||
```
|
||||
|
||||
You can also selectively run the Solidity or `mocha` tests:
|
||||
|
||||
```shell
|
||||
npx hardhat test solidity
|
||||
npx hardhat test mocha
|
||||
```
|
||||
|
||||
### Make a deployment to Sepolia
|
||||
|
||||
This project includes an example Ignition module to deploy the contract. You can deploy this module to a locally simulated chain or to Sepolia.
|
||||
|
||||
To run the deployment to a local chain:
|
||||
|
||||
```shell
|
||||
npx hardhat ignition deploy ignition/modules/Counter.ts
|
||||
```
|
||||
|
||||
To run the deployment to Sepolia, you need an account with funds to send the transaction. The provided Hardhat configuration includes a Configuration Variable called `SEPOLIA_PRIVATE_KEY`, which you can use to set the private key of the account you want to use.
|
||||
|
||||
You can set the `SEPOLIA_PRIVATE_KEY` variable using the `hardhat-keystore` plugin or by setting it as an environment variable.
|
||||
|
||||
To set the `SEPOLIA_PRIVATE_KEY` config variable using `hardhat-keystore`:
|
||||
|
||||
```shell
|
||||
npx hardhat keystore set SEPOLIA_PRIVATE_KEY
|
||||
```
|
||||
|
||||
After setting the variable, you can run the deployment with the Sepolia network:
|
||||
|
||||
```shell
|
||||
npx hardhat ignition deploy --network sepolia ignition/modules/Counter.ts
|
||||
```
|
||||
19
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/contracts/Counter.sol
generated
vendored
Executable file
19
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/contracts/Counter.sol
generated
vendored
Executable file
@@ -0,0 +1,19 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity ^0.8.28;
|
||||
|
||||
contract Counter {
|
||||
uint public x;
|
||||
|
||||
event Increment(uint by);
|
||||
|
||||
function inc() public {
|
||||
x++;
|
||||
emit Increment(1);
|
||||
}
|
||||
|
||||
function incBy(uint by) public {
|
||||
require(by > 0, "incBy: increment should be positive");
|
||||
x += by;
|
||||
emit Increment(by);
|
||||
}
|
||||
}
|
||||
32
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/contracts/Counter.t.sol
generated
vendored
Executable file
32
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/contracts/Counter.t.sol
generated
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity ^0.8.28;
|
||||
|
||||
import {Counter} from "./Counter.sol";
|
||||
import {Test} from "forge-std/Test.sol";
|
||||
|
||||
// Solidity tests are compatible with foundry, so they
|
||||
// use the same syntax and offer the same functionality.
|
||||
|
||||
contract CounterTest is Test {
|
||||
Counter counter;
|
||||
|
||||
function setUp() public {
|
||||
counter = new Counter();
|
||||
}
|
||||
|
||||
function test_InitialValue() public view {
|
||||
require(counter.x() == 0, "Initial value should be 0");
|
||||
}
|
||||
|
||||
function testFuzz_Inc(uint8 x) public {
|
||||
for (uint8 i = 0; i < x; i++) {
|
||||
counter.inc();
|
||||
}
|
||||
require(counter.x() == x, "Value after calling inc x times should be x");
|
||||
}
|
||||
|
||||
function test_IncByZero() public {
|
||||
vm.expectRevert();
|
||||
counter.incBy(0);
|
||||
}
|
||||
}
|
||||
20
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/gitignore
generated
vendored
Executable file
20
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/gitignore
generated
vendored
Executable file
@@ -0,0 +1,20 @@
|
||||
# Node modules
|
||||
/node_modules
|
||||
|
||||
# Compilation output
|
||||
/dist
|
||||
|
||||
# pnpm deploy output
|
||||
/bundle
|
||||
|
||||
# Hardhat Build Artifacts
|
||||
/artifacts
|
||||
|
||||
# Hardhat compilation (v2) support directory
|
||||
/cache
|
||||
|
||||
# Typechain output
|
||||
/types
|
||||
|
||||
# Hardhat coverage reports
|
||||
/coverage
|
||||
38
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/hardhat.config.ts
generated
vendored
Executable file
38
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/hardhat.config.ts
generated
vendored
Executable file
@@ -0,0 +1,38 @@
|
||||
import hardhatToolboxMochaEthersPlugin from "@nomicfoundation/hardhat-toolbox-mocha-ethers";
|
||||
import { configVariable, defineConfig } from "hardhat/config";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [hardhatToolboxMochaEthersPlugin],
|
||||
solidity: {
|
||||
profiles: {
|
||||
default: {
|
||||
version: "0.8.28",
|
||||
},
|
||||
production: {
|
||||
version: "0.8.28",
|
||||
settings: {
|
||||
optimizer: {
|
||||
enabled: true,
|
||||
runs: 200,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
networks: {
|
||||
hardhatMainnet: {
|
||||
type: "edr-simulated",
|
||||
chainType: "l1",
|
||||
},
|
||||
hardhatOp: {
|
||||
type: "edr-simulated",
|
||||
chainType: "op",
|
||||
},
|
||||
sepolia: {
|
||||
type: "http",
|
||||
chainType: "l1",
|
||||
url: configVariable("SEPOLIA_RPC_URL"),
|
||||
accounts: [configVariable("SEPOLIA_PRIVATE_KEY")],
|
||||
},
|
||||
},
|
||||
});
|
||||
9
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/ignition/modules/Counter.ts
generated
vendored
Executable file
9
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/ignition/modules/Counter.ts
generated
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
||||
|
||||
export default buildModule("CounterModule", (m) => {
|
||||
const counter = m.contract("Counter");
|
||||
|
||||
m.call(counter, "incBy", [5n]);
|
||||
|
||||
return { counter };
|
||||
});
|
||||
34
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/package.json
generated
vendored
Executable file
34
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/package.json
generated
vendored
Executable file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "template-mocha-ethers",
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"description": "A TypeScript Hardhat project using Mocha and Ethers.js",
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"hardhat": "workspace:^3.1.10",
|
||||
"@nomicfoundation/hardhat-toolbox-mocha-ethers": "workspace:^3.0.3",
|
||||
"@nomicfoundation/hardhat-ethers": "workspace:^4.0.5",
|
||||
"@nomicfoundation/hardhat-ignition": "workspace:^3.0.8",
|
||||
"@types/chai": "^5.2.3",
|
||||
"@types/chai-as-promised": "^8.0.1",
|
||||
"@types/mocha": ">=10.0.10",
|
||||
"@types/node": "^22.8.5",
|
||||
"chai": "^6.2.2",
|
||||
"ethers": "^6.14.0",
|
||||
"forge-std": "foundry-rs/forge-std#v1.9.4",
|
||||
"mocha": "^11.0.0",
|
||||
"typescript": "~5.8.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@nomicfoundation/hardhat-ethers": "workspace:^4.0.5",
|
||||
"@nomicfoundation/hardhat-ethers-chai-matchers": "workspace:^3.0.3",
|
||||
"@nomicfoundation/hardhat-ignition": "workspace:^3.0.8",
|
||||
"@nomicfoundation/hardhat-ignition-ethers": "workspace:^3.0.8",
|
||||
"@nomicfoundation/hardhat-keystore": "workspace:^3.0.5",
|
||||
"@nomicfoundation/hardhat-mocha": "workspace:^3.0.11",
|
||||
"@nomicfoundation/hardhat-network-helpers": "workspace:^3.0.4",
|
||||
"@nomicfoundation/hardhat-typechain": "workspace:^3.0.3",
|
||||
"@nomicfoundation/hardhat-verify": "workspace:^3.0.11",
|
||||
"@nomicfoundation/ignition-core": "workspace:^3.0.8"
|
||||
}
|
||||
}
|
||||
22
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/scripts/send-op-tx.ts
generated
vendored
Executable file
22
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/scripts/send-op-tx.ts
generated
vendored
Executable file
@@ -0,0 +1,22 @@
|
||||
import { network } from "hardhat";
|
||||
|
||||
const { ethers } = await network.connect({
|
||||
network: "hardhatOp",
|
||||
chainType: "op",
|
||||
});
|
||||
|
||||
console.log("Sending transaction using the OP chain type");
|
||||
|
||||
const [sender] = await ethers.getSigners();
|
||||
|
||||
console.log("Sending 1 wei from", sender.address, "to itself");
|
||||
|
||||
console.log("Sending L2 transaction");
|
||||
const tx = await sender.sendTransaction({
|
||||
to: sender.address,
|
||||
value: 1n,
|
||||
});
|
||||
|
||||
await tx.wait();
|
||||
|
||||
console.log("Transaction sent successfully");
|
||||
36
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/test/Counter.ts
generated
vendored
Executable file
36
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/test/Counter.ts
generated
vendored
Executable file
@@ -0,0 +1,36 @@
|
||||
import { expect } from "chai";
|
||||
import { network } from "hardhat";
|
||||
|
||||
const { ethers } = await network.connect();
|
||||
|
||||
describe("Counter", function () {
|
||||
it("Should emit the Increment event when calling the inc() function", async function () {
|
||||
const counter = await ethers.deployContract("Counter");
|
||||
|
||||
await expect(counter.inc()).to.emit(counter, "Increment").withArgs(1n);
|
||||
});
|
||||
|
||||
it("The sum of the Increment events should match the current value", async function () {
|
||||
const counter = await ethers.deployContract("Counter");
|
||||
const deploymentBlockNumber = await ethers.provider.getBlockNumber();
|
||||
|
||||
// run a series of increments
|
||||
for (let i = 1; i <= 10; i++) {
|
||||
await counter.incBy(i);
|
||||
}
|
||||
|
||||
const events = await counter.queryFilter(
|
||||
counter.filters.Increment(),
|
||||
deploymentBlockNumber,
|
||||
"latest",
|
||||
);
|
||||
|
||||
// check that the aggregated events match the current value
|
||||
let total = 0n;
|
||||
for (const event of events) {
|
||||
total += event.args.by;
|
||||
}
|
||||
|
||||
expect(await counter.x()).to.equal(total);
|
||||
});
|
||||
});
|
||||
13
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/tsconfig.json
generated
vendored
Executable file
13
dev/env/node_modules/hardhat/templates/hardhat-3/02-mocha-ethers/tsconfig.json
generated
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
/* Based on https://github.com/tsconfig/bases/blob/501da2bcd640cf95c95805783e1012b992338f28/bases/node22.json */
|
||||
{
|
||||
"compilerOptions": {
|
||||
"lib": ["es2023"],
|
||||
"module": "node16",
|
||||
"target": "es2022",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"moduleResolution": "node16",
|
||||
"outDir": "dist"
|
||||
}
|
||||
}
|
||||
7
dev/env/node_modules/hardhat/templates/hardhat-3/03-minimal/README.md
generated
vendored
Executable file
7
dev/env/node_modules/hardhat/templates/hardhat-3/03-minimal/README.md
generated
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
# Sample Hardhat 3 Beta Project (minimal)
|
||||
|
||||
This project has a minimal setup of Hardhat 3 Beta, without any plugins.
|
||||
|
||||
## What's included?
|
||||
|
||||
The project includes native support for TypeScript, Hardhat scripts, tasks, and support for Solidity compilation and tests.
|
||||
20
dev/env/node_modules/hardhat/templates/hardhat-3/03-minimal/gitignore
generated
vendored
Executable file
20
dev/env/node_modules/hardhat/templates/hardhat-3/03-minimal/gitignore
generated
vendored
Executable file
@@ -0,0 +1,20 @@
|
||||
# Node modules
|
||||
/node_modules
|
||||
|
||||
# Compilation output
|
||||
/dist
|
||||
|
||||
# pnpm deploy output
|
||||
/bundle
|
||||
|
||||
# Hardhat Build Artifacts
|
||||
/artifacts
|
||||
|
||||
# Hardhat compilation (v2) support directory
|
||||
/cache
|
||||
|
||||
# Typechain output
|
||||
/types
|
||||
|
||||
# Hardhat coverage reports
|
||||
/coverage
|
||||
7
dev/env/node_modules/hardhat/templates/hardhat-3/03-minimal/hardhat.config.ts
generated
vendored
Executable file
7
dev/env/node_modules/hardhat/templates/hardhat-3/03-minimal/hardhat.config.ts
generated
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
import { defineConfig } from "hardhat/config";
|
||||
|
||||
export default defineConfig({
|
||||
solidity: {
|
||||
version: "0.8.28",
|
||||
},
|
||||
});
|
||||
12
dev/env/node_modules/hardhat/templates/hardhat-3/03-minimal/package.json
generated
vendored
Executable file
12
dev/env/node_modules/hardhat/templates/hardhat-3/03-minimal/package.json
generated
vendored
Executable file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "template-minimal",
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"description": "A minimal Hardhat project",
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"hardhat": "workspace:^3.1.10",
|
||||
"@types/node": "^22.8.5",
|
||||
"typescript": "~5.8.0"
|
||||
}
|
||||
}
|
||||
13
dev/env/node_modules/hardhat/templates/hardhat-3/03-minimal/tsconfig.json
generated
vendored
Executable file
13
dev/env/node_modules/hardhat/templates/hardhat-3/03-minimal/tsconfig.json
generated
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
/* Based on https://github.com/tsconfig/bases/blob/501da2bcd640cf95c95805783e1012b992338f28/bases/node22.json */
|
||||
{
|
||||
"compilerOptions": {
|
||||
"lib": ["es2023"],
|
||||
"module": "node16",
|
||||
"target": "es2022",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"moduleResolution": "node16",
|
||||
"outDir": "dist"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user