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.
-
Chain removal deletes configuration without checking for pending or unprocessed messages.
Seen in 1 report
-
Chain support is stored as non-empty strings or hashes, so there is no value the checks treat as not supported.
Seen in 1 report
-
Changing the bitmap currency did not clear the previous active bitmap currency from the account context.
Seen in 1 report
-
Changing the efficiency factor did not recompute the pool target value.
Seen in 1 report
-
Changing the role of an invited user updated their membership status to full member without requiring invite acceptance.
Seen in 1 report
-
Character validation permits a hyphen adjacent to another hyphen inside the string.
-
The utilisation buffer is checked only when opening a taker position, not when closing a maker position.
Seen in 1 report
-
Checkout reuses cached pricing state from before the cart changed instead of recalculating.
Seen in 1 report
-
Checkout validated only the most recently applied coupon and did not track earlier discounts.
Seen in 1 report
-
Claim and withdraw functions take no user-specified minimum output, so the payout depends entirely on current state.
-
The claim function lacks an owner-only access control check.
Seen in 1 report
-
Claim functions do not verify that the request's epoch is not the current unsettled epoch, so uninitialised epoch data is used.
Seen in 1 report
-
Claim logic credits only the balance delta of the currently configured token and never checks the previous instance.
-
Claim transfers tokens but never increments the claimed counter, so the same amount can be claimed repeatedly.
-
Claiming did not check that cumulative rewards stayed within the promotion's allocated balance.
Seen in 1 report
-
Claiming proceeds changed the status to Claimed while claimBids only allowed the Settled status.
Seen in 1 report
-
Clearing a user's validator record sets the staked amount to zero without first settling unclaimed rewards accrued up to the slash timestamp.
Seen in 1 report
-
The client treats the response payload as authoritative and updates verification state from its fields instead of server-side state.
Seen in 1 report
-
Client-side JavaScript validated the payment status from a server response the user could modify.
Seen in 1 report
-
Client-supplied quantity values were used for price calculation without validating they are positive integers.
Seen in 1 report
-
Client-supplied recipient and template text were used without binding the recipient to the authenticated account or treating the display name as untrusted.
Seen in 1 report
-
Close admission projects the position through the account's pending same-side increases while execution re-plans against the live position only.
-
The close function does not enforce the maintenance invariant, and the liquidation incentive is a small constant.
Seen in 1 report
-
Close-factor validation runs on the original amount before the minimum-remaining-debt logic replaces it with the full balance, with no second validation.
-
Close-time price impact divides by net pool depth with no lower bound and no cap relative to the notional being closed, skipping the charge only at exactly zero depth.
-
closePosition repays the full borrowed amount before redeeming collateral, without accounting for collateral being worth less than the debt.
Seen in 1 report
-
closePosition uses the original full position amount and ignores reductions caused by liquidation.
Seen in 1 report
-
Closures were modelled only as whole UTC days and a fixed weekly window, while the oracle's holiday closure was an intraday New York boundary spanning two UTC days.
-
Code assumed a market contract exists on every chain, but markets were only deployed on the host chain, so calls on other chains revert.
-
Code assumes the current balance never falls below the previous balance.
Seen in 1 report
-
Code used the latestMarket state variable instead of the marketIndex parameter.
Seen in 1 report
-
Code validated that a bookable slot existed in the range but stored the raw request parameters, and the confirmation step repeated the flawed check.
-
Collateral credit is read from the live LP token balance instead of internal accounting.
Seen in 1 report
-
Collateral deposits are not segregated from lendable liquidity, so collateral reserves can be emptied.
Seen in 1 report
-
Collateral is checked at bid submission but not transferred or locked until the lender accepts.
-
Collateral is sent to the liquidator before the liquidator's repayment is pulled in.
-
Collateral reduction is applied uniformly to all borrowers while debt reduction is weighted by time held.
Seen in 1 report
-
Collateral seizure lives in a separate contract that does not update the loan state in the main contract.
Seen in 1 report
-
Collateral shares are burnt only for the amount sent to the liquidator, ignoring the protocol fee.
-
Collateral valuation multiplies NFT count by floor price without accounting for slippage or market depth.
Seen in 1 report
-
Collateral valuation uses stale stored index data instead of recomputing the current index before the balance call.
Seen in 1 report
-
Collateral-enable logic is duplicated across entrypoints, so the transfer path and manual enable set the bit without a shared pause and oracle check.
Seen in 1 report
-
Commit reserves only margin and bounty, never the trader claim, and the claim-settlement function has no check for a pending open that counted that claim as collateral.
-
commitToLien did not validate that the vault address in the strategy details matched the vault being called.
-
Common misspellings of support addresses were not blocked or reserved at registration.
Seen in 1 report
-
Company names were compared with exact string matching without normalising Unicode characters.
Seen in 1 report
-
A per-pool reward cap is compared against a global cumulative claimed total.
Seen in 1 report
-
completePurchase does not verify that the vesting plan is still marked sellable, unlike listVesting.
-
Compound-style mint and redeem return values are not checked.
Seen in 1 report
-
Compounding raised the value of all existing shares with no time weighting, so reward distribution depended only on current share ownership.
Seen in 1 report