Skip to content

STRINGLIB — The Word-Game Engine

One-line pitch: STRINGLIB powers Dysnomia's acronym mini-game: generate random acronyms, validate that a player's phrase matches, check palindromes.

What this is

A utility library (LibStrings) that provides:

  • RandomAcronym(n) — generate a random n-letter acronym (e.g., "ABCDE").
  • CheckAcronym(acronym, phrase) — validate whether a phrase matches the acronym (each word's first letter, in order, equals the acronym).
  • CheckPalindrome(s) — returns true if a string reads the same forward and backward.

Strings must meet a MinimumLength3 rule for most operations — single or double-character strings revert.

If you've played a web3 game before

  • Closest analogy: the validation oracle for a word-game dApp.
  • Or: a helper library like Solady's string utilities, but with game-specific rules.
Dysnomia term What it maps to
STRINGLIB Word-game helpers library
RandomAcronym(n) Generate random letter sequence
CheckAcronym(acronym, phrase) Validate word-game submission
CheckPalindrome(s) Palindrome check

What you actually do with it

  • Submit phrases via the word-game contract — validation runs through STRINGLIB.
  • Don't call STRINGLIB directly as a player — the game contracts wrap it.

Rewards / costs

  • Cost: none directly.
  • Reward: whatever the word-game round pays winners.

Requirements & gating

  • Strings ≥ 3 chars or MinimumLength3 reverts.

Where it connects

Used by whatever contract implements the word-game round logic. Consumes VMREQ-adjacent randomness for acronym generation. Interacts with ACRONYM submissions and USERVOTE tallies.

Quick FAQ

Q: Case-sensitive? A: CheckAcronym typically normalizes case, but precise behavior depends on the implementation — don't assume.

Q: What counts as a "word"? A: Whitespace-separated tokens. Punctuation rules vary.

Q: Why is there a palindrome function? A: Side game or future use case. Not essential to the acronym game — bonus utility.


Want the Solidity? The contract reference lives at technical/docs/lib/STRINGLIB.md.