Skip to content

Feat: Rewards server poc#279

Merged
karacurt merged 9 commits intomainfrom
feat/sum-782-rewards-server-poc
Feb 26, 2026
Merged

Feat: Rewards server poc#279
karacurt merged 9 commits intomainfrom
feat/sum-782-rewards-server-poc

Conversation

@karacurt
Copy link
Contributor

@karacurt karacurt commented Feb 19, 2026

Issue: resolves: https://linear.app/game7/issue/SUM-782/rewards-with-serverid-poc

🐵 Description

This pull request introduces a new RewardsFactory contract for managing the deployment of per-server RewardsServer contracts, 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:

  • Added RewardsFactory contract (contracts/upgradeables/soulbounds/RewardsFactory.sol) that allows deploying new RewardsServer contracts as beacon proxies, registering them with the RewardsManager, and managing ownership and beacon configuration. Includes access control, error handling, and event emission for key actions.

Deployment automation:

  • Introduced a deployment script (scripts/deployRewardsManager.ts) that automates the process of deploying the RewardsServer implementation, RewardsManager (UUPS proxy), initializing the beacon, deploying the RewardsFactory, and wiring up permissions. This script streamlines setup for both local and testnet environments.

Testing and validation:

  • Added a comprehensive test suite (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:

  • I have added tests proving my fix is effective or that my feature works
  • Contract deployed to testnet(only for new contracts)

@linear
Copy link

linear bot commented Feb 19, 2026

@karacurt karacurt changed the title Feat/sum-782-rewards-server-poc Feat: Rewards server poc Feb 19, 2026
@karacurt karacurt self-assigned this Feb 19, 2026
@openzeppelin-code
Copy link

openzeppelin-code bot commented Feb 19, 2026

Feat: Rewards server poc

Generated at commit: 113b3acbdf9b1be2cea5134c7efb6f23fb6306e0

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
3
0
10
41
56
Dependencies Critical
High
Medium
Low
Note
Total
1
0
0
0
0
1

For more details view the full report in OpenZeppelin Code Inspector

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

@ogarciarevett ogarciarevett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After talk in slack We agreed to:

  1. Rename manager to router
  2. Try to move all the logic from the router to the server contract(if is possible)
  3. ServerId change it to be a int8

Copy link
Collaborator

@ogarciarevett ogarciarevett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@karacurt karacurt merged commit 00a3b82 into main Feb 26, 2026
1 check passed
@karacurt karacurt deleted the feat/sum-782-rewards-server-poc branch February 26, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants