Skip to content

STE-50: Tokens refusals are named from the Tokens ABI - #48

Merged
Lin1er merged 1 commit into
mainfrom
fix/50-tokens-error-names
Sep 17, 2026
Merged

Lin1er merged 1 commit into
mainfrom
fix/50-tokens-error-names

Conversation

@Lin1er

@Lin1er Lin1er commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Linear: STE-50 · ACC by Axel 2026-09-17 · reviewers @axelmatsama @fable

Problem

ContractCallError resolved error names from the registry table for anything it did not recognise. The STE-27 rehearsal logged the Tokens gate refusing to licence a DANGEROUS version (#5 NotVerified) as VersionAlreadyExists (#5, registry).

Fix

  • TOKENS_ERRORS added, taken from contracts/tokens/src/data.rs::TokenError.
  • REGISTRY_ERRORS gains STE-16: verdict mendarat on-chain — escrow kanonik dengan USDC asli #10–13. STE-44 added these upgrade errors and they were never copied.
  • Entrypoints are listed per contract. A name exported by one contract resolves on its own. A shared name (get_admin, the upgrade functions) or an unknown one reports contract not identified and lists each candidate. It never guesses.
  • simulate() / invoke() take an optional contract=.
  • Tests read all three tables back from the Rust enums, so an uncopied variant turns CI red.

Tests

  • Pipeline: 671 passed, 9 skipped.
  • API: 142 passed.

E2E (testnet, read-only simulate against Tokens v2, nothing signed)

call main this branch
mint_license on DANGEROUS release-notes 2.0.0 VersionAlreadyExists (#5, registry) NotVerified (#5, tokens)
mint_verified on the same version — NotSafeVerdict (#4, tokens)

Evidence: docs/evidence/ste-50-tokens-error-names-2026-09-17.json.

…red name is not guessed

ContractCallError picked the error table from a function-name map that
knew registry and escrow only, and fell back to the registry for anything
else. The STE-27 rehearsal logged the Tokens gate refusing to licence a
DANGEROUS version (#5 NotVerified) as "VersionAlreadyExists (#5, registry)".

- TOKENS_ERRORS from contracts/tokens/src/data.rs::TokenError.
- REGISTRY_ERRORS gains 10-13, added by STE-44 and never copied.
- Entrypoints are listed per contract. A name only one contract exports
  resolves on its own; a name several export (get_admin, the STE-44 upgrade
  functions) or an unknown one reports "contract not identified" with each
  candidate's name, instead of silently borrowing the registry's.
- simulate() and invoke() take an optional contract= for the shared names.
- Tests read all three tables back from the Rust enums, so a new variant
  that is not copied fails CI instead of mislabelling a failure in prod.

Decision: no guess for shared names. A wrong name sent the operator after
a duplicate version when the real cause was the VERIFIED gate; "cannot
tell, here are both" costs one extra look and never points the wrong way.

E2E: read-only simulate against Tokens v2. mint_license on DANGEROUS
release-notes 2.0.0 is NotVerified (#5, tokens); main says
VersionAlreadyExists (#5, registry). mint_verified is NotSafeVerdict (#4,
tokens). Pipeline: 671 passed, 9 skipped.
@vercel

vercel Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sterish Ready Ready Preview Sep 17, 2026 7:27am UTC

@Lin1er
Lin1er merged commit 827b57f into main Sep 17, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — 9330d42a Deployed Sep 17, 2026 by vercel[bot]
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.

1 participant