Skip to content

fix: stop reporting outcomes the tooling did not observe - #22

Merged
SyedAsadKazmi merged 1 commit into
mainfrom
fix/report
Aug 4, 2026
Merged

fix: stop reporting outcomes the tooling did not observe#22
SyedAsadKazmi merged 1 commit into
mainfrom
fix/report

Conversation

@aelmanaa

@aelmanaa aelmanaa commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This pull request improves the clarity, reliability, and safety of deployment and diagnostic scripts for token pools, with a particular focus on how token decimals and symbols are resolved, allowlist enforcement is reported, and diagnostics are presented. The changes add more robust error handling, stricter checks, and clearer user guidance in both deployment and operational scripts.

Deployment and Pool Configuration Improvements:

  • Decimals resolution for pools is now stricter: the pool will only deploy if the token’s decimals() and an explicit DECIMALS value (when both are provided) agree; otherwise, deployment fails. The fallback logic is centralized in DeploymentUtils._resolveTokenDecimals, and all scripts and docs are updated to reflect this behavior. [1] [2] [3] [4] [5] [6]
  • Adoption scripts now require a token symbol either from the token contract or via explicit TOKEN_SYMBOL, preventing ambiguous or colliding registry entries.

Allowlist Diagnostics and Enforcement:

  • Allowlist scripts now explicitly check and report whether allowlist enforcement is enabled on pool hooks, clarifying the meaning of an empty allowlist and preventing misinterpretation. Errors in reading enforcement state are now surfaced and abort the script with a clear message. [1] [2]
  • The allowlist update script now requires at least one address to be added or removed, preventing silent no-op executions due to unset environment variables.

Diagnostics and User Guidance:

  • The preflight transfer diagnostic script now clearly displays the simulated sender and warns users to set ORIGINAL_SENDER explicitly, ensuring the simulation matches the actual sender and preventing false positives. [1] [2] [3] [4]
  • Error handling and user feedback are improved throughout, including more informative logging for lockbox and finality config scripts and clearer error propagation. [1] [2]

Codebase Maintenance:

  • Unused imports are removed and utility imports are updated for clarity and maintainability.

Let me know if you want to discuss any of these changes in detail or need help understanding how they affect your workflow!

Ten places where a script answered a question it had not asked, or reported
success it had not established. They share one shape: a call that fails, or
returns nothing, is read as a fact about the chain rather than as a failed read.

The allowlist check is the sharpest. `checkAllowList` is a no-op while the
allowlist is disabled, so it returns without reverting for every address, and
reading that as "permitted" answered yes for anybody, 0x0 included, on the one
command an operator runs to confirm a restriction is in force. It now reads the
enforcement state first and says which of the three situations it found. The
allowlist listing had the same ambiguity: an empty list means every sender is
permitted when the hooks were deployed without one, and nobody may send when an
enforced list was emptied. The listing now names the enforcement state outright,
so an enforced empty list reads as what it is instead of being inferred from
the absence of a warning.

The pool deploys resolve decimals from the token when decimals() answers and
from an explicit DECIMALS otherwise; decimals() is optional in ERC20 and the
pool takes the value as a constructor argument by design, treating an on-chain
read as a cross-check only. What changed is that the value is never guessed:
with both sources present they must agree (the pool constructor's own
InvalidDecimalArgs check, surfaced before the broadcast with a message that
names the fix), and with neither the deploy stops instead of substituting
something. The number is immutable and scales every amount the pool moves, so
a wrong one is wrong in a way nothing downstream can detect.

The transfer preflight simulated the receiver as the sender whenever
ORIGINAL_SENDER was unset, which is the field the source pool gates on, so a
clean GO could be followed by a live SenderNotAllowed. The sender it simulated
is now printed with the inputs and named in the verdict.

The rest: an allowlist update with neither list set broadcast an empty change
and reported success; adopting a token that supplied no usable symbol stored it
under the literal "unknown", where the next such token overwrote it, and the
TOKEN_SYMBOL fallback covers a symbol() answering the empty string the same as
one that reverts, since telling an operator to set a variable and then ignoring
it is the same defect one layer down; the pool
version resolver told operators their pool was not a pool when the read had
several possible causes, and now separates that from the case where nothing is
deployed at the address, which is definite; the roles audit accepted anything
with code as a Safe, so a declared threshold of zero reconciled clean against a
contract that answers no Safe getter; a lockbox whose token could not be read
printed nothing at all; and the finality read printed an error and exited zero,
telling any wrapper checking the exit code that the read had succeeded.
@aelmanaa
aelmanaa requested review from a team as code owners August 4, 2026 15:17
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

👋 aelmanaa, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@SyedAsadKazmi
SyedAsadKazmi merged commit f546ffa into main Aug 4, 2026
12 checks passed
@SyedAsadKazmi
SyedAsadKazmi deleted the fix/report branch August 4, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants