Skip to content

Fix action.yml severity-value mismatch, add typed events to vulnerable-contract - #1491

Merged
Gbangbolaoluwagbemiga merged 3 commits into
HyperSafeD:mainfrom
springswell:fix/issues-1443-1445
Aug 27, 2026
Merged

Fix action.yml severity-value mismatch, add typed events to vulnerable-contract#1491
Gbangbolaoluwagbemiga merged 3 commits into
HyperSafeD:mainfrom
springswell:fix/issues-1443-1445

Conversation

@springswell

@springswell springswell commented Aug 27, 2026

Copy link
Copy Markdown

Summary

Closes #1443
Closes #1445
Closes #1442
Closes #1444

action.yml typos/language.** Did a full read of action.yml looking for typos and
grammar issues and didn't find any literal ones — the one place text and actual behavior disagreed
was the min-severity input's description, which advertised (critical|high|medium|low|info) as
accepted values. The CLI's own SeverityLevel enum
(tooling/sanctifier-cli/src/commands/analyze.rs) only implements FromStr for
critical/high/medium/low — info isn't real there. scripts/action_inputs.py's
_ALLOWED_SEVERITIES set does accept "info" at the action-input-validation layer, so
min-severity: info would pass that check and then fail one step later inside the actual
sanctifier analyze invocation with "unknown severity: info" — a confusing two-stage failure for
a value the action's own description told the user was valid. Fixed the description to match
reality. Left scripts/action_inputs.py's validation set unchanged since it's outside this issue's
named file — happy to also tighten it as a follow-up if wanted.

event emissions.** Neither set_admin nor set_admin_secure (the only two
state-changing entrypoints in contracts/vulnerable-contractfail_explicitly panics without
touching storage) emitted any event, so an indexer had no way to observe an admin change other than
diffing instance storage directly. Adds an AdminSetEvent #[contracttype] struct and publishes it
from both functions, following the same contracttype + events().publish((topic,), data)
convention already used elsewhere in this workspace (e.g. contracts/flashloan-token) rather than a
loose, unlabeled tuple an indexer would have to guess the shape of.

Test plan

  • cargo check -p vulnerable-contract passes clean
  • Manual review against each issue's acceptance criteria

Closes HyperSafeD#1443

The min-severity input's description advertised (critical|high|medium|
low|info) as accepted values, but the CLI's own SeverityLevel enum
(tooling/sanctifier-cli/src/commands/analyze.rs) only implements
FromStr for critical/high/medium/low — "info" isn't a real accepted
value there. scripts/action_inputs.py's _ALLOWED_SEVERITIES set does
accept "info" at the action-input-validation layer, so passing
min-severity: info would pass that check and then fail one step later
inside the actual `sanctifier analyze` invocation with "unknown
severity: info" — a confusing two-stage failure for a value the action's
own description told the user was valid.

Didn't find any other typos/grammar issues in this file on a full read —
this was the one place text and actual behavior disagreed. Left
scripts/action_inputs.py's validation set unchanged since it's outside
this issue's named file and the fix in action.yml already stops the
misleading advertisement; happy to also tighten
_ALLOWED_SEVERITIES if that's wanted as a follow-up.
Closes HyperSafeD#1445

Neither set_admin nor set_admin_secure (the only two state-changing
entrypoints — fail_explicitly panics without touching storage) emitted
any event, so an indexer had no way to observe an admin change on this
contract other than diffing instance storage directly.

Adds an AdminSetEvent #[contracttype] struct and publishes it (topic
symbol_short!("admin_set")) from both functions, following the same
contracttype + events().publish((topic,), data) convention already used
elsewhere in this workspace (e.g. contracts/flashloan-token) rather than
publishing a loose, unlabeled tuple an indexer would have to guess the
shape of.
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

@springswell is attempting to deploy a commit to the gbangbolaoluwagbemiga's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@springswell Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Gbangbolaoluwagbemiga
Gbangbolaoluwagbemiga merged commit b0f8685 into HyperSafeD:main Aug 27, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants