@@ -11,22 +11,19 @@ contract BackingEigen is OwnableUpgradeable, ERC20VotesUpgradeable {
11
11
IERC20 public immutable EIGEN;
12
12
13
13
/// STORAGE
14
+ /// @dev Do not remove, deprecated storage.
14
15
/// @notice the timestamp after which transfer restrictions are disabled
15
- uint256 public transferRestrictionsDisabledAfter;
16
+ uint256 internal __dreprecated_transferRestrictionsDisabledAfter;
17
+ /// @dev Do not remove, deprecated storage.
16
18
/// @notice mapping of addresses that are allowed to transfer tokens to any address
17
- mapping (address => bool ) public allowedFrom;
19
+ mapping (address => bool ) internal __dreprecated_allowedFrom;
20
+ /// @dev Do not remove, deprecated storage.
18
21
/// @notice mapping of addresses that are allowed to receive tokens from any address
19
- mapping (address => bool ) public allowedTo;
22
+ mapping (address => bool ) internal __dreprecated_allowedTo;
23
+
20
24
// @notice whether or not an address is allowed to mint new bEIGEN tokens
21
25
mapping (address => bool ) public isMinter;
22
26
23
- /// @notice event emitted when the allowedFrom status of an address is set
24
- event SetAllowedFrom (address indexed from , bool isAllowedFrom );
25
- /// @notice event emitted when the allowedTo status of an address is set
26
- event SetAllowedTo (address indexed to , bool isAllowedTo );
27
- /// @notice event emitted when the transfer restrictions are disabled
28
- event TransferRestrictionsDisabled ();
29
- /// @notice event emitted when the EIGEN token is backed
30
27
event Backed ();
31
28
// @notice event emitted when the `isMinter` mapping is modified
32
29
event IsMinterModified (address indexed minterAddress , bool newStatus );
@@ -75,52 +72,12 @@ contract BackingEigen is OwnableUpgradeable, ERC20VotesUpgradeable {
75
72
_transferOwnership (initialOwner);
76
73
__ERC20Permit_init ("bEIGEN " );
77
74
78
- // set transfer restrictions to be disabled at type(uint256).max to be set down later
79
- transferRestrictionsDisabledAfter = type (uint256 ).max;
80
-
81
- // the EIGEN contract should be allowed to transfer tokens to any address for unwrapping
82
- // likewise, anyone should be able to transfer bEIGEN to EIGEN for wrapping
83
- _setAllowedFrom (address (EIGEN), true );
84
- _setAllowedTo (address (EIGEN), true );
85
-
86
75
// Mint the entire supply of EIGEN - this is a one-time event that
87
76
// ensures bEIGEN fully backs EIGEN.
88
77
_mint (address (EIGEN), 1_673_646_668_284_660_000_000_000_000 );
89
78
emit Backed ();
90
79
}
91
80
92
- /// EXTERNAL FUNCTIONS
93
-
94
- /**
95
- * @notice This function allows the owner to set the allowedFrom status of an address
96
- * @param from the address whose allowedFrom status is being set
97
- * @param isAllowedFrom the new allowedFrom status
98
- */
99
- function setAllowedFrom (address from , bool isAllowedFrom ) external onlyOwner {
100
- _setAllowedFrom (from, isAllowedFrom);
101
- }
102
-
103
- /**
104
- * @notice This function allows the owner to set the allowedTo status of an address
105
- * @param to the address whose allowedTo status is being set
106
- * @param isAllowedTo the new allowedTo status
107
- */
108
- function setAllowedTo (address to , bool isAllowedTo ) external onlyOwner {
109
- _setAllowedTo (to, isAllowedTo);
110
- }
111
-
112
- /**
113
- * @notice Allows the owner to disable transfer restrictions
114
- */
115
- function disableTransferRestrictions () external onlyOwner {
116
- require (
117
- transferRestrictionsDisabledAfter == type (uint256 ).max,
118
- "BackingEigen.disableTransferRestrictions: transfer restrictions are already disabled "
119
- );
120
- transferRestrictionsDisabledAfter = 0 ;
121
- emit TransferRestrictionsDisabled ();
122
- }
123
-
124
81
/// VIEW FUNCTIONS
125
82
126
83
/**
@@ -139,34 +96,4 @@ contract BackingEigen is OwnableUpgradeable, ERC20VotesUpgradeable {
139
96
function CLOCK_MODE () public pure override returns (string memory ) {
140
97
return "mode=timestamp " ;
141
98
}
142
-
143
- /// INTERNAL FUNCTIONS
144
-
145
- function _setAllowedFrom (address from , bool isAllowedFrom ) internal {
146
- allowedFrom[from] = isAllowedFrom;
147
- emit SetAllowedFrom (from, isAllowedFrom);
148
- }
149
-
150
- function _setAllowedTo (address to , bool isAllowedTo ) internal {
151
- allowedTo[to] = isAllowedTo;
152
- emit SetAllowedTo (to, isAllowedTo);
153
- }
154
-
155
- /**
156
- * @notice Overrides the beforeTokenTransfer function to enforce transfer restrictions
157
- * @param from the address tokens are being transferred from
158
- * @param to the address tokens are being transferred to
159
- * @param amount the amount of tokens being transferred
160
- */
161
- function _beforeTokenTransfer (address from , address to , uint256 amount ) internal override {
162
- // if transfer restrictions are enabled
163
- if (block .timestamp <= transferRestrictionsDisabledAfter) {
164
- // if both from and to are not whitelisted
165
- require (
166
- allowedFrom[from] || allowedTo[to] || from == address (0 ),
167
- "BackingEigen._beforeTokenTransfer: from or to must be whitelisted "
168
- );
169
- }
170
- super ._beforeTokenTransfer (from, to, amount);
171
- }
172
99
}
0 commit comments