Verified contractPartialAGPL-3.0-only
NestVaultAdminLogic
Address0xd86f4f4c272a08e657a54950c98d87d24a7915fb
- Balance
0 ETH
- Transactions
0
- Compiler
solc 0.8.30
- Same code
Only this contract
Details
- Compiler
- solc 0.8.30+commit.73712a01
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- cancun
- Via IR
- yes
- License
- AGPL-3.0-only
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,335,432
- Creation transaction
- 0x7d3984adaf…89d8a7729f
- Libraries
- contracts/libraries/NestVaultTransferLogic.sol:NestVaultTransferLogic0x208f…d3e0adcontracts/libraries/NestVaultCoreValidationLogic.sol:NestVaultCoreValidationLogic0x0b23…fd869b
86 files
The source code is large: one file is shown at a time. Choose a file in the list.
- contracts/libraries/NestVaultAdminLogic.solmain7.27 KB
- contracts/NestShareOFT.sol20.64 KB
- contracts/accountant/NestHubAccountant.sol64.94 KB
- contracts/auth/AuthUpgradeable.sol8.37 KB
- contracts/interfaces/IERC7540.sol6.58 KB
- contracts/interfaces/IRateProvider.sol797 B
- contracts/interfaces/ITransferHook.sol419 B
- contracts/libraries/NestVaultAccountingLogic.sol4.72 KB
- contracts/libraries/NestVaultCoreValidationLogic.sol15.16 KB
- contracts/libraries/NestVaultTransferLogic.sol5.43 KB
- contracts/operators/OperatorRegistry.sol4.37 KB
- contracts/types/Errors.sol6.29 KB
- contracts/types/NestVaultCoreTypes.sol5.25 KB
- node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol2.59 KB
- node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol519 B
- node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLib.sol805 B
- node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol2.76 KB
- node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingChannel.sol1.54 KB
- node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingComposer.sol1.03 KB
- node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingContext.sol239 B
- node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol923 B
- node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/libs/AddressCast.sol1.47 KB
- node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol3.67 KB
- node_modules/@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/OAppCoreUpgradeable.sol4.23 KB
- node_modules/@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/OAppReceiverUpgradeable.sol5.96 KB
- node_modules/@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/OAppSenderUpgradeable.sol6.14 KB
- node_modules/@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/OAppUpgradeable.sol2.21 KB
- node_modules/@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/libs/OAppOptionsType3Upgradeable.sol5.29 KB
- node_modules/@layerzerolabs/oapp-evm-upgradeable/contracts/precrime/OAppPreCrimeSimulatorUpgradeable.sol6.64 KB
- node_modules/@layerzerolabs/oapp-evm/contracts/oapp/OAppCore.sol3.36 KB
- node_modules/@layerzerolabs/oapp-evm/contracts/oapp/OAppSender.sol5.63 KB
- node_modules/@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppCore.sol1.86 KB
- node_modules/@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppMsgInspector.sol909 B
- node_modules/@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppOptionsType3.sol1.44 KB
- node_modules/@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppReceiver.sol1.08 KB
- node_modules/@layerzerolabs/oapp-evm/contracts/precrime/interfaces/IOAppPreCrimeSimulator.sol1.92 KB
- node_modules/@layerzerolabs/oapp-evm/contracts/precrime/interfaces/IPreCrime.sol1.11 KB
- node_modules/@layerzerolabs/oapp-evm/contracts/precrime/libs/Packet.sol2.47 KB
- node_modules/@layerzerolabs/oft-evm-upgradeable/contracts/oft/OFTCoreUpgradeable.sol21.78 KB
- node_modules/@layerzerolabs/oft-evm-upgradeable/contracts/oft/OFTUpgradeable.sol3.97 KB
- node_modules/@layerzerolabs/oft-evm/contracts/interfaces/IOFT.sol6.28 KB
- node_modules/@layerzerolabs/oft-evm/contracts/libs/OFTComposeMsgCodec.sol2.99 KB
- node_modules/@layerzerolabs/oft-evm/contracts/libs/OFTMsgCodec.sol2.91 KB
- node_modules/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol4.03 KB
- node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol9.28 KB
- node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol12.13 KB
- node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.sol3.16 KB
- node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol1.19 KB
- node_modules/@openzeppelin/contracts-upgradeable/utils/NoncesUpgradeable.sol2.33 KB
- node_modules/@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol8.56 KB
- node_modules/@openzeppelin/contracts/access/Ownable.sol3.1 KB
- node_modules/@openzeppelin/contracts/interfaces/IERC1271.sol656 B
- node_modules/@openzeppelin/contracts/interfaces/IERC1363.sol4.45 KB
- node_modules/@openzeppelin/contracts/interfaces/IERC165.sol193 B
- node_modules/@openzeppelin/contracts/interfaces/IERC20.sol182 B
- node_modules/@openzeppelin/contracts/interfaces/IERC5267.sol740 B
- node_modules/@openzeppelin/contracts/interfaces/IERC7913.sol674 B
- node_modules/@openzeppelin/contracts/interfaces/draft-IERC6093.sol6.54 KB
- node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol2.78 KB
- node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol684 B
- node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol3.81 KB
- node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol10.08 KB
- node_modules/@openzeppelin/contracts/utils/Address.sol6 KB
- node_modules/@openzeppelin/contracts/utils/Bytes.sol4.89 KB
- node_modules/@openzeppelin/contracts/utils/Context.sol963 B
- node_modules/@openzeppelin/contracts/utils/Errors.sol896 B
- node_modules/@openzeppelin/contracts/utils/Panic.sol1.97 KB
- node_modules/@openzeppelin/contracts/utils/ShortStrings.sol4.3 KB
- node_modules/@openzeppelin/contracts/utils/StorageSlot.sol4.18 KB
- node_modules/@openzeppelin/contracts/utils/Strings.sol19.28 KB
- node_modules/@openzeppelin/contracts/utils/cryptography/ECDSA.sol7.82 KB
- node_modules/@openzeppelin/contracts/utils/cryptography/EIP712.sol6.7 KB
- node_modules/@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol4.25 KB
- node_modules/@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol6.05 KB
- node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol871 B
- node_modules/@openzeppelin/contracts/utils/math/Math.sol32.15 KB
- node_modules/@openzeppelin/contracts/utils/math/SafeCast.sol34.94 KB
- node_modules/@openzeppelin/contracts/utils/math/SignedMath.sol2.61 KB
- node_modules/@uniswap/permit2/src/interfaces/IEIP712.sol144 B
- node_modules/@uniswap/permit2/src/interfaces/ISignatureTransfer.sol6.88 KB
- node_modules/forge-std/src/interfaces/IERC165.sol537 B
- node_modules/forge-std/src/interfaces/IERC7575.sol12.6 KB
- node_modules/solmate/src/auth/Auth.sol2.58 KB
- node_modules/solmate/src/tokens/ERC20.sol6.81 KB
- node_modules/solmate/src/utils/FixedPointMathLib.sol10.05 KB
- node_modules/solmate/src/utils/SafeTransferLib.sol5.77 KB
contracts/libraries/NestVaultAdminLogic.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.30;
import {ERC20} from "@solmate/tokens/ERC20.sol";
import {NestHubAccountant} from "contracts/accountant/NestHubAccountant.sol";
import {NestVaultCoreTypes} from "contracts/types/NestVaultCoreTypes.sol";
import {NestVaultCoreValidationLogic} from "contracts/libraries/NestVaultCoreValidationLogic.sol";
import {NestVaultTransferLogic} from "contracts/libraries/NestVaultTransferLogic.sol";
import {OperatorRegistry} from "contracts/operators/OperatorRegistry.sol";
/// @title NestVaultAdminLogic
/// @notice Library containing admin-related logic for NestVaultCore
/// @author plumenetwork
/// @custom:oz-upgrades-unsafe-allow external-library-linking
library NestVaultAdminLogic {
using NestVaultCoreValidationLogic for NestVaultCoreTypes.NestVaultCoreStorage;
using NestVaultTransferLogic for ERC20;
/*//////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
/// @dev Emitted when the fee configuration for a fee type is updated
/// @param f NestVaultCoreTypes.Fees indexed fee type
/// @param oldFee NestVaultCoreTypes.Fee Previous fee configuration
/// @param fee NestVaultCoreTypes.Fee New fee configuration
event SetFee(NestVaultCoreTypes.Fees indexed f, NestVaultCoreTypes.Fee oldFee, NestVaultCoreTypes.Fee fee);
/// @dev Emitted when the maximum fee cap for a fee type is updated
/// @param f NestVaultCoreTypes.Fees indexed fee type
/// @param oldMaxFee NestVaultCoreTypes.Fee Previous max fee configuration
/// @param maxFee NestVaultCoreTypes.Fee New max fee configuration
event SetMaxFee(NestVaultCoreTypes.Fees indexed f, NestVaultCoreTypes.Fee oldMaxFee, NestVaultCoreTypes.Fee maxFee);
/// @notice Emitted when the operator registry address is updated.
/// @param oldOperatorRegistry address The previous operator registry address.
/// @param newOperatorRegistry address The new operator registry address.
event OperatorRegistryUpdated(address indexed oldOperatorRegistry, address indexed newOperatorRegistry);
/// @notice Emitted when accountant address is updated.
/// @param oldAccountant The previous accountant address.
/// @param newAccountant The new accountant address.
event SetAccountant(address indexed oldAccountant, address indexed newAccountant);
/// @notice Emitted when fees are claimed
/// @param f NestVaultCoreTypes.Fees The fee type being claimed
/// @param receiver address The address receiving claimed fees
/// @param amount uint256 The amount of fees claimed
event FeeClaimed(NestVaultCoreTypes.Fees indexed f, address indexed receiver, uint256 amount);
/*//////////////////////////////////////////////////////////////
EXECUTE FUNCTIONS
//////////////////////////////////////////////////////////////*/
/// @notice Sets the operator registry used for global operator approvals
/// @param $ NestVaultCoreTypes.NestVaultCoreStorage The full storage struct
/// @param _registry address The operator registry address (zero disables registry)
function executeSetOperatorRegistry(NestVaultCoreTypes.NestVaultCoreStorage storage $, address _registry) external {
address oldOperatorRegistry = address($.operatorRegistry);
$.validateOperatorRegistry(_registry);
$.operatorRegistry = OperatorRegistry(_registry);
emit OperatorRegistryUpdated(oldOperatorRegistry, _registry);
}
/// @notice Executes accountant update with compatibility checks
/// @dev Compatibility note:
/// - Legacy AccountantWithRateProviders is supported.
/// - Global pending-share methods are treated as optional and handled best-effort.
/// @param $ NestVaultCoreTypes.NestVaultCoreStorage The full storage struct
/// @param _accountant address Candidate accountant address
/// @param _asset ERC20 Vault asset used to probe safe quote rates
function executeSetAccountant(NestVaultCoreTypes.NestVaultCoreStorage storage $, address _accountant, ERC20 _asset)
external
{
$.validateSetAccountant(_accountant, _asset);
address _oldAccountant = address($.accountant);
$.accountant = NestHubAccountant(_accountant);
emit SetAccountant(_oldAccountant, _accountant);
}
/// @notice Executes fee configuration update for a fee type
/// @param $ NestVaultCoreTypes.NestVaultCoreStorage The full storage struct
/// @param _f NestVaultCoreTypes.Fees Fee type
/// @param _fee NestVaultCoreTypes.Fee New fee configuration (rate + flat)
function executeSetFee(
NestVaultCoreTypes.NestVaultCoreStorage storage $,
NestVaultCoreTypes.Fees _f,
NestVaultCoreTypes.Fee calldata _fee
) external {
$.validateSetFee(_f, _fee);
NestVaultCoreTypes.Fee memory _oldFee = NestVaultCoreTypes.Fee({rate: $.fees[_f].rate, flat: $.fees[_f].flat});
$.fees[_f].rate = _fee.rate;
$.fees[_f].flat = _fee.flat;
emit SetFee(_f, _oldFee, _fee);
}
/// @notice Executes max fee configuration update for a fee type
/// @param $ NestVaultCoreTypes.NestVaultCoreStorage The full storage struct
/// @param _f NestVaultCoreTypes.Fees Fee type
/// @param _maxFee NestVaultCoreTypes.Fee New max fee configuration (rate + flat)
function executeSetMaxFee(
NestVaultCoreTypes.NestVaultCoreStorage storage $,
NestVaultCoreTypes.Fees _f,
NestVaultCoreTypes.Fee calldata _maxFee
) external {
$.validateSetMaxFee(_f, _maxFee);
NestVaultCoreTypes.Fee memory _oldMaxFee =
NestVaultCoreTypes.Fee({rate: $.maxFees[_f].rate, flat: $.maxFees[_f].flat});
$.maxFees[_f].rate = _maxFee.rate;
$.maxFees[_f].flat = _maxFee.flat;
emit SetMaxFee(_f, _oldMaxFee, _maxFee);
}
/// @notice Claims accrued fees for a given fee type to a receiver
/// @param $ NestVaultCoreTypes.NestVaultCoreStorage The full storage struct
/// @param _f NestVaultCoreTypes.Fees Fee type to claim
/// @param _receiver address The address receiving claimed fees
/// @param _assetToken ERC20 Vault asset token used for payout
/// @return _feeAmount uint256 The amount of fees claimed
function executeClaimFee(
NestVaultCoreTypes.NestVaultCoreStorage storage $,
NestVaultCoreTypes.Fees _f,
address _receiver,
ERC20 _assetToken
) external returns (uint256 _feeAmount) {
$.validateClaimFee(_f, _receiver);
_feeAmount = $.claimableFees[_f];
$.claimableFees[_f] = 0;
_assetToken.safeTransferFrom(address(this), _receiver, _feeAmount);
emit FeeClaimed(_f, _receiver, _feeAmount);
}
}
Compiler settingsShow
{
"viaIR": true,
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"libraries": {
"contracts/libraries/NestVaultTransferLogic.sol": {
"NestVaultTransferLogic": "0x208f17744dAeE75822052E18dc8Fa1AfAeD3e0aD"
},
"contracts/libraries/NestVaultCoreValidationLogic.sol": {
"NestVaultCoreValidationLogic": "0x0b2397A073Ba001c4dcD130bCb5e5A0B51fd869B"
}
},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "cancun",
"remappings": [
"forge-std/=node_modules/forge-std/src/",
"@openzeppelin/=node_modules/@openzeppelin/",
"@openzeppelin-4.9.3/=script/vendor/openzeppelin-4.9.3/",
"@solmate/=node_modules/solmate/src/",
"@boring-vault/=node_modules/boring-vault/",
"src/=node_modules/boring-vault/src/",
"@predicate/=node_modules/@predicate/contracts/",
"@predicate-v2/=contracts/vendor/predicate-v2/",
"@pendle/=node_modules/@pendle/",
"createx/=node_modules/createx/src/",
"solidity-bytes-utils/contracts/=node_modules/@layerzerolabs/toolbox-foundry/lib/solidity-bytes-utils/",
"@layerzerolabs/=node_modules/@layerzerolabs/",
"@uniswap/permit2/=node_modules/@uniswap/permit2/src/",
"@morpho/=node_modules/morpho/src/",
"node_modules/@layerzerolabs/toolbox-foundry/:solidity-bytes-utils/contracts/=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/",
"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/=node_modules/@layerzerolabs/toolbox-foundry/lib/solidity-bytes-utils/",
"@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/",
"@uniswap/=node_modules/@uniswap/",
"boring-vault/=node_modules/boring-vault/",
"ds-test/=node_modules/@layerzerolabs/toolbox-foundry/lib/ds-test/",
"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/",
"solmate/=node_modules/solmate/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.