Repository navigation
test(foundry): add Foundry test framework + ConfidentialToken access-control suite - #36
Open
Alicepoltora wants to merge 1 commit into
Open
Alicepoltora wants to merge 1 commit into
Alicepoltora wants to merge 1 commit into
Conversation
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 testhas 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 buildcompiles the full contract set (incl. fhevm deps).forge test→ 8 passed, 0 failed (incl.testFuzz_Mint_RevertWhen_NotOwner, 256 runs).Run