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 burn used total contract balances including accrued fees instead of reserves.
-
The buy function allows the purchase price to be set below total contributions.
Seen in 1 report
-
The buy function did not check that input and output assets differed, so the swap maths returned a near-zero input.
-
The buy function does not accept or enforce a minimum output parameter.
-
The buy function lacks access control for private parties and the final price can be inflated by unclaimable donations.
Seen in 1 report
-
The buy function never compares the current timestamp with the sale's end time.
Seen in 1 report
-
The buy function omitted a check on the islisted flag before processing a purchase.
Seen in 1 report
-
The buy function only checks that the new item count does not exceed the final count, so a zero-quantity buy after the sale still runs the payout branch.
Seen in 1 report
-
The buy function reverts instead of handling a purchase that would exceed the final ID, letting an attacker block others.
Seen in 1 report
-
The buy function transfers the NFT before collecting payment, creating a callback window.
Seen in 1 report
-
The buy token variable was overwritten with the plain staked token address, so the wrapping branch never ran.
Seen in 1 report
-
The buy-for-another-user path updates the same last-trade timestamp used for the seller's lock.
Seen in 1 report
-
The buyout check requires a minimum duration increase that is incompatible with short-duration liens.
Seen in 1 report
-
The buyout does not reset the lien's payee field to zero or to the new owner.
Seen in 1 report
-
The buyout flow burns the old lien and decreases the vault slope but creating the new lien does not increase it.
Seen in 1 report
-
The buyout path only decreases the selling vault's open-lien count and never increments the buying vault's count.
-
The buyout start did not specify which fractions to take and took all held fractions.
Seen in 1 report
-
The buyout transfers the lien without calling the function that decrements the vault's per-epoch lien counter.
Seen in 1 report
-
The buyout updates lien terms but does not adjust the public vault's slope.
Seen in 1 report
-
The byte slice length was calculated as end index minus start index, omitting the plus one.
Seen in 1 report
-
The cache guard uses a membership test instead of checking that the previous transaction is the immediate predecessor in the cached order.
Seen in 1 report
-
The cache key for the inclusion-proof check omits the KZG commitments, so results are reused across sidecars with different commitments.
-
The cached last file-choose event was not reset on cross-document navigation.
Seen in 1 report
-
The cached previous agent id is never updated inside the loop, so the cached address can be stale or uninitialised.
-
The cached stored total assets does not include unlocked rewards from the current cycle, so subtracting a withdrawal causes an underflow.
-
The cached total value was not refreshed before calculating LP tokens on deposit.
Seen in 1 report
-
The Cairo callback uses an assert for handler validation, which reverts on failure, whereas the Solidity version returns false.
Seen in 1 report
-
The Cairo implementation of the settlement function omits the input validation present in the Solidity version.
Seen in 1 report
-
The calculated tree root hash is never assigned to the named storage root return value, so the function always returns nil.
Seen in 1 report
-
The calculation divided by a power of ten based on decimals without checking the token had at most 18.
Seen in 1 report
-
The calculation of the current position omits the queued pending size delta.
-
The calculation of the deduction incorrectly divides by the share instead of multiplying.
-
The calculation sums all pool reserves without separating protocol-owned shares from user deposits.
-
The calendar override is keyed to whole UTC days with no way to set intraday start or end times, so it cannot match New York-aligned feed closures.
-
The calendar setter never validates that the combined weekend and holiday override freeze window fits inside the maximum allowed mark staleness.
-
The callback endpoint accepted unauthenticated requests that replaced merchant settings with attacker-controlled values.
Seen in 1 report
-
The callback functions only update transaction status on failure and do not return locked or burned tokens to the sender.
-
The callback paid out immediately without handling a reverting recipient, allowing forced retries.
Seen in 1 report
-
The callback reports only the quote token amount and omits the excess quote token used to cover rounding.
Seen in 1 report
-
The caller passed the account's current sequence number to commit_transaction instead of one less, so cleanup deleted the current transaction too.
Seen in 1 report
-
The caller trusts the swapped amount returned alongside an error instead of resetting it.
Seen in 1 report
-
The caller's address is used as the refund address without checking whether it is a contract that can handle refunds on the other chain.
-
The caller-supplied amount is used as the source of truth across transfer, cap validation and minting instead of measuring the post-transfer balance delta.
Seen in 1 report
-
The callLoan function calculates late fees only on the current overdue period, not on all missed payment intervals.
-
The campaign start time is stored but never validated as a lower bound.
-
The cancel action lacks permission checks and can be used to bypass the permission check on the mark-as-paid action.
Seen in 1 report
-
The cancel check treats the expired state as final even though it depends on a mutable grace period.
Seen in 1 report
-
The cancel function did not check that the transfer's status was still on hold before cancelling and refunding.
Seen in 1 report
-
The cancel function does not reduce the all-vest-at state, leaving the vesting end block artificially high.
Seen in 1 report
-
The cancel function reads the index from the price checkpoint trace instead of the timestamp trace that indexes the requests tree.
Seen in 1 report