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

WalletGuard.ai, powered by Gestalt Labs
Findings selected for deep verification. Where possible we generated a Solidity proof-of-concept and executed it against a forked mainnet.
src/libraries/SignatureVerifier.solLines: 1-35The analyzed contract system is a complex NFT gaming protocol deployed on Blast L2, encompassing NFT minting, locking, migration, schnibble reward distribution, and a snuggery management system across multiple UUPS upgradeable proxy contracts. The analysis identified 2 critical, 11 high, 14 medium, 9 low, and 8 informational findings. The single most dangerous pattern is the always-reverting SignatureVerifier.recover function caused by a logical tautology, which completely disables all signature-based authentication flows including NFT reveals and game interactions. The contract system is unsafe for production deployment in its current state, as the combination of broken signature verification, missing initializer protections on UUPS implementations, incorrect yield claiming logic, and multiple arithmetic errors in migration and reward calculations pose immediate and material risks to user funds and protocol functionality.
A single typo in the signature verification code ('or' instead of 'and') means that every single operation requiring a signature will permanently fail. This includes NFT reveals, level-ups, and any other authenticated game action. The protocol is functionally broken for all signature-gated features until this is patched.
The core game contracts (AccountManager, ClaimManager) have a well-known vulnerability in upgradeable proxy systems: the underlying implementation contracts can be initialized directly by anyone. An attacker who initializes the implementation first becomes its admin and can then upgrade the contract to malicious code, potentially stealing all user funds or permanently breaking the protocol.
The formula used to calculate migration bonuses contains a mathematical error where the divisor shrinks as a user's locked value increases. This means users who carefully calibrate their migration amount can receive a migration bonus that is orders of magnitude larger than intended, allowing them to drain the protocol's reward pool.
2 centralization points identified
The risk is entirely dependent on whether the mock contract is deployed to production. This is a deployment governance concern rather than a code-level vulnerability in the production contracts.
giveSchnibbles()Same as MockAccountManager: the exploit path requires the mock contract to be deployed to production, making this a deployment governance concern.
givePoints()An attacker calls initialize() directly on the AccountManager or ClaimManager implementation contract (possible because no constructor calls _disableInitializers()). This grants the attacker the Admin role on the implementation. The attacker then calls upgradeToAndCall() on the implementation, pointing it to a malicious contract. Because all proxies delegatecall to the implementation and _authorizeUpgrade only checks the Admin role, the attacker gains full control over the proxy storage and all user funds managed by those contracts.
MigrationManager.migratePurchasedNFTs validates payment AFTER calling _migrateNFTs. If discountFactor is 0 (possible if the admin has not yet configured it or it is reset), the required payment computes to 0 via integer multiplication. An attacker calls migratePurchasedNFTs with msg.value=0, _migrateNFTs burns old NFTs and mints new ones, and the payment check passes because 0 == 0. The attacker obtains new NFTs for free. This is compounded by the 10e12 vs 1e12 calculation error which already makes migrations 10x cheaper than intended.
SnuggeryManager.pet multiplies schnibble amounts by 1e18 after already using a PET_TOTAL_SCHNIBBLES config value that is expressed at 1e18 scale. This produces schnibble grants 1e18 times larger than intended. These inflated schnibbles can be fed to NFTs via SnuggeryManager.feed, causing NFT chonk values to skyrocket. The corrupted globalTotalChonk tracked in _recalculateChonks then causes ClaimManager to distribute points using a denominator that no longer reflects real aggregate state, allowing early users to claim a disproportionate share of all available points.
LockManager.unlock calls accountManager.forceHarvest before decrementing lockedToken.quantity. forceHarvest reads the full pre-decrement locked balance via lockManager.getLockedWeightedValue to compute schnibbles. A user repeatedly calling unlock in small increments each time harvests schnibbles as if they still hold their full balance, systematically over-accumulating schnibbles beyond their rightful share. These excess schnibbles can then be converted to chonks and fed into the claims system.
| Agent | Status | Findings | Severity | Confidence | Duration | Coverage |
|---|---|---|---|---|---|---|
| reentrancy | success | 7 | 2H1L | 82% | 1.3m | Classic reentrancy (external call before state update) in LockManager._lock and unlock, Cross-function reentrancy across LockManager functions, ERC-777 callback reentrancy via token transfer hooks, Read-only reentrancy in view functions called during external calls, CEI pattern compliance in all state-mutating functions, ReentrancyGuard usage and correct placement, Access control on privileged functions, Signature verification logic in SignatureVerifier library, ERC-4626/ERC-721 callback patterns, Flash loan callback patterns, Logic errors in migration, claim, and reward distribution flows, Cross-contract state sharing between LockManager, AccountManager, SnuggeryManager, UUPS upgrade authorization |
| access control | success | 12 | 3H3M1L | 82% | 1.6m | Access control on all public/external functions, Initializer protection in UUPS upgradeable contracts, Signature verification in SignatureVerifier library, ecrecover return value checking, Role-based authentication in BaseConfigStorage modifiers, Ownership and admin patterns in ConfigStorage, RewardsManager yield claim access control, MigrationManager fund locking and NFT migration logic, LockManager lock/unlock logic and duration management, SnuggeryManager array indexing in pagination, ClaimManager points distribution, Mock contracts deployed in production risk, Cross-function reentrancy (ReentrancyGuard usage checked), Delegatecall patterns (none found in production contracts), UUPS _authorizeUpgrade protection, Blast governor reassignment logic |
| economic | success | 14 | 4H3M3L | 83% | 2.3m | Flash loan attack vectors - no direct token balance pricing found, Oracle manipulation - no price feed reads found (custom multi-sig oracle for USD prices), LockManager USD price proposal mechanism for manipulation, SignatureVerifier library correctness, RewardsManager yield claiming logic and access control, MigrationManager discount factor calculations, SnuggeryManager chonk accounting and pet schnibble calculations, ClaimManager points distribution and period logic, AccountManager sub-account management and spray proposal logic, BonusManager migration bonus calculation edge cases, PrimordialManager level-up logic, UUPS upgrade authorization, Reentrancy guards on token-moving functions, Fee-on-transfer token handling in LockManager, Cross-contract trust and access control patterns, NFTOverlord reveal queue and RNG integration, Integer overflow/underflow risks (Solidity 0.8.25 with built-in checks) |
| logic validation | success | 13 | 1C2H3M3L | 83% | 2.2m | Input validation on all public/external functions, Arithmetic safety including unchecked blocks and type casts, Access control modifiers and role-based permissions, State machine integrity (lockdrop lifecycle, migration states, claim periods), Signature verification library correctness, ERC-4626-style rounding patterns (not applicable - no vault), abi.encodePacked collision risks in storage key derivation, Timestamp-based operations (harvest, lock durations, pet cooldowns), Unbounded loops and DoS vectors, Cross-contract call patterns and reentrancy (ReentrancyGuard used appropriately), UUPS upgrade authorization, Migration manager state transitions and fund handling, Schnibble spray proposal duplicate detection, NFT minting and reveal queue management, Yield/gas claiming logic in RewardsManager, Token transfer patterns in LockManager, Snuggery pagination logic, ClaimManager points distribution logic |
| code quality | success | 15 | 82% | 1.9m | ERC-20 conformance (MunchToken), ERC-721 conformance (MunchNFT, OldMunchNFT), ERC-1967/UUPS proxy upgrade safety, Access control modifiers (onlyAdmin, onlyRole, onlyConfiguredContract), Integer overflow/underflow (Solidity 0.8.x protections), Reentrancy (ReentrancyGuard usage in LockManager, MigrationManager), Signature verification logic (SignatureVerifier library), CEI pattern violations (MunchNFT.transferFrom), Logic errors in yield/reward calculations (ClaimManager, BonusManager, RewardsManager), Migration flow correctness (MigrationManager), Schnibble spray proposal duplicate detection, Array bounds and pagination in getSnuggery, getSubAccounts, Discount factor arithmetic in MigrationManager, Access control on permissionless yield claim functions, WETH vs USDB token address in yield claiming, ConfigStorage role and address management | |
| compiler bugs | success | 6 | 1H1M | 83% | 1.2m | SignatureVerifier library logic correctness, RewardsManager yield claim token address correctness, Access control on all external functions (claimYieldForContracts, claimGasFeeForContracts), BaseConfigStorage modifier logic (onlyConfiguredContract, onlyConfiguredContract2, onlyOneOfRoles), MigrationManager fund flow: lockFundsForAllMigration vs _migrateNFTs discountFactor calculation, ClaimManager points logic and period accounting, LockManager reentrancy protection (ReentrancyGuard present), LockManager USD price proposal approval logic, SnuggeryManager chonk calculation and global chonk tracking, AccountManager spray proposal duplicate check (uses _tempSprayPlayerCheck mapping reset bug review), MunchNFT transferFrom munchadex update before transfer, UUPS upgrade authorization (onlyAdmin check present), Compiler bug patterns for solc 0.8.25 (no affected version range bugs apply) |
| assembly safety | success | 12 | 1C2M1L | 82% | 2.5m | Full codepoint scan for non-ASCII characters, RTLO, zero-width joiners, homoglyphs in all identifiers and strings, All inline assembly blocks - SignatureVerifier.recover assembly for signature splitting, Yul shift instruction argument ordering (no shl/shr/sar found in assembly blocks), assembly return() vs leave semantics (no return() in assembly found), sload/sstore with hardcoded slots (none found), delegatecall patterns in assembly (none found), Access control on all external/public functions across all contracts, Reentrancy: LockManager, MigrationManager, MunchNFT (ReentrancyGuard present), Logic errors in SignatureVerifier (always-reverting condition found), Logic errors in RewardsManager yield claiming (WETH/USDB address bug found), Logic errors in SnuggeryManager.getSnuggery pagination, Logic errors in ClaimManager._claimPoints period tracking, Logic errors in BonusManager._calculateMigrationBonus formula, Logic errors in AccountManager.spraySchnibblesPropose temp mapping cleanup, Logic errors in SnuggeryManager.feed negative bonus cast, MigrationManager access control for burnNFTs third-party invocation, UUPS upgrade authorization in BaseConfigStorageUpgradeable._authorizeUpgrade, ConfigStorage notify() function for DoS via unbounded loop, Integer overflow/underflow risks in Solidity 0.8.25 (checked arithmetic), ERC721 transferFrom override in MunchNFT and munchadex update ordering, Blast governor assignment logic in BaseBlastManager, RewardsManager.reassignBlastGovernor access control |
| l2 specific | success | 14 | 2M1L | 80% | 2.1m | SignatureVerifier library correctness, RewardsManager yield claim logic and access control, LockManager lock/unlock mechanics and USD price proposal system, ClaimManager period management and points accounting, SnuggeryManager pet/feed/import/export mechanics, AccountManager spray proposal and sub-account management, MigrationManager NFT burn and migration flows, BonusManager migration bonus calculation for division-by-zero, PrimordialManager feeding and hatching logic, BaseConfigStorage access control modifiers, MunchNFT transfer and minting mechanics, ConfigStorage notification pattern, Cross-function reentrancy patterns, Integer overflow/underflow in Solidity 0.8.25 (checked by default), UUPS upgrade authorization, Blast-specific predeploy integrations (IBlast, IBlastPoints, IERC20Rebasing), Cross-domain message patterns (none found - L2 Blast-specific only) |
| upgrade | success | 15 | 1C1H1M | 84% | 2.1m | UUPS proxy pattern implementation and disableInitializers() in constructors, Storage layout and __gap arrays across upgradeable inheritance chain, Initialization functions and initializer modifier usage, Access control on admin and privileged functions, SignatureVerifier library correctness, RewardsManager yield claiming logic and access control, MigrationManager payment validation and NFT migration flow, BonusManager calculation edge cases (division by zero, overflow), LockManager locking and unlock time calculations, ClaimManager period management and points calculation, SnuggeryManager array indexing and pagination, AccountManager spray proposals and sub-account management, Cross-contract interaction patterns (delegatecall risks, reentrancy), ConfigStorage notification mechanism and re-entrancy via notify(), MunchNFT transferFrom ordering (munchadex update before transfer), Diamond/Beacon/Minimal proxy patterns - not present, selfdestruct usage - not found, Immutable variables in upgradeable contracts |
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/b355950f-8e40-4893-b769-755c9ccf1feb)
<a href="https://walletguard.ai/audit/b355950f-8e40-4893-b769-755c9ccf1feb"> <img src="https://walletguard.ai/api/badge/b355950f-8e40-4893-b769-755c9ccf1feb" alt="WalletGuard Audit Badge" /> </a>