test hardhat

This commit is contained in:
Dimitar Manov 2025-06-11 09:28:52 +03:00
parent c1ecf8fbd6
commit 3eb8bf5d63
5 changed files with 59 additions and 18 deletions

2
.gitignore vendored
View file

@ -56,3 +56,5 @@ cmd/evm/evm
cmd/geth/geth
cmd/rlpdump/rlpdump
cmd/workload/workload
devnet/

35
hardhat/.gitignore vendored
View file

@ -13,23 +13,24 @@ node_modules
/coverage
/coverage.json
# Hardhat Ignition default folder for deployments against a local node
ignition/deployments/chain-1337/
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
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

View file

@ -0,0 +1,19 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract Greeter {
string public greeting;
constructor(string memory _greeting) {
greeting = _greeting;
}
function greet() public view returns (string memory) {
return greeting;
}
function setGreeting(string memory _greeting) public {
greeting = _greeting;
}
}

0
hardhat/eth.chainId Normal file
View file

19
hardhat/scripts/deploy.ts Normal file
View file

@ -0,0 +1,19 @@
import { ethers } from "hardhat";
async function main() {
const [deployer] = await ethers.getSigners();
console.log("Deploying contract with account:", deployer.address);
const Greeter = await ethers.getContractFactory("Greeter");
const greeter = await Greeter.deploy("Hello from Geth Devnet!");
await greeter.waitForDeployment(); // <-- Ethers v6 method
console.log("Contract deployed to:", await greeter.getAddress());
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});