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/libraries/NestVaultCoreValidationLogic.solmain15.16 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/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/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/auth/AuthUpgradeable.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
// contracts
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {ContextUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import {Authority} from "@solmate/auth/Auth.sol";
/// @title AuthUpgradeable Contract
/// @notice This contract provides a flexible and updatable authentication pattern
/// that is entirely separate from the application logic. The original
/// implementation has been modified to support upgradeable proxies,
/// using OpenZeppelin's Initializable contract for initialization.
///
/// @dev This contract is an upgradeable version of the `Auth` contract from Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Auth.sol).
/// It has been modified to include the `Initializable` and `ContextUpgradeable` contracts from OpenZeppelin to support the use of upgradeable proxies.
/// This ensures that the contract logic can be updated in the future while maintaining its state and existing data.
/// The contract is designed to be used in proxy-based patterns (such as UUPS or Transparent proxies).
/// Ensure that the initialization is done properly in the proxy's constructor to avoid any issues.
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Auth.sol)
/// @author Further modified by plumenetwork to support upgradeable proxies
abstract contract AuthUpgradeable is Initializable, ContextUpgradeable {
/// @notice Emitted when ownership is transferred to a new address
/// @param previousOwner The address of the current owner before the transfer
/// @param newOwner The address of the new owner.
event AUTH_OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/// @notice Emitted when the authority is updated
/// @param user address of the user updating the authority
/// @param newAuthority address of the new authority
event AUTH_AuthorityUpdated(address indexed user, Authority indexed newAuthority);
/// @notice Emitted when ownership transfer is started
/// @param previousOwner The address of current owner
/// @param newOwner The address of new owner
event AUTH_OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
/// @dev The caller account is not authorized to perform an operation
error AUTH_UNAUTHORIZED();
/// @dev The address(0) is not allowed
error AUTH_ZERO_ADDRESS();
/// @dev This struct stores the current owner's address and the contract's authority
/// @param _owner The address of the current contract owner
/// @param _authority The address of the current authority
/// @param _pendingOwner The address of the pending owner
/// @custom:storage-location erc7201:plumenetwork.storage.Auth
struct AuthStorage {
address _owner;
Authority _authority;
address _pendingOwner;
}
// keccak256(abi.encode(uint256(keccak256("plumenetwork.storage.Auth")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant AuthStorageLocation = 0x341f7c713c76cb881fd7047f7cccebe3fe10eddfc5e20fe83ee7e0b505e8ea00;
/// @dev Internal function to access the contract's AuthStorage slot
/// @return $ A reference to the AuthStorage struct for reading/writing authentication data
function _getAuthStorage() private pure returns (AuthStorage storage $) {
assembly {
$.slot := AuthStorageLocation
}
}
/// @notice Initializes the contract with the owner's address and the authority
/// @param _owner The address to set as the owner of the contract
/// @param _authority The address of the initial authority responsible for managing permissions
function __Auth_init(address _owner, Authority _authority) internal onlyInitializing {
__Auth_init_unchained(_owner, _authority);
}
/// @dev Internal function to initialize the contract's state
/// @param _owner The address to set as the owner of the contract
/// @param _authority The address of the initial authority
function __Auth_init_unchained(address _owner, Authority _authority) internal onlyInitializing {
AuthStorage storage $ = _getAuthStorage();
$._owner = _owner;
emit AUTH_OwnershipTransferred(address(0), _owner);
$._authority = _authority;
emit AUTH_AuthorityUpdated(_msgSender(), _authority);
}
/// @notice Modifier that ensures the caller is authorized to perform the action
/// @dev This modifier checks whether the caller is authorized based on the current
/// authority or is the owner of the contract
modifier requiresAuth() virtual {
_checkAuth();
_;
}
/// @dev Internal function to check authorization
/// @dev Reverts with UNAUTHORIZED if msg.sender is not authorized for msg.sig
function _checkAuth() internal view virtual {
if (!isAuthorized(_msgSender(), msg.sig)) {
revert AUTH_UNAUTHORIZED();
}
}
/// @notice Retrieves the current owner of the contract
/// @return The address of the current owner
function owner() public view virtual returns (address) {
AuthStorage storage $ = _getAuthStorage();
return $._owner;
}
/// @notice Retrieves the current authority of the contract
/// @return The address of the current authority
function authority() public view virtual returns (Authority) {
AuthStorage storage $ = _getAuthStorage();
return $._authority;
}
/// @notice Checks if a user is authorized to call a specific function in the contract
/// @param user The address of the user requesting access
/// @param functionSig The signature of the function being called
/// @return A boolean indicating whether the user is authorized
function isAuthorized(address user, bytes4 functionSig) internal view virtual returns (bool) {
Authority auth = authority(); // Memoizing authority saves us a warm SLOAD, around 100 gas.
// Checking if the caller is the owner only after calling the authority saves gas in most cases, but be
// aware that this makes protected functions uncallable even to the owner if the authority is out of order.
return (address(auth) != address(0) && auth.canCall(user, address(this), functionSig)) || user == owner();
}
/// @notice Allows the owner to set a new authority for the contract
/// @param newAuthority The address of the new authority
function setAuthority(Authority newAuthority) public virtual {
AuthStorage storage $ = _getAuthStorage();
// We check if the caller is the owner first because we want to ensure they can
// always swap out the authority even if it's reverting or using up a lot of gas.
require(_msgSender() == owner() || $._authority.canCall(_msgSender(), address(this), msg.sig));
$._authority = newAuthority;
emit AUTH_AuthorityUpdated(_msgSender(), newAuthority);
}
/// @notice Initiates ownership transfer to a new address (step 1 of 2)
/// @param newOwner The address of the proposed new owner
function transferOwnership(address newOwner) public virtual requiresAuth {
if (newOwner == address(0)) revert AUTH_ZERO_ADDRESS();
AuthStorage storage $ = _getAuthStorage();
$._pendingOwner = newOwner;
emit AUTH_OwnershipTransferStarted(_msgSender(), newOwner);
}
/// @notice Accepts ownership transfer (step 2 of 2)
/// @dev Must be called by the pending owner to complete the transfer
function acceptOwnership() public virtual {
AuthStorage storage $ = _getAuthStorage();
if (_msgSender() != $._pendingOwner) revert AUTH_UNAUTHORIZED();
address oldOwner = $._owner;
$._owner = $._pendingOwner;
$._pendingOwner = address(0);
emit AUTH_OwnershipTransferred(oldOwner, $._owner);
}
/// @notice Returns the pending owner address
/// @return The address of the pending owner (if any)
function pendingOwner() public view virtual returns (address) {
AuthStorage storage $ = _getAuthStorage();
return $._pendingOwner;
}
}
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.