In-depth lesson · Business logic
Typical fixes
Every point the Business logic reports back under this heading, best-backed first, each with the reports it is seen in.
-
Check that the named controller consented before enqueuing a redeem request.
-
Claim the receiver's pending rewards before increasing their average start time, and ignore dust deposits when resetting it.
-
Configure the billing public key and verify purchase receipt signatures in the native plugin.
-
Decode unit and compact types as no-ops to match the runtime.
Seen in 2 reports
-
High -
High
-
-
Decrement the global cumulative earmarked counter in the force-repay path.
-
Derive the minimum output from a manipulation-resistant source rather than the current pool state.
Seen in 2 reports
-
Do not gate whole-pool settlement liveness on a latch that untrusted order flow can set, and require a timelocked recovery.
Seen in 2 reports
-
High -
High
-
-
End holiday overrides at the New York market reopen rather than at midnight UTC.
Seen in 2 reports
-
Medium -
Medium
-
-
Enforce the same maximum line length in the cookie jar writer as the reader, counting domain and path.
-
Keep the larger of the existing Senior mark and the recap target when recapitalising a wiped pool.
-
Keep the protocol treasury address out of the execution-config digest, or version the config separately, so a treasury rotation does not invalidate pending orders.
Seen in 2 reports
-
Only advance the stored Transmuter balance by the portion of cover actually consumed.
-
Only drop a preimage reference on failure paths where the scheduler actually took the reference.
-
Pass true for the extra-incentive claim flag in the routine claim path and override the internal claim hook in each strategy.
-
Pay the liquidator base fee unconditionally from the gross seizure.
-
Preserve the stored Senior high-water mark when recapitalising a wiped pool.
Seen in 2 reports
-
Low -
Low
-
-
Put a lower bound on pool depth and cap the price-impact charge relative to the notional being closed.
-
Rate limit on the real connection address rather than client-supplied forwarding headers.
-
Re-evaluate the insolvency latch when solvency is restored and count locked margin of opposing positions.
Seen in 2 reports
-
High -
High
-
-
Recompute the liquidation reserve to the new target on every open and increase, and let the settlement sidecar move collateral back out of the reserve.
Seen in 2 reports
-
Medium -
Medium
-
-
Recompute the transaction ID from the signed transaction data on the DA layer instead of trusting the submitted field.
-
Reduce the global cumulative earmarked counter in the forced repayment routine as the normal repay path does.
-
Reject a minimum collateralisation below the existing lower bound.
Seen in 2 reports
-
Reject a redeem whose computed assets floor to zero.
Seen in 2 reports
-
Remove array elements properly and rebuild the cache before dependent functions run.
Seen in 2 reports
-
Screen opens against the position projected through the account's queued orders.
Seen in 2 reports
-
Low -
Low
-
-
Store an immutable per-period snapshot instead of a mutable timestamp-keyed checkpoint.
Seen in 2 reports
-
High
-
High
-
-
Store the rate that applied when each deposit arrived instead of reading the live rate at release.
Seen in 2 reports
-
Track the exact shares a rescue moved rather than a single boolean, and check the flag in the request path.
-
Treat a failed price read as an error state with a retry rather than a zero price, and block the flow until a price is known.
Seen in 2 reports
-
Medium -
Medium
-
-
Validate trigger prices against a view that does not revert when the engine mark is ahead of the accepted basket.
Seen in 2 reports
-
Low -
Low
-
-
Verify the webhook signature against the payload and record processed event IDs to reject replays.
-
Accept and enforce a user-specified minimum output on claim and withdraw.
-
Accept both SPL Token and Token 2022 program IDs instead of hardcoding one.
Seen in 1 report
-
Account for fresh post-reset exit balances when handling vested pending unstakes.
-
Account for losses in the underlying strategy when calculating deposit shares.
-
Account for past changes to the epoch length when calculating the next epoch's start time.
Seen in 1 report
-
Add a source-equals-destination guard on the hold release arm of the event scan.
-
Add a timelocked submission function for strategy removal.
-
Add an owner sweep for tokens sent directly to the tranche vault above recorded escrow obligations.
-
Add rate limiting and extra verification so unauthenticated requests cannot lock an account by identifier alone.
Seen in 1 report
-
Add rate limiting, CAPTCHA or account lockout to the login endpoint.
Seen in 1 report
-
Add timelocks and quorum requirements so borrowed voting power cannot pass a proposal in one transaction.
Seen in 1 report
-
Add unassigned earnings to the accumulator before comparing it with the bad debt.
-
Add upper and lower bounds to the emission rate parameter.
Seen in 1 report
-
Agree on one handler address encoding and check it before marking the message consumed.
Seen in 1 report
-
Apply full normalisation before availability checks and registration.
-
Apply rewards for the elapsed interval before assigning the new rate.
-
Apply the amplification factor only where it is valid, rather than compounding it on an already-grown exchange price.
-
Apply the first-party trust check before honouring a caller-supplied transition type.
Seen in 1 report