ERC-20
Overview
Max Total Supply
764,272,426,038,231,001,205
Holders
0
Market
Price
$0.00 @ 0.000000 S
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 0 Decimals)
Balance
0Value
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x56b0c5C9...6e07592ab The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
YelayLiteVault
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 10000 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.28; import {Proxy} from "@openzeppelin/contracts/proxy/Proxy.sol"; import {Multicall} from "@openzeppelin/contracts/utils/Multicall.sol"; import {LibOwner} from "src/libraries/LibOwner.sol"; import {LibFunds, ERC20} from "src/libraries/LibFunds.sol"; import {LibErrors} from "src/libraries/LibErrors.sol"; import {IOwnerFacet} from "src/interfaces/IOwnerFacet.sol"; import {ISwapper} from "src/interfaces/ISwapper.sol"; contract YelayLiteVault is Proxy, Multicall { constructor( address _owner, address _ownerFacet, address underlyingAsset, address yieldExtractor, string memory uri ) { LibOwner.OwnerStorage storage s = LibOwner._getOwnerStorage(); // set owner s.owner = _owner; // set OwnerFacet selectors s.selectorToFacet[IOwnerFacet.owner.selector] = _ownerFacet; s.selectorToFacet[IOwnerFacet.pendingOwner.selector] = _ownerFacet; s.selectorToFacet[IOwnerFacet.transferOwnership.selector] = _ownerFacet; s.selectorToFacet[IOwnerFacet.acceptOwnership.selector] = _ownerFacet; s.selectorToFacet[IOwnerFacet.setSelectorToFacets.selector] = _ownerFacet; s.selectorToFacet[IOwnerFacet.selectorToFacet.selector] = _ownerFacet; // set Multicall selector s.selectorToFacet[Multicall.multicall.selector] = address(this); LibFunds.FundsStorage storage sF = LibFunds._getFundsStorage(); sF.underlyingAsset = ERC20(underlyingAsset); sF.yieldExtractor = yieldExtractor; LibFunds.ERC1155Storage storage sT = LibFunds._getERC1155Storage(); sT._uri = uri; } function _implementation() internal view override returns (address) { LibOwner.OwnerStorage storage s = LibOwner._getOwnerStorage(); address facet = s.selectorToFacet[msg.sig]; require(facet != address(0), LibErrors.InvalidSelector(msg.sig)); return facet; } receive() external payable {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/Proxy.sol) pragma solidity ^0.8.20; /** * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to * be specified by overriding the virtual {_implementation} function. * * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a * different contract through the {_delegate} function. * * The success and return data of the delegated call will be returned back to the caller of the proxy. */ abstract contract Proxy { /** * @dev Delegates the current call to `implementation`. * * This function does not return to its internal call site, it will return directly to the external caller. */ function _delegate(address implementation) internal virtual { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev This is a virtual function that should be overridden so it returns the address to which the fallback * function and {_fallback} should delegate. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates the current call to the address returned by `_implementation()`. * * This function does not return to its internal call site, it will return directly to the external caller. */ function _fallback() internal virtual { _delegate(_implementation()); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other * function in the contract matches the call data. */ fallback() external payable virtual { _fallback(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol) pragma solidity ^0.8.20; import {Errors} from "./Errors.sol"; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert Errors.InsufficientBalance(address(this).balance, amount); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert Errors.FailedCall(); } } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {Errors.FailedCall} error. * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert Errors.InsufficientBalance(address(this).balance, value); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case * of an unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {Errors.FailedCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly ("memory-safe") { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert Errors.FailedCall(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol) pragma solidity ^0.8.20; /** * @dev Collection of common custom errors used in multiple contracts * * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library. * It is recommended to avoid relying on the error API for critical functionality. * * _Available since v5.1._ */ library Errors { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error InsufficientBalance(uint256 balance, uint256 needed); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedCall(); /** * @dev The deployment failed. */ error FailedDeployment(); /** * @dev A necessary precompile is missing. */ error MissingPrecompile(address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Multicall.sol) pragma solidity ^0.8.20; import {Address} from "./Address.sol"; import {Context} from "./Context.sol"; /** * @dev Provides a function to batch together multiple calls in a single external call. * * Consider any assumption about calldata validation performed by the sender may be violated if it's not especially * careful about sending transactions invoking {multicall}. For example, a relay address that filters function * selectors won't filter calls nested within a {multicall} operation. * * NOTE: Since 5.0.1 and 4.9.4, this contract identifies non-canonical contexts (i.e. `msg.sender` is not {_msgSender}). * If a non-canonical context is identified, the following self `delegatecall` appends the last bytes of `msg.data` * to the subcall. This makes it safe to use with {ERC2771Context}. Contexts that don't affect the resolution of * {_msgSender} are not propagated to subcalls. */ abstract contract Multicall is Context { /** * @dev Receives and executes a batch of function calls on this contract. * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) { bytes memory context = msg.sender == _msgSender() ? new bytes(0) : msg.data[msg.data.length - _contextSuffixLength():]; results = new bytes[](data.length); for (uint256 i = 0; i < data.length; i++) { results[i] = Address.functionDelegateCall(address(this), bytes.concat(data[i], context)); } return results; } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Modern and gas efficient ERC20 + EIP-2612 implementation. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol) /// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol) /// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it. abstract contract ERC20 { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); /*////////////////////////////////////////////////////////////// METADATA STORAGE //////////////////////////////////////////////////////////////*/ string public name; string public symbol; uint8 public immutable decimals; /*////////////////////////////////////////////////////////////// ERC20 STORAGE //////////////////////////////////////////////////////////////*/ uint256 public totalSupply; mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowance; /*////////////////////////////////////////////////////////////// EIP-2612 STORAGE //////////////////////////////////////////////////////////////*/ uint256 internal immutable INITIAL_CHAIN_ID; bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR; mapping(address => uint256) public nonces; /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor( string memory _name, string memory _symbol, uint8 _decimals ) { name = _name; symbol = _symbol; decimals = _decimals; INITIAL_CHAIN_ID = block.chainid; INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator(); } /*////////////////////////////////////////////////////////////// ERC20 LOGIC //////////////////////////////////////////////////////////////*/ function approve(address spender, uint256 amount) public virtual returns (bool) { allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function transfer(address to, uint256 amount) public virtual returns (bool) { balanceOf[msg.sender] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(msg.sender, to, amount); return true; } function transferFrom( address from, address to, uint256 amount ) public virtual returns (bool) { uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals. if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount; balanceOf[from] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(from, to, amount); return true; } /*////////////////////////////////////////////////////////////// EIP-2612 LOGIC //////////////////////////////////////////////////////////////*/ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual { require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED"); // Unchecked because the only math done is incrementing // the owner's nonce which cannot realistically overflow. unchecked { address recoveredAddress = ecrecover( keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR(), keccak256( abi.encode( keccak256( "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" ), owner, spender, value, nonces[owner]++, deadline ) ) ) ), v, r, s ); require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER"); allowance[recoveredAddress][spender] = value; } emit Approval(owner, spender, value); } function DOMAIN_SEPARATOR() public view virtual returns (bytes32) { return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator(); } function computeDomainSeparator() internal view virtual returns (bytes32) { return keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name)), keccak256("1"), block.chainid, address(this) ) ); } /*////////////////////////////////////////////////////////////// INTERNAL MINT/BURN LOGIC //////////////////////////////////////////////////////////////*/ function _mint(address to, uint256 amount) internal virtual { totalSupply += amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(address(0), to, amount); } function _burn(address from, uint256 amount) internal virtual { balanceOf[from] -= amount; // Cannot underflow because a user's balance // will never be larger than the total supply. unchecked { totalSupply -= amount; } emit Transfer(from, address(0), amount); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; import {ERC20} from "../tokens/ERC20.sol"; /// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol) /// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer. library SafeTransferLib { /*////////////////////////////////////////////////////////////// ETH OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferETH(address to, uint256 amount) internal { bool success; /// @solidity memory-safe-assembly assembly { // Transfer the ETH and store if it succeeded or not. success := call(gas(), to, amount, 0, 0, 0, 0) } require(success, "ETH_TRANSFER_FAILED"); } /*////////////////////////////////////////////////////////////// ERC20 OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferFrom( ERC20 token, address from, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(from, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "from" argument. mstore(add(freeMemoryPointer, 36), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument. mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type. // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. success := call(gas(), token, 0, freeMemoryPointer, 100, 0, 32) // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data and token has code. if and(iszero(and(eq(mload(0), 1), gt(returndatasize(), 31))), success) { success := iszero(or(iszero(extcodesize(token)), returndatasize())) } } require(success, "TRANSFER_FROM_FAILED"); } function safeTransfer( ERC20 token, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type. // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. success := call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data and token has code. if and(iszero(and(eq(mload(0), 1), gt(returndatasize(), 31))), success) { success := iszero(or(iszero(extcodesize(token)), returndatasize())) } } require(success, "TRANSFER_FAILED"); } function safeApprove( ERC20 token, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type. // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. success := call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data and token has code. if and(iszero(and(eq(mload(0), 1), gt(returndatasize(), 31))), success) { success := iszero(or(iszero(extcodesize(token)), returndatasize())) } } require(success, "APPROVE_FAILED"); } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; struct SelectorsToFacet { address facet; bytes4[] selectors; } interface IOwnerFacet { /** * @dev Returns the address of the current owner. * @return The address of the current owner. */ function owner() external view returns (address); /** * @dev Returns the address of the pending owner. * @return The address of the pending owner. */ function pendingOwner() external view returns (address); /** * @dev Sets the mapping of function selectors to facet addresses. * @param arr An array of SelectorsToFacet structs containing the selectors and their corresponding facet addresses. */ function setSelectorToFacets(SelectorsToFacet[] calldata arr) external; /** * @dev Returns the facet address for a given function selector. * @param selector The function selector. * @return The address of the facet. */ function selectorToFacet(bytes4 selector) external view returns (address); /** * @dev Initiates the transfer of ownership to a new owner. * @param newOwner The address of the new owner. */ function transferOwnership(address newOwner) external; /** * @dev Accepts the transfer of ownership. */ function acceptOwnership() external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.28; struct SwapArgs { address tokenIn; address swapTarget; bytes swapCallData; } struct ExchangeArgs { address exchange; bool allowed; } interface ISwapper { /** * @notice Swaps tokens according to the provided swap arguments. * @param swapArgs The swap arguments. * @param tokenOut The token to be received. * @return tokenOutAmount The amount of tokenOut received. */ function swap(SwapArgs[] memory swapArgs, address tokenOut) external returns (uint256 tokenOutAmount); /** * @notice Updates the exchange allowlist. * @param exchangeArgs The exchange arguments. */ function updateExchangeAllowlist(ExchangeArgs[] calldata exchangeArgs) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.28; library LibErrors { // ===================== OwnerFacet ================================ /** * @dev The caller account is not authorized to perform an operation. * @param account The address of the unauthorized account. */ error OwnableUnauthorizedAccount(address account); /** * @dev The function selector is invalid. * @param selector The invalid function selector. */ error InvalidSelector(bytes4 selector); // ===================== ClientsFacet ================================ /** * @dev The owner address is already used by some client. */ error ClientOwnerReserved(); /** * @dev The caller is not the client owner. */ error NotClientOwner(); /** * @dev The project ID is out of bounds. */ error OutOfBoundProjectId(); /** * @dev The project is already active. */ error ProjectActive(); /** * @dev The client name is empty. */ error ClientNameEmpty(); /** * @dev The client name is empty. */ error ReservedProjectsIsZero(); /** * @dev The client name is already taken. */ error ClientNameTaken(); // ===================== FundsFacet ================================ /** * @dev The project is inactive. */ error ProjectInactive(); /** * @dev The function can only be called in a view context. */ error OnlyView(); /** * @dev Compounding the underlying asset is forbidden. */ error CompoundUnderlyingForbidden(); /** * @dev Position migration is forbidden. */ error PositionMigrationForbidden(); /** * @dev There is not enough underlying assets in YelayLiteVault to cover redeem. */ error NotEnoughInternalFunds(); /** * @dev Redeem doesn't pass minimum asset amount */ error MinRedeem(); /** * @dev During swapRewards totalAssets have been reduced */ error TotalAssetsLoss(); // ===================== SwapWrapper ================================ /** * @dev The token is not WETH. */ error NotWeth(); /** * @dev No ETH available. */ error NoEth(); // ===================== ManagementFacet ================================ /** * @dev The assets were not withdrawn from strategy. */ error StrategyNotEmpty(); /** * @dev The strategy is already registered. */ error StrategyRegistered(); /** * @dev The strategy is already active. */ error StrategyActive(); // ===================== LibPausable ================================ /** * @dev The function is paused. * @param selector The function selector that is paused. */ error Paused(bytes4 selector); // ===================== Swapper ================================ /** * @notice Used when trying to do a swap via an exchange that is not allowed to execute a swap. * @param exchange Exchange used. */ error ExchangeNotAllowed(address exchange); /** * @notice Used when there is nothing to swap. * @param tokenIn The token that was intended to be swapped. */ error NothingToSwap(address tokenIn); /** * @notice Used when nothing was swapped. * @param tokenOut The token that was intended to be received. */ error NothingSwapped(address tokenOut); // ===================== DepositLockPlugin ================================ /** * @dev The caller is not the project owner. * @param vault The address of the vault. * @param projectId The ID of the project. * @param caller The address of the caller. */ error NotProjectOwner(address vault, uint256 projectId, address caller); /** * @dev The lock period exceeds the maximum allowable period. * @param lockPeriod The lock period. */ error LockPeriodExceedsMaximum(uint256 lockPeriod); /** * @dev Lock Mode is unset for the project. * @param vault The address of the vault. * @param projectId The ID of the project. */ error LockModeNotSetForProject(address vault, uint256 projectId); /** * @dev The requested shares to remove is not available. * @param requested The requested shares to remove. * @param available The available shares to remove. */ error NotEnoughShares(uint256 requested, uint256 available); /** * @dev The project is still locked, withdrawals are not allowed. * @param unlockTime The unlock time. */ error GlobalUnlockTimeNotReached(uint256 unlockTime); /** * @dev Project is unlocked, deposits are not allowed. * @param unlockTime The unlock time. */ error GlobalUnlockTimeReached(uint256 unlockTime); /** * @dev The lock mode is already set for the project. * @param vault The address of the vault. * @param projectId The ID of the project. * @param lockMode The lock mode. */ error LockModeAlreadySet(address vault, uint256 projectId, uint256 lockMode); /** * @dev The lock mode mismatch for particular project. * @param vault The address of the vault. * @param projectId The ID of the project. * @param lockMode The lock mode. */ error LockModeMismatch(address vault, uint256 projectId, uint256 lockMode); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.28; import {ERC20} from "@solmate/utils/SafeTransferLib.sol"; library LibFunds { /** * @custom:storage-location erc7201:yelay-vault.storage.FundsFacet * @custom:member underlyingBalance The balance of the underlying asset held by the vault excluding assets in strategies. * @custom:member lastTotalAssetsUpdateInterval The interval for updating the last total assets on deposit. * @custom:member lastTotalAssets The last total assets value for yield calculation. * @custom:member lastTotalAssetsTimestamp The timestamp of the last total assets update. * @custom:member underlyingAsset The underlying asset. * @custom:member yieldExtractor The address of the yield extractor. */ struct FundsStorage { uint192 underlyingBalance; uint64 lastTotalAssetsUpdateInterval; uint192 lastTotalAssets; uint64 lastTotalAssetsTimestamp; ERC20 underlyingAsset; address yieldExtractor; } // keccak256(abi.encode(uint256(keccak256("yelay-vault.storage.FundsFacet")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant FundsStorageLocation = 0xe9f6622f42b3306a25789276a3506ebaae4fda2335fb5bfa8bfd419c0dde8100; function _getFundsStorage() internal pure returns (FundsStorage storage $) { assembly { $.slot := FundsStorageLocation } } /// @custom:storage-location erc7201:openzeppelin.storage.ERC1155 struct ERC1155Storage { mapping(uint256 id => mapping(address account => uint256)) _balances; mapping(address account => mapping(address operator => bool)) _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string _uri; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC1155")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant ERC1155StorageLocation = 0x88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c4500; function _getERC1155Storage() internal pure returns (ERC1155Storage storage $) { assembly { $.slot := ERC1155StorageLocation } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.28; import {LibErrors} from "src/libraries/LibErrors.sol"; library LibOwner { /** * @custom:storage-location erc7201:yelay-vault.storage.OwnerFacet * @custom:member owner The owner of the contract. * @custom:member pendingOwner The address pending to become the owner. * @custom:member selectorToFacet Mapping from selector to facet address. */ struct OwnerStorage { address owner; address pendingOwner; mapping(bytes4 => address) selectorToFacet; } // keccak256(abi.encode(uint256(keccak256("yelay-vault.storage.OwnerFacet")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant OWNER_STORAGE_LOCATION = 0x52b130868e76fc87849159cef46eb9bb0156aa8877197d318e4437829044d000; function _getOwnerStorage() internal pure returns (OwnerStorage storage $) { assembly { $.slot := OWNER_STORAGE_LOCATION } } /** * @dev Reverts if the caller is not the owner. */ function onlyOwner() internal view { OwnerStorage storage s = _getOwnerStorage(); require(s.owner == msg.sender, LibErrors.OwnableUnauthorizedAccount(msg.sender)); } }
{ "evmVersion": "cancun", "optimizer": { "enabled": true, "runs": 10000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_ownerFacet","type":"address"},{"internalType":"address","name":"underlyingAsset","type":"address"},{"internalType":"address","name":"yieldExtractor","type":"address"},{"internalType":"string","name":"uri","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[],"name":"FailedCall","type":"error"},{"inputs":[{"internalType":"bytes4","name":"selector","type":"bytes4"}],"name":"InvalidSelector","type":"error"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405234801561000f575f5ffd5b50604051610b2c380380610b2c83398101604081905261002e916102c1565b7f52b130868e76fc87849159cef46eb9bb0156aa8877197d318e4437829044d00080546001600160a01b038781166001600160a01b03199283161783557f52b130868e76fc87849159cef46eb9bb0156aa8877197d318e4437829044d0026020527fdf9de6333d9b6b511bfa8cbeeb3dc3be2d90cffd880d526ea09513bc0192581b805488831690841681179091557f25889e79057dc7bb2aaaafe872d794c918590f29df30e45a7fe78157ceec028780548416821790557fcc66d551a758fa48896748037c88a02e72d5395a955e0faaaa1746a7a34d8b7480548416821790557ff4eb4b4ea3404cb493ae9c5e4fa3f42b15406c4f07222a7cf62c0f5c4399d5c180548416821790557fc2bd986c8cfafde8d72d49c626f14926513cc9222f335a5df0a5e57703629b2c80548416821790557f3dbfc9200cdb6c8836b85e5aec9446156ca9c14f7d1ea4dd2afe0d779c91e2d7805484169091179055631592ca1b60e31b5f527f3ffab8aa0162aaced716a171d45904e42c38e1f5cb92c6a1989e98f67686480480548316301790557fe9f6622f42b3306a25789276a3506ebaae4fda2335fb5bfa8bfd419c0dde810280548783169084161790557fe9f6622f42b3306a25789276a3506ebaae4fda2335fb5bfa8bfd419c0dde81038054918616919092161790557fe9f6622f42b3306a25789276a3506ebaae4fda2335fb5bfa8bfd419c0dde81007f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c45007f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c45026102848582610437565b5050505050505050506104f1565b80516001600160a01b03811681146102a8575f5ffd5b919050565b634e487b7160e01b5f52604160045260245ffd5b5f5f5f5f5f60a086880312156102d5575f5ffd5b6102de86610292565b94506102ec60208701610292565b93506102fa60408701610292565b925061030860608701610292565b60808701519092506001600160401b03811115610323575f5ffd5b8601601f81018813610333575f5ffd5b80516001600160401b0381111561034c5761034c6102ad565b604051601f8201601f19908116603f011681016001600160401b038111828210171561037a5761037a6102ad565b6040528181528282016020018a1015610391575f5ffd5b8160208401602083015e5f602083830101528093505050509295509295909350565b600181811c908216806103c757607f821691505b6020821081036103e557634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561043257805f5260205f20601f840160051c810160208510156104105750805b601f840160051c820191505b8181101561042f575f815560010161041c565b50505b505050565b81516001600160401b03811115610450576104506102ad565b6104648161045e84546103b3565b846103eb565b6020601f821160018114610496575f831561047f5750848201515b5f19600385901b1c1916600184901b17845561042f565b5f84815260208120601f198516915b828110156104c557878501518255602094850194600190920191016104a5565b50848210156104e257868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b61062e806104fe5f395ff3fe608060405260043610610021575f3560e01c8063ac9650d81461003257610028565b3661002857005b610030610067565b005b34801561003d575f5ffd5b5061005161004c3660046103c4565b610079565b60405161005e9190610435565b60405180910390f35b61007761007261015f565b610253565b565b604080515f8152602081019091526060908267ffffffffffffffff8111156100a3576100a36104f5565b6040519080825280602002602001820160405280156100d657816020015b60608152602001906001900390816100c15790505b5091505f5b8381101561015757610132308686848181106100f9576100f9610522565b905060200281019061010b919061054f565b8560405160200161011e939291906105ce565b604051602081830303815290604052610271565b83828151811061014457610144610522565b60209081029190910101526001016100db565b505092915050565b5f80357fffffffff00000000000000000000000000000000000000000000000000000000168082527f52b130868e76fc87849159cef46eb9bb0156aa8877197d318e4437829044d00260205260408220547f52b130868e76fc87849159cef46eb9bb0156aa8877197d318e4437829044d0009173ffffffffffffffffffffffffffffffffffffffff909116908161024c576040517f12ba286f0000000000000000000000000000000000000000000000000000000081527fffffffff0000000000000000000000000000000000000000000000000000000090911660048201526024015b60405180910390fd5b5092915050565b365f5f375f5f365f845af43d5f5f3e80801561026d573d5ff35b3d5ffd5b60605f5f8473ffffffffffffffffffffffffffffffffffffffff168460405161029a91906105ed565b5f60405180830381855af49150503d805f81146102d2576040519150601f19603f3d011682016040523d82523d5f602084013e6102d7565b606091505b50915091506102e78583836102f0565b95945050505050565b6060826103055761030082610382565b61037b565b8151158015610329575073ffffffffffffffffffffffffffffffffffffffff84163b155b15610378576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610243565b50805b9392505050565b8051156103925780518082602001fd5b6040517fd6bda27500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f602083850312156103d5575f5ffd5b823567ffffffffffffffff8111156103eb575f5ffd5b8301601f810185136103fb575f5ffd5b803567ffffffffffffffff811115610411575f5ffd5b8560208260051b8401011115610425575f5ffd5b6020919091019590945092505050565b5f602082016020835280845180835260408501915060408160051b8601019250602086015f5b828110156104e9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0878603018452815180518087528060208301602089015e5f6020828901015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168801019650505060208201915060208401935060018101905061045b565b50929695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f5f83357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610582575f5ffd5b83018035915067ffffffffffffffff82111561059c575f5ffd5b6020019150368190038213156105b0575f5ffd5b9250929050565b5f81518060208401855e5f93019283525090919050565b828482375f8382015f81526105e381856105b7565b9695505050505050565b5f61037b82846105b756fea26469706673582212203823d1ecece47e3017f440936fafdde460ae1cee534e9a45a7855b09e62a66e764736f6c634300081c00330000000000000000000000001892e547f4e1ba76f82a09c16c9f774744de1ff3000000000000000000000000da1620236ace35387ce753a081d82868a738e6ae00000000000000000000000029219dd400f2bf60e5a23d13be72b486d40388940000000000000000000000009909ee4947be39c208607d8d2473d68c05cef8f900000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000002d68747470733a2f2f6c6974652e6170692e79656c61792e696f2f736f6e69632f6d657461646174612f7b69647d00000000000000000000000000000000000000
Deployed Bytecode
0x608060405260043610610021575f3560e01c8063ac9650d81461003257610028565b3661002857005b610030610067565b005b34801561003d575f5ffd5b5061005161004c3660046103c4565b610079565b60405161005e9190610435565b60405180910390f35b61007761007261015f565b610253565b565b604080515f8152602081019091526060908267ffffffffffffffff8111156100a3576100a36104f5565b6040519080825280602002602001820160405280156100d657816020015b60608152602001906001900390816100c15790505b5091505f5b8381101561015757610132308686848181106100f9576100f9610522565b905060200281019061010b919061054f565b8560405160200161011e939291906105ce565b604051602081830303815290604052610271565b83828151811061014457610144610522565b60209081029190910101526001016100db565b505092915050565b5f80357fffffffff00000000000000000000000000000000000000000000000000000000168082527f52b130868e76fc87849159cef46eb9bb0156aa8877197d318e4437829044d00260205260408220547f52b130868e76fc87849159cef46eb9bb0156aa8877197d318e4437829044d0009173ffffffffffffffffffffffffffffffffffffffff909116908161024c576040517f12ba286f0000000000000000000000000000000000000000000000000000000081527fffffffff0000000000000000000000000000000000000000000000000000000090911660048201526024015b60405180910390fd5b5092915050565b365f5f375f5f365f845af43d5f5f3e80801561026d573d5ff35b3d5ffd5b60605f5f8473ffffffffffffffffffffffffffffffffffffffff168460405161029a91906105ed565b5f60405180830381855af49150503d805f81146102d2576040519150601f19603f3d011682016040523d82523d5f602084013e6102d7565b606091505b50915091506102e78583836102f0565b95945050505050565b6060826103055761030082610382565b61037b565b8151158015610329575073ffffffffffffffffffffffffffffffffffffffff84163b155b15610378576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610243565b50805b9392505050565b8051156103925780518082602001fd5b6040517fd6bda27500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f602083850312156103d5575f5ffd5b823567ffffffffffffffff8111156103eb575f5ffd5b8301601f810185136103fb575f5ffd5b803567ffffffffffffffff811115610411575f5ffd5b8560208260051b8401011115610425575f5ffd5b6020919091019590945092505050565b5f602082016020835280845180835260408501915060408160051b8601019250602086015f5b828110156104e9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0878603018452815180518087528060208301602089015e5f6020828901015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168801019650505060208201915060208401935060018101905061045b565b50929695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f5f83357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610582575f5ffd5b83018035915067ffffffffffffffff82111561059c575f5ffd5b6020019150368190038213156105b0575f5ffd5b9250929050565b5f81518060208401855e5f93019283525090919050565b828482375f8382015f81526105e381856105b7565b9695505050505050565b5f61037b82846105b756fea26469706673582212203823d1ecece47e3017f440936fafdde460ae1cee534e9a45a7855b09e62a66e764736f6c634300081c0033
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.