Sample report

Sample Contract Check report: Aave V4 position managers

An example of the report you receive. We reviewed published Aave V4 code on our own initiative; Aave did not ask for this review and is not connected to SolWhale Labs.

This is a showcase of the SolWhale Contract Check report format. We reviewed source-available code ourselves, without being asked. Aave did not ask for it, has not seen it, and has no connection to us or to this document. It is not a client report, and it is not a client testimonial. We are a new team with no client track record. Nothing in this sample is an undisclosed vulnerability: we found no Medium or higher issue, and the informational notes below are about rounding dust in code that three published third-party reviews already cover, and about test failures that are test problems, not contract problems.

---

Aave V4 position managers: Contract Check report (sample)

1. Header

ProjectAave V4 (position-manager contracts)
Repositoryhttps://github.com/aave/aave-v4 (source-available, Business Source License)
Commit reviewedcdacec509e4f848bff1a5556f503afa83eee3b79
Chain / languageEVM (Solidity), reviewed as source only
TierSample (comparable in size to a Custom job)
Order IDnone (unsolicited sample)
Review date28 Nov 2026 (Asia/Nicosia time, UTC+2)
Prepared bySolWhale Labs (AI-assisted review team)
Delivered toPublished as a sample. No customer.

Scope

FileLines
src/position-manager/ConfigPositionManager.sol467
src/position-manager/TakerPositionManager.sol341
src/position-manager/GiverPositionManager.sol71
src/position-manager/PositionManagerBase.sol125
src/position-manager/PositionManagerIntentBase.sol20
src/position-manager/libraries/ConfigPermissionsMap.sol130
src/position-manager/libraries/EIP712Hash.sol274
Total in scope1,428

