Skip to content
Merged
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
130 changes: 130 additions & 0 deletions contracts/interfaces/IEthErc20MetaVault.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.22;

import {IKeeperRewards} from "./IKeeperRewards.sol";
import {IVaultAdmin} from "./IVaultAdmin.sol";
import {IVaultVersion} from "./IVaultVersion.sol";
import {IVaultFee} from "./IVaultFee.sol";
import {IVaultState} from "./IVaultState.sol";
import {IVaultEnterExit} from "./IVaultEnterExit.sol";
import {IVaultOsToken} from "./IVaultOsToken.sol";
import {IVaultSubVaults} from "./IVaultSubVaults.sol";
import {IVaultToken} from "./IVaultToken.sol";
import {IMulticall} from "./IMulticall.sol";

/**
* @title IEthErc20MetaVault
* @author StakeWise
* @notice Defines the interface for the EthErc20MetaVault contract
*/
interface IEthErc20MetaVault is
IVaultAdmin,
IVaultVersion,
IVaultFee,
IVaultState,
IVaultEnterExit,
IVaultOsToken,
IVaultToken,
IVaultSubVaults,
IMulticall
{
/**
* @dev Struct for deploying the EthErc20MetaVault contract
* @param keeper The address of the Keeper contract
* @param vaultsRegistry The address of the VaultsRegistry contract
* @param osTokenVaultController The address of the OsTokenVaultController contract
* @param osTokenConfig The address of the OsTokenConfig contract
* @param osTokenVaultEscrow The address of the OsTokenVaultEscrow contract
* @param subVaultsRegistryFactory The address of the factory for creating SubVaultsRegistry contracts
* @param exitingAssetsClaimDelay The delay after which the assets can be claimed after exiting from staking
*/
struct EthErc20MetaVaultConstructorArgs {
address keeper;
address vaultsRegistry;
address osTokenVaultController;
address osTokenConfig;
address osTokenVaultEscrow;
address subVaultsRegistryFactory;
uint64 exitingAssetsClaimDelay;
}

/**
* @dev Struct for initializing the EthErc20MetaVault contract
* @param subVaultsCurator The address of the initial sub-vaults curator
* @param capacity The Vault stops accepting deposits after exceeding the capacity
* @param feePercent The fee percent that is charged by the Vault
* @param name The name of the ERC20 token
* @param symbol The symbol of the ERC20 token
* @param metadataIpfsHash The IPFS hash of the Vault's metadata file
*/
struct EthErc20MetaVaultInitParams {
address subVaultsCurator;
uint256 capacity;
uint16 feePercent;
string name;
string symbol;
string metadataIpfsHash;
}

/**
* @notice Initializes or upgrades the EthErc20MetaVault contract. Must transfer security deposit during the deployment.
* @param params The encoded parameters for initializing the EthErc20MetaVault contract
*/
function initialize(bytes calldata params) external payable;

/**
* @notice Deposit ETH to the Vault
* @param receiver The address that will receive Vault's shares
* @param referrer The address of the referrer. Set to zero address if not used.
* @return shares The number of shares minted
*/
function deposit(address receiver, address referrer) external payable returns (uint256 shares);

/**
* @notice Updates Vault state and deposits ETH to the Vault
* @param receiver The address that will receive Vault's shares
* @param referrer The address of the referrer. Set to zero address if not used.
* @param harvestParams The parameters for harvesting Keeper rewards
* @return shares The number of shares minted
*/
function updateStateAndDeposit(
address receiver,
address referrer,
IKeeperRewards.HarvestParams calldata harvestParams
) external payable returns (uint256 shares);

/**
* @notice Deposits assets to the vault and mints OsToken shares to the receiver
* @param receiver The address to receive the OsToken
* @param osTokenShares The amount of OsToken shares to mint.
* If set to type(uint256).max, max OsToken shares will be minted.
* @param referrer The address of the referrer
* @return The amount of OsToken assets minted
*/
function depositAndMintOsToken(address receiver, uint256 osTokenShares, address referrer)
external
payable
returns (uint256);

/**
* @notice Updates the state, deposits assets to the vault and mints OsToken shares to the receiver
* @param receiver The address to receive the OsToken
* @param osTokenShares The amount of OsToken shares to mint.
* If set to type(uint256).max, max OsToken shares will be minted.
* @param referrer The address of the referrer
* @param harvestParams The parameters for the harvest
* @return The amount of OsToken assets minted
*/
function updateStateAndDepositAndMintOsToken(
address receiver,
uint256 osTokenShares,
address referrer,
IKeeperRewards.HarvestParams calldata harvestParams
) external payable returns (uint256);

/**
* @notice Donate assets to the Vault. Must transfer ETH together with the call.
*/
function donateAssets() external payable;
}
56 changes: 53 additions & 3 deletions contracts/interfaces/IEthMetaVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,67 @@
pragma solidity ^0.8.22;

import {IKeeperRewards} from "./IKeeperRewards.sol";
import {IMetaVault} from "./IMetaVault.sol";
import {IVaultAdmin} from "./IVaultAdmin.sol";
import {IVaultVersion} from "./IVaultVersion.sol";
import {IVaultFee} from "./IVaultFee.sol";
import {IVaultState} from "./IVaultState.sol";
import {IVaultEnterExit} from "./IVaultEnterExit.sol";
import {IVaultOsToken} from "./IVaultOsToken.sol";
import {IVaultSubVaults} from "./IVaultSubVaults.sol";
import {IMulticall} from "./IMulticall.sol";

/**
* @title IEthMetaVault
* @author StakeWise
* @notice Defines the interface for the EthMetaVault contract
*/
interface IEthMetaVault is IMetaVault {
interface IEthMetaVault is
IVaultAdmin,
IVaultVersion,
IVaultFee,
IVaultState,
IVaultEnterExit,
IVaultOsToken,
IVaultSubVaults,
IMulticall
{
/**
* @dev Struct for deploying the EthMetaVault contract
* @param keeper The address of the Keeper contract
* @param vaultsRegistry The address of the VaultsRegistry contract
* @param osTokenVaultController The address of the OsTokenVaultController contract
* @param osTokenConfig The address of the OsTokenConfig contract
* @param osTokenVaultEscrow The address of the OsTokenVaultEscrow contract
* @param subVaultsRegistryFactory The address of the factory for creating SubVaultsRegistry contracts
* @param exitingAssetsClaimDelay The delay after which the assets can be claimed after exiting from staking
*/
struct EthMetaVaultConstructorArgs {
address keeper;
address vaultsRegistry;
address osTokenVaultController;
address osTokenConfig;
address osTokenVaultEscrow;
address subVaultsRegistryFactory;
uint64 exitingAssetsClaimDelay;
}

/**
* @dev Struct for initializing the EthMetaVault contract
* @param subVaultsCurator The address of the initial sub-vaults curator
* @param capacity The Vault stops accepting deposits after exceeding the capacity
* @param feePercent The fee percent that is charged by the Vault
* @param metadataIpfsHash The IPFS hash of the Vault's metadata file
*/
struct EthMetaVaultInitParams {
address subVaultsCurator;
uint256 capacity;
uint16 feePercent;
string metadataIpfsHash;
}

/**
* @notice Initializes or upgrades the EthMetaVault contract. Must transfer security deposit during the deployment.
* @param params The encoded parameters for initializing the EthVault contract
* @param params The encoded parameters for initializing the EthMetaVault contract
*/
function initialize(bytes calldata params) external payable;

Expand Down
13 changes: 13 additions & 0 deletions contracts/interfaces/IEthPrivErc20MetaVault.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.22;

import {IVaultWhitelist} from "./IVaultWhitelist.sol";
import {IEthErc20MetaVault} from "./IEthErc20MetaVault.sol";

/**
* @title IEthPrivErc20MetaVault
* @author StakeWise
* @notice Defines the interface for the EthPrivErc20MetaVault contract
*/
interface IEthPrivErc20MetaVault is IEthErc20MetaVault, IVaultWhitelist {}
56 changes: 53 additions & 3 deletions contracts/interfaces/IGnoMetaVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,67 @@

pragma solidity ^0.8.22;

import {IMetaVault} from "./IMetaVault.sol";
import {IVaultAdmin} from "./IVaultAdmin.sol";
import {IVaultVersion} from "./IVaultVersion.sol";
import {IVaultFee} from "./IVaultFee.sol";
import {IVaultState} from "./IVaultState.sol";
import {IVaultEnterExit} from "./IVaultEnterExit.sol";
import {IVaultOsToken} from "./IVaultOsToken.sol";
import {IVaultSubVaults} from "./IVaultSubVaults.sol";
import {IMulticall} from "./IMulticall.sol";

/**
* @title IGnoMetaVault
* @author StakeWise
* @notice Defines the interface for the GnoMetaVault contract
*/
interface IGnoMetaVault is IMetaVault {
interface IGnoMetaVault is
IVaultAdmin,
IVaultVersion,
IVaultFee,
IVaultState,
IVaultEnterExit,
IVaultOsToken,
IVaultSubVaults,
IMulticall
{
/**
* @dev Struct for deploying the GnoMetaVault contract
* @param keeper The address of the Keeper contract
* @param vaultsRegistry The address of the VaultsRegistry contract
* @param osTokenVaultController The address of the OsTokenVaultController contract
* @param osTokenConfig The address of the OsTokenConfig contract
* @param osTokenVaultEscrow The address of the OsTokenVaultEscrow contract
* @param subVaultsRegistryFactory The address of the factory for creating SubVaultsRegistry contracts
* @param exitingAssetsClaimDelay The delay after which the assets can be claimed after exiting from staking
*/
struct GnoMetaVaultConstructorArgs {
address keeper;
address vaultsRegistry;
address osTokenVaultController;
address osTokenConfig;
address osTokenVaultEscrow;
address subVaultsRegistryFactory;
uint64 exitingAssetsClaimDelay;
}

/**
* @dev Struct for initializing the GnoMetaVault contract
* @param subVaultsCurator The address of the initial sub-vaults curator
* @param capacity The Vault stops accepting deposits after exceeding the capacity
* @param feePercent The fee percent that is charged by the Vault
* @param metadataIpfsHash The IPFS hash of the Vault's metadata file
*/
struct GnoMetaVaultInitParams {
address subVaultsCurator;
uint256 capacity;
uint16 feePercent;
string metadataIpfsHash;
}

/**
* @notice Initializes or upgrades the GnoMetaVault contract. Must transfer security deposit during the deployment.
* @param params The encoded parameters for initializing the GnoVault contract
* @param params The encoded parameters for initializing the GnoMetaVault contract
*/
function initialize(bytes calldata params) external;

Expand Down
13 changes: 0 additions & 13 deletions contracts/interfaces/IGnoPrivMetaVault.sol

This file was deleted.

86 changes: 0 additions & 86 deletions contracts/interfaces/IMetaVault.sol

This file was deleted.

Loading