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.
-
Fee and base reward are minted as separate credits, so the fee is checked against the existential deposit before the reward creates the account.
Seen in 1 report
-
The fee is calculated on the full input amount rather than the actual amount swapped.
Seen in 1 report
-
Fee calculation only considers allocated and minted shares, not shares burned immediately on a redeem request.
Seen in 1 report
-
Fee calculation relies solely on utilisation percentage, which a large provider can manipulate with offsetting positions.
Seen in 1 report
-
Fee calculation subtracts previously accrued fees so pre-existing fees are not counted as protocol fees.
-
Fee claiming is nested inside a time-gated condition that becomes unreachable once the stored timestamp passes the end time.
Seen in 1 report
-
The fee is computed from the debt repaid instead of the liquidation reward.
Seen in 1 report
-
The fee is converted using the pre-swap price snapshot and not recomputed after the swap moves the price.
Seen in 1 report
-
Fee distribution uses the current total borrowed amount without settling accrued fees first.
-
The fee factor is updated without first accruing interest and updating the supply rate.
Seen in 1 report
-
Fee growth values were read from the position manager before triggering an update via collect, so stale values were stored.
Seen in 1 report
-
Fee hooks were only set when the launchpad itself created the pair, and the first pair stored could not be replaced.
Seen in 1 report
-
The fee setter has no upper bound, so values above one hundred per cent cause an underflow.
Seen in 1 report
-
Medium
-
-
Fee tracking was skipped when liquidity tokens were transferred to the pair itself, and the fee withdrawal function allowed anyone to withdraw on behalf of any address.
Seen in 1 report
-
The fee update resets the last action timestamp regardless of deposit size.
Seen in 1 report
-
Fee-on-transfer detection relied on an admin flag instead of measuring the actual balance change.
Seen in 1 report
-
Fees are calculated on total shares that already include previously minted fee shares.
Seen in 1 report
-
Fees go to whoever provides liquidity at the moment a position closes, regardless of how long they provided it.
Seen in 1 report
-
Finalisation sets the last bid to total contributions when the NFT was gifted, without checking whether any real bid was placed.
Seen in 1 report
-
Finishing distribution only updates the finish time and does not stop later harvest calls from resetting the reward rate and finish time.
Seen in 1 report
-
First-supply determination uses the scaled balance, which any third party can make nonzero by transferring a minimal amount.
Seen in 1 report
-
Fixed borrow shares are computed from the current floating debt, which grows over time, so claimable rewards shrink.
Seen in 1 report
-
Fixed borrow shares are recomputed from the current reward start time, discarding unsettled shares from the previous distribution.
Seen in 1 report
-
Fixed module-level transaction ids are shared by every registration, with history written by that id as a key instead of appended.
Seen in 1 report
-
Fixed six-decimal scaling and flooring of token values and the threshold made the live metric and threshold round to the same integer, hiding a real drawdown.
Seen in 1 report
-
Fixed-pool functions that change the backup borrowed value do not accrue the floating debt first, so past interest can be changed retroactively.
Seen in 1 report
-
Flash loan fees are added through the credit repayment path, which does not increase expected liquidity, instead of the profit minting path that would.
-
Flashloan fees are credited only to the active bin's providers while the loan draws on liquidity from all bins.
Seen in 1 report
-
Follow checks that the handle exists but not that it maps to the profile id being followed.
Seen in 1 report
-
For a zero-weight market the collateral calculation used only current margin instead of deriving collateral from target leverage.
-
Forecast elements were not deduplicated, letting an attacker inflate the weight of their elements.
-
Form handling used different HTTP methods based on input length and did not reject unexpected GET submissions.
Seen in 1 report
-
Four asset-moving functions update local accounting but omit the interest update call that deposit and withdraw make.
Seen in 1 report
-
free is called before melt, so pending redistribution updates on zero-balance yangs are missed.
Seen in 1 report
-
Hardcoded function selectors do not match the real signatures.
Seen in 1 report
-
Functions assumed path and token arrays were consistent with the pair without checking lengths or contents.
Seen in 1 report
-
Functions call the remaining margin helper but discard the invalid boolean it returns.
-
Functions calling the mark price do not validate that the returned value is non-zero.
-
Functions moved the full requested sell amount into the contract but never returned the unswapped remainder to the receiver.
Seen in 1 report
-
Functions take a caller-supplied from address and the signed messages lack a nonce and verifying contract, enabling replay.
Seen in 1 report
-
Functions take a share amount while the token amount is recalculated at settlement after interest has accrued.
-
Functions that needed to forward ETH for protocol fees were missing the payable modifier.
Seen in 1 report
-
The funding vote lacks the screening participation check that the reward claim enforces.
Seen in 1 report
-
Funds are only released when the entire batch sells, with no fallback withdrawal for partial sales.
Seen in 1 report
-
Fuzzy login matching associates accounts with similar emails and identical passwords.
Seen in 1 report
-
A generic parameter setter writes any value to storage without validating it against the allowed range.
-
Global and local positions handle invalid oracle versions differently, causing profit and loss desync.
-
Go pointer equality is used on big integer pointers instead of comparing values.
Seen in 1 report
-
Gossip and sync paths validate signature, hash and timestamp but never enforce monotonicity or parent continuity before overwriting the unsafe head.
-
Governance allowed voting power to be borrowed temporarily without safeguards such as timelocks or quorum requirements.
Seen in 1 report