Skills, Token Bound Accounts & Reroll
ROBINDUDES combines on-chain skill progression with ERC-6551 Token Bound Accounts (TBAs). Each NFT acts as an independent RPG character whose abilities provide strategic advantages during virtual trading competitions.
1. The 4 Core In-Game Skills
Skills are registered on-chain in SkillRegistry.sol and mapped directly to each NFT's tokenId:
Surfaces real-time institutional smart-money flow analytics (large wallet accumulations, net exchange flows, and directional convictions) directly within the trading dashboard.
Grants additional starting virtual USDC (VUSD) trading capital credited to the NFT at the start of each weekly epoch.
+10% VUSD balance per level above standard starting allocation (e.g. Level 3 grants $13,000 starting VUSD instead of $10,000).Mitigates synthetic slippage penalties and simulated execution fees on large market order fills, preserving profit margins on high-conviction trades.
5% per level (up to a 50% maximum slippage reduction cap).Grants the tactical ability to execute a mid-week bracket switch via PrizePool.useSecondWind, moving the NFT to a different tier without re-entry disqualification.
2. Level Progression & Onboarding
- One-Time Starter Pick: Freshly minted NFTs call
SkillRegistry.claimStarterSkill(tokenId, skillId)to immediately activate their choice of starter ability at Level 1. - Weekly Champion Upgrades: The 1st place finisher in any tier earns a permanent on-chain reward. Calling
WeeklySettlement.claimSkillRewardallows the owner to either upgrade any existing skill by +1 or unlock an unheld catalog skill at Level 1. - Level Cap: Every individual skill is capped at
MAX_LEVEL = 100to prevent arithmetic overflow and long-term balance creep.
3. Skill Rerolling (2-Step Commit-Reveal RNG)
Players wishing to reshuffle their abilities can perform a self-service Reroll via SkillReroll.sol. Because blockchains are public, rerolling uses a strict Commit-Reveal mechanism to prevent front-running and validator manipulation:
Owner calls requestReroll(tokenId, oldSkillId). The contract escrows the fixed rerollPrice $DUDES, commits the 7-day cooldown immediately to prevent fishing, and sets targetBlock = block.number + revealDelayBlocks.
Once targetBlock is mined, anyone calls revealReroll(tokenId). The contract derives randomness from blockhash(targetBlock), selects a replacement skill the NFT does not already hold, burns the escrowed $DUDES, and sets the new skill to Level 1.
If the reveal window expires (>256 blocks old, when blockhash becomes 0), calling reclaimExpiredReroll(tokenId) returns 100% of the escrowed tokens. If the NFT changed ownership mid-flight, _voidAndRefund safely returns tokens to the original requester without mutating the new owner's NFT.
Why Rerolls Reset to Level 1: Rerolling always sets the replacement skill to Level 1 (RESET_LEVEL = 1). This prevents players from "laundering" hard-earned high levels from one skill into another with tokens. Progress can only be earned on the leaderboard, never bought.4. ERC-6551 Token Bound Account (TBA) Architecture
ROBINDUDES uses the canonical ERC-6551 Registry (0x000000006551c19487814612e58FE06813775758) paired with our custom GameAccount.sol implementation:
| Component | Implementation Detail | Security Guarantee |
|---|---|---|
| Account Cloning | Minimal ERC-1167 proxies pointing to GameAccount | Deterministic, gas-free counterfactual addresses precomputed before deployment. |
| Signer Validation | isValidSigner queries IERC721.ownerOf(tokenId) live | Signing rights automatically and seamlessly transfer when the NFT is traded. |
| Signature Support | IERC1271.isValidSignature via SignatureChecker | Supports both standard ECDSA wallet signatures and smart contract wallets. |
| Restricted Execution | execute() allows operation = 0 (CALL) only | DELEGATECALL and CREATE2 are disabled to eliminate proxy storage hijack vectors. |
| Trophy Backpack | IERC721Receiver and IERC1155Receiver hooks | Enables the TBA to hold winner trophies, season badges, and collectibles. |