Skip to content

Add RewardRecipientGateway source and mainnet addresses#1

Open
mindfreakzerox wants to merge 4 commits into0xmindfreak:mainfrom
mindfreakzerox:add-reward-recipient-gateway
Open

Add RewardRecipientGateway source and mainnet addresses#1
mindfreakzerox wants to merge 4 commits into0xmindfreak:mainfrom
mindfreakzerox:add-reward-recipient-gateway

Conversation

@mindfreakzerox
Copy link

Summary

  • add RewardRecipientGateway source from mainnet (proxy 0xde4a1b2ea88ec03e93aad9d4c5bffeb18687d079; implementation 0x1dffcfd3c2be5e5f3d0e41be8e11c57397e59ca6)
  • add RewardRecipientGatewayStorage
  • document proxy/impl addresses in README

Testing

  • forge fmt
  • forge test (fails locally: missing solmate/mixins/ERC4626.sol in repo; solmate submodule here only has tokens/utils; need to vendor mixins or adjust remapping before tests compile)

Copilot AI review requested due to automatic review settings February 12, 2026 16:11
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

Adds the on-chain (mainnet) RewardRecipientGateway contract source + storage stub to this repo and documents the deployed proxy/implementation addresses for reference.

Changes:

  • Added RewardRecipientGateway.sol source (synced from Sourcify) to forward rewards between standard and institutional PirexEth systems.
  • Added RewardRecipientGatewayStorage.sol with a reserved storage gap for upgrade-safe layout changes.
  • Updated README.md to record mainnet proxy + implementation addresses and the source sync note.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/RewardRecipientGateway.sol Introduces the gateway contract that routes validator operations and splits harvested ETH rewards between two systems.
src/RewardRecipientGatewayStorage.sol Adds an upgrade-friendly storage gap contract used as a base for the gateway.
README.md Documents mainnet deployment addresses and the source provenance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

import {
AccessControlDefaultAdminRulesUpgradeable
} from "openzeppelin-contracts-upgradeable/contracts/access/extensions/AccessControlDefaultAdminRulesUpgradeable.sol";
import {ERC4626} from "solmate/mixins/ERC4626.sol";
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

Importing solmate/mixins/ERC4626.sol will not compile with the current repo layout: lib/solmate/src only contains tokens/ and utils/ (no mixins/). Consider switching the type to an ERC-4626 interface available in this repo (e.g., OpenZeppelin IERC4626), or vendor the missing Solmate mixin and update remappings accordingly so CI builds succeed.

Suggested change
import {ERC4626} from "solmate/mixins/ERC4626.sol";
import {ERC4626} from "solmate/tokens/ERC4626.sol";

Copilot uses AI. Check for mistakes.
// Calculate the rewards that should go to the institutional system based on the total assets ratio
uint256 standardAssets = autoPxEth.totalAssets();
uint256 institutionalAssets = institutionalAutoPxEth.totalAssets();
uint256 institutionalRewards = (institutionalAssets * _amount) / (standardAssets + institutionalAssets);
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

institutionalRewards divides by (standardAssets + institutionalAssets) without guarding against the case where both vaults have totalAssets() == 0, which will revert due to division-by-zero. Add an explicit check for a zero denominator (and decide on a sensible behavior, e.g. revert with Errors.NoRewards() or route all rewards to one system) before performing the ratio calculation.

Suggested change
uint256 institutionalRewards = (institutionalAssets * _amount) / (standardAssets + institutionalAssets);
uint256 totalAssets = standardAssets + institutionalAssets;
// Revert if both vaults manage zero assets to avoid division by zero
if (totalAssets == 0) {
revert Errors.NoRewards();
}
uint256 institutionalRewards = (institutionalAssets * _amount) / totalAssets;

Copilot uses AI. Check for mistakes.
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.

2 participants