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.
-
Checkpoint balances when vault ownership changes.
-
Clamp the body write to the declared message size and discard bytes after the terminator.
Seen in 1 report
-
Clear approvals with the internal approval-clearing routine rather than the public approve function.
Seen in 1 report
-
Clear or validate the name's stored records before reattaching an existing stateful resolver.
Seen in 1 report
-
Clear the compromised flag when an address is restored.
-
Clear the elected accounts array after processing to prevent repeated rewards.
Seen in 1 report
-
Collect LP fees from the separate rewards distributor rather than relying on burnAndCollect.
Seen in 1 report
-
Compare big integer values rather than pointers.
Seen in 1 report
-
Compare finality events against a threshold that accounts for the chain's normal finality lag.
-
Compare the encryption bit between the Local File Header and the Central Directory in minizip.
Seen in 1 report
-
Compare the saved baseline and the form values in the same normalised form.
-
Compare the submitted amount against the server-side cart total before processing payment.
-
Compute capacity from live vault assets and revalidate stored commitments at settlement.
-
Compute the protocol fee share as a percentage rather than dividing by the fee setting.
Seen in 1 report
-
Compute the redemption delta before the earmark call updates the reference balance.
-
Consider sustained price drops when blocking liquidations based on spot price versus TWAP.
Seen in 1 report
-
Constrain the deposited token's mint address to equal the allowed token's mint address.
Seen in 1 report
-
High
-
-
Constrain the webhook lookup by user, channel type and status, and reject duplicate pending addresses.
-
Control rounding in the utilisation percentage so values just under the cap do not display as 100 percent.
Seen in 1 report
-
Convert shares to assets before comparing against asset-denominated tier thresholds.
-
Correct the formula for shares received in single-asset entry.
-
Correct the hardcoded function selectors to match the real signatures.
Seen in 1 report
-
Correct the public liquidation pages to describe uncovered loss as a diagnostic write-off rather than protocol bad debt.
-
Count Unicode code points rather than UTF-16 code units when deciding whether a character is a special key.
Seen in 1 report
-
Cross-check resolver events against the registry's resolver records before rendering them.
Seen in 1 report
-
Deduct the performance fee when calculating invested assets.
-
Derive L2 coin types from the same chain ids in both apps.
-
Derive ownership from the registrant or wrapped owner rather than the v1 registry controller.
-
Derive plan and price server-side from the user's selection rather than trusting client-supplied values.
Seen in 1 report
-
Derive the signed scope from the same row data shown to the operator and do not overload an empty fallback as root scope.
Seen in 1 report
-
Disable confirm when decoding fails, not only when fetching the call bytes fails.
-
Do not accept the course price from the client; look it up server-side at checkout.
Seen in 1 report
-
Do not apply the exchange contribution when the token supply becomes zero.
Seen in 1 report
-
Do not calculate liquidity to burn from pool reserves for V3 pools that support single-sided liquidity.
Seen in 1 report
-
Do not reset the failed-attempt counter on a successful login from the same IP.
Seen in 1 report
-
Do not reuse the registration response token for email verification; issue a separate single-use verification token.
Seen in 1 report
-
Do not treat an inner dispatch error as terminal, or retry the hold release.
-
Emit an event when a deferred refund is credited to the internal ledger and update the NatSpec to match the actual refund flow.
-
Emit the computed credit rather than the function input.
Seen in 1 report
-
Enforce a limit on account creation requests per source in a time window.
-
Enforce a minimum bound on the initial state.y.
-
Enforce a minimum execution window tied to keeper latency and the settlement window.
-
Enforce a minimum quantity of one on the server.
Seen in 1 report
-
Enforce that fixed-size bytes types are between 1 and 32 bytes.
Seen in 1 report
-
Enforce that the sale price stays at or above the peg throughout the trade.
Seen in 1 report
-
Enforce that withdrawal penalties are greater than zero.
Seen in 1 report
-
Enforce the email domain restriction on the server.
Seen in 1 report
-
Enforce the maximum meeting duration on the server.
-
Enforce the maximum sample count inside the inner loop that appends scores.
Seen in 1 report
-
Enforce the password protection rule in the preferences save operation.