code-423n4 / redacted-bug-bounty

13 stars 9 forks source link

Dinero Bounty Details

Note for participants: The sponsor's repo, scope definition, and contents herein are all subject to change.

Publicly Known Issues

Note: We have acknowledged all findings in referenced Audits and have either fixed them or have mitigated them. These functions are required for the protocol to work as intended.

Pirex ETH Overview

Pirex ETH is built on top of the Redacted DAO’s Pirex platform and forms the foundation of the Dinero protocol. It is a two-token system built around ETH staking, consisting of pxETH and apxETH, tailored for different user preferences. This design gives users a choice: pxETH for liquidity or apxETH for boosted ETH staking yield.

pxETH and apxETH

When depositing ETH, users can choose between holding pxETH or depositing to an auto compounding rewards vault for apxETH.

Deposits and the ETH Buffer

Most ETH deposited into the Dinero protocol via Pirex ETH is staked on the Ethereum network. However, a small fraction remains in an "ETH buffer" instead of being staked. This buffer facilitates smooth staking and unstaking, allows faster ETH withdrawals when it has funds, and will support self-contained meta transactions through the Redacted Relayer RPC in the future.

Withdrawals

There are limits on the rate at which validators can enter and exit the Ethereum network, based on the total number of validators. Therefore, if there is a significant ETH unstaking queue, this can hamper the timeliness of ETH withdrawals from the Dinero protocol from the spinning down of validators. In these circumstances, an incentivized withdrawal pool can be used to improve pxETH liquidity from ETH unstaking.

Users can deposit ETH into a pool and receive rewards whilst they provide liquidity to that pool. Where there is an unstaking queue and ETH from the spinning down of validators is not readily available, ETH from this pool is provided to users in exchange for pxETH, with the exchange rate or price being determined by demand for ETH from the pool. As pxETH is redeemed and validators are spun down, ETH is replenished in the pool. Depositors into the withdrawal pool therefore receive rewards in exchange for potential ETH illiquidity.

As pricing depends on the demand for ETH in the pool, rewards on deposited ETH increase during periods of high demand, allowing the pool to scale when demand is high. This makes liquidity provision more efficient and cost effective.

Yield Stripping (Coming Soon)

Yield from apxETH can be tokenized via yield stripping. For example, if a user wants to tokenize 1 year of yield for 1 pxETH deposited in the rewards vault, they can exchange 1 pxETH for:

Users decide how many reward cycles they tokenize. These tokens can be used throughout DeFi and are tradable. Yield stripping provides users the ability to leverage, hedge, and speculate on future pxETH price and future yield.

Links

Scope

This is the complete list of what's in scope for this contest:

Contract SLOC Purpose Libraries used
src/AutoPxEth.sol 489 This contract enables autocompounding for pxETH assets and includes various fee mechanisms. openzeppelin-contracts, solmate
src/DineroERC20.sol 77 A Standard ERC20 token with minting and burning with access control. openzeppelin-contracts, solmate
src/OracleAdapter.sol 112 This contract facilitates interactions between PirexEth, the reward recipient, and oracles for managing validators. openzeppelin-contracts
src/PirexEth.sol 552 This contract manages various interactions with pxETH, such as deposits, redemptions, and fee adjustments. solmate
src/PirexEthValidators.sol 1063 This contract includes functionality for handling validator-related operations and deposits. openzeppelin-contracts, solmate
src/PirexFees.sol 86 This contract manages the distribution of protocol fees to assigned recipient. openzeppelin-contracts, solmate
src/PxEth.sol 51 This contract manages the PxEth token, the main token for the PirexEth system used in the Dinero ecosystem. It extends the DineroERC20 contract and includes additional functionality. None
src/RewardRecipient.sol 158 This contract manages rewards for validators and handles associated functionalities. openzeppelin-contracts
src/interfaces/IDepositContract.sol 24 This is the Ethereum 2.0 deposit contract interface. None
src/interfaces/IOracleAdapter.sol 18 This interface defines the methods for interacting with OracleAdapter. None
src/interfaces/IPirexEth.sol 61 This interface defines the methods for interacting with PirexEth. None
src/interfaces/IPirexFees.sol 23 This interface defines functions related to the distribution of fees in the Pirex protocol. None
src/interfaces/IRewardRecipient.sol 40 This interface defines functions related to dissolving and slashing validators in the Pirex protocol. None
src/libraries/DataTypes.sol 87 This library provides data structures and enums crucial for the functionality of the Pirex protocol. None
src/libraries/Errors.sol 204 This interface defines errors that might occur in the PirexEth system. None
src/libraries/ValidatorQueue.sol 347 This library provides functions for adding, swapping, and removing validators in the validator queue. It also includes functions for popping validators from the end of the queue, retrieving validator information, and clearing the entire queue. openzeppelin-contracts
src/tokens/UpxEth.sol 127 This is a semi-fungible ERC1155 token contract with minting and burning capabilities, using AccessControl for role-based access. openzeppelin-contracts, solmate
Total 3519

This is a list of mainnet contract deployments:

Contract Documentation Mainnet Deployment
src/AutoPxEth.sol AutoPxEth.sol 0x9Ba021B0a9b958B5E75cE9f6dff97C7eE52cb3E6
src/OracleAdapter.sol OracleAdapter 0x15f1203aFb3Ba2BFf383Dc0a3d5a781DedEB44fC
src/PirexEth.sol PirexEth.sol 0xD664b74274DfEB538d9baC494F3a4760828B02b0
src/PirexFees.sol PirexFees.sol 0x177D685384AA1Ac5ABA41b7E649F9fA0Be717fdb
src/PxEth.sol PxEth.sol 0x04C154b66CB340F3Ae24111CC767e0184Ed00Cc6
src/RewardRecipient.sol RewardRecipient.sol 0xCd615270aB3a7a3A262A4E49935D002278C76b78
src/libraries/ValidatorQueue.sol (Implementation) ValidatorQueue.sol 0x9E0d7D79735e1c63333128149c7b616a0dC0bBDb
src/tokens/UpxEth.sol (Implementation) UpxEth.sol 0x5BF2419a33f82F4C1f075B4006d7fC4104C43868

Out of scope

Contracts:

Vendor Libraries:

Additional Context

Main invariants

Scoping Details

Miscellaneous

Employees of Redacted Finance, and employees' family members are ineligible for bounties.