I wrote this ERC20-based liquid staking contract built in Solidity for Real World Gaming(RWG) "Realbet" Platform.
This project demonstrates production-ready staking architecture designed to reward long-term holders and active governance participants.
Mainnet Deployment: 0x25b8176566c2f762820ef6eddf3fc58b23dcb8b6
Audit Report: https://staging.vip.realworldgaming.io/$REAL_Zokyo_audit_report_Jan27th_2025.pdf
-
Liquid Staking: Stakers receive an ERC20 token (sREAL) representing their staked position, allowing them to utilize their capital elsewhere (DeFi, Govenance) while still earning rewards.
-
Tiered Staking System: Multiple tiers with different lock-up periods and reward multipliers, incentivizing long-term commitment.
-
Epoch-Based Rewards: Rewards are calculated and distributed on a per-epoch basis (e.g., weekly, monthly, etc.), allowing for more frequent and consistent rewards.
-
Vote-Coupled Rewards: Integrates a voting mechanism where users must participate in governance to claim their rewards for a given epoch, preventing passive farming and encouraging active participation.
-
Role-Based Access Control: Utilizes OpenZeppelin's AccessControl for granular permissions (e.g., EPOCH_MANAGER_ROLE, DEFAULT_ADMIN_ROLE).
-
Pausable & Secure: Implements Pausable for emergency stops and ReentrancyGuard to prevent common attack vectors.
The system is centered around the TokenStaking contract which inherits from ERC20 to create the liquid sREAL token. Users stake their $REAL tokens and are minted $sREAL. Rewards are calculated based on their "effective amount" (stake amount * tier multiplier) as a proportion of the total effective supply for each epoch in which they actively voted.
npm install
npx hardhat test