Conversation
Feat: Rewards server poc
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
There was a problem hiding this comment.
Pull request overview
This pull request introduces a scalable rewards system architecture consisting of a factory pattern for deploying per-server reward contracts. The implementation enables multi-tenant reward management where each server (e.g., Discord server) can have its own isolated treasury, access control, and reward token definitions.
Changes:
- Added RewardsFactory contract for deploying BeaconProxy instances of RewardsServer with per-server admin control
- Added RewardsManager contract as a UUPS-upgradeable coordinator managing multiple servers and handling signature-based claims
- Added RewardsServer contract as an upgradeable-via-beacon treasury that holds whitelisted assets and reward token definitions
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| contracts/upgradeables/soulbounds/RewardsFactory.sol | Factory contract that deploys BeaconProxy instances of RewardsServer and registers them with RewardsManager, with two-step ownership transfer |
| contracts/upgradeables/soulbounds/RewardsManager.sol | UUPS-upgradeable multi-tenant manager coordinating servers, handling signature verification, and orchestrating reward claims across ERC20/721/1155/ETHER |
| contracts/upgradeables/soulbounds/RewardsServer.sol | BeaconProxy-upgradeable per-server treasury managing whitelisted tokens, reward definitions, reservations, and per-server access control |
| scripts/deployRewardsManager.ts | Deployment automation script for setting up the beacon, manager proxy, and factory with proper role assignments |
| test/rewardsManager.test.ts | Test suite covering server deployment, admin actions, token whitelisting, and ERC20 reward claim flow with signature validation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ogarciarevett
left a comment
There was a problem hiding this comment.
After talk in slack We agreed to:
- Rename manager to router
- Try to move all the logic from the router to the server contract(if is possible)
- ServerId change it to be a int8
Issue: resolves: https://linear.app/game7/issue/SUM-782/rewards-with-serverid-poc
🐵 Description
This pull request introduces a new
RewardsFactorycontract for managing the deployment of per-serverRewardsServercontracts, along with a deployment script and a comprehensive test suite. These changes enable a scalable, modular system for managing rewards servers and their associated logic, with robust access control and ownership management.Core contract addition:
RewardsFactorycontract (contracts/upgradeables/soulbounds/RewardsFactory.sol) that allows deploying newRewardsServercontracts as beacon proxies, registering them with theRewardsManager, and managing ownership and beacon configuration. Includes access control, error handling, and event emission for key actions.Deployment automation:
scripts/deployRewardsManager.ts) that automates the process of deploying theRewardsServerimplementation,RewardsManager(UUPS proxy), initializing the beacon, deploying theRewardsFactory, and wiring up permissions. This script streamlines setup for both local and testnet environments.Testing and validation:
test/rewardsManager.test.ts) covering server deployment, access control for admin actions, token whitelisting and treasury management, and the full reward claim flow including signature validation and nonce handling.🙊 Checklist: