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
6 changes: 0 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,23 @@ REMOVE_PREV_FACTORIES=false

# contract variables
# mainnet
#META_VAULT_FACTORY_OWNER=0x2685C0e39EEAAd383fB71ec3F493991d532A87ae
#OS_TOKEN_REDEEMER_OWNER=0x2685C0e39EEAAd383fB71ec3F493991d532A87ae
#OS_TOKEN_REDEEMER_EXIT_QUEUE_UPDATE_DELAY=43200
#VALIDATORS_REGISTRY=0x00000000219ab540356cBB839Cbe05303d7705Fa

# hoodi
#META_VAULT_FACTORY_OWNER=0xFF2B6d2d5c205b99E2e6f607B6aFA3127B9957B6
#OS_TOKEN_REDEEMER_OWNER=0xFF2B6d2d5c205b99E2e6f607B6aFA3127B9957B6
#OS_TOKEN_REDEEMER_EXIT_QUEUE_UPDATE_DELAY=43200
#VALIDATORS_REGISTRY=0x00000000219ab540356cBB839Cbe05303d7705Fa

# chiado
#META_VAULT_FACTORY_OWNER=0xFF2B6d2d5c205b99E2e6f607B6aFA3127B9957B6
#OS_TOKEN_REDEEMER_OWNER=0xFF2B6d2d5c205b99E2e6f607B6aFA3127B9957B6
#OS_TOKEN_REDEEMER_EXIT_QUEUE_UPDATE_DELAY=43200
#TOKENS_CONVERTER_FACTORY=0xd1C58a7a8809fe48dD4BE2a43e2a604a68e51503
#VALIDATORS_REGISTRY=0xb97036A26259B7147018913bD58a774cf91acf25
#GNO_TOKEN=0x19C653Da7c37c66208fbfbE8908A5051B57b4C70

# gnosis
#META_VAULT_FACTORY_OWNER=0x2685C0e39EEAAd383fB71ec3F493991d532A87ae
#OS_TOKEN_REDEEMER_OWNER=0x2685C0e39EEAAd383fB71ec3F493991d532A87ae
#OS_TOKEN_REDEEMER_EXIT_QUEUE_UPDATE_DELAY=43200
#TOKENS_CONVERTER_FACTORY=0xdeC758323bF734c72F909965841fC2dba3C8c007
#VALIDATORS_REGISTRY=0x0B98057eA310F4d31F2a452B414647007d1645d9
#GNO_TOKEN=0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb
54 changes: 2 additions & 52 deletions contracts/interfaces/IEthMetaVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,14 @@
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 {IMulticall} from "./IMulticall.sol";
import {IMetaVault} from "./IMetaVault.sol";

/**
* @title IEthMetaVault
* @author StakeWise
* @notice Defines the interface for the EthMetaVault contract
*/
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 curatorsRegistry The address of the CuratorsRegistry contract
* @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 curatorsRegistry;
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;
}

interface IEthMetaVault is IMetaVault {
/**
* @notice Initializes or upgrades the EthMetaVault contract. Must transfer security deposit during the deployment.
* @param params The encoded parameters for initializing the EthVault contract
Expand Down
6 changes: 2 additions & 4 deletions contracts/interfaces/IEthMetaVaultFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ pragma solidity ^0.8.22;
interface IEthMetaVaultFactory {
/**
* @notice Event emitted on a MetaVault creation
* @param caller The address of the factory caller
* @param admin The address of the Vault admin
* @param vault The address of the created Vault
* @param params The encoded parameters for initializing the Vault contract
*/
event MetaVaultCreated(address indexed caller, address indexed admin, address indexed vault, bytes params);
event MetaVaultCreated(address indexed admin, address indexed vault, bytes params);

/**
* @notice The address of the Vault implementation contract used for proxy creation
Expand All @@ -31,8 +30,7 @@ interface IEthMetaVaultFactory {

/**
* @notice Create Vault. Must transfer security deposit together with a call.
* @param admin The address of the Vault admin
* @param params The encoded parameters for initializing the Vault contract
*/
function createVault(address admin, bytes calldata params) external payable returns (address vault);
function createVault(bytes calldata params) external payable returns (address vault);
}
13 changes: 13 additions & 0 deletions contracts/interfaces/IEthPrivMetaVault.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 {IEthMetaVault} from "./IEthMetaVault.sol";

/**
* @title IEthPrivMetaVault
* @author StakeWise
* @notice Defines the interface for the EthPrivMetaVault contract
*/
interface IEthPrivMetaVault is IEthMetaVault, IVaultWhitelist {}
58 changes: 3 additions & 55 deletions contracts/interfaces/IGnoMetaVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,19 @@

pragma solidity ^0.8.22;

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";
import {IMetaVault} from "./IMetaVault.sol";

/**
* @title IGnoMetaVault
* @author StakeWise
* @notice Defines the interface for the GnoMetaVault contract
*/
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 curatorsRegistry The address of the CuratorsRegistry contract
* @param gnoToken The address of the GNO token
* @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 curatorsRegistry;
address gnoToken;
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;
}

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

/**
* @notice Deposit GNO to the Vault
Expand Down
6 changes: 2 additions & 4 deletions contracts/interfaces/IGnoMetaVaultFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ pragma solidity ^0.8.22;
interface IGnoMetaVaultFactory {
/**
* @notice Event emitted on a MetaVault creation
* @param caller The address of the factory caller
* @param admin The address of the Vault admin
* @param vault The address of the created Vault
* @param params The encoded parameters for initializing the Vault contract
*/
event MetaVaultCreated(address indexed caller, address indexed admin, address indexed vault, bytes params);
event MetaVaultCreated(address indexed admin, address indexed vault, bytes params);

/**
* @notice The address of the Vault implementation contract used for proxy creation
Expand All @@ -31,8 +30,7 @@ interface IGnoMetaVaultFactory {

/**
* @notice Create Vault. Must transfer security deposit together with a call.
* @param admin The address of the Vault admin
* @param params The encoded parameters for initializing the Vault contract
*/
function createVault(address admin, bytes calldata params) external returns (address vault);
function createVault(bytes calldata params) external returns (address vault);
}
13 changes: 13 additions & 0 deletions contracts/interfaces/IGnoPrivMetaVault.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 {IGnoMetaVault} from "./IGnoMetaVault.sol";

/**
* @title IGnoPrivMetaVault
* @author StakeWise
* @notice Defines the interface for the GnoPrivMetaVault contract
*/
interface IGnoPrivMetaVault is IGnoMetaVault, IVaultWhitelist {}
86 changes: 86 additions & 0 deletions contracts/interfaces/IMetaVault.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.22;

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";
import {ISubVaultsCurator} from "./ISubVaultsCurator.sol";

/**
* @title IMetaVault
* @author StakeWise
* @notice Defines the interface for the MetaVault contract
*/
interface IMetaVault is
IVaultAdmin,
IVaultVersion,
IVaultFee,
IVaultState,
IVaultEnterExit,
IVaultOsToken,
IVaultSubVaults,
IMulticall
{
/**
* @notice Event emitted when assets are redeemed from sub-vaults
* @param assetsRedeemed The amount of assets redeemed to the meta vault
*/
event SubVaultsAssetsRedeemed(uint256 assetsRedeemed);

/**
* @dev Struct for deploying the MetaVault 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 curatorsRegistry The address of the CuratorsRegistry contract
* @param exitingAssetsClaimDelay The delay after which the assets can be claimed after exiting from staking
*/
struct MetaVaultConstructorArgs {
address keeper;
address vaultsRegistry;
address osTokenVaultController;
address osTokenConfig;
address osTokenVaultEscrow;
address curatorsRegistry;
uint64 exitingAssetsClaimDelay;
}

/**
* @dev Struct for initializing the MetaVault 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 MetaVaultInitParams {
address subVaultsCurator;
uint256 capacity;
uint16 feePercent;
string metadataIpfsHash;
}

/**
* @notice Calculates the required sub-vaults exit requests to fulfill the assets to redeem
* @param assetsToRedeem The amount of assets to redeem
* @return redeemRequests The array of sub-vaults exit requests
*/
function calculateSubVaultsRedemptions(uint256 assetsToRedeem)
external
view
returns (ISubVaultsCurator.ExitRequest[] memory redeemRequests);

/**
* @notice Redeems assets from sub-vaults to the meta vault. Can only be called by the redeemer.
* @param assetsToRedeem The amount of assets to redeem to the meta vault
* @return totalRedeemedAssets The total amount of assets redeemed from sub-vaults
*/
function redeemSubVaultsAssets(uint256 assetsToRedeem) external returns (uint256 totalRedeemedAssets);
}
Loading
Loading