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 winner selection loop does not check for or prevent duplicate addresses, so the same index can be chosen more than once.
-
The winner-selection logic recorded the winner but never removed or marked the chosen ticket, so the ticket pool was reused unchanged.
Seen in 1 report
-
The winning prize index was calculated on the client and stored by the server without validation.
-
The wiped-tranche guard was added only to one quote function, leaving the shared pricing helpers and their other callers unguarded against zero pricing assets.
-
The withdraw call hardcodes the contract's own address instead of using the position parameter supplied to the hook.
-
The withdraw function accrues rewards for the caller and receiver but not the owner.
Seen in 1 report
-
The withdraw function and its helper returned nothing and the accrual helper stayed internal, so no on-chain query exists.
Seen in 1 report
-
The withdraw function applies the non-Kerosene collateral check to Kerosene withdrawals, comparing the non-Kerosene value minus the withdrawn amount against the minted amount.
Seen in 1 report
-
The withdraw function calls safeTransferFrom on the asset token without first setting an allowance for the vault to spend its own tokens.
Seen in 1 report
-
The withdraw function capped the payout at the original deposit while burning the full share amount, leaving interest with no shares to claim it.
-
The withdraw function deletes the whole NFT record without checking for a non-zero unpaid reward balance.
Seen in 1 report
-
The withdraw function did not check that the token being withdrawn was not the collateral token's legacy counterpart.
-
The withdraw function did not check the lock-enabled state variable before allowing withdrawals.
Seen in 1 report
-
The withdraw function did not decrement the total voting amount or write a voting checkpoint, so the total stayed inflated after withdrawals.
Seen in 1 report
-
The withdraw function did not decrement the unstreamed variable.
Seen in 1 report
-
The withdraw function did not record that a withdrawal had occurred.
Seen in 1 report
-
The withdraw function did not remove old bids before checking the user's bid rate.
Seen in 1 report
-
The withdraw function did not return unused shares to the caller when Yearn only partially fulfilled the withdrawal.
Seen in 1 report
-
The withdraw function did not run the same safety check that enforces per-collateral borrow caps.
Seen in 1 report
-
The withdraw function does not check that the boost unlock time has passed.
Seen in 1 report
-
The withdraw function does not decrease the total delegated WETH state variable.
Seen in 1 report
-
The withdraw function does not reduce the user's voting power balance when the contract is stopped and the full amount is withdrawn.
Seen in 1 report
-
The withdraw function enforced the frozen check unlike the collect and burn functions, so gas fee deposits failed when the CoinStore was frozen.
Seen in 1 report
-
The withdraw function failed to decrease the pending withdrawals variable, overstating outstanding withdrawals.
Seen in 1 report
-
The withdraw function hardcodes a 1 percent slippage tolerance instead of letting the caller specify it.
Seen in 1 report
-
The withdraw function has no lock-up preventing immediate withdrawal after deposit and pays all accrued rewards to the caller.
Seen in 1 report
-
The withdraw function read the withdrawal proposal from the caller rather than the owner argument.
Seen in 1 report
-
The withdraw function relies only on a burn mechanism that needs sufficient excess balance, with no fallback liquidity source.
-
The withdraw function subtracted from the minted counter instead of only adding to the removed counter.
-
The withdraw function subtracts the underlying amount from the allowance instead of the equivalent number of shares.
Seen in 1 report
-
The withdraw function sweeps the entire reserve pool balance without tracking individual stakes.
Seen in 1 report
-
The withdraw function uses a minimum shares out check instead of a maximum shares in check.
Seen in 1 report
-
The withdraw guard ignores free cash and carry is projected out of the pledge, so the trader controls their own liquidation eligibility during the freeze.
-
The withdraw guard uses the raw cached mark while liquidation applies a side-adverse confidence shift to the same mark, with no buffer between the thresholds.
-
The withdraw message options builder only added gas and value options and omitted the ordered execution option.
Seen in 1 report
-
The withdraw reserve is only computed from the surplus above the auction's expected amount, so it is forced to zero when total assets do not exceed that expectation.
Seen in 1 report
-
The withdraw transaction preparation functions omitted an instruction to increment the nonce, so a failed withdrawal left the nonce unchanged.
-
The withdraw-to-chain call set unwrap to false, so the destination received wrapped tokens the lock function could not use.
-
The withdrawable calculation uses the reduced borrow limit as the denominator while the numerator uses the original total supply.
-
The withdrawal accounting subtracted only the amount returned by the vault and ignored the fee the vault took.
-
The withdrawal amount is set to zero instead of the full supply when the allocation is zero.
-
The withdrawal amount parameter is 64-bit while other token amounts use 128-bit.
Seen in 1 report
-
The withdrawal amount was added in one function and then subtracted again by the caller, subtracting it twice.
-
The withdrawal amount was scaled by price per share before being passed to a vault function that expected the exact token amount.
Seen in 1 report
-
The withdrawal check relies only on the lowest utilized price, which can be inflated by adding quote tokens to a high bucket.
Seen in 1 report
-
The withdrawal fee logic did not exempt withdrawals signed by the vault fee wallet or program fee wallet.
-
The withdrawal function checked only the user's own share balance against the minimum, not total pool issuance.
Seen in 1 report
-
The withdrawal function checks the total remaining supply against a minimum amount, rather than checking only the withdrawing user's balance, so the last tokens cannot be withdrawn.
Seen in 1 report
-
The withdrawal function does not reset the high-water mark when total supply reaches zero.
Seen in 1 report
-
The withdrawal function does not verify that the lien has no active loan before transferring the NFT.
Seen in 1 report