Skip to content

Commit

Permalink
docs: add descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
1kresh committed Feb 18, 2025
1 parent 12dc2dc commit 3c79587
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 16 deletions.
2 changes: 2 additions & 0 deletions src/contracts/vault/v1.1/VaultTokenized.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ contract VaultTokenized is Vault {
if (oldVersion == 1) {
(IVaultTokenized.MigrateParamsTokenized memory params) =
abi.decode(data, (IVaultTokenized.MigrateParamsTokenized));

super._migrate(oldVersion, newVersion, params.baseParams);

_implementation().functionDelegateCall(
abi.encodeCall(VaultTokenizedImplementation._VaultTokenized_init, (params.name, params.symbol))
);
Expand Down
37 changes: 27 additions & 10 deletions src/interfaces/vault/v1.1/IVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@ interface IVault is IVaultStorage, IAccessControl, IERC165, IERC3156FlashLender
error InvalidDelegator();
error InvalidEpoch();
error InvalidEpochDuration();
error InvalidEpochDurationSetEpochsDelay();
error InvalidFlashParams();
error InvalidLengthEpochs();
error InvalidNewEpochDuration();
error InvalidOnBehalfOf();
error InvalidReceiver();
error InvalidRecipient();
error InvalidReturnAmount();
error InvalidSlasher();
error InvalidTimestamp();
error MaxLoanExceeded();
error MissingRoles();
error NewEpochDurationNotReady();
error NoDepositWhitelist();
error NoPreviousEpoch();
error NotDelegator();
error NotSlasher();
error NotWhitelistedDepositor();
error SlasherAlreadyInitialized();
error TooMuchRedeem();
error TooMuchWithdraw();
error InvalidEpochDurationSetEpochsDelay();
error InvalidNewEpochDuration();
error NewEpochDurationNotReady();
error NoDepositWhitelist();
error UnsupportedToken();
error MaxLoanExceeded();
error InvalidReceiver();
error InvalidReturnAmount();
error InvalidFlashParams();
error InvalidTimestamp();
error NoPreviousEpoch();

/**
* @notice Initial parameters needed for a vault deployment.
Expand All @@ -54,11 +54,18 @@ interface IVault is IVaultStorage, IAccessControl, IERC165, IERC3156FlashLender
* @param depositWhitelist if enabling deposit whitelist
* @param isDepositLimit if enabling deposit limit
* @param depositLimit deposit limit (maximum amount of the collateral that can be in the vault simultaneously)
* @param epochDurationSetEpochsDelay number of epochs to wait before accepting a new epoch duration
* @param flashFeeRate flash fee rate (100% = 1_000_000_000; 0.03% = 300_000)
* @param flashFeeReceiver address of the flash fee receiver
* @param defaultAdminRoleHolder address of the initial DEFAULT_ADMIN_ROLE holder
* @param depositWhitelistSetRoleHolder address of the initial DEPOSIT_WHITELIST_SET_ROLE holder
* @param depositorWhitelistRoleHolder address of the initial DEPOSITOR_WHITELIST_ROLE holder
* @param depositorsWhitelisted addresses of the whitelisted depositors
* @param isDepositLimitSetRoleHolder address of the initial IS_DEPOSIT_LIMIT_SET_ROLE holder
* @param depositLimitSetRoleHolder address of the initial DEPOSIT_LIMIT_SET_ROLE holder
* @param epochDurationSetRoleHolder address of the initial EPOCH_DURATION_SET_ROLE holder
* @param flashFeeRateSetRoleHolder address of the initial FLASH_FEE_RATE_SET_ROLE holder
* @param flashFeeReceiverSetRoleHolder address of the initial FLASH_FEE_RECEIVER_SET_ROLE holder
*/
struct InitParams {
address collateral;
Expand All @@ -81,6 +88,16 @@ interface IVault is IVaultStorage, IAccessControl, IERC165, IERC3156FlashLender
address flashFeeReceiverSetRoleHolder;
}

/**
* @notice Parameters needed for a vault migration.
* @param epochDurationSetEpochsDelay number of epochs to wait before accepting a new epoch duration
* @param flashFeeRate flash fee rate (100% = 1_000_000_000; 0.03% = 300_000)
* @param flashFeeReceiver address of the flash fee receiver
* @param epochDurationSetRoleHolder address of the initial EPOCH_DURATION_SET_ROLE holder
* @param flashFeeRateSetRoleHolder address of the initial FLASH_FEE_RATE_SET_ROLE holder
* @param flashFeeReceiverSetRoleHolder address of the initial FLASH_FEE_RECEIVER_SET_ROLE holder
* @dev Version 1 and 2 -> version 3 vaults migration.
*/
struct MigrateParams {
uint256 epochDurationSetEpochsDelay;
uint256 flashFeeRate;
Expand Down
10 changes: 5 additions & 5 deletions src/interfaces/vault/v1.1/IVaultTokenized.sol
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IVault} from "./IVault.sol";

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import {IERC20Errors} from "@openzeppelin/contracts/interfaces/draft-IERC6093.sol";
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IVaultTokenized is IERC20, IERC20Metadata, IERC20Errors {
/**
* @notice Initial parameters needed for a tokenized vault deployment.
* @param baseParams initial parameters needed for a vault deployment (InitParams)
* @param baseParams initial parameters needed for a vault deployment (abi.encode(IVault.InitParams))
* @param name name for the ERC20 tokenized vault
* @param symbol symbol for the ERC20 tokenized vault
*/
Expand All @@ -22,8 +20,10 @@ interface IVaultTokenized is IERC20, IERC20Metadata, IERC20Errors {

/**
* @notice Parameters needed for a tokenized vault migration.
* @param baseParams parameters needed for a vault migration (abi.encode(IVault.MigrateParams))
* @param name name for the ERC20 tokenized vault
* @param symbol symbol for the ERC20 tokenized vault
* @dev Version 1 -> version 3 vaults migration.
*/
struct MigrateParamsTokenized {
bytes baseParams;
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/vault/v1.1/IVaultVotes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.0;
import {IERC5805} from "@openzeppelin/contracts/interfaces/IERC5805.sol";

interface IVaultVotes is IERC5805 {
error SafeSupplyExceeded();
error ImproperMigration();
error InvalidData();
error SafeSupplyExceeded();
}

0 comments on commit 3c79587

Please sign in to comment.