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 withdrawal function lacked the pause check that the borrow, repay and lend functions had.
Seen in 1 report
-
The withdrawal function only allows sending the NFT to the original recipient with no alternative address.
Seen in 1 report
-
The withdrawal function relies on a mutable escrow contract reference, so changing it orphans tokens held by the previous contract.
-
The withdrawal function transferred the fees but did not reset the stored balance to zero.
-
The withdrawal function used a counter decremented on withdrawal, blocking redemption of untracked deposits.
-
The withdrawal function used the caller's address instead of a recipient parameter and required an incentive reporter role.
Seen in 1 report
-
The withdrawal functions assume each external call is atomic and never compare the amount actually received with the amount expected.
Seen in 1 report
-
The withdrawal guard only checks the health of the existing position and does not reserve the free cash needed for pending orders' fees.
-
The withdrawal guard reverted whenever borrowing exceeded the maximum utilisation ratio, with no rebalancing path.
-
The withdrawal limit check was skipped when the number of withdrawals left was one, allowing the full balance to be withdrawn at once.
Seen in 1 report
-
The withdrawal limit did not reserve assets needed to close long positions.
Seen in 1 report
-
The withdrawal limit returns zero when the collateral factor is zero instead of allowing proportional withdrawals.
-
The withdrawal limit tracked only quote-token flows and ignored base-token deposits held in a hedging module, so the total value used for the cap could be inflated.
Seen in 1 report
-
The withdrawal logic burns shares from destination vaults in a fixed order starting with profitable ones rather than proportionally.
Seen in 1 report
-
The withdrawal logic requires the received amount to be at least the promised amount without accounting for transfer fees.
Seen in 1 report
-
The withdrawal logic selected every farm with the matching LP denom without filtering by whether the farm was active.
Seen in 1 report
-
The withdrawal path makes the health check use bare collateral while liquidation uses weighted collateral, creating a discrepancy.
-
The withdrawal path was reduced to a single update with a negative delta and no minimum-output parameters.
Seen in 1 report
-
The withdrawal proxy inherits public deposit and mint functions without restricting them to the intended vault path.
-
The withdrawal request function checks the user's sToken balance but does not lock or commit those tokens, allowing the same tokens to be used for multiple withdrawal requests across different addresses.
Seen in 1 report
-
The withdrawal request function did not check whether the target-period bucket was already marked as claimed, unlike the rescue function.
-
The withdrawal request function overwrites the previous request amount for the same cycle without tracking cumulative requests across cycles, allowing a user to request their full balance each cycle and withdraw earlier than intended.
-
The withdrawal returned early when the vault cap was zero, so netting did not occur and contract tokens were sent out.
-
The withdrawal set the user's reward debt to zero before using it in the difference calculation.
Seen in 1 report
-
The withdrawal transaction's merkle root includes each signer's locally stored vote bitmap, so inconsistent votes produce different sighashes.
Seen in 1 report
-
The withdrawal was bucketed by period number but its checkpoint was keyed on the raw block timestamp, and the inclusive boundary lookup returned the post-exit balance.
-
The withdrawals view does not check the withdrawal-claimed flag when calculating the withdrawable amount.
Seen in 1 report
-
The withdrawCredit function does not check whether the pool is in a payout or cover-applied state.
-
The withdrawInternal function calculates how many LP tokens to hold back for the user but omits the refund call that would transfer them to the user.
Seen in 1 report
-
The worker allows unbounded attacker-controlled channel cardinality in one unchunked insert, commits notification rows separately from delivery rows, and treats existing notifications as already delivered on retry.
-
The wrap helper transferred wrapped tokens directly to the user instead of depositing them into YieldBox for the contract.
-
The wrapper calls the teller directly, so the teller records the share lock against the wrapper rather than the real depositor.
Seen in 1 report
-
The wrapper contract omitted a checkpoint on token transfers.
-
The wrapper contract uses lazy accounting and does not checkpoint balances when vault ownership changes.
-
The wrapper transferred and approved the full input amount but never checked or refunded the balance left after a partial swap.
Seen in 1 report
-
The wrapping function uses the entire attached value without reserving any amount for the subsequent gas fee.
Seen in 1 report
-
The write request was built from the route's address parameter with no check it matched the signing wallet, and the dialog omitted the target address.
-
The write-off function did not require the borrower's collateral balance to be zero.
-
The y-intercept adjustment reads the contract's token balance after funds are distributed, so the balance is always zero and the decrease is overstated.
-
The yield calculation assumed the exchange rate never decreases and did not clear the notional balance.
Seen in 1 report
-
The zero check tests total shares minted instead of the total reserve.
Seen in 1 report
-
The zero hash is accepted as a referral code although zero is also the default no-referrer value.
-
The zero-check on the stake amount ran before the stake limit was applied, so a zero limit produced a zero amount that was not handled.
Seen in 1 report
-
The zero-depth safeguard is an exact-zero test while the close VPI curve has no minimum denominator and the charge has no cap relative to the closed notional.
-
The zero-quote branch checks only the pre-burn quote and breaks out before refunding, so a head that is still zero after the Senior burn stays queued and blocks Junior funding.
Seen in 1 report
-
The zero-value check applied to the requested amount rather than the amount matched by ticket closing.
Seen in 1 report
-
The zone does not enforce allocation of consideration extensions, so unsigned tokens can be appended.
Seen in 1 report
-
There is no cross-validation between calendar override days and the maximum staleness setting, allowing the frozen period to exceed the staleness budget.
-
There is no delay between epoch end and vote changes, and distribution can be front-run.
Seen in 1 report
-
There is no fallback to return tokens when the swap execution fails and the payload is cached for retry.
Seen in 1 report