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 reward loop includes the current unfinished epoch, allowing a claim-merge-reclaim cycle.
Seen in 1 report
-
The reward multiplies the last locked amount by the reward rate instead of the total locked balance.
-
The reward notification always restarts the period and recalculates the rate on any new reward, with no minimum threshold.
Seen in 1 report
-
The reward notification combines leftover rewards with the new reward and divides by the new duration, ignoring the original period finish.
Seen in 1 report
-
The reward notification updates the last update time without first storing the accumulated reward per token, so the elapsed period is not accounted for.
-
The reward parameter was set from the user's configuration at preparation time, but the user could change that configuration before the transaction was mined.
Seen in 1 report
-
The reward payout timestamp is not updated during the freeze, so the whole period's rewards go to whoever is staked at unfreeze.
Seen in 1 report
-
The reward period finish is set unconditionally to now plus the full rewards duration, even when a period is already ongoing.
Seen in 1 report
-
The reward period starts when rewards are notified regardless of whether any participants exist, so rewards accrue when no one can claim them.
Seen in 1 report
-
The reward pool allowed the same extra reward address to be added multiple times without a duplicate check.
Seen in 1 report
-
The reward processing stakes the main reward without checking the minimum stake requirement, so a small amount reverts the entire claim.
Seen in 1 report
-
The reward rate calculation omits the rollover amount while the reward reserve includes it.
Seen in 1 report
-
The reward rate uses the average of start and final ratios, which does not account for the non-linear reward curve when crossing a bound.
-
The reward share calculation uses the current total supply, which can be temporarily inflated by a large stake.
Seen in 1 report
-
The reward split divided the total equally by receiver count instead of reading each operator's current bond.
Seen in 1 report
-
The reward token array is fixed in the constructor with no way to add entries.
Seen in 1 report
-
The reward tracker stores only the current stake amount and starting period, without preserving historical stake amounts per period.
-
The reward update relied on current total borrows, which could be inflated within one transaction or block.
Seen in 1 report
-
The reward update runs after the token burn, so the reward calculation uses the reduced post-burn balance.
Seen in 1 report
-
The reward window end is hardcoded as a constant timestamp instead of being computed from deployment time in the constructor.
-
The reward-per-token calculation returned early when total supply was zero, so incoming rewards were not accounted for.
Seen in 1 report
-
The reward-per-token-paid mapping is not updated on a user's first deposit, so vested tokens can be claimed immediately.
Seen in 1 report
-
The reward-processing threshold is derived from a token balance any external party can increase by a direct transfer, so reward timing can be controlled.
-
The rewarder contract had no sweep or recovery function for unutilised reward tokens, unlike its base contract.
Seen in 1 report
-
The risk calculation uses the stored exchange rate instead of the current one that accrues interest.
Seen in 1 report
-
The risk check compares account value against zero without subtracting the trade fee charged afterwards.
Seen in 1 report
-
The risk check omits the referral fee the account will receive from the counterparty.
-
The risk check used the full borrow amount instead of the amount after the origination fee.
Seen in 1 report
-
The roll function did not handle a zero new collateral, causing a zero-value transfer.
Seen in 1 report
-
The roll function lacked a limit on rolls and the toggle could not prevent multiple rolls in one transaction.
Seen in 1 report
-
The roller assumes it can always create a series at the calculated maturity, but the system enforces one series per adapter and maturity.
Seen in 1 report
-
The room login endpoint does not enforce any rate limiting or account lockout on failed password attempts.
Seen in 1 report
-
$500 Medium
-
-
The room-ending routine failed to clean up the linked event, leaving an orphaned post with no valid delete path.
Seen in 1 report
-
The route-calculation function lacks logic to evaluate pools and indices and defaults to zero.
Seen in 1 report
-
The router approves the vault for the shares amount instead of the assets amount required by previewMint.
-
The router calls a single permit signature that does not match DAI's non-standard implementation.
Seen in 1 report
-
Medium
-
-
The router calls permit on a pair contract that does not implement it.
Seen in 1 report
-
The router computed token amounts from virtual reserves while the pair's mint expected a different amount, so the values only matched in one case.
Seen in 1 report
-
The router constant was assigned the V3 router address instead of the V2 router address.
-
The router did not transfer the user's tokens to itself before calling the unwrap, and it checked the destination address instead of the owner.
Seen in 1 report
-
The router does not reject liquidator equal to user, and the liquidation transfer lacks the self-transfer guard present in its sibling transfer function.
-
The router enforced no minimum borrow or residual debt, so partial repayment could leave a position too small to be worth liquidating.
Seen in 1 report
-
The router forwards the full message value to each pool in a loop but only the fee-subtracted amount returns.
Seen in 1 report
-
The router only checked the input cap and never confirmed the received output equalled the requested amount.
-
The router passed the auction duration instead of the final timestamp when initialising the accountant.
Seen in 1 report
-
The router signature hash included only the transfer ID and path length, not the actual router addresses.
Seen in 1 report
-
The router trusts a pre-calculated expected amount based on a possibly stale exchange rate instead of the actual amount received from the lToken.
Seen in 1 report
-
The router uses the wrong token variable when transferring proceeds back to the user.
Seen in 1 report
-
The router validates close admission against the queued-position projection while the engine validates the same request against the live position.
-
The router withdrew both tokens but only forwarded one for conversion, never returning the base portion to the member.
Seen in 1 report