Skip to content

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 test

Run the E2E Suite ​

bash
npx hardhat test test/e2e.js

The 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 test

Test Files ​

FilePurpose
FuzzCLMath.t.solFoundry fuzz test for concentrated-liquidity math.
HalmosSymbolicTest.solSymbolic-execution target for formal verification.
MedusaFuzzTest.solMedusa property-based fuzzing target.

Gas Reporting ​

Set REPORT_GAS=true in .env to enable the Hardhat gas reporter:

bash
REPORT_GAS=true npm run test

Security 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/

Released under the GNU AGPL v3 License.