-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58c2f2e
commit 2724ba4
Showing
7 changed files
with
199 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
mainnet-contracts/src/l2-contracts/L2RewardManagerStorage.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity >=0.8.0 <0.9.0; | ||
|
||
/** | ||
* @title L2RewardManagerStorage | ||
* @author Puffer Finance | ||
* @custom:security-contact security@puffer.fi | ||
*/ | ||
abstract contract L2RewardManagerStorage { | ||
/** | ||
* @custom:storage-location erc7201:L2RewardManager.storage | ||
* @dev +-----------------------------------------------------------+ | ||
* | | | ||
* | DO NOT CHANGE, REORDER, REMOVE EXISTING STORAGE VARIABLES | | ||
* | | | ||
* +-----------------------------------------------------------+ | ||
*/ | ||
|
||
struct RateAndRoot { | ||
uint128 ethToPufETHRate; | ||
bytes32 rewardRoot; | ||
} | ||
|
||
struct RewardManagerStorage { | ||
/** | ||
* @notice Mapping to track the exchange rate from ETH to pufETH and reward root for each unique epoch range | ||
*/ | ||
mapping(uint64 startEpoch => mapping(uint64 endEpoch => RateAndRoot)) rateAndRoots; | ||
/** | ||
* @notice Mapping to track claimed tokens for users for each unique epoch range | ||
*/ | ||
mapping(uint64 startEpoch => mapping(uint64 endEpoch => mapping(address account => bool claimed))) claimedRewards; | ||
/** | ||
* @notice Mapping to track the custom claimer set by specific accounts | ||
*/ | ||
mapping(address account => address claimer) customClaimers; | ||
} | ||
|
||
// keccak256(abi.encode(uint256(keccak256("L2RewardManager.storage")) - 1)) & ~bytes32(uint256(0xff)) | ||
bytes32 internal constant _REWARD_MANAGER_STORAGE_LOCATION = | ||
0x7f1aa0bc41c09fbe61ccc14f95edc9998b7136087969b5ccb26131ec2cbbc800; | ||
|
||
function _getRewardManagerStorage() | ||
internal | ||
pure | ||
returns (RewardManagerStorage storage $) | ||
{ | ||
// solhint-disable-next-line | ||
assembly { | ||
$.slot := _REWARD_MANAGER_STORAGE_LOCATION | ||
} | ||
} | ||
} |
Oops, something went wrong.