In-depth lesson · Business logic
Root causes
Every point the Business logic reports back under this heading, best-backed first, each with the reports it is seen in.
-
The pre-check required the total amount to cover exchange and pre-payment amounts plus the referrer fee, but the settlement logic only needed it to cover exchange and pre-payment amounts.
Seen in 1 report
-
Medium
-
-
The pre-order flow did not revoke the product licence after a failed charge, and developer sandboxes lacked authorisation checks.
Seen in 1 report
-
The pre-trade balance was only recorded for wrapped or native sold tokens, so for other tokens it stayed zero and the post-trade difference included the whole existing balance.
Seen in 1 report
-
The pre-transfer amount is used to increase the pool balance instead of measuring the actual balance change.
Seen in 1 report
-
The pre-wrap amount is passed to the router instead of the wrapped amount after applying the decimal offset.
Seen in 1 report
-
The precision returned by the pool's amplification parameter getter was ignored, so the parameter was used unscaled.
-
The precompile reader decoded only the supply field of the portfolio margin state and discarded the borrow fields.
Seen in 1 report
-
The predicate address is hardcoded when approving tokens for bridging.
Seen in 1 report
-
The preferences save operation does not enforce the rule that password protection can only be disabled after transfer or a paid plan.
-
The preflight passes only the side, not the projected size and margin, into the state-dependent checks.
-
The premium is calculated from the spot fee growth inside the position at closing time instead of a capped or time-weighted value.
Seen in 1 report
-
The premium uses time remaining until the next funding payment instead of a fixed epoch duration.
Seen in 1 report
-
The prepared migration plan is not bound to a snapshot of the authority-bearing state and is not freshness-checked before submission.
Seen in 1 report
-
The prevention check looks at the current vote count rather than whether a shutdown has been initiated.
Seen in 1 report
-
The preview functions take no keeper address and always subtract the gross liquidation charge.
-
The preview planner deducts the whole liquidation charge without knowing the caller, so it cannot account for the keeper share returning when the account is its own liquidator.
-
The preview redeem function uses cached debt and idle values that may not reflect actual market conditions.
Seen in 1 report
-
The preview token has no expiry and is not invalidated on uninstall, and the name field accepts invisible characters.
-
The previous recommendation request was not deleted after a response, so it could be reused repeatedly.
-
The price blend always divided by the fixed precision constant instead of the configured weight, and the setter did not enforce the bound.
-
The price calculation performs an unchecked subtraction of the total supply from TVL, causing an underflow revert when TVL is less than the supply.
Seen in 1 report
-
The price depends only on the current ratio of votes, which can be shifted before a large purchase.
Seen in 1 report
-
The price difference was normalised by the current price in one branch and by the verified price in the other instead of a single symmetric formula.
Seen in 1 report
-
The price factor was multiplied only with the first term of the numerator rather than the whole sum.
Seen in 1 report
-
The price formula only considers elapsed time and the last auction price, ignoring the current liquidatable balance, so it cannot react to sudden increases in available assets.
-
The price formula reaches the reserve before the auction ends instead of decreasing linearly to the reserve at the end.
Seen in 1 report
-
The price function returned zero once the sale ended instead of blocking further minting.
Seen in 1 report
-
The price function uses strict inequalities while minting allows the end timestamp, so the boundary returns the wrong price.
-
The price function uses total supply without subtracting the shares held by the contract for pending withdrawals.
Seen in 1 report
-
The price impact calculation returned early if either token lacked virtual inventory.
-
The price is a client-side parameter not validated server-side.
-
The price is stored as an integer count of the payment token's smallest units and must be greater than zero.
-
The price lock expiry was calculated from the client device clock instead of a server-side timestamp.
Seen in 1 report
-
The price module skips reverting feeds instead of failing, so an attacker can selectively disable feeds.
Seen in 1 report
-
The price oracle and swap limits did not prevent manipulation when a token had no Chainlink feed, so repeated partial swaps could drain the pool.
Seen in 1 report
-
High
-
-
The price retrieval does not verify the timestamp or freshness of the stored synthetic price.
Seen in 1 report
-
The price signature timestamp must fall within the liquidation timeout, but there is no way to reset the liquidation status once the timeout passes.
Seen in 1 report
-
The price uses effective supply, which falls when shares are escrowed, and a donation inflates the numerator.
Seen in 1 report
-
The price was used in arithmetic without bounds checking, so extreme values overflowed.
Seen in 1 report
-
The pricing algorithm mishandles a zero reserve and swaps that empty a reserve are allowed.
Seen in 1 report
-
The pricing endpoint exposed a state-changing PATCH method without authorisation or server-side price validation.
Seen in 1 report
-
The pricing experiment variant was stored client-side and not validated server-side, allowing users to set their own price tier.
Seen in 1 report
-
The pricing function relies on the router's best-price selection and then requires a specific pool type, which can be manipulated.
-
The principal is negated before the present value call, so the positive branch applies the supply rate.
Seen in 1 report
-
The private vault's deposit function is missing the whenNotPaused modifier that checks the router pause flag and the vault's shutdown flag.
Seen in 1 report
-
The private vault's fund function does not allow the depositor to set a slippage limit or price deviation check.
-
The prize NFT is only transferred into the contract at draw time rather than at raffle creation, and the ownership check at initialisation can be satisfied by a temporary holder.
Seen in 1 report
-
The prize pool did not configure the token's yield mode to Claimable, so automatic yield increased the contract's balance and could be claimed by anyone via contributePrizeTokens.
Seen in 1 report
-
The prize pool queries the time-weighted balance without first checking the time range is safe.
-
The processEvents function did not return errors and simply logged them, causing subsequent events to be skipped.
Seen in 1 report