Skip to content
Verified contractPartialAGPL-3.0-only

NestVaultCoreValidationLogic

Address0x3e5f0bce2db2bc99d341b96ca3d2294dcd3a9cfd
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.30

 

Same code

7 more contracts

 

Details

Compiler
solc 0.8.30+commit.73712a01
Language
solidity
Optimization
Yes, 200 runs
EVM version
osaka
Via IR
yes
License
AGPL-3.0-only
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,299,710
Creation transaction
0x02c188ac31…ba310863ac
Libraries
contracts/libraries/NestVaultCoreValidationLogic.sol:NestVaultCoreValidationLogic0xbea4…7cc243

82 files

The source code is large: one file is shown at a time. Choose a file in the list.

contracts/interfaces/IERC7540.sol

// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2;

import {IERC7575} from "forge-std/interfaces/IERC7575.sol";

/// @dev Interface of the base operator logic of ERC7540, as defined in
/// https://eips.ethereum.org/EIPS/eip-7540
interface IERC7540Operator {
    /**
     * @dev The event emitted when an operator is set.
     *
     * @param controller The address of the controller.
     * @param operator The address of the operator.
     * @param approved The approval status.
     */
    event OperatorSet(address indexed controller, address indexed operator, bool approved);

    /**
     * @dev Sets or removes an operator for the caller.
     *
     * @param operator The address of the operator.
     * @param approved The approval status.
     * @return Whether the call was executed successfully or not
     */
    function setOperator(address operator, bool approved) external returns (bool);

    /**
     * @dev Returns `true` if the `operator` is approved as an operator for an `controller`.
     *
     * @param controller The address of the controller.
     * @param operator The address of the operator.
     * @return status The approval status
     */
    function isOperator(address controller, address operator) external view returns (bool status);
}

/// @dev Interface of the asynchronous deposit Vault interface of ERC7540, as defined in
/// https://eips.ethereum.org/EIPS/eip-7540
interface IERC7540Deposit is IERC7540Operator {
    event DepositRequest(
        address indexed controller, address indexed owner, uint256 indexed requestId, address sender, uint256 assets
    );
    /**
     * @dev Transfers assets from sender into the Vault and submits a Request for asynchronous deposit.
     *
     * - MUST support ERC-20 approve / transferFrom on asset as a deposit Request flow.
     * - MUST revert if all of assets cannot be requested for deposit.
     * - owner MUST be msg.sender unless some unspecified explicit approval is given by the caller,
     *    approval of ERC-20 tokens from owner to sender is NOT enough.
     *
     * @param assets the amount of deposit assets to transfer from owner
     * @param controller the controller of the request who will be able to operate the request
     * @param owner the source of the deposit assets
     *
     * NOTE: most implementations will require pre-approval of the Vault with the Vault's underlying asset token.
     */

    function requestDeposit(uint256 assets, address controller, address owner) external returns (uint256 requestId);

    /**
     * @dev Returns the amount of requested assets in Pending state.
     *
     * - MUST NOT include any assets in Claimable state for deposit or mint.
     * - MUST NOT show any variations depending on the caller.
     * - MUST NOT revert unless due to integer overflow caused by an unreasonably large input.
     */
    function pendingDepositRequest(uint256 requestId, address controller) external view returns (uint256 pendingAssets);

    /**
     * @dev Returns the amount of requested assets in Claimable state for the controller to deposit or mint.
     *
     * - MUST NOT include any assets in Pending state.
     * - MUST NOT show any variations depending on the caller.
     * - MUST NOT revert unless due to integer overflow caused by an unreasonably large input.
     */
    function claimableDepositRequest(uint256 requestId, address controller)
        external
        view
        returns (uint256 claimableAssets);

    /**
     * @dev Mints shares Vault shares to receiver by claiming the Request of the controller.
     *
     * - MUST emit the Deposit event.
     * - controller MUST equal msg.sender unless the controller has approved the msg.sender as an operator.
     */
    function deposit(uint256 assets, address receiver, address controller) external returns (uint256 shares);

    /**
     * @dev Mints exactly shares Vault shares to receiver by claiming the Request of the controller.
     *
     * - MUST emit the Deposit event.
     * - controller MUST equal msg.sender unless the controller has approved the msg.sender as an operator.
     */
    function mint(uint256 shares, address receiver, address controller) external returns (uint256 assets);
}

/// @dev Interface of the asynchronous deposit Vault interface of ERC7540, as defined in
/// https://eips.ethereum.org/EIPS/eip-7540
interface IERC7540Redeem is IERC7540Operator {
    event RedeemRequest(
        address indexed controller, address indexed owner, uint256 indexed requestId, address sender, uint256 shares
    );

