The contract stores cumulative price observations by adding a new value to the previous cumulative total, and reads them back by subtracting two totals. Because these additions and subtractions are checked for overflow, the contract will revert once the cumulative value exceeds the integer limit, breaking the time-weighted average price functions.
The time-weighted average valuation (TWAV) implementation only averages over four observations, which can be updated every block, making it effectively an observation-weighted average over a very short window. An attacker could manipulate the valuation to reject a buyout and then dump tokens within about one minute.
In the NibblVault contract's buy function, when a purchase spans both the secondary and primary curves, the fee for the secondary curve portion is not charged. An attacker could avoid paying fees on that part of the purchase, reducing revenue for the curator and admin.
The Basket contract is meant to be used behind a proxy, but the ERC721 implementation is not upgradeable and its constructor sets the name and symbol only on the implementation. As a result, every proxy has an empty name and symbol, which breaks integrations and listings.
The Twav contract's _getTwav function subtracts two uint32 timestamps without unchecked arithmetic, so when the current timestamp has overflowed uint32 but the previous one has not, the subtraction underflows and reverts. This would make the _rejectBuyout function unavailable, potentially freezing user funds in the vault.
The contract lacks a sanity check on the initial token supply and price, so if their product is too small, the primary reserve balance becomes zero due to rounding. This prevents buying and selling, and the NFT owner may lose the NFT in a gas war when trying to recover it via initiateBuyout.
The buyout mechanism allows a bidder to withdraw the NFT after a fixed duration even if the system is paused, because redeem and withdraw functions lack the whenNotPaused modifier. This means token holders cannot reject a buyout during a pause, as they cannot buy new tokens to increase the value.
The Basket contract checks ownership only at the start of a batch withdrawal, so an attacker can transfer the basket NFT to a vault mid-withdrawal and still drain all tokens. This could let a third-party contract that buys the vault lose funds.
A calculation of the secondary reserve ratio could overflow due to a cast to uint32, allowing an attacker to bypass checks in the initialize function. This could result in an incorrect configuration and impact subsequent functionality.
The buyout duration (5 days) is longer than the timelock for updating the vault implementation (2 days), so a bidder who initiates a buyout cannot cancel it before the administrator can change the implementation. This could leave the bidder in a bad state, potentially losing funds or trust.
The Twav contract's _getTwav() function checks if the timestamp of the last observation is zero, but timestamps are stored modulo 2^32, so a valid timestamp can be zero. This causes the function to return 0 instead of the correct time-weighted average value, affecting buy and sell functions.
NC
Nibbl contest
Medium
Instant results are busy. Press Enter to search every report.
No direct matches. Search every report above, or try a bug class like IDOR or SSRF.