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 bootstrap branch fires whenever both principals are zero even when a nonzero senior high-water mark survives, crediting the full recap to senior.
-
The borrow function allows the caller to specify the interest to pay without proper validation.
-
The borrow function checked that a collateral deposit existed but not that it belonged to the same position being borrowed against.
Seen in 1 report
-
The borrow function did not validate that the position account in the repay instruction matched the position being closed.
-
The borrow function does not reject a zero-asset borrow, so the allowance check passes and the borrower is entered into the market.
Seen in 1 report
-
The borrow function omits the health-factor check that the repay function performs after interacting with the lending protocol.
-
The borrow function trusts a user-supplied increase value and adds it to the pool's state without ensuring it is consistent with the collateral transferred in.
-
The borrow index is not updated before reading the previous debt balance.
-
The borrow loop does not supply the final swapped asset as collateral after the loop ends.
-
The borrow path never enforces the same-asset prohibition that the liquidation paths assume.
Seen in 1 report
-
The borrow-limit check inspects only the balance of the single token being borrowed against, not overall liquidity across markets.
-
The borrowing calculation adds the maximum borrowable amount from existing collateral to the new position's borrow amount, double-counting previous collateral.
-
The borrowing fee calculation looked only at open notional and did not account for whether the taker was reducing their position, so utilisation could be inflated artificially.
Seen in 1 report
-
The borrowing formula does not scale linearly with leverage, so position sizes are not monotonic across leverage values.
-
The borrowing modifier checked only the first credit position's principal, but repayment could reorder the queue.
-
The bounty struct was loaded into memory rather than storage, so setting active to false never persisted.
Seen in 1 report
-
The bounty-eligibility flag on each scope was not reset when the programme type changed.
Seen in 1 report
-
The branch condition compared the pool long and short token amounts with the wrong inequality, so the unsigned subtraction underflowed and reverted.
Seen in 1 report
-
The branch handling a cancelled close request skips the minimum-value check that other branches enforce.
Seen in 1 report
-
The bribe claim function checks only the checkpoint balance and not whether the token voted in the epoch being claimed.
Seen in 1 report
-
The bribe claim function lacks a check that the lock end time is in the future.
Seen in 1 report
-
The bribe delivery call sits inside a conditional that checks the base token reward amount, so it is skipped when that amount is too small.
-
The bribe reward balance is not reset to zero after claiming.
Seen in 1 report
-
The bribe withdraw function failed to reduce a user's balance when the withdrawal amount exceeded their current balance.
Seen in 1 report
-
The bridge approved only the transfer amount while the fee adapter attempted to pull the amount plus the fee.
Seen in 1 report
-
The bridge cached the inflation multiplier in storage and only refreshed it via a separate rebase call.
Seen in 1 report
-
The bridge did not verify that the execute calldata's destination domain matched the current chain.
-
The bridge paid the execution fee before registering the user's principal assets, so a fee shortfall aborted execution before the principal was recorded and the recovery mechanism did not cover it.
Seen in 1 report
-
The bridge trusted that a non-zero message value meant funds were sent, but delegatecall preserves the caller's value without transferring funds.
-
The bridge uses the source-chain sender address as the destination recipient without letting the user specify a different address.
Seen in 1 report
-
The bridge validated only that the requested destination appeared somewhere in the array instead of requiring exactly one match.
Seen in 1 report
-
The browser trusted renderer MIME type validation that accepts any top-level type beginning with x- and copied strings verbatim into the desktop file.
Seen in 1 report
-
The bubble re-reads the active permission request on click instead of remembering the request it was created for.
Seen in 1 report
-
The buffer is updated using the old cap before the new cap is stored, so the new cap is not enforced.
Seen in 1 report
-
The buffer sums two flow rates as one flow, ignoring that the minimum deposit applies per flow.
Seen in 1 report
-
The buffered entry solvency check subtracts recorded trader claims from pool cash but does not reserve the positive marked profit that open winners can realise immediately.
-
The burn clears approvals by calling approve with the caller as sender, which fails for a caller approved only for that token identifier.
Seen in 1 report
-
The burn condition only checks whether the short amount is zero and ignores whether collateral is also zero.
Seen in 1 report
-
The burn function allows burning for the zero address multiple times and the initial contribution is assigned to the zero address.
Seen in 1 report
-
The burn function calls the same transfer logic that applies the burn fee, so the fee is applied recursively to itself.
-
The burn function deducts from the initial owner's airdrop without checking whether the caller is the initial or current owner.
Seen in 1 report
-
The burn function deletes token and rental data without checking for active rentals.
-
The burn function let anyone burn freely minted tokens and receive Ether in return without proper checks.
Seen in 1 report
-
The burn function omits the call to the ERC721 _burn function.
Seen in 1 report
-
The burn function passes the market address as the receiver of principal tokens instead of the connector's own address.
Seen in 1 report
-
The burn function unconditionally clears the token URI for a token id shared by multiple holders.
-
The burn function updated the caller's power but left total voting power unchanged.
-
The burn loop used a logical AND with a blacklist flag instead of an OR, so skipped assets were only excluded when blacklisted assets were also present.
Seen in 1 report
-
The burn path does not decrement the total supply counter, so recorded supply drifts from circulating tokens.
Seen in 1 report
-
The burn subtracts the redemption amount from a counter that excludes rewards, so it can underflow.
Seen in 1 report