Skip to content

Commit

Permalink
Merge branch 'feat/vaults' into feat/vaults-triggerable-exits
Browse files Browse the repository at this point in the history
# Conflicts:
#	contracts/0.8.25/vaults/Dashboard.sol
  • Loading branch information
tamtamchik committed Feb 3, 2025
2 parents fde279b + 31bf140 commit 8763f26
Show file tree
Hide file tree
Showing 22 changed files with 1,875 additions and 334 deletions.
2 changes: 2 additions & 0 deletions contracts/0.8.25/interfaces/ILido.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ interface ILido is IERC20, IERC20Permit {

function transferSharesFrom(address, address, uint256) external returns (uint256);

function transferShares(address, uint256) external returns (uint256);

function rebalanceExternalEtherToInternal() external payable;

function getTotalPooledEther() external view returns (uint256);
Expand Down
309 changes: 201 additions & 108 deletions contracts/0.8.25/vaults/Dashboard.sol

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions contracts/0.8.25/vaults/Delegation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,10 @@ contract Delegation is Dashboard {
/**
* @notice Constructs the contract.
* @dev Stores token addresses in the bytecode to reduce gas costs.
* @param _steth Address of the stETH token contract.
* @param _weth Address of the weth token contract.
* @param _wsteth Address of the wstETH token contract.
* @param _lidoLocator Address of the Lido locator contract.
*/
constructor(address _steth, address _weth, address _wsteth) Dashboard(_steth, _weth, _wsteth) {}
constructor(address _weth, address _lidoLocator) Dashboard(_weth, _lidoLocator) {}

/**
* @notice Initializes the contract:
Expand Down
6 changes: 3 additions & 3 deletions contracts/0.8.25/vaults/Permissions.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
// SPDX-FileCopyrightText: 2024 Lido <[email protected]>
// SPDX-FileCopyrightText: 2025 Lido <[email protected]>

// See contracts/COMPILERS.md
pragma solidity 0.8.25;
Expand Down Expand Up @@ -126,11 +126,11 @@ abstract contract Permissions is AccessControlVoteable {
_unsafeWithdraw(_recipient, _ether);
}

function _mint(address _recipient, uint256 _shares) internal onlyRole(MINT_ROLE) {
function _mintShares(address _recipient, uint256 _shares) internal onlyRole(MINT_ROLE) {
vaultHub.mintSharesBackedByVault(address(stakingVault()), _recipient, _shares);
}

function _burn(uint256 _shares) internal onlyRole(BURN_ROLE) {
function _burnShares(uint256 _shares) internal onlyRole(BURN_ROLE) {
vaultHub.burnSharesBackedByVault(address(stakingVault()), _shares);
}

Expand Down
8 changes: 4 additions & 4 deletions contracts/0.8.9/Burner.sol
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ contract Burner is IBurner, AccessControlEnumerable {
if (_amount == 0) revert ZeroRecoveryAmount();
if (_token == address(LIDO)) revert StETHRecoveryWrongFunc();

emit ERC20Recovered(msg.sender, _token, _amount);

IERC20(_token).safeTransfer(LOCATOR.treasury(), _amount);

emit ERC20Recovered(msg.sender, _token, _amount);
}

/**
Expand All @@ -259,9 +259,9 @@ contract Burner is IBurner, AccessControlEnumerable {
function recoverERC721(address _token, uint256 _tokenId) external {
if (_token == address(LIDO)) revert StETHRecoveryWrongFunc();

emit ERC721Recovered(msg.sender, _token, _tokenId);

IERC721(_token).transferFrom(address(this), LOCATOR.treasury(), _tokenId);

emit ERC721Recovered(msg.sender, _token, _tokenId);
}

/**
Expand Down
Loading

0 comments on commit 8763f26

Please sign in to comment.