
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
test-hardhat-app
Advanced tools
A Hardhat 3 project
这是一个使用 Hardhat 3 创建的以太坊智能合约项目。
npm install
npm run compile
# 运行所有测试
npm test
# 只运行 Solidity 测试
npm run test:solidity
# 只运行 Mocha 测试
npm run test:mocha
test-hardhat-app/
├── contracts/ # Solidity 智能合约
│ ├── Counter.sol # 示例合约
│ └── examples/ # 更多示例合约
├── test/ # 测试文件
│ ├── Counter.t.sol # Solidity 测试
│ └── Counter.ts # TypeScript 测试
├── scripts/ # 部署和交互脚本
│ ├── deploy.ts # 部署脚本
│ ├── interact.ts # 合约交互脚本
│ └── utils/ # 工具函数
├── ignition/ # Hardhat Ignition 部署模块
│ └── modules/
│ └── Counter.ts # 声明式部署配置
├── hardhat.config.ts # Hardhat 配置文件
└── README.md # 项目文档
复制 .env.example 到 .env 并填入你的配置:
cp .env.example .env
需要配置的变量:
SEPOLIA_RPC_URL - Sepolia 测试网 RPC URLSEPOLIA_PRIVATE_KEY - 部署账户私钥ETHERSCAN_API_KEY - Etherscan API Key(用于合约验证)项目已配置以下网络:
hardhatMainnet - 本地模拟主网hardhatOp - 本地模拟 OP Stacksepolia - Sepolia 测试网# 部署到本地网络
npm run deploy
# 部署到 Sepolia 测试网
npm run deploy:sepolia
# 部署到本地网络
npm run ignition:deploy
# 部署到 Sepolia
npx hardhat ignition deploy ignition/modules/Counter.ts --network sepolia
项目支持两种测试方式:
// test/Counter.t.sol
pragma solidity ^0.8.28;
import "forge-std/Test.sol";
import "../contracts/Counter.sol";
contract CounterTest is Test {
function test_Example() public {
// 测试逻辑
}
}
// test/Counter.ts
import { expect } from "chai";
import { network } from "hardhat";
const { ethers } = await network.connect();
describe("Counter", function () {
it("Should work", async function () {
const counter = await ethers.deployContract("Counter");
// 测试逻辑
});
});
欢迎提交 Issues 和 Pull Requests!
MIT © 2025
FAQs
A Hardhat 3 project
The npm package test-hardhat-app receives a total of 2 weekly downloads. As such, test-hardhat-app popularity was classified as not popular.
We found that test-hardhat-app demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.