Testing
Rugdrome uses both Hardhat and Foundry for testing. This page describes how to run the test suites and what they cover.
Hardhat Tests
Hardhat tests are located in test/ and are written in JavaScript/TypeScript.
Run All Hardhat Tests
bash
npm run testRun the E2E Suite
bash
npx hardhat test test/e2e.jsThe E2E suite covers the full protocol lifecycle: token deployment, liquidity provision, voting, emissions, and reward claims.
Foundry Tests
Foundry tests are located in test/foundry/ and are written in Solidity.
Run Foundry Tests
bash
forge testTest Files
| File | Purpose |
|---|---|
FuzzCLMath.t.sol | Foundry fuzz test for concentrated-liquidity math. |
HalmosSymbolicTest.sol | Symbolic-execution target for formal verification. |
MedusaFuzzTest.sol | Medusa property-based fuzzing target. |
Gas Reporting
Set REPORT_GAS=true in .env to enable the Hardhat gas reporter:
bash
REPORT_GAS=true npm run testSecurity Audit Results
A comprehensive security audit was performed using seven tools. See the Audits page for a summary.
Continuous Integration
When adding new tests, ensure they pass against both Hardhat and Foundry. Keep test files in the appropriate directory:
- JavaScript/TypeScript tests in
test/ - Solidity tests in
test/foundry/