We also read the entry points these contracts call in the core Spoke and Hub contracts (supply, withdraw, borrow, repay, collateral and risk-premium updates, user position-manager approvals, and the hub's draw, restore and remove), so that we could follow value through them. Those core files are not part of the scope.

Out of scope: the core Spoke, Hub, liquidation logic and premium math (read only to follow calls), NativeTokenGateway, SignatureGateway and GatewayBase (older contracts, covered by their own published reviews), the access manager, configurators and other admin-only contracts, off-chain components, deployments, economic and governance design.

2. Disclaimer

Written by our AI review system, not an independent audit firm.

This report describes what we found when we read the code above at the commit above. It is not a certificate. A report with no Medium or higher findings does not mean the code has no bugs.

3. Summary

No Medium or higher findings in the reviewed scope. We found 0 Critical, 0 High, 0 Medium, 0 Low and 4 Informational notes. The position managers gate every user action twice (once in the manager and once in the core contract), and the allowance accounting held under interest, premiums and rounding in our fuzz tests. Every rounding residue we saw is tiny and favours the protocol or the owner of the position, according to our review notes.

SeverityCount
Critical0
High0
Medium0
Low0
Informational4

4. Methodology

  1. Scope check. Checked out the commit above. No commit after it on the main branch changes src/position-manager/.
  2. Line-by-line reading of all seven files, focused on:
    • Access: every user action is gated in the manager (registered core contract, plus a per-owner allowance or permission keyed by the caller) and again in the core contract (the position owner must have approved the manager). Registering a core contract, renouncing the manager role and rescuing tokens are owner-only (a trusted role).
    • Typed-data signatures (EIP-712): recomputed all 13 type-hash constants with cast keccak and compared them with their strings (all match); checked that every hash() encodes every struct field in order; checked the per-manager domain, the keyed nonces, the deadline check and ERC-1271 support.
    • Taker allowances: a withdraw spends the allowance by the measured change in the owner's supplied amount, not by the requested amount; a borrow spends it by the measured change in total debt.
    • Giver repay and supply: the repay amount is capped at the current total debt; the manager keeps no tokens and no token allowance afterwards. Supply pulls only from the caller.
    • Permit helper: it sets an allowance to the manager itself, and no manager ever pulls from the position owner, so a leaked permit cannot be spent by a third party. Errors are swallowed on purpose so that a front-run permit does not block the call.
    • Config permissions: bit-mask set and clear, global permission, renounce clears only the caller's own bit, and the delegatee cannot be the zero address.
    • Multicall: non-payable, and delegatecall keeps the caller, so a call value cannot be reused and the sender cannot be spoofed.
  3. Existing tests. Ran the repository's position-manager unit tests.
  4. Extra tests. Wrote 6 fuzz tests (listed in section 7) and ran them in-process. Every one runs after a third party has borrowed for 1 day to 5 years, so the share price and the debt index are not 1:1.
  5. Tools. Foundry (forge 1.10.1) with an in-process EVM. No RPC, no local node, no keys.
  6. Second check. A separate AI review pass checked the numbers and wording against the logs before this sample was written.

Environment notes. Forge 1.10.1 rejects the repository's optimizer_runs value (it is larger than a 32-bit integer), so we changed that one setting locally to build. The change does not alter the contracts' source. To stay inside the memory of our machine we skipped unrelated test directories (gas, misc, most core Spoke, hub, library and tokenization-spoke tests) and ran builds with a memory cap.

5. Severity scale

The scale in our report template applies (Critical, High, Medium, Low, Informational, from impact and likelihood). In this sample there is nothing above Informational.

6. Findings

Critical, High, Medium, Low

None found in the reviewed scope.

I-01: Partial repay can reduce the recorded debt by up to 2 wei less than the amount paid (rounding, in the protocol's favour)

IDI-01
TitleRepay rounding dust, protocol-favourable
SeverityInformational (impact None, likelihood High)
Locationsrc/spoke/Spoke.sol:317 (function repay); debt is rounded up at src/spoke/libraries/UserPositionUtils.sol:132
StatusAccepted as is (no change needed)

Description. In the core Spoke.repay, the shares restored are computed by rounding the repaid drawn amount down (restoredShares = drawnDebtRestored.rayDivDown(drawnIndex), src/spoke/Spoke.sol:317), while a user's debt is computed by rounding up (drawnShares.rayMulUp(drawnIndex), src/spoke/libraries/UserPositionUtils.sol:132). When we repaid part of a debt through the Giver position manager, the reported total debt fell by up to 2 wei less than the amount the payer paid.

Impact. The residue is a couple of wei and it favours the protocol. This is in the core Spoke, not in the position managers, and our notes treat that core code as covered by the published third-party reviews.

Proof or test. Seen while running the fuzz test testFuzz_giverRepayNoDust (section 7). That test passes, and its log records only the pass. The "up to 2 wei" bound comes from our own reading of the rounding directions during the review, not from a number printed in the log. We did not write a separate test that pins the 2-wei figure.

Recommended fix. None required. If a team wants an exact match, document the rounding direction in the function's comments.

I-02: Three failing repository tests are test problems under forge 1.10.1, not contract bugs

IDI-02
Title3 SignatureGateway test expectations fail under forge 1.10.1
SeverityInformational (impact None)
Locationtests/unit/position-manager/SignatureGateway/SignatureGateway.Reverts.InsufficientAllowance.t.sol (1 test, test_repayWithSig_revertsWith_ERC20InsufficientAllowance); tests/unit/position-manager/SignatureGateway/SignatureGateway.Reverts.SpokeNotRegistered.t.sol (2 tests, test_updateUserDynamicConfigWithSig_revertsWith_SpokeNotRegistered and test_updateUserRiskPremiumWithSig_revertsWith_SpokeNotRegistered)
StatusAccepted as is (not in scope; reported for completeness)

Description. Running the repository's tests/unit/position-manager/* (18 suites, 268 tests), 265 pass and 3 fail. In all 3 failures the test expects a revert that carries an extra address argument, while the contract encodes the error without it. The log shows the two raw revert byte strings differing only by that trailing address argument. Older forge versions matched these revert strings by prefix; forge 1.10.1 matches them strictly. The three failing tests are in SignatureGateway, which is outside our scope.

Impact. None on the contracts. It is a test-harness mismatch.

Proof or test. test-pm-baseline log: "Encountered a total of 3 failing tests, 265 tests succeeded"; "18 test suites ... 265 tests passed, 3 failed, 0 skipped (268 total tests)". Fuzz seed 0x640.

Recommended fix. Update the three expectations to match the real revert data, or match on the error selector only.

I-03: Owner-only functions are a trust assumption

IDI-03
TitleTrusted owner role
SeverityInformational
Locationsrc/position-manager/PositionManagerBase.sol:33 (registerSpoke), :89-92 (renouncePositionManagerRole) and :122 (the token-rescue guardian is the owner); all owner-only
StatusAccepted as is

Description. Registering a core contract, renouncing the manager role for a user, and rescuing tokens are restricted to the owner. This is normal for this design, but users trust the owner not to register a malicious core contract. We list it so readers see that we looked at it and did not treat it as a finding.

Impact. None, unless the owner acts against its interest or its key is lost. We did not review how the owner key is held.

Proof or test. Reasoning only, no test.

Recommended fix. None. State the trust assumption in user-facing documentation.

I-04: Permit errors are swallowed on purpose

IDI-04
Titletry/catch around permit and self-approval signatures
SeverityInformational
Locationsrc/position-manager/PositionManagerBase.sol:40-60 (setSelfAsUserPositionManagerWithSig) and :64-85 (permitReserveUnderlying)
StatusAccepted as is

Description. The permit helper and the self-approval-with-signature call catch their own reverts, so that someone who front-runs the signature cannot block the call. The side effect is that a failed permit is not reported to the caller. The later transfer will still fail if no allowance exists.

Impact. None found. No manager pulls tokens from the position owner, so a leaked permit is not spendable by a third party.

Proof or test. Reasoning only, no test.

Recommended fix. None. Optional: emit an event on a swallowed failure, to help integrators.

7. Tests run

All runs were local, in-process, with no network and no keys, in Foundry forge 1.10.1 (memory-capped).

RunTestsResultLog
Repository tests tests/unit/position-manager/* (18 suites)268265 pass, 3 fail (the 3 are I-02)test-pm-baseline
Our extra fuzz tests, default seed 0x640, 1,000 runs each66 passtest-sw-pm-1000-defaultseed
Our extra fuzz tests, 5,000 runs each (seed not recorded in the log)66 passtest-sw-pm-5000

Our 6 extra fuzz tests (files TakerPositionManager.SW.t.sol and GiverConfigPositionManager.SW.t.sol, which are ours and are not part of the Aave repository):

  1. testFuzz_withdrawAllowanceNeverExceeded: a spender drains an allowance in 1 to 40 chunks and then the remainder. The total received stays at or under the allowance, and the owner's position falls by at least what the spender received (within 10 wei).
  2. testFuzz_withdrawTinyAmounts: up to 200 one-wei withdrawals against a 64-wei allowance. Never more than 64 wei out.
  3. testFuzz_borrowAllowanceNeverExceeded: the same drain pattern for the borrow allowance, with 1 second of interest between calls.
  4. testFuzz_giverRepayNoDust: repays from 1 to 2 times the debt on behalf of a user. The manager keeps 0 tokens and 0 allowance, the payer is charged exactly the lesser of the amount and the debt, and the debt is cleared when the amount is at least the debt.
  5. testFuzz_giverSupplyNoDust: no residue after a gifted supply.
  6. testFuzz_permissionIsolation: single permission bits grant only their own action, with no leak to other delegatees, and a global permission can be revoked.

8. Not covered

  • The core Spoke liquidation logic and the premium (risk-premium) math in depth.
  • The access manager, hub configurator and spoke configurator (admin-only, trusted).
  • A handler-based invariant campaign across all three position managers at once.
  • Mutation testing and formal verification.
  • Economic, governance and off-chain review.
  • Any deployed instance. We read source code only.

9. Limitations

Written by our AI review system, not an independent audit firm.

  • Time-boxed and scope-limited to the seven files at the commit above. Other files, other commits and any deployment may differ.
  • Limits. No Medium or higher finding in this scope does not mean none exist.
  • No economic or off-chain review.
  • Source only: no transactions sent, nothing deployed, no keys or funds touched, no contact with the project.
  • Written by our AI review system, not an independent audit firm.
  • Severity is a judgement. We are a new team with no client track record.

10. Follow-up

This is a sample, so there is no follow-up round. To request a review of your own code, use the on-page Request a Contract Check form. We do not take orders by email. See the tiers and intake pages.

SolWhale Labs

Request a Contract Check