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.
-
Normalise the name once and use the same node for owner and records queries.
-
Observe PaymentRequestSpec updates so the signed amount matches the amount shown in the trusted dialog.
Seen in 1 report
-
Override claimRewards to call the reward controller for the relevant assets.
Seen in 1 report
-
Override maxWithdraw and maxRedeem to account for the minimum stake period.
Seen in 1 report
-
Override the throttle identity so it does not trust the client-supplied forwarding header.
Seen in 1 report
-
Paginate on a unique tiebreaker and treat a truncated page as an error rather than a cursor.
-
Pass a minimum-shares-out or slippage bound when withdrawing from the external vault.
Seen in 1 report
-
Pass a non-zero minimum shares out and verify shares received.
Seen in 1 report
-
Pass the calculated revenue into the drip function instead of re-reading the stored value.
-
Pass the caller into the sender field of the event.
-
Pass zero as the additional revenue when activating a topic after a stake.
-
Perform an ownership check such as a DNS record or file before reserving a custom domain.
Seen in 1 report
-
Perform the password reuse comparison on the server instead of trusting a client-supplied flag.
Seen in 1 report
-
Preserve or return the shortfall instead of burning the position for the capped amount.
-
Prevent an account from changing its email to one already used by another account.
Seen in 1 report
-
Prevent harvest from resetting the finish time after distribution has been marked finished.
Seen in 1 report
-
Propagate the API error to the caller instead of only logging it.
Seen in 1 report
-
Properly adjust the counter and active samples when increasing sample memory.
-
Pull funds back from the strategy before transferring them out.
Seen in 1 report
-
Quantum-align minted amounts and leaves, or enforce a minimum, so remainders are claimable.
-
Range-check latitude and longitude before saving.
-
Rate limit confirmation code attempts and shorten the code validity window.
Seen in 1 report
-
Re-check the company-email restriction on the second step and bind the email to the first step's session.
Seen in 1 report
-
Re-check the trust level of all participants when someone is added to a conversation.
Seen in 1 report
-
Re-check the username policy and whether changes are allowed on the profile update endpoint.
Seen in 1 report
-
Re-evaluate the voting threshold after updating vote counts on a transfer.
Seen in 1 report
-
Re-read the live registry owner, resolver and records before submitting a migration.
-
Re-validate existing links against the current share settings on every download.
Seen in 1 report
-
Re-validate group ownership immediately before allowing deletion.
Seen in 1 report
-
Re-validate subscription status during cross-device session handoff.
-
Re-validate the verification status on the backend before serving restricted routes.
-
Read the token's actual decimals instead of dividing by a hardcoded factor.
-
Recalculate the discount server-side from the promo code instead of trusting the request amount.
-
Recalculate the order price server-side from stored product data.
Seen in 1 report
-
Recalculate the total from the authoritative product price and current cart state at checkout.
Seen in 1 report
-
Recompute the multisig address from signers, threshold and nonce and compare it with the indexer record.
Seen in 1 report
-
Recompute the unassigned cash cap upward when the terminal delta recovers.
Seen in 1 report
-
Record a checkpoint at a specific block number when calculating voting power.
Seen in 1 report
-
Record carry and settlement fields in the commitment effects on the open and increase branch.
-
Record the clipped ownerless amount so later revenue restores it.
-
Refund the actual unspent amount rather than absorbing it into the fee.
Seen in 1 report
-
Register the user's principal before paying the execution fee, or make the recovery mechanism cover fee shortfalls.
Seen in 1 report
-
Reject auth dates in the future as well as dates older than the maximum age.
Seen in 1 report
-
Reject duplicate shareholders in the shareholder-setting function.
Seen in 1 report
-
Reject expiration dates that are not in the future.
Seen in 1 report
-
Reject requests with an empty or invalid organisation identifier instead of skipping the quota deduction.
-
Remember the permission request the bubble was created for and act on that request.
Seen in 1 report
-
Require a CAPTCHA token on every registration and treat tokens as single-use.
Seen in 1 report
-
Require a minimum initial liquidity and lock the first LP tokens.
-
Require authentication and authorisation and do not trust client-supplied recipient or content fields.