diff --git a/README.md b/README.md index c1ff755..ef7b66a 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,10 @@ npx hardhat compile # Run tests npx hardhat test +# Run Foundry tests +forge test +# or: npm run test:forge + # Deploy locally npx hardhat node & npx hardhat run scripts/deploy.js --network localhost @@ -143,6 +147,12 @@ config/geographies/ | `DepegGuard.sol` | Depeg-defence watchdog — Normal/Caution/Hard state machine, pauses mints + stablecoin on threshold breaches. Spec: [`docs/depeg-guard.md`](docs/depeg-guard.md) | | `ChainlinkPoRAdapter.sol` | Adapter for Chainlink Proof of Reserves feeds | +## Foundry notes + +- Forge tests live under `forge-test/` and are wired through `foundry.toml`, so plain `forge test` works after `npm install`. +- `lib/forge-std` is already vendored for the test harness; no extra `forge install` step is needed for a normal local checkout. +- If `forge` is installed outside your shell `PATH`, invoke it with your local Foundry bin path or add that directory to `PATH` first. + ## Contributing We welcome contributions. See open issues tagged `good-first-issue`. diff --git a/foundry.toml b/foundry.toml index d890d5a..8f5a574 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,7 +1,8 @@ [profile.default] src = "contracts" +test = "forge-test" out = "forge-out" -libs = ["node_modules"] +libs = ["node_modules", "lib"] solc = "0.8.24" optimizer = true optimizer-runs = 200 diff --git a/package.json b/package.json index 5aa5260..2a741ae 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "scripts": { "compile": "hardhat compile", "test": "hardhat test", + "test:forge": "forge test -vvv", "deploy:local": "hardhat run scripts/deploy.js --network localhost" }, "dependencies": {