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 loss check compares current debt value to the last recorded debt basis, which is updated during rebalancing.
Seen in 1 report
-
The loss check uses the reduced payout value instead of the original requested value, so the slippage limit passes.
-
The loss fee is written to common storage but no function exists to withdraw or reimburse it to the keeper.
-
The loss is already reflected in the asset difference but is subtracted again from the return on investment.
Seen in 1 report
-
The lot ID was still zero when the storage pointer was taken, so every auction wrote to slot zero before the real counter was assigned.
Seen in 1 report
-
The low-level call did not check that the target address contained code, so a call to a non-existent contract returned success.
Seen in 1 report
-
The lower bound only checks a fixed minimum and ignores the extra gas needed for transaction data size.
Seen in 1 report
-
The lower-minted function has the same permission level as mint, so a whitelisted minter can reduce their own counter.
Seen in 1 report
-
The LP net asset value calculation uses pool cash and terminal delta without adding the negative price impact rebate reserve, which is pool cash certain to return.
-
The LP token minting calculation uses the contract's actual token balance instead of the internal reserve balance.
-
The mail client's MIME parser did not strictly follow the MIME standard and determined the end of an attachment at the wrong point.
Seen in 1 report
-
The mail pipeline trusted a referenced Message-ID as proof the message belonged to an existing thread.
Seen in 1 report
-
The maintenance guard compares the finality event height against the recent best block height with a threshold smaller than the normal finality lag, so every finality event is skipped.
-
The maker funding share uses absolute skew times the minor side funding instead of a proportional ratio.
Seen in 1 report
-
The maker's fee exposure adjustment was weighted by open position size rather than individual exposure.
-
The managed code enabled flag and taskpane resource references were not validated properly, so security prompts could be bypassed.
Seen in 1 report
-
The manager read the current global ticket price instead of the price snapshotted for the active drawing.
-
The mandatory CSP was only added by the scheme-specific URL loader, so service-worker-synthesised responses skipped it.
Seen in 1 report
-
The manifest parser used the original merchant-supplied URL as the base for relative entries instead of the URL the manifest was fetched from after redirects.
Seen in 1 report
-
The mapping layer billed gas by encoded byte size rather than storage transition type, so zero-size values and empty reads cost nothing.
-
The mapping of reserved pool token suffixes is never cleared when an agent vault is destroyed.
-
The margin calculation always returns a positive value regardless of whether the position size is increasing or decreasing.
-
The margin-to-debt ratio is calculated as margin divided by debt alone instead of margin divided by debt plus margin.
Seen in 1 report
-
The mark update scales the whole mark by the funded fraction of principal without checking that other senior holders still own shares.
-
The Markdown renderer converts and displays link text and destinations without applying punycode/IDN normalisation or a warning.
Seen in 1 report
-
The market creation function did not check that the opening time precedes the locking time.
-
The market creation function does not verify that the initial depositor is the caller.
Seen in 1 report
-
The market overrides cancel but not offer, so offers created via the inherited function are never inserted into the sorted or unsorted data structures cancel relies on.
Seen in 1 report
-
The market-empty check does not include the connector's balance in the staking pool when deciding whether a position is empty.
-
The marketplace trusted the custom contract to mint the exact requested count.
Seen in 1 report
-
The masking condition for irrelevant characters in the final loop iteration is wrong and the mask can overflow.
Seen in 1 report
-
The master contract used the caller's address as the user, so wrapper-held balances lost individual ownership.
-
The matching function has no minimum lend amount and rounds down, allowing manipulation of the weighted average rate.
-
The matching function uses the pay amount without adding the fee when calling buy, so the amount passed is less than needed.
Seen in 1 report
-
The matching logic reduced maker amounts without checking the remainder against the minimum limit.
Seen in 1 report
-
The matching policy returns a hardcoded amount of 1 instead of the order's amount.
Seen in 1 report
-
The maturity check is conditioned on the sender being the founder.
Seen in 1 report
-
The max functions did not account for the daily lend increase limit or available vault balance, returning values that exceed what the operations allow.
Seen in 1 report
-
The max scale can be raised by direct donations and never updates downwards.
Seen in 1 report
-
The max withdraw calculation did not account for the loan-to-value ratio of the withdrawn collateral's reserve.
Seen in 1 report
-
The max withdraw function delegates to the adapter without including the vault's withdrawal fee.
Seen in 1 report
-
The max-buy option reads the current epoch maximum at execution time rather than binding to the epoch seen at submission.
Seen in 1 report
-
The max-redeem view was implemented as a balance lookup instead of triggering the external redeem call.
Seen in 1 report
-
The max_deposit and max_withdraw functions omitted checks for certain global restrictions, such as the owner's share balance or a paused-withdrawals flag, leading to inaccurate return values.
Seen in 1 report
-
The maxDeposit function does not account for the yield buffer balance, so it can return an amount that leads to a lossy deposit and revert when the buffer is depleted.
Seen in 1 report
-
The maximum allocation function returns the default maximum when the user's tier allocation is zero instead of returning zero.
Seen in 1 report
-
The maximum and minimum trackers were initialised to zero instead of extreme values.
Seen in 1 report
-
The maximum borrow amount is calculated without a safety margin for interest accrual, leaving the position at the liquidation threshold.
Seen in 1 report
-
The maximum borrow rate constant was not adjusted for the average block time of the deployment chain.
Seen in 1 report
-
The maximum contribution check was per claim call and per address, not per resulting card.
Seen in 1 report