@@ -11,22 +11,19 @@ contract BackingEigen is OwnableUpgradeable, ERC20VotesUpgradeable {
1111 IERC20 public immutable EIGEN;
1212
1313 /// STORAGE
14+ /// @dev Do not remove, deprecated storage.
1415 /// @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.
1618 /// @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.
1821 /// @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+
2024 // @notice whether or not an address is allowed to mint new bEIGEN tokens
2125 mapping (address => bool ) public isMinter;
2226
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
3027 event Backed ();
3128 // @notice event emitted when the `isMinter` mapping is modified
3229 event IsMinterModified (address indexed minterAddress , bool newStatus );
@@ -75,52 +72,12 @@ contract BackingEigen is OwnableUpgradeable, ERC20VotesUpgradeable {
7572 _transferOwnership (initialOwner);
7673 __ERC20Permit_init ("bEIGEN " );
7774
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-
8675 // Mint the entire supply of EIGEN - this is a one-time event that
8776 // ensures bEIGEN fully backs EIGEN.
8877 _mint (address (EIGEN), 1_673_646_668_284_660_000_000_000_000 );
8978 emit Backed ();
9079 }
9180
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-
12481 /// VIEW FUNCTIONS
12582
12683 /**
@@ -139,34 +96,4 @@ contract BackingEigen is OwnableUpgradeable, ERC20VotesUpgradeable {
13996 function CLOCK_MODE () public pure override returns (string memory ) {
14097 return "mode=timestamp " ;
14198 }
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- }
17299}
0 commit comments