Skip to main content

InsuranceFund

The Lido Insurance Fund is a vault contract that serves as a simple transparent store for funds allocated for self-insurance purposes.

Mechanics

The Insurance Fund is a simple vault that inherits OpenZeppelin's Ownable and allows the owner to transfer ether, ERC20, ERC721, ERC1155 tokens from the contract. The owner, which will the Lido DAO Agent, can transfer ownership to another entity with an exception of zero address.

View methods

owner()

Returns the current owner.

function owner() public view returns (address);

renounceOwnership()

Reverts always.

function renounceOwnership() public pure override;

Methods

transferERC1155()

Transfer a single ERC1155 token with the specified id in the specified amount to an entity from the contract balance. A contract recipient must implement ERC1155TokenReceiver in accordance to EIP-1155 in order to safely receive tokens.

  • reverts if msg.sender is not owner;
  • reverts if _recipient is zero address;
  • reverts if the contract balance is insufficient;
  • emits ERC721Transferred(address indexed _token, address indexed _recipient, uint256 _tokenId, bytes _data).
function transferERC1155(address _token, address _recipient, uint256 _tokenId, uint256 _amount, bytes calldata _data) external;

Parameters

NameTypeDescription
_tokenaddressan ERC1155 token
_recipientaddressrecipient entity
_tokenIduint256token identifier
_amountuint256transfer amount
_databytesbyte sequence for onERC1155Received hook
info

Note: transferERC1155 does not support multi-token batch transfers.

transferERC20()

Transfer an ERC20 token to an entity in the specified amount from the contract balance.

  • reverts if msg.sender is not owner;
  • reverts if _recipient is zero address;
  • reverts if the contract balance is insufficient;
  • emits ERC20Transferred(address indexed _token, address indexed _recipient, uint256 _amount).
function transferERC20(address _token, address _recipient, uint256 _amount) external;

Parameters

NameTypeDescription
_tokenaddressan ERC20 token
_recipientaddressrecipient entity
_amountuint256transfer amount

transferERC721()

Transfer a single ERC721 token with the specified id to an entity from the contract balance. A contract recipient must implement ERC721TokenReceiver in accordance to EIP-721 in order to safely receive tokens.

  • reverts if msg.sender is not owner;
  • reverts if _recipient is zero address;
  • emits ERC721Transferred(address indexed _token, address indexed _recipient, uint256 _tokenId, bytes _data).
function transferERC721(address _token, address _recipient, uint256 _tokenId, bytes memory _data) external;

Parameters

NameTypeDescription
_tokenaddressan ERC721 token
_recipientaddressrecipient entity
_tokenIduint256token identifier
_databytesbyte sequence for onERC721Received hook

transferEther()

Transfers ether to an entity from the contract balance.

  • reverts if msg.sender is not owner;
  • reverts if _recipient is zero address;
  • reverts if the contract balance is insufficient;
  • reverts if the actual transfer OP fails (e.g. _recipient is a contract with no fallback);
  • emits EtherTransferred(address indexed _recipient, uint256 _amount).
function transferEther(address _recipient, uint256 _amount) external;

Parameters

NameTypeDescription
_recipientaddressrecipient entity
_amountuint256transfer amount

transferOwnership()

Assigns newOwner as the owner.

  • reverts if msg.sender is not owner;
  • reverts if newOwner is zero address;
  • emits emit OwnershipTransferred(address indexed previousOwner, address indexed newOwner).
function transferOwnership(address newOwner) public;

Parameters

NameTypeDescription
newOwneraddressentity which will have access to all state-mutating operations