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
Section titled “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
Section titled “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
Section titled “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.
Use these calls here. Simulations preview the current state; each confirmed call is a separate transaction.
0x4ab87f1DBDF6f741ED8BF481C7346103a86f1068STRINGLIB.CheckAcronym(string _A, string _B)Read
Open this function to load its call form.
STRINGLIB.CheckPalindrome(string S)Read
Open this function to load its call form.
Rewards / costs
Section titled “Rewards / costs”- Cost: none directly.
- Reward: whatever the word-game round pays winners.
Requirements & gating
Section titled “Requirements & gating”- Strings ≥ 3 chars or
MinimumLength3reverts.
Where it connects
Section titled “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
Section titled “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.