    /**
     * @dev Assumes control of shares from sender into the Vault and submits a Request for asynchronous redeem.
     *
     * - MUST support a redeem Request flow where the control of shares is taken from sender directly
     *   where msg.sender has ERC-20 approval over the shares of owner.
     * - MUST revert if all of shares cannot be requested for redeem.
     *
     * @param shares the amount of shares to be redeemed to transfer from owner
     * @param controller the controller of the request who will be able to operate the request
     * @param owner the source of the shares to be redeemed
     *
     * NOTE: most implementations will require pre-approval of the Vault with the Vault's share token.
     */
    function requestRedeem(uint256 shares, address controller, address owner) external returns (uint256 requestId);

    /**
     * @dev Returns the amount of requested shares in Pending state.
     *
     * - MUST NOT include any shares in Claimable state for redeem or withdraw.
     * - MUST NOT show any variations depending on the caller.
     * - MUST NOT revert unless due to integer overflow caused by an unreasonably large input.
     */
    function pendingRedeemRequest(uint256 requestId, address controller) external view returns (uint256 pendingShares);

    /**
     * @dev Returns the amount of requested shares in Claimable state for the controller to redeem or withdraw.
     *
     * - MUST NOT include any shares in Pending state for redeem or withdraw.
     * - MUST NOT show any variations depending on the caller.
     * - MUST NOT revert unless due to integer overflow caused by an unreasonably large input.
     */
    function claimableRedeemRequest(uint256 requestId, address controller)
        external
        view
        returns (uint256 claimableShares);
}

/// @dev Interface of the fully asynchronous Vault interface of ERC7540, as defined in
/// https://eips.ethereum.org/EIPS/eip-7540
interface IERC7540 is IERC7540Deposit, IERC7540Redeem, IERC7575 {}
Compiler settingsShow
{
  "viaIR": true,
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "libraries": {
    "contracts/libraries/NestVaultCoreValidationLogic.sol": {
      "NestVaultCoreValidationLogic": "0xBEa4EFf7CC7b6d04a501fa0F896D7eA5147cC243"
    }
  },
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "osaka",
  "remappings": [
    "/Users/rafa/Documents/Plume/worktrees/nest-async-redemption-fee-tiers/node_modules/@layerzerolabs/toolbox-foundry/:solidity-bytes-utils/=node_modules/@layerzerolabs/toolbox-foundry/lib/solidity-bytes-utils/",
    "/Users/rafa/Documents/Plume/worktrees/nest-async-redemption-fee-tiers/node_modules/@layerzerolabs/toolbox-foundry/:solidity-bytes-utils/contracts/=node_modules/@layerzerolabs/toolbox-foundry/lib/solidity-bytes-utils/",
    "@boring-vault/=node_modules/boring-vault/",
    "@ds-test/=node_modules/boring-vault/lib/forge-std/lib/ds-test/src/",
    "@forge-std/=node_modules/boring-vault/lib/forge-std/src/",
    "@ion-protocol/=node_modules/boring-vault/lib/ion-protocol/src/",
    "@layerzerolabs/=node_modules/@layerzerolabs/",
    "@morpho/=node_modules/morpho/src/",
    "@openzeppelin-4.9.3/=script/vendor/openzeppelin-4.9.3/",
    "@openzeppelin/=node_modules/@openzeppelin/",
    "@pendle/=node_modules/@pendle/",
    "@predicate-v2/=contracts/vendor/predicate-v2/",
    "@predicate/=node_modules/@predicate/contracts/",
    "@solmate/=node_modules/solmate/src/",
    "@uniswap/=node_modules/@uniswap/",
    "@uniswap/permit2/=node_modules/@uniswap/permit2/src/",
    "boring-vault/=node_modules/boring-vault/",
    "createx/=node_modules/createx/src/",
    "ds-test/=node_modules/@layerzerolabs/toolbox-foundry/lib/ds-test/",
    "forge-std/=node_modules/forge-std/src/",
    "hardhat-deploy/=node_modules/hardhat-deploy/",
    "hardhat/=node_modules/hardhat/",
    "morpho/=node_modules/morpho/",
    "openzeppelin/=node_modules/createx/lib/openzeppelin-contracts/contracts/",
    "solady/=node_modules/createx/lib/solady/src/",
    "solidity-bytes-utils/=node_modules/solidity-bytes-utils/",
    "solidity-bytes-utils/contracts/=node_modules/@layerzerolabs/toolbox-foundry/lib/solidity-bytes-utils/",
    "solmate/=node_modules/solmate/",
    "src/=node_modules/boring-vault/src/",
    "node_modules/@layerzerolabs/toolbox-foundry/:solidity-bytes-utils/=node_modules/@layerzerolabs/toolbox-foundry/lib/solidity-bytes-utils/",
    "node_modules/@layerzerolabs/toolbox-foundry/:solidity-bytes-utils/contracts/=node_modules/@layerzerolabs/toolbox-foundry/lib/solidity-bytes-utils/"
  ]
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.