aere-contracts/test/formal/forge-std-shim/Test.sol
Aere Network a13a649b77
Some checks are pending
contracts-ci / Install (lockfile) → compile → full test suite (push) Waiting to run
contracts-ci / PQC known-answer tests (NIST vectors) (push) Waiting to run
contracts-ci / Coverage (scoped, with artifacts) (push) Waiting to run
Initial public release
Aere Network public source. Everything here can be checked against the live
chain (chain id 2800, https://rpc.aere.network).

Scope note, stated up front rather than buried: consensus on chain 2800 is
classical secp256k1 ECDSA QBFT. The post-quantum work in this repository is at
the signature, precompile, account and transport layers. Nothing here makes the
consensus post-quantum, and no document in it should be read as claiming so.
2026-07-20 01:02:37 +03:00

36 lines
1.7 KiB
Solidity

// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
/**
* Minimal, self-contained forge-std stand-in for the formal (halmos) suite.
*
* We deliberately DO NOT vendor the full forge-std / halmos-cheatcodes libraries
* (they require `forge install` against a git repo; this tree is not a git repo).
* Instead this shim declares only the cheatcodes the symbolic tests actually use,
* at the exact HEVM cheatcode address halmos intercepts
* (0x7109709ECfa91a80626fF3989D68f67F5b1DD12D). Symbolic inputs are supplied by
* halmos automatically as the test functions' parameters, so no svm helper is
* needed. Assertions use plain Solidity `assert`: halmos reports any reachable
* assertion violation (a Panic(0x01)) as a counterexample.
*/
interface Vm {
/// Constrain a symbolic value (halmos prunes paths where the condition is false).
/// Declared `pure` (as in forge-std) so it is callable from view/pure test bodies.
function assume(bool condition) external pure;
/// Set msg.sender for the NEXT call only.
function prank(address sender) external;
/// Set msg.sender for all subsequent calls until stopPrank.
function startPrank(address sender) external;
function stopPrank() external;
/// Install runtime bytecode at an address (used to stand up the precompile oracle).
function etch(address target, bytes calldata newRuntimeBytecode) external;
/// Write a storage slot (used to drive the oracle's symbolic return word).
function store(address target, bytes32 slot, bytes32 value) external;
/// Read a storage slot.
function load(address target, bytes32 slot) external view returns (bytes32);
}
abstract contract Test {
Vm internal constant vm = Vm(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);
}