Skip to content

test(foundry): add Foundry test framework + ConfidentialToken access-control suite - #36

Open
Alicepoltora wants to merge 1 commit into
Inco-fhevm:mainfrom
Alicepoltora:feat/foundry-test-framework
Open

Alicepoltora wants to merge 1 commit into
Inco-fhevm:mainfrom
Alicepoltora:feat/foundry-test-framework

Conversation

@Alicepoltora

Copy link
Copy Markdown

Closes #21.

Adds a Foundry layer alongside the existing Hardhat suite. Contract deps resolve from node_modules (pnpm install); forge-std is pinned as a git submodule — no new JS package manager is introduced.

Scope (honest)

fhEVM v0.5 mock FHE is off-chain (the Hardhat setup etches a MockedPrecompile and keeps ciphertext/handle state in a JS coprocessor + gateway). Pure forge test has no JS side, so it cannot reproduce decryption or gateway callbacks. What Foundry can cover — and this suite does — is everything that runs before any TFHE op: construction, metadata, and owner-gated access control (mint / burn / transferOwnership), including a fuzz test. FHE value and decryption paths remain in the Hardhat suite.

Verified

  • forge build compiles the full contract set (incl. fhevm deps).
  • forge test → 8 passed, 0 failed (incl. testFuzz_Mint_RevertWhen_NotOwner, 256 runs).

Run

pnpm install
forge install foundry-rs/forge-std
forge test -vv

…control suite (Inco-fhevm#21)

Adds a Foundry layer alongside the existing Hardhat suite (issue Inco-fhevm#21).
Contract deps resolve from node_modules (pnpm install); forge-std is
pinned as a git submodule. No new JS package manager is introduced.

Scope: Foundry covers the plaintext/control-flow surface that executes
before any TFHE op - construction, metadata, and owner-gated access
control (mint/burn/transferOwnership), plus a fuzz test. FHE value paths
(mint/transfer success, decryption, gateway callbacks) remain in the
Hardhat suite, which wires the off-chain mock coprocessor that pure
forge test cannot provide.

Verified: forge build compiles the full contract set; forge test => 8
passed (incl. 256-run fuzz).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement a foundry based testing framework

1 participant