
Loading...
Loading
Loading...
LoadingLoading audit report...

WalletGuard.ai, powered by Gestalt Labs
Forge fork-validation ran but no findings met the threshold for PoC inclusion. See the per-finding "Forge validated" badges in the report below for individual results.
The analyzed contract is a DeFi vault system (AccountingManager) implementing a queue-based deposit and withdrawal mechanism with ERC4626 inheritance, multi-connector TVL aggregation, flash loan support, and a multi-tier governance model. The analysis identified 2 critical, 8 high, 10 medium, 9 low, and 4 informational findings across 34 total deduplicated findings from 9 specialist agents. The single most dangerous pattern is the MorphoBlue TVL double-counting of borrow amounts as assets, which combined with a manipulable Uniswap V3 slot0 oracle creates a composable path to drain vault value from other depositors. The contract in its current state is unsafe for production use without remediation of the critical and high severity issues, particularly the access control logic inversion in onlyVaultMaintainer and the oracle manipulation surfaces.
When the vault calculates its total value locked using MorphoBlue positions, it incorrectly adds the amount the vault has borrowed (which is a debt it owes) as if it were an asset it owns. This makes the vault appear far wealthier than it actually is. An attacker can exploit this by depositing when TVL is inflated to receive more shares than they deserve, then withdrawing at the true lower value, effectively stealing funds from other depositors.
The vault calculates the value of its Uniswap V3 positions using the current spot price, which can be instantly manipulated within a single transaction using a flash loan. An attacker can borrow a large amount, move the price to inflate or deflate the vault's apparent value, then deposit or withdraw at the manipulated price to extract value from honest depositors.
A logic error in the access control modifier means that vault maintainers cannot perform essential administrative actions such as adding connectors, updating trusted tokens, or removing positions. Only an address that simultaneously holds both the maintainer role and the emergency role can call these functions, which is likely never the case in practice. This locks critical protocol administration indefinitely.
4 centralization points identified
Single-step ownership transfer in NoyaFeeReceiver can result in permanent loss of administrative control if the new owner address is incorrect; this is a property the buyer should know.
constructor()The period is maintainer-configurable with no lower bound, making it a privileged parameter that could be set to near-zero, effectively converting the TWAP to a spot price read.
setPeriod()Setting deposit limits to zero requires a trusted maintainer action; this is an admin capability the buyer should be aware of, not an externally exploitable vulnerability.
setDepositLimits()The ERC4626 non-compliance is intentional by design and does not create an exploit path, but it is a property integrators must know as it breaks composability with ERC4626-assuming protocols.
mint()An attacker uses a flash loan (via BalancerFlashLoan, which has no access control on makeFlashLoan) to perform a large swap in a Uniswap V3 pool that the UNIv3Connector uses for TVL via slot0. The manipulated slot0 price inflates the reported TVL. In the same transaction window, the inflated TVL causes AccountingManager to issue more shares per unit of baseToken deposited. The attacker then deposits baseToken at the inflated share price, reverses the price manipulation, and withdraws shares at the true higher per-share value, extracting value from existing depositors. The deposit ordering bug (safeTransferFrom before limit checks) further reduces friction for large deposits.
The MorphoBlue connector adds borrow amounts as assets rather than liabilities, permanently inflating TVL for any vault with active MorphoBlue borrows. Combined with the Chainlink stale price issue (missing answeredInRound check), an attacker can time a deposit during a stale price period when the Chainlink oracle has not yet updated a round, causing the vault to use the inflated MorphoBlue TVL alongside a stale favorable price to compute share issuance. The attacker receives excess shares relative to contributed value, then redeems after prices normalize.
makeFlashLoan has no access control, allowing any caller to initiate a flash loan and set themselves as the caller state variable. The security of receiveFlashLoan rests entirely on the caller matching keeperContract. If the keeperContract address is updated through governance (which is accessible via the broken onlyVaultMaintainer modifier allowing emergency role bypass), a malicious keeper can call makeFlashLoan, and receiveFlashLoan will execute arbitrary calls on any destinationConnector addresses with borrowed funds and user-supplied calldata, draining connector assets.
checkIfTVLHasDroped is publicly callable and resets performance fee state if current TVL is below stored profit. An attacker who can temporarily reduce TVL (e.g., via slot0 price manipulation on a Uniswap V3 connector position, or by exploiting the MorphoBlue borrow double-count being corrected by a market move) can call checkIfTVLHasDroped immediately before the 12-48 hour collection window closes, zeroing out preformanceFeeSharesWaitingForDistribution. This can be repeated indefinitely to permanently block fee collection.
| Agent | Status | Findings | Severity | Confidence | Duration | Coverage |
|---|---|---|---|---|---|---|
| reentrancy | success | 6 | 1H2M1L | 69% | 1.3m | Classic reentrancy in deposit/withdraw/executeDeposit/executeWithdraw functions, Cross-function reentrancy between deposit queue and withdraw queue shared state, ERC-4626 deposit/withdraw ordering (shares minted before/after token transfer), Flash loan callback in BalancerFlashLoan.receiveFlashLoan, ReentrancyGuard usage and placement across all contracts, CEI pattern compliance in AccountingManager, sendTokensToTrustedAddress external calls, Registry modifier logic correctness, Fee collection functions (collectManagementFees, collectPerformanceFees, recordProfitForFee), retrieveTokensForWithdraw external calls to connectors, Read-only reentrancy via TVL()/totalAssets() view functions, Connector addLiquidity callback chain, Token transfer ordering in executeWithdraw loop |
| access control | success | 7 | 1H2M1L | 80% | 1.3m | Access control modifiers in PositionRegistry (onlyVaultMaintainer, onlyVaultGoverner, onlyVaultMaintainerWithoutTimeLock), AccountingManager deposit/withdraw flow and limit checks ordering, Fee collection functions and authorization checks, BalancerFlashLoan receiveFlashLoan arbitrary call execution, sendTokensToTrustedAddress access control patterns, burnShares unrestricted access, ERC4626 standard override functions, Signature-based operations in Keepers multisig (nonce, deadline, replay protection), Initializer protection (no proxy pattern detected), Registry role administration and self-granting risks, Ownership patterns in NoyaFeeReceiver and Keepers, Flash loan guard patterns in BalancerFlashLoan, OmnichainLogic bridge transaction approval flow, Connector delegatecall patterns (none found), Withdraw queue state machine correctness, Event emission correctness in fulfillCurrentWithdrawGroup, TVL calculation ordering in deposit, Cross-function reentrancy with nonReentrant guards |
| economic | success | 10 | 3H1M1L | 87% | 1.6m | Flash loan attack vectors in deposit/withdraw flow, Oracle manipulation - Chainlink staleness checks in ChainlinkOracleConnector, Oracle manipulation - Uniswap V3 slot0 usage in UNIv3Connector TVL, Oracle manipulation - spot reserve usage in Aerodrome/Camelot LP TVL, Oracle manipulation - UniswapValueOracle TWAP window, MEV/sandwich exposure in share calculation timing, Governance access control modifiers in PositionRegistry, Accounting logic in deposit() - ordering of checks vs transfers, Withdraw group lifecycle - calculateWithdrawShares accumulation, MorphoBlue TVL calculation correctness, Fee calculation precision in BalancerConnector, BalancerFlashLoan - caller authentication, ReentrancyGuard usage across accounting flows, Chainlink answeredInRound completeness check, WETH_Oracle mock - hardcoded values not relevant to production security, PrismaConnector, FraxConnector, SiloConnector TVL calculations, DolomiteConnector debt/collateral accounting, PendleConnector SY/PT/YT pricing via static router |
| logic validation | success | 10 | 3L | 76% | 1.9m | Input validation and parameter bounds in AccountingManager deposit/withdraw/fee functions, Arithmetic safety in fee calculations, share price calculations, and TVL computations, State machine integrity for deposit/withdraw queue state transitions, Access control modifiers in Registry (onlyVaultMaintainer logic bug), Reentrancy protection via ReentrancyGuard usage, Flash loan security in BalancerFlashLoan, MorphoBlue TVL calculation correctness, Downcast safety in UniswapValueOracle, Unbounded loop analysis in TVLHelper, Deposit limit ordering and validation, fulfillCurrentWithdrawGroup event emission ordering, calculateWithdrawShares accumulation logic, retrieveTokensForWithdraw validation ordering, ERC4626 overrides to prevent standard deposit/withdraw/mint/redeem, abi.encodePacked usage for hash collision risks, Keepers multisig signature validation |
| code quality | success | 18 | 86% | 2.5m | ERC4626 compliance - deposit/withdraw/mint/redeem override behavior, Deposit queue ordering and fund transfer logic, Withdraw queue state machine correctness, Fee calculation logic (management, performance, withdrawal), TVL calculation across all connectors for underflow/overflow, Access control modifiers in Registry (onlyVaultMaintainer AND vs OR bug), Flash loan callback security in BalancerFlashLoan, Oracle price manipulation resistance, uint128 downcast safety in UniswapValueOracle, Reentrancy protection (nonReentrant guards present), Cross-connector TVL aggregation correctness, MorphoBlue TVL calculation (borrow+supply+collateral instead of supply-borrow+collateral), Deposit limit checks ordering relative to token transfer, Withdraw group state machine (calculateWithdrawShares, startCurrentWithdrawGroup, fulfillCurrentWithdrawGroup, executeWithdraw), Event emission correctness (WithdrawGroupFulfilled totalCBAmount = 0 bug), burnShares access control, retrieveTokensForWithdraw cumulative amount validation, Bridge transaction approval mechanism in OmnichainLogic, Keepers multisig signature validation, ChainlinkOracleConnector staleness check | |
| compiler bugs | success | 4 | 86% | 49.4s | AccountingManager deposit/withdraw/execute flow and queue state management, Fee collection logic (management, performance, withdrawal fees), Access control modifiers in Registry and NoyaGovernanceBase, Registry.onlyVaultMaintainer modifier logic, fulfillCurrentWithdrawGroup event emission ordering, retrieveTokensForWithdraw validation logic, BalancerFlashLoan access control and callback validation, BaseConnector sendTokensToTrustedAddress trust model, Deposit limit checks ordering relative to token transfer, Compiler version (0.8.20 fixed - no legacy compiler bugs applicable), Reentrancy guards on state-modifying functions, ERC4626 standard compliance overrides | |
| assembly safety | success | 10 | 2H3M | 84% | 1.9m | Full codepoint-by-codepoint scan for non-ASCII characters, homoglyphs, zero-width characters, and RTLO characters - none found, All assembly{} blocks scanned - none found in this codebase (FullMath, TickMath, and library code contain assembly but none of the anti-patterns), AccountingManager deposit/withdraw queue logic and arithmetic, PositionRegistry access control modifiers (onlyVaultMaintainer bug identified), Fee calculation and collection logic (performance, management, withdrawal fees), Flash loan BalancerFlashLoan security model, fulfillCurrentWithdrawGroup state mutation ordering and event emission, retrieveTokensForWithdraw balance validation logic, executeDeposit control flow and error conditions, TVL calculation across connectors (Morpho, Compound, Aave), burnShares access control and pause bypass, Keepers multisig signature verification, Registry vault and position management, ERC4626 override functions, SwapAndBridgeHandler route verification |
| l2 specific | success | 11 | 3M3L | 82% | 2.1m | AccountingManager deposit/withdraw queue logic and ordering, Fee calculation and distribution (management, performance, withdrawal), PositionRegistry access control modifiers, BalancerFlashLoan access control and flash loan flow, Keepers multi-sig signature verification, MorphoBlue TVL calculation, Chainlink oracle freshness checks, executeDeposit connector validation logic, calculateWithdrawShares accumulation logic, fulfillCurrentWithdrawGroup fulfillment conditions, Cross-chain L2 patterns (no L2-specific imports found in core contracts), ERC4626 override functions (correctly revert with NOT_ALLOWED), ReentrancyGuard usage across all state-changing functions, Token transfer safety (SafeERC20 used throughout), Registry vault maintainer/governance modifier logic, Performance fee time window constraints, Deposit limit checks ordering relative to token transfers |
| upgrade | success | 9 | 3M2L | 77% | 2.0m | AccountingManager deposit/withdraw queue ordering and limit checks, Registry modifier logic (onlyVaultMaintainer AND vs OR condition), Fee collection mechanics (management fee, performance fee, withdraw fee), Flash loan implementation security in BalancerFlashLoan, Access control on sendTokensToTrustedAddress, WithdrawGroup state machine transitions, Event emission ordering relative to state changes, retrieveTokensForWithdraw cumulative over-retrieval, checkIfTVLHasDroped public access griefing vector, ERC4626 standard override correctness (mint/withdraw/redeem/deposit all revert), NoyaFeeReceiver withdrawal flow, PositionRegistry holding position management, BaseConnector token registry and liquidity management, Cross-connector token transfer security in sendTokensToTrustedAddress, Proxy pattern - no proxy pattern detected, not applicable, Storage collision - no proxy pattern, not applicable, Initialization risks - no upgradeable pattern, not applicable |
This automated audit has inherent limitations. The following areas are not covered.
This report is an automated point-in-time assessment and does not guarantee protection against all possible attacks. It does not cover off-chain components, economic modeling, or business logic correctness unless explicitly noted. Changes to the contract after the audit commit are not reviewed. This is not financial or legal advice. WalletGuard, powered by Gestalt Labs, provides this analysis as-is with no warranty of completeness.
[](https://walletguard.ai/audit/c28b2392-8ab8-4d7e-8f20-1c9bfe0b4e9c)
<a href="https://walletguard.ai/audit/c28b2392-8ab8-4d7e-8f20-1c9bfe0b4e9c"> <img src="https://walletguard.ai/api/badge/c28b2392-8ab8-4d7e-8f20-1c9bfe0b4e9c" alt="WalletGuard Audit Badge" /> </a>