LSDVault Contracts
LSDVault-I.sol
Note
Split reference
This reference file was too long so it is split into multiple chunks. This is chunk number I.
This is part of a solidity contract file for LSDVault, a contract responsible for holding and managing the deposited LSDs. It includes various interfaces and contract classes. The LSDVault contract contains several functions for managing LSDs, including adding new LSD, configuring LSD, enabling LSD, etc. It also contains various events that can be triggered in different circumstances. The contract manages access controls and implements a time-locked function for certain actions.
Interface for unshETH functionalities. Contains functions for minting and burning, setting and adding minter, and setting timelock address.
Interface for LSD vault. Contains functions to get the balance, exit the vault, and get the Shanghai time.
Interface to interact with darknet. Contains a function to check the price of LSD.
Main contract to manage LSDs. Contains several functions for managing LSDs and events for different actions. It also uses modifiers to restrict access to certain functions.
constructor(address _owner, address _darknetAddress, address _unshethAddress, address[] memory _lsds)
Constructor method for the LSDVault contract. Sets the owner, darknet address, unshETH address and initializes the LSDs.
- _owner
address
: Address of the owner. - _darknetAddress
address
: Address of the darknet. - _unshethAddress
address
: Address of unshETH. - _lsds
address[] memory
: Array of LSD addresses.
setUnshethZap(address _unshethZapAddress) external
Sets the address for the unshETH zap. Can only be called by the owner and if the unshETH zap address is not already set.
- _unshethZapAddress
address
: Address of the unshETH zap.
setAdmin(address _admin) external
Sets the admin address. Can only be called by the owner.
- _admin
address
: Address of the admin.
addLSD(address _lsd) public
Adds a new LSD to the contract. Can only be called by the owner and if the deposits are paused.
- _lsd
address
: Address of the LSD to be added.
setLSDConfigs(address _lsd, uint256 _targetWeightBps, uint256 _maxWeightBps, uint256 _maxEthCap) public
Sets the configuration for an LSD. Can only be called by the owner and if the deposits are paused.
- _lsd
address
: Address of the LSD. - _targetWeightBps
uint256
: Target weight in basis points for the LSD. - _maxWeightBps
uint256
: Maximum weight in basis points for the LSD. - _maxEthCap
uint256
: Maximum ETH cap for the LSD.
enableLSD(address _lsd) public
Enables an LSD. Can only be called by the owner and if the deposits are paused.
- _lsd
address
: Address of the LSD.