Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions script/VerifyV3Upgrade.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import "../src/interfaces/IEtherFiOracle.sol";
import "../src/interfaces/IEtherFiAdmin.sol";
import "../src/interfaces/IeETH.sol";
import "../src/interfaces/IWeETH.sol";
import "../src/interfaces/ITNFT.sol";
import "../src/StakingManager.sol";
import "../src/EtherFiNodesManager.sol";
import "../src/EtherFiNode.sol";
Expand Down Expand Up @@ -46,7 +45,6 @@ contract VerifyV3Upgrade is Script {
address etherFiAdmin = 0x0EF8fa4760Db8f5Cd4d993f3e3416f30f942D705;
address eETH = 0x35fA164735182de50811E8e2E824cFb9B6118ac2;
address weETH = 0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee;
address TNFT = 0x7B5ae07E2AF1C861BcC4736D23f5f66A61E0cA5e;

// ERC1967 storage slot for implementation address
bytes32 constant IMPLEMENTATION_SLOT =
Expand Down Expand Up @@ -86,7 +84,7 @@ contract VerifyV3Upgrade is Script {
console2.log("----------------------------------------");
verifyContractInteractions();

// 5. Verify Additional Contracts (Oracle, Admin, eETH, weETH, TNFT)
// 5. Verify Additional Contracts (Oracle, Admin, eETH, weETH)
console2.log("\n5. VERIFYING ADDITIONAL CONTRACTS");
console2.log("----------------------------------------");
verifyAdditionalContracts();
Expand Down Expand Up @@ -387,9 +385,6 @@ contract VerifyV3Upgrade is Script {
console2.log("Checking weETH...");
verifyProxyUpgradeability(weETH, "weETH");

// Verify TNFT upgradeability
console2.log("Checking TNFT...");
verifyProxyUpgradeability(TNFT, "TNFT");

// Additional specific checks for these contracts
console2.log("\nChecking EtherFiOracle specific functionality...");
Expand Down
1 change: 1 addition & 0 deletions script/deploys/Deployed.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ contract Deployed {
// Membership & NFTs
address public constant MEMBERSHIP_MANAGER = 0x3d320286E014C3e1ce99Af6d6B00f0C1D63E3000;
address public constant MEMBERSHIP_NFT = 0xb49e4420eA6e35F98060Cd133842DbeA9c27e479;
// Deprecated legacy NFT contracts retained for historical reference only.
address public constant TNFT = 0x7B5ae07E2AF1C861BcC4736D23f5f66A61E0cA5e;
address public constant BNFT = 0x6599861e55abd28b91dd9d86A826eC0cC8D72c2c;
address public constant WITHDRAW_REQUEST_NFT = 0x7d5706f6ef3F89B3951E23e557CDFBC3239D4E2c;
Expand Down
1 change: 1 addition & 0 deletions src/BNFT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "@openzeppelin-upgradeable/contracts/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin-upgradeable/contracts/access/OwnableUpgradeable.sol";

// Deprecated legacy bNFT contract retained for historical storage compatibility. Do not use in new flows.
contract BNFT is ERC721Upgradeable, UUPSUpgradeable, OwnableUpgradeable {
//--------------------------------------------------------------------------------------
//--------------------------------- STATE-VARIABLES ----------------------------------
Expand Down
20 changes: 15 additions & 5 deletions src/LiquidityPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ import "./interfaces/IRoleRegistry.sol";

contract LiquidityPool is Initializable, OwnableUpgradeable, UUPSUpgradeable, ILiquidityPool {
using SafeERC20 for IERC20;

// Deprecated legacy holder struct kept to maintain storage layout.
struct BnftHolder {
address holder;
}
//--------------------------------------------------------------------------------------
//--------------------------------- STATE-VARIABLES ----------------------------------
//--------------------------------------------------------------------------------------
Expand Down Expand Up @@ -124,16 +129,15 @@ contract LiquidityPool is Initializable, OwnableUpgradeable, UUPSUpgradeable, IL
totalValueInLp += uint128(msg.value);
}

function initialize(address _eEthAddress, address _stakingManagerAddress, address _nodesManagerAddress, address _membershipManagerAddress, address _tNftAddress, address _etherFiAdminContract, address _withdrawRequestNFT) external initializer {
if (_eEthAddress == address(0) || _stakingManagerAddress == address(0) || _nodesManagerAddress == address(0) || _membershipManagerAddress == address(0) || _tNftAddress == address(0)) revert DataNotSet();
function initialize(address _eEthAddress, address _stakingManagerAddress, address _nodesManagerAddress, address _membershipManagerAddress, address _etherFiAdminContract, address _withdrawRequestNFT) external initializer {
if (_eEthAddress == address(0) || _stakingManagerAddress == address(0) || _nodesManagerAddress == address(0) || _membershipManagerAddress == address(0)) revert DataNotSet();

__Ownable_init();
__UUPSUpgradeable_init();
eETH = IeETH(_eEthAddress);
stakingManager = IStakingManager(_stakingManagerAddress);
nodesManager = IEtherFiNodesManager(_nodesManagerAddress);
membershipManager = _membershipManagerAddress;
DEPRECATED_TNFT = _tNftAddress;
paused = true;
restakeBnftDeposits = false;
ethAmountLockedForWithdrawal = 0;
Expand Down Expand Up @@ -373,7 +377,7 @@ contract LiquidityPool is Initializable, OwnableUpgradeable, UUPSUpgradeable, IL
validatorSizeWei = _validatorSizeWei;
}

/// @notice The admin can register an address to become a BNFT holder
/// @notice The admin can register an address to become a validator spawner (legacy bNFT role)
/// @param _user The address of the Validator Spawner to register
function registerValidatorSpawner(address _user) public {
if (!roleRegistry.hasRole(LIQUIDITY_POOL_ADMIN_ROLE, msg.sender)) revert IncorrectRole();
Expand All @@ -384,6 +388,12 @@ contract LiquidityPool is Initializable, OwnableUpgradeable, UUPSUpgradeable, IL
emit ValidatorSpawnerRegistered(_user);
}

/// @notice Backwards-compatible alias for legacy bNFT flow.
/// @dev Calls `registerValidatorSpawner` under the hood to preserve role checks and events.
function registerAsBnftHolder(address _user) external {
registerValidatorSpawner(_user);
}

/// @notice Removes a Validator Spawner
/// @param _user the address of the Validator Spawner to remove
function unregisterValidatorSpawner(address _user) external {
Expand Down Expand Up @@ -412,7 +422,7 @@ contract LiquidityPool is Initializable, OwnableUpgradeable, UUPSUpgradeable, IL
emit Rebase(getTotalPooledEther(), eETH.totalShares());
}

/// @notice pay protocol fees including 5% to treaury, 5% to node operator and ethfund bnft holders
/// @notice pay protocol fees including treasury and node operator splits (legacy bnft logic removed)
/// @param _protocolFees The amount of protocol fees to pay in ether
function payProtocolFees(uint128 _protocolFees) external {
if (msg.sender != address(etherFiAdminContract)) revert IncorrectCaller();
Expand Down
7 changes: 3 additions & 4 deletions src/NodeOperatorManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,9 @@ contract NodeOperatorManager is INodeOperatorManager, Initializable, UUPSUpgrade
}

/// @notice Approves or un approves an operator to run validators from a specific source of funds
/// @dev To allow a permissioned system, we will approve node operators to run validators only for a specific source of funds (EETH / ETHER_FAN)
/// Some operators can be approved for both sources and some for only one. Being approved means that when a BNFT player deposits,
/// we allocate a source of funds to be used for the deposit. And only operators approved for that source can run the validators
/// being created.
/// @dev To allow a permissioned system, we will approve node operators to run validators only for a specific source of funds (EETH / ETHER_FAN).
/// Some operators can be approved for both sources and some for only one.
/// Legacy bNFT references have been removed; approvals now apply generically to validator spawners.
/// @param _users the operator addresses to perform an approval or denial on
/// @param _approvedTags the source of funds we will be updating operator permissions for
/// @param _approvals whether we are approving or un approving the operator
Expand Down
2 changes: 1 addition & 1 deletion src/TNFT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "@openzeppelin-upgradeable/contracts/access/OwnableUpgradeable.sol";

import "./interfaces/IEtherFiNodesManager.sol";


// Deprecated legacy tNFT contract retained for historical storage compatibility. Do not use in new flows.
contract TNFT is ERC721Upgradeable, UUPSUpgradeable, OwnableUpgradeable {
//--------------------------------------------------------------------------------------
//--------------------------------- STATE-VARIABLES ----------------------------------
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/IBNFT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pragma solidity ^0.8.13;

import "@openzeppelin-upgradeable/contracts/token/ERC721/IERC721Upgradeable.sol";

// Deprecated: legacy bNFT interface retained for storage/ABI compatibility only.
interface IBNFT is IERC721Upgradeable {

function burnFromWithdrawal(uint256 _validatorId) external;
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/IEtherFiNodesManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ interface IEtherFiNodesManager {
|-------------------------------------------+---------------------------------------------------------------+------+--------+-------+-------------------------------------------------|
| etherfiNodeAddress | mapping(uint256 => address) | 305 | 0 | 32 | src/EtherFiNodesManager.sol:EtherFiNodesManager |
|-------------------------------------------+---------------------------------------------------------------+------+--------+-------+-------------------------------------------------|
| tnft | contract TNFT | 306 | 0 | 20 | src/EtherFiNodesManager.sol:EtherFiNodesManager |
| DEPRECATED_tnft | address | 306 | 0 | 20 | src/EtherFiNodesManager.sol:EtherFiNodesManager |
|-------------------------------------------+---------------------------------------------------------------+------+--------+-------+-------------------------------------------------|
| bnft | contract BNFT | 307 | 0 | 20 | src/EtherFiNodesManager.sol:EtherFiNodesManager |
| DEPRECATED_bnft | address | 307 | 0 | 20 | src/EtherFiNodesManager.sol:EtherFiNodesManager |
|-------------------------------------------+---------------------------------------------------------------+------+--------+-------+-------------------------------------------------|
| auctionManager | contract IAuctionManager | 308 | 0 | 20 | src/EtherFiNodesManager.sol:EtherFiNodesManager |
|-------------------------------------------+---------------------------------------------------------------+------+--------+-------+-------------------------------------------------|
Expand Down
5 changes: 1 addition & 4 deletions src/interfaces/ILiquidityPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ interface ILiquidityPool {
uint32 startOfSlotNumOwners;
}

struct BnftHolder {
address holder;
}

struct ValidatorSpawner {
bool registered;
}
Expand Down Expand Up @@ -68,6 +64,7 @@ interface ILiquidityPool {
function DEPRECATED_sendExitRequests(uint256[] calldata _validatorIds) external;

function registerValidatorSpawner(address _user) external;
function registerAsBnftHolder(address _user) external;
function unregisterValidatorSpawner(address _user) external;

function rebase(int128 _accruedRewards) external;
Expand Down
8 changes: 4 additions & 4 deletions src/interfaces/IStakingManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ interface IStakingManager {
|------------------------+-------------------------------------------------------+------+--------+-------+---------------------------------------|
| merkleRoot | bytes32 | 304 | 0 | 32 | src/StakingManager.sol:StakingManager |
|------------------------+-------------------------------------------------------+------+--------+-------+---------------------------------------|
| TNFTInterfaceInstance | contract ITNFT | 305 | 0 | 20 | src/StakingManager.sol:StakingManager |
| DEPRECATED_TNFTInterfaceInstance | address | 305 | 0 | 20 | src/StakingManager.sol:StakingManager |
|------------------------+-------------------------------------------------------+------+--------+-------+---------------------------------------|
| BNFTInterfaceInstance | contract IBNFT | 306 | 0 | 20 | src/StakingManager.sol:StakingManager |
| DEPRECATED_BNFTInterfaceInstance | address | 306 | 0 | 20 | src/StakingManager.sol:StakingManager |
|------------------------+-------------------------------------------------------+------+--------+-------+---------------------------------------|
| auctionManager | contract IAuctionManager | 307 | 0 | 20 | src/StakingManager.sol:StakingManager |
|------------------------+-------------------------------------------------------+------+--------+-------+---------------------------------------|
Expand All @@ -71,12 +71,12 @@ interface IStakingManager {
//---------------------------------------------------------------------------

event validatorCreated(bytes32 indexed pubkeyHash, address indexed etherFiNode, bytes pubkey);
event validatorConfirmed(bytes32 indexed pubkeyHash, address indexed bnftRecipient, address indexed tnftRecipient, bytes pubkey);
event validatorConfirmed(bytes32 indexed pubkeyHash, address indexed validatorRecipient, address indexed withdrawalRecipient, bytes pubkey);
event linkLegacyValidatorId(bytes32 indexed pubkeyHash, uint256 indexed legacyId);
event EtherFiNodeDeployed(address indexed etheFiNode);

// legacy event still being emitted in its original form to play nice with existing external tooling
event ValidatorRegistered(address indexed operator, address indexed bNftOwner, address indexed tNftOwner, uint256 validatorId, bytes validatorPubKey, string ipfsHashForEncryptedValidatorKey);
event ValidatorRegistered(address indexed operator, address indexed validatorRecipient, address indexed withdrawalRightsRecipient, uint256 validatorId, bytes validatorPubKey, string ipfsHashForEncryptedValidatorKey);

//--------------------------------------------------------------------------
//----------------------------- Errors -----------------------------------
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/ITNFT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pragma solidity ^0.8.13;

import "@openzeppelin-upgradeable/contracts/token/ERC721/IERC721Upgradeable.sol";

// Deprecated: legacy tNFT interface retained for storage/ABI compatibility only.
interface ITNFT is IERC721Upgradeable {

function burnFromWithdrawal(uint256 _validatorId) external;
Expand Down
124 changes: 0 additions & 124 deletions test/BNFT.t.sol

This file was deleted.

Loading
Loading