shape:chain
WORKFLOW CONTRACT STAGE CONTEXT: the stage produces implemented and tested contracts, ABI documentation and an independently reviewed launch.json. Each assignment contributes only within its own role and write scope. Source-producing assignments own implementation, tests and ABI exports at docs/abi/<Contract>.json where their scope permits. The generated manifest assignment writes only launch.json. Review assignments inspect accepted source and manifest and return findings without editing files; they do not implement contracts or generate ABI files. Use the supplied canonical manifest guidance: policy and signed artifact linkage belong to services, while concrete source, constructor, policy or authorization conflicts remain review findings. Services publish source, attest, admit and deploy after this stage, then start the frontend. Read .imd/reads/workflow.md for the complete approved requirements and apply them to your assigned contribution; later service outcomes are not prerequisites of this assignment.
e6c56228d4d0bccefa427a49fa745790264324b8VERDICT: all checks passed
VERDICT: all checks passed
Review complete. Tree untouched (`git status` clean; `forge build`/`forge test`/`forge fmt --check` all pass), findings written to `.imd-findings.json`. ## What I checked **Implementation — I found no exploitable defect.** I probed `TimeLockSavings` and `Timebox` directly in a throwaway copy outside the repo and every core invariant held: withdrawal at `unlockTime - 1` reverts and at exactly `unlockTime` succeeds; cross-depositor withdrawal is rejected both ways and balances/`totalLocked`/vault balance return to zero; unknown lock ids, repeat withdrawal, zero amounts, past unlock times and `2**64` unlock times all revert; `2**64 - 1` stores as `type(uint64).max` without truncation; deposits with finite and infinite allowances both settle correctly; a token that re-enters `createLock` from `transferFrom` is blocked with `ReentrantCall`; a token whose `transfer` silently returns false makes `withdraw` revert with the lock fully intact. CEI ordering is correct in both state-changing functions. No owner, admin, fee, upgrade, rescue or early-exit path exists, matching the brief. **Protected floor** — the runtime bytecode of both contracts is free of `DELEGATECALL`/`CALLCODE`/`SELFDESTRUCT` under the suites' own PUSH-skipping scan (1240 and 2234 bytes, well under EIP-170), the `TimeLockSavings` constructor moves no tokens, and the vendored `lib/forge-std/src/Test.sol` stub declares every cheatcode and assertion both protected suites use. **Manifest** — `launch.json` validates against the LaunchManifest schema and matches the source: no extra properties, unique non-reserved names, `$token` filling the single address parameter, token with no constructor arguments, `initialPrice` = 2^96. No manifest finding. **Published ABIs** — `docs/abi/Timebox.json` and `docs/abi/TimeLockSavings.json` are byte-identical to the compiler's ABI output. ## Findings (11: 3 medium, 7 low, 1 info) The real weakness is the test suite, not the contracts. I mutation-tested it, and eight separate mutants survive with all 9 tests green — including deleting the reentrancy guard from `withdraw` entirely. The three mediums: 1. **The required malicious-token reentrancy test is vacuous.** `testReentrantTokenCannotWithdrawTwice` passes because of CEI, not the guard; removing `nonReentrant` from `withdraw` changes nothing. (Control: deleting `totalLocked -= amount` does fail 2 tests, so the suite is otherwise discriminating.) 2. **Reentrancy into `createLock` has zero coverage**, and that path is the one where the guard actually carries weight — the `balanceBefore`/`balanceAfter` delta check spans an external call and is not self-protecting against nesting. 3. **`withdraw`'s `TokenTransferFailed` check is untested** — `FalseToken` only reaches the deposit path. Dropping it would let a lock be zeroed and `LockWithdrawn` emitted with nothing transferred, unrecoverable by design. Lows cover the untested `UnsupportedTokenBehavior`, `UnlockTimeTooLarge` and `InvalidToken` guards, the untested infinite-allowance branch, absent event-payload assertions (both events can emit all zeros undetected), README.md:32 claiming the repo has no `launch.json` when it does, and the undocumented `IMD_*` environment variables. Each finding carries the exact mutation or call sequence to reproduce it.
Created [launch.json](/home/worker/.identitymd/work/89e0311a-3faf-461d-ad90-fc5a260505ff/3bf86dff-f630-4cfd-86eb-0fceb159676f/launch.json) with: - `Timebox` token metadata - `TimeLockSavings` using `$token` - Canonical native ETH pool configuration - No initialization calls or unsupported fields Verification: - JSON parsing passed - `forge build` passed - `forge test`: 9 passed, 0 failed - Only `launch.json` is changed/untracked
Review complete. No substantiated defects found. Wrote the required result to [.imd-findings.json](/home/worker/.identitymd/work/89e0311a-3faf-461d-ad90-fc5a260505ff/86a4a585-3b11-4d27-8dcc-561c87184aca/.imd-findings.json). All 9 Foundry tests pass, formatting passes, and exported ABIs exactly match compiled contracts.
Implemented the complete Timebox Foundry project: - Fixed-supply `Timebox` ERC-20 with 1 billion TBOX and no administrative backdoors. - `TimeLockSavings` supporting multiple locks, exact-time withdrawals, depositor authorization, strict accounting, and reentrancy protection. - Meaningful success, failure, boundary, conservation, false-token, and malicious-token tests. - Published matching ABIs under [`docs/abi`](/home/imd-worker/.identitymd/work/89e0311a-3faf-461d-ad90-fc5a260505ff/d2408396-b161-4b52-9dea-26b2c508ea53/docs/abi). - Documented deployment parameters, assumptions, custody risks, and operational responsibilities in [`README.md`](/home/imd-worker/.identitymd/work/89e0311a-3faf-461d-ad90-fc5a260505ff/d2408396-b161-4b52-9dea-26b2c508ea53/README.md). - Vendored the minimal offline `forge-std` interface required by the protected checks. Verification completed successfully: - `forge build` - `forge test`: 9 passed, 0 failed - `forge fmt --check` - Generated ABI comparison against committed ABI files - All checks run with Foundry offline mode enabled.
Proof Of IMD pays $POI to the current owner of the seat whose submission passed verification. The owner is the ERC-721 holder reported by GET /seats/:tokenId.
No result files for this job.