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.
-
A bitwise AND was used instead of a logical OR to test whether either amount was zero.
Seen in 1 report
-
A boolean flag is declared but never assigned, so refund logic always takes the wrong branch.
Seen in 1 report
-
A boundary check uses less-than-or-equal instead of less-than, so single-block queries return zero.
-
A branch never assigns the compensated amount, leaving it at its default of zero.
Seen in 1 report
-
A burn function requiring an allowance is called without granting that allowance.
Seen in 1 report
-
A cache-miss marker was treated as proof the transaction was included without metering, but a transaction can be rejected before inclusion for a transient reason.
-
A cache-reuse coverage check still compares every feed against an aggregate publish time that was redefined from the oldest to the newest component time.
-
A caller-supplied reward token list was used to index storage without a duplicate check, and the same precomputed amounts were reused per entry.
-
A checkpoint created during reset is counted for the new epoch, so the previous epoch's balance stays claimable.
Seen in 1 report
-
A client-controlled flag decided whether a convenience fee was applied instead of the server calculating charges itself.
-
A clip function on the end square root price prevents it from contributing negatively to the active tick.
Seen in 1 report
-
Medium
-
-
A collateral activity check is applied to all vault interactions, including ones that do not need price validation.
-
A condition used OR instead of AND when checking admin or host, so an admin who was not host returned early and skipped updating the recording status.
-
A condition uses logical AND instead of OR when checking the caller is the owner and the short ID matches.
Seen in 1 report
-
A conditional check gates the application of the governance-set rate so the adjustment is skipped above a fixed threshold.
Seen in 1 report
-
A constant was set to 5000 instead of the documented 6600, likely a typo or oversight.
Seen in 1 report
-
A constraint variable is used in the bond calculation without first being set to the collateral sell value, so the kicker reward uses the wrong base.
-
A copy-paste error called the generic tribute function instead of the governance variant.
Seen in 1 report
-
A copy-paste error called the inference score insert instead of the forecast score insert.
Seen in 1 report
-
A copy-paste error reverses the subtraction order for one token's pool exposure.
Seen in 1 report
-
A copy-paste error set the wrong array index to zero after processing.
Seen in 1 report
-
A copy-paste error: the unfreezeChain function calls freezeDiamond instead of unfreezeDiamond.
-
A copy-paste or typo error assigns the cumulative ask where the cumulative bid was intended.
Seen in 1 report
-
A copy-paste typo made the require statement check the primary token's decimals instead of the secondary token's.
Seen in 1 report
-
A custom invite link was not reserved or monitored, so it became claimable when the boost level dropped.
Seen in 1 report
-
A custom price set during a position order was reused for later swaps in the same order.
Seen in 1 report
-
A custom transfer helper was used instead of a safe transfer library that handles non-standard tokens.
Seen in 1 report
-
A day-in-blocks constant was calculated from a pre-merge 13.3-second block time.
Seen in 1 report
-
Medium
-
-
A decode failure of the authoritative call bytes is caught without setting the flag that blocks confirmation, so indexer labels are shown instead.
-
A deleted project name became immediately available for re-registration and package managers treated the new owner's package as a routine upgrade.
-
A deprecated API allowed changing a field documented as read-only, and the console had no safeguard against forcing users into an organisation that was their only one.
Seen in 1 report
-
A design flaw where the same KeroseneManager list is used for two conflicting purposes: pricing (which must exclude Kerosene vaults to avoid recursion) and licensing (which must include Kerosene vaults).
Seen in 1 report
-
A discrete compounding formula is applied at irregular, activity-dependent intervals.
-
A drip function fetches the stored revenue rather than accepting the calculated revenue as a parameter, so any bonus computed elsewhere is silently dropped.
-
A dynamic redemption cap is used as a measure of ownership value instead of the LP tokens' proportional claim on pool liquidity.
Seen in 1 report
-
A failed cross-chain message is not marked as consumed, so it can be retried after the NFT has moved back.
-
A failed NFT transfer to the bidder returns false and is interpreted as a signal to proceed to the next stage.
-
A false return is treated as no transfer even though part of the reward was already forwarded to a sub-gauge.
Seen in 1 report
-
A faulty rate-limit implementation alternated reliable and unreliable responses, and registration returned distinguishable responses.
Seen in 1 report
-
A fee adjustment value with 18 decimals is used in a division without scaling.
Seen in 1 report
-
A fixed end block incentivises last-minute bidding and prevents proper price discovery.
Seen in 1 report
-
A fixed gas limit used to size the funding permit with no input for whether the resolver still needs deploying.
-
A fixed initial liquidity amount of each asset ignores the real-world value of the gas token.
Seen in 1 report
-
A fixed leftover floor is inconsistent with the close-factor cap, so the leftover check rejects repayments the close factor permits.
Seen in 1 report
-
A fixed-point oracle price was multiplied in without converting back to a normal integer, so payouts could be off by the scaling factor.
Seen in 1 report
-
A fixed-share threshold was used for minting but redeem could reduce total shares below it.
Seen in 1 report
-
A function that floors negative changes at zero is used for the initial APR, combined with a slow exponential moving average.
Seen in 1 report
-
A gas charge before a state read that does not charge gas internally was removed.
-
A global weight decays all users' collateral during redemption while only users with earmarked debt get debt relief.
Seen in 1 report
-
A greater-than comparison selects the larger value where a less-than comparison should select the smaller, inverting the operator cap.
Seen in 1 report