Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 25195778 | 117 days ago | Contract Creation | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
VLFStrategyExecutorFactory
Compiler Version
v0.8.30+commit.73712a01
Optimization Enabled:
Yes with 150 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.8.23 <0.9.0;
import { BeaconProxy } from '@oz/proxy/beacon/BeaconProxy.sol';
import { IERC20 } from '@oz/token/ERC20/IERC20.sol';
import { Ownable2StepUpgradeable } from '@ozu/access/Ownable2StepUpgradeable.sol';
import { UUPSUpgradeable } from '@ozu/proxy/utils/UUPSUpgradeable.sol';
import { UpgradeableBeacon } from '@solady/utils/UpgradeableBeacon.sol';
import { IMitosisVault } from '../../interfaces/branch/IMitosisVault.sol';
import { BeaconBase } from '../../lib/proxy/BeaconBase.sol';
import { Versioned } from '../../lib/Versioned.sol';
import { VLFStrategyExecutor } from './VLFStrategyExecutor.sol';
contract VLFStrategyExecutorFactory is BeaconBase, Ownable2StepUpgradeable, UUPSUpgradeable, Versioned {
constructor() {
_disableInitializers();
}
function initialize(address owner_, address initialImpl) external initializer {
__Ownable2Step_init();
__Ownable_init(owner_);
__BeaconBase_init(new UpgradeableBeacon(address(this), address(initialImpl)));
__UUPSUpgradeable_init();
}
function create(IMitosisVault vault_, IERC20 asset_, address hubVLFVault_, address owner_)
external
onlyOwner
returns (address)
{
bytes memory args = abi.encodeCall(VLFStrategyExecutor.initialize, (vault_, asset_, hubVLFVault_, owner_));
address instance = address(new BeaconProxy(address(beacon()), args));
_pushInstance(instance);
return instance;
}
function callBeacon(bytes calldata data) external onlyOwner returns (bytes memory) {
return _callBeacon(data);
}
function _authorizeUpgrade(address) internal override onlyOwner { }
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (proxy/beacon/BeaconProxy.sol)
pragma solidity ^0.8.22;
import {IBeacon} from "./IBeacon.sol";
import {Proxy} from "../Proxy.sol";
import {ERC1967Utils} from "../ERC1967/ERC1967Utils.sol";
/**
* @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.
*
* The beacon address can only be set once during construction, and cannot be changed afterwards. It is stored in an
* immutable variable to avoid unnecessary storage reads, and also in the beacon storage slot specified by
* https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] so that it can be accessed externally.
*
* CAUTION: Since the beacon address can never be changed, you must ensure that you either control the beacon, or trust
* the beacon to not upgrade the implementation maliciously.
*
* IMPORTANT: Do not use the implementation logic to modify the beacon storage slot. Doing so would leave the proxy in
* an inconsistent state where the beacon storage slot does not match the beacon address.
*/
contract BeaconProxy is Proxy {
// An immutable address for the beacon to avoid unnecessary SLOADs before each delegate call.
address private immutable _beacon;
/**
* @dev Initializes the proxy with `beacon`.
*
* If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This
* will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity
* constructor.
*
* Requirements:
*
* - `beacon` must be a contract with the interface {IBeacon}.
* - If `data` is empty, `msg.value` must be zero.
*/
constructor(address beacon, bytes memory data) payable {
ERC1967Utils.upgradeBeaconToAndCall(beacon, data);
_beacon = beacon;
}
/**
* @dev Returns the current implementation address of the associated beacon.
*/
function _implementation() internal view virtual override returns (address) {
return IBeacon(_getBeacon()).implementation();
}
/**
* @dev Returns the beacon.
*/
function _getBeacon() internal view virtual returns (address) {
return _beacon;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.20;
import {OwnableUpgradeable} from "./OwnableUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This extension of the {Ownable} contract includes a two-step mechanism to transfer
* ownership, where the new owner must call {acceptOwnership} in order to replace the
* old one. This can help prevent common mistakes, such as transfers of ownership to
* incorrect accounts, or to contracts that are unable to interact with the
* permission system.
*
* The initial owner is specified at deployment time in the constructor for `Ownable`. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {
/// @custom:storage-location erc7201:openzeppelin.storage.Ownable2Step
struct Ownable2StepStorage {
address _pendingOwner;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable2Step")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant Ownable2StepStorageLocation = 0x237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00;
function _getOwnable2StepStorage() private pure returns (Ownable2StepStorage storage $) {
assembly {
$.slot := Ownable2StepStorageLocation
}
}
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
function __Ownable2Step_init() internal onlyInitializing {
}
function __Ownable2Step_init_unchained() internal onlyInitializing {
}
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
Ownable2StepStorage storage $ = _getOwnable2StepStorage();
return $._pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*
* Setting `newOwner` to the zero address is allowed; this can be used to cancel an initiated ownership transfer.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
Ownable2StepStorage storage $ = _getOwnable2StepStorage();
$._pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
Ownable2StepStorage storage $ = _getOwnable2StepStorage();
delete $._pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() public virtual {
address sender = _msgSender();
if (pendingOwner() != sender) {
revert OwnableUnauthorizedAccount(sender);
}
_transferOwnership(sender);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.22;
import {IERC1822Proxiable} from "@openzeppelin/contracts/interfaces/draft-IERC1822.sol";
import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol";
import {Initializable} from "./Initializable.sol";
/**
* @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
* {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
*
* A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
* reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
* `UUPSUpgradeable` with a custom implementation of upgrades.
*
* The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
*/
abstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
address private immutable __self = address(this);
/**
* @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`
* and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,
* while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.
* If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must
* be the empty byte string if no function should be called, making it impossible to invoke the `receive` function
* during an upgrade.
*/
string public constant UPGRADE_INTERFACE_VERSION = "5.0.0";
/**
* @dev The call is from an unauthorized context.
*/
error UUPSUnauthorizedCallContext();
/**
* @dev The storage `slot` is unsupported as a UUID.
*/
error UUPSUnsupportedProxiableUUID(bytes32 slot);
/**
* @dev Check that the execution is being performed through a delegatecall call and that the execution context is
* a proxy contract with an implementation (as defined in ERC-1967) pointing to self. This should only be the case
* for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
* function through ERC-1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
* fail.
*/
modifier onlyProxy() {
_checkProxy();
_;
}
/**
* @dev Check that the execution is not being performed through a delegate call. This allows a function to be
* callable on the implementing contract but not through proxies.
*/
modifier notDelegated() {
_checkNotDelegated();
_;
}
function __UUPSUpgradeable_init() internal onlyInitializing {
}
function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
}
/**
* @dev Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the
* implementation. It is used to validate the implementation's compatibility when performing an upgrade.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
*/
function proxiableUUID() external view virtual notDelegated returns (bytes32) {
return ERC1967Utils.IMPLEMENTATION_SLOT;
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
* encoded in `data`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
*/
function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, data);
}
/**
* @dev Reverts if the execution is not performed via delegatecall or the execution
* context is not of a proxy with an ERC-1967 compliant implementation pointing to self.
* See {_onlyProxy}.
*/
function _checkProxy() internal view virtual {
if (
address(this) == __self || // Must be called through delegatecall
ERC1967Utils.getImplementation() != __self // Must be called through an active proxy
) {
revert UUPSUnauthorizedCallContext();
}
}
/**
* @dev Reverts if the execution is performed via delegatecall.
* See {notDelegated}.
*/
function _checkNotDelegated() internal view virtual {
if (address(this) != __self) {
// Must not be called through delegatecall
revert UUPSUnauthorizedCallContext();
}
}
/**
* @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeToAndCall}.
*
* Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
*
* ```solidity
* function _authorizeUpgrade(address) internal onlyOwner {}
* ```
*/
function _authorizeUpgrade(address newImplementation) internal virtual;
/**
* @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.
*
* As a security check, {proxiableUUID} is invoked in the new implementation, and the return value
* is expected to be the implementation slot in ERC-1967.
*
* Emits an {IERC1967-Upgraded} event.
*/
function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {
try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {
if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {
revert UUPSUnsupportedProxiableUUID(slot);
}
ERC1967Utils.upgradeToAndCall(newImplementation, data);
} catch {
// The implementation is not UUPS
revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/// @notice Upgradeable beacon for ERC1967 beacon proxies.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/UpgradeableBeacon.sol)
/// @author Modified from OpenZeppelin
/// (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/proxy/beacon/UpgradeableBeacon.sol)
///
/// @dev Note:
/// - The implementation is intended to be used with ERC1967 beacon proxies.
/// See: `LibClone.deployERC1967BeaconProxy` and related functions.
/// - For gas efficiency, the ownership functionality is baked into this contract.
///
/// Optimized creation code (hex-encoded):
/// `60406101c73d393d5160205180821760a01c3d3d3e803b1560875781684343a0dc92ed22dbfc558068911c5a209f08d5ec5e557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b3d38a23d7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e03d38a3610132806100953d393df35b636d3e283b3d526004601cfdfe3d3560e01c635c60da1b14610120573d3560e01c80638da5cb5b1461010e5780633659cfe61460021b8163f2fde38b1460011b179063715018a6141780153d3d3e684343a0dc92ed22dbfc805490813303610101573d9260068116610089575b508290557f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e03d38a3005b925060048035938460a01c60243610173d3d3e146100ba5782156100ad573861005f565b637448fbae3d526004601cfd5b82803b156100f4578068911c5a209f08d5ec5e557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b3d38a2005b636d3e283b3d526004601cfd5b6382b429003d526004601cfd5b684343a0dc92ed22dbfc543d5260203df35b68911c5a209f08d5ec5e543d5260203df3`.
/// See: https://gist.github.com/Vectorized/365bd7f6e9a848010f00adb9e50a2516
///
/// To get the initialization code:
/// `abi.encodePacked(creationCode, abi.encode(initialOwner, initialImplementation))`
///
/// This optimized bytecode is compiled via Yul and is not verifiable via Etherscan
/// at the time of writing. For best gas efficiency, deploy the Yul version.
/// The Solidity version is provided as an interface / reference.
contract UpgradeableBeacon {
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CUSTOM ERRORS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The new implementation is not a deployed contract.
error NewImplementationHasNoCode();
/// @dev The caller is not authorized to perform the operation.
error Unauthorized();
/// @dev The `newOwner` cannot be the zero address.
error NewOwnerIsZeroAddress();
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* EVENTS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Emitted when the proxy's implementation is upgraded.
event Upgraded(address indexed implementation);
/// @dev The ownership is transferred from `oldOwner` to `newOwner`.
/// This event is intentionally kept the same as OpenZeppelin's Ownable to be
/// compatible with indexers and [EIP-173](https://eips.ethereum.org/EIPS/eip-173),
/// despite it not being as lightweight as a single argument event.
event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);
/// @dev `keccak256(bytes("Upgraded(address)"))`.
uint256 private constant _UPGRADED_EVENT_SIGNATURE =
0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b;
/// @dev `keccak256(bytes("OwnershipTransferred(address,address)"))`.
uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE =
0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0;
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* STORAGE */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The storage slot for the implementation address.
/// `uint72(bytes9(keccak256("_UPGRADEABLE_BEACON_IMPLEMENTATION_SLOT")))`.
uint256 internal constant _UPGRADEABLE_BEACON_IMPLEMENTATION_SLOT = 0x911c5a209f08d5ec5e;
/// @dev The storage slot for the owner address.
/// `uint72(bytes9(keccak256("_UPGRADEABLE_BEACON_OWNER_SLOT")))`.
uint256 internal constant _UPGRADEABLE_BEACON_OWNER_SLOT = 0x4343a0dc92ed22dbfc;
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CONSTRUCTOR */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
constructor(address initialOwner, address initialImplementation) payable {
_constructUpgradeableBeacon(initialOwner, initialImplementation);
}
/// @dev Called in the constructor. Override as required.
function _constructUpgradeableBeacon(address initialOwner, address initialImplementation)
internal
virtual
{
_initializeUpgradeableBeacon(initialOwner, initialImplementation);
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* UPGRADEABLE BEACON OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Required to be called in the constructor or initializer.
/// This function does not guard against double-initialization.
function _initializeUpgradeableBeacon(address initialOwner, address initialImplementation)
internal
virtual
{
// We don't need to check if `initialOwner` is the zero address here,
// as some use cases may not want the beacon to be owned.
_setOwner(initialOwner);
_setImplementation(initialImplementation);
}
/// @dev Sets the implementation directly without authorization guard.
function _setImplementation(address newImplementation) internal virtual {
/// @solidity memory-safe-assembly
assembly {
newImplementation := shr(96, shl(96, newImplementation)) // Clean the upper 96 bits.
if iszero(extcodesize(newImplementation)) {
mstore(0x00, 0x6d3e283b) // `NewImplementationHasNoCode()`.
revert(0x1c, 0x04)
}
sstore(_UPGRADEABLE_BEACON_IMPLEMENTATION_SLOT, newImplementation) // Store the implementation.
// Emit the {Upgraded} event.
log2(codesize(), 0x00, _UPGRADED_EVENT_SIGNATURE, newImplementation)
}
}
/// @dev Sets the owner directly without authorization guard.
function _setOwner(address newOwner) internal virtual {
/// @solidity memory-safe-assembly
assembly {
newOwner := shr(96, shl(96, newOwner)) // Clean the upper 96 bits.
let oldOwner := sload(_UPGRADEABLE_BEACON_OWNER_SLOT)
sstore(_UPGRADEABLE_BEACON_OWNER_SLOT, newOwner) // Store the owner.
// Emit the {OwnershipTransferred} event.
log3(codesize(), 0x00, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, oldOwner, newOwner)
}
}
/// @dev Returns the implementation stored in the beacon.
/// See: https://eips.ethereum.org/EIPS/eip-1967#beacon-contract-address
function implementation() public view returns (address result) {
/// @solidity memory-safe-assembly
assembly {
result := sload(_UPGRADEABLE_BEACON_IMPLEMENTATION_SLOT)
}
}
/// @dev Returns the owner of the beacon.
function owner() public view returns (address result) {
/// @solidity memory-safe-assembly
assembly {
result := sload(_UPGRADEABLE_BEACON_OWNER_SLOT)
}
}
/// @dev Allows the owner to upgrade the implementation.
function upgradeTo(address newImplementation) public virtual onlyOwner {
_setImplementation(newImplementation);
}
/// @dev Allows the owner to transfer the ownership to `newOwner`.
function transferOwnership(address newOwner) public virtual onlyOwner {
/// @solidity memory-safe-assembly
assembly {
if iszero(shl(96, newOwner)) {
mstore(0x00, 0x7448fbae) // `NewOwnerIsZeroAddress()`.
revert(0x1c, 0x04)
}
}
_setOwner(newOwner);
}
/// @dev Allows the owner to renounce their ownership.
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/// @dev Throws if the sender is not the owner.
function _checkOwner() internal view virtual {
/// @solidity memory-safe-assembly
assembly {
// If the caller is not the stored owner, revert.
if iszero(eq(caller(), sload(_UPGRADEABLE_BEACON_OWNER_SLOT))) {
mstore(0x00, 0x82b42900) // `Unauthorized()`.
revert(0x1c, 0x04)
}
}
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* MODIFIERS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Marks a function as only callable by the owner.
modifier onlyOwner() virtual {
_checkOwner();
_;
}
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.28;
import { IMitosisVaultVLF } from './IMitosisVaultVLF.sol';
enum AssetAction {
None,
Deposit
}
interface IMitosisVault is IMitosisVaultVLF {
//=========== NOTE: EVENT DEFINITIONS ===========//
event CapSet(address indexed setter, address indexed asset, uint256 prevMaxCap, uint256 newMaxCap);
event AssetInitialized(address asset);
event Deposited(address indexed asset, address indexed to, uint256 amount);
event Withdrawn(address indexed asset, address indexed to, uint256 amount);
event EntrypointSet(address entrypoint);
event AssetHalted(address indexed asset, AssetAction action);
event AssetResumed(address indexed asset, AssetAction action);
//=========== NOTE: ERROR DEFINITIONS ===========//
error IMitosisVault__ExceededCap(address asset, uint256 increasedSupply, uint256 availableCap);
error IMitosisVault__InsufficientBalance(address asset, uint256 amount);
error IMitosisVault__AssetNotInitialized(address asset);
error IMitosisVault__AssetAlreadyInitialized(address asset);
//=========== NOTE: View functions ===========//
function isAssetInitialized(address asset) external view returns (bool);
function entrypoint() external view returns (address);
function quoteDeposit(address asset, address to, uint256 amount) external view returns (uint256);
//=========== NOTE: Asset ===========//
/// @dev Hyperlane message receiver
function initializeAsset(address asset) external;
/// @dev Hyperlane message sender
function deposit(address asset, address to, uint256 amount) external payable;
/// @dev Hyperlane message receiver
function withdraw(address asset, address to, uint256 amount) external;
//=========== NOTE: OWNABLE FUNCTIONS ===========//
function setEntrypoint(address entrypoint) external;
}// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.8.23 <0.9.0;
import { ContextUpgradeable } from '@ozu/utils/ContextUpgradeable.sol';
import { UpgradeableBeacon } from '@solady/utils/UpgradeableBeacon.sol';
import { IBeaconBase } from '../../interfaces/lib/proxy/IBeaconBase.sol';
import { ERC7201Utils } from '../ERC7201Utils.sol';
import { StdError } from '../StdError.sol';
abstract contract BeaconBase is IBeaconBase, ContextUpgradeable {
using ERC7201Utils for string;
struct BeaconBaseStorage {
UpgradeableBeacon beacon;
address[] instances;
mapping(address => uint256) instanceIndex;
}
string private constant _NAMESPACE = 'mitosis.storage.BeaconBase';
bytes32 private immutable _slot = _NAMESPACE.storageSlot();
function _getBeaconBaseStorage() private view returns (BeaconBaseStorage storage $) {
bytes32 slot = _slot;
// slither-disable-next-line assembly
assembly {
$.slot := slot
}
}
function __BeaconBase_init(UpgradeableBeacon beacon_) internal {
require(address(beacon_).code.length > 0, StdError.InvalidAddress('beacon'));
__Context_init();
BeaconBaseStorage storage $ = _getBeaconBaseStorage();
$.beacon = beacon_;
}
function beacon() public view returns (address) {
return address(_getBeaconBaseStorage().beacon);
}
function isInstance(address instance) external view returns (bool) {
BeaconBaseStorage storage $ = _getBeaconBaseStorage();
if ($.instances.length == 0) return false;
uint256 index = $.instanceIndex[instance];
if (index == 0 && $.instances[0] != instance) return false;
return true;
}
function instances(uint256 index) external view returns (address) {
BeaconBaseStorage storage $ = _getBeaconBaseStorage();
uint256 instancesLen = $.instances.length;
require(index < instancesLen, IBeaconBase__IndexOutOfBounds(instancesLen, index));
return $.instances[index];
}
function instances(uint256[] calldata indexes) external view returns (address[] memory) {
BeaconBaseStorage storage $ = _getBeaconBaseStorage();
address[] memory result = new address[](indexes.length);
uint256 instancesLen = $.instances.length;
uint256 indexesLen = indexes.length;
for (uint256 i = 0; i < indexesLen; i++) {
uint256 index = indexes[i];
require(index < instancesLen, IBeaconBase__IndexOutOfBounds(instancesLen, index));
result[i] = $.instances[index];
}
return result;
}
function instancesLength() external view returns (uint256) {
return _getBeaconBaseStorage().instances.length;
}
function _callBeacon(bytes calldata data) internal returns (bytes memory) {
(bool success, bytes memory result) = address(beacon()).call(data);
require(success, IBeaconBase__BeaconCallFailed(result));
emit BeaconExecuted(_msgSender(), data, success, result);
return result;
}
function _pushInstance(address instance) internal {
BeaconBaseStorage storage $ = _getBeaconBaseStorage();
$.instances.push(instance);
$.instanceIndex[instance] = $.instances.length - 1;
emit InstanceAdded(instance);
}
}// SPDX-License-Identifier: Apache-2.0
// THIS IS GENERATED FILE. DO NOT EDIT.
pragma solidity ^0.8.28;
import { IVersioned } from '../interfaces/lib/IVersioned.sol';
contract Versioned is IVersioned {
string public constant GIT_TAG = 'v1.1.0';
string public constant GIT_COMMIT = '4f6a15a0854cb1db34ba7ccc11aa61e1f7c13bac';
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.28;
import { IERC20 } from '@oz/token/ERC20/IERC20.sol';
import { SafeERC20 } from '@oz/token/ERC20/utils/SafeERC20.sol';
import { Address } from '@oz/utils/Address.sol';
import { ReentrancyGuard } from '@oz/utils/ReentrancyGuard.sol';
import { Ownable2StepUpgradeable } from '@ozu/access/Ownable2StepUpgradeable.sol';
import { IMitosisVault } from '../../interfaces/branch/IMitosisVault.sol';
import { IStrategyExecutor } from '../../interfaces/branch/strategy/IStrategyExecutor.sol';
import { IVLFStrategyExecutor } from '../../interfaces/branch/strategy/IVLFStrategyExecutor.sol';
import { ITally } from '../../interfaces/branch/strategy/tally/ITally.sol';
import { StdError } from '../../lib/StdError.sol';
import { Versioned } from '../../lib/Versioned.sol';
import { VLFStrategyExecutorStorageV1 } from './VLFStrategyExecutorStorageV1.sol';
contract VLFStrategyExecutor is
IStrategyExecutor,
IVLFStrategyExecutor,
Ownable2StepUpgradeable,
ReentrancyGuard,
VLFStrategyExecutorStorageV1,
Versioned
{
using SafeERC20 for IERC20;
using Address for address;
//=========== NOTE: INITIALIZATION FUNCTIONS ===========//
constructor() {
_disableInitializers();
}
fallback() external payable {
revert StdError.NotSupported();
}
receive() external payable {
Address.sendValue(payable(_getStorageV1().strategist), msg.value);
}
function initialize(IMitosisVault vault_, IERC20 asset_, address hubVLFVault_, address owner_) public initializer {
__Ownable2Step_init();
__Ownable_init(owner_);
StorageV1 storage $ = _getStorageV1();
$.vault = vault_;
$.asset = asset_;
$.hubVLFVault = hubVLFVault_;
}
//=========== NOTE: VIEW FUNCTIONS ===========//
function vault() external view returns (IMitosisVault) {
return _getStorageV1().vault;
}
function asset() external view returns (IERC20) {
return _getStorageV1().asset;
}
function hubVLFVault() external view returns (address) {
return _getStorageV1().hubVLFVault;
}
function strategist() external view returns (address) {
return _getStorageV1().strategist;
}
function executor() external view returns (address) {
return _getStorageV1().executor;
}
function tally() external view returns (ITally) {
return _getStorageV1().tally;
}
function totalBalance() external view returns (uint256) {
return _totalBalance(_getStorageV1());
}
function storedTotalBalance() external view returns (uint256) {
return _getStorageV1().storedTotalBalance;
}
function quoteDeallocateLiquidity(uint256 amount) external view returns (uint256) {
StorageV1 memory $ = _getStorageV1();
return $.vault.quoteDeallocateVLF($.hubVLFVault, amount);
}
function quoteSettleYield(uint256 amount) external view returns (uint256) {
StorageV1 memory $ = _getStorageV1();
return $.vault.quoteSettleVLFYield($.hubVLFVault, amount);
}
function quoteSettleLoss(uint256 amount) external view returns (uint256) {
StorageV1 memory $ = _getStorageV1();
return $.vault.quoteSettleVLFLoss($.hubVLFVault, amount);
}
function quoteSettleExtraRewards(address reward, uint256 amount) external view returns (uint256) {
StorageV1 memory $ = _getStorageV1();
return $.vault.quoteSettleVLFExtraRewards($.hubVLFVault, reward, amount);
}
//=========== NOTE: STRATEGIST FUNCTIONS ===========//
function deallocateLiquidity(uint256 amount) external payable {
require(amount > 0, StdError.ZeroAmount());
StorageV1 memory $ = _getStorageV1();
_assertOnlyStrategist($);
$.vault.deallocateVLF{ value: msg.value }($.hubVLFVault, amount);
}
function fetchLiquidity(uint256 amount) external {
require(amount > 0, StdError.ZeroAmount());
StorageV1 storage $ = _getStorageV1();
_assertOnlyStrategist($);
$.vault.fetchVLF($.hubVLFVault, amount);
$.storedTotalBalance += amount;
}
function returnLiquidity(uint256 amount) external {
require(amount > 0, StdError.ZeroAmount());
StorageV1 storage $ = _getStorageV1();
_assertOnlyStrategist($);
$.asset.forceApprove(address($.vault), amount);
$.vault.returnVLF($.hubVLFVault, amount);
$.storedTotalBalance -= amount;
}
function settle() external payable nonReentrant {
StorageV1 storage $ = _getStorageV1();
_assertOnlyStrategist($);
uint256 totalBalance_ = _totalBalance($);
uint256 storedTotalBalance_ = $.storedTotalBalance;
$.storedTotalBalance = totalBalance_;
if (totalBalance_ >= storedTotalBalance_) {
$.vault.settleVLFYield{ value: msg.value }($.hubVLFVault, totalBalance_ - storedTotalBalance_);
} else {
$.vault.settleVLFLoss{ value: msg.value }($.hubVLFVault, storedTotalBalance_ - totalBalance_);
}
}
function settleExtraRewards(address reward, uint256 amount) external payable {
require(amount > 0, StdError.ZeroAmount());
StorageV1 memory $ = _getStorageV1();
_assertOnlyStrategist($);
require(reward != address($.asset), StdError.InvalidAddress('reward'));
IERC20(reward).forceApprove(address($.vault), amount);
$.vault.settleVLFExtraRewards{ value: msg.value }($.hubVLFVault, reward, amount);
}
//=========== NOTE: EXECUTOR FUNCTIONS ===========//
function execute(address target, bytes calldata data, uint256 value)
external
payable
nonReentrant
returns (bytes memory result)
{
StorageV1 memory $ = _getStorageV1();
_assertOnlyExecutor($);
result = target.functionCallWithValue(data, value);
}
function execute(address[] calldata targets, bytes[] calldata data, uint256[] calldata values)
external
payable
nonReentrant
returns (bytes[] memory results)
{
require(targets.length == data.length && data.length == values.length, StdError.InvalidParameter('executeData'));
StorageV1 memory $ = _getStorageV1();
_assertOnlyExecutor($);
uint256 targetsLength = targets.length;
results = new bytes[](targetsLength);
for (uint256 i; i < targetsLength; ++i) {
results[i] = targets[i].functionCallWithValue(data[i], values[i]);
}
}
//=========== NOTE: OWNABLE FUNCTIONS ===========//
function setTally(address implementation) external onlyOwner {
require(implementation.code.length > 0, StdError.InvalidAddress('implementation'));
StorageV1 storage $ = _getStorageV1();
require(
address($.tally) == address(0) || _tallyTotalBalance($) == 0,
IVLFStrategyExecutor.IVLFStrategyExecutor__TallyTotalBalanceNotZero(implementation)
);
$.tally = ITally(implementation);
emit TallySet(implementation);
}
function setStrategist(address strategist_) external onlyOwner {
require(strategist_ != address(0), StdError.InvalidAddress('strategist'));
_getStorageV1().strategist = strategist_;
emit StrategistSet(strategist_);
}
function setExecutor(address executor_) external onlyOwner {
require(executor_ != address(0), StdError.InvalidAddress('executor'));
_getStorageV1().executor = executor_;
emit ExecutorSet(executor_);
}
function unsetStrategist() external onlyOwner {
_getStorageV1().strategist = address(0);
emit StrategistSet(address(0));
}
function unsetExecutor() external onlyOwner {
_getStorageV1().executor = address(0);
emit ExecutorSet(address(0));
}
//=========== NOTE: INTERNAL FUNCTIONS ===========//
function _assertOnlyStrategist(StorageV1 memory $) internal view {
address strategist_ = $.strategist;
require(strategist_ != address(0), IVLFStrategyExecutor.IVLFStrategyExecutor__StrategistNotSet());
require(_msgSender() == strategist_, StdError.Unauthorized());
}
function _assertOnlyExecutor(StorageV1 memory $) internal view {
address executor_ = $.executor;
require(executor_ != address(0), IVLFStrategyExecutor.IVLFStrategyExecutor__ExecutorNotSet());
require(_msgSender() == executor_, StdError.Unauthorized());
}
function _tallyTotalBalance(StorageV1 storage $) internal view returns (uint256) {
bytes memory context;
return
$.tally.pendingDepositBalance(context) + $.tally.totalBalance(context) + $.tally.pendingWithdrawBalance(context);
}
function _totalBalance(StorageV1 storage $) internal view returns (uint256) {
return $.asset.balanceOf(address(this)) + _tallyTotalBalance($);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)
pragma solidity ^0.8.20;
/**
* @dev This is the interface that {BeaconProxy} expects of its beacon.
*/
interface IBeacon {
/**
* @dev Must return an address that can be used as a delegate call target.
*
* {UpgradeableBeacon} will check that this address is a contract.
*/
function implementation() external view returns (address);
}// 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.2.0) (proxy/ERC1967/ERC1967Utils.sol)
pragma solidity ^0.8.22;
import {IBeacon} from "../beacon/IBeacon.sol";
import {IERC1967} from "../../interfaces/IERC1967.sol";
import {Address} from "../../utils/Address.sol";
import {StorageSlot} from "../../utils/StorageSlot.sol";
/**
* @dev This library provides getters and event emitting update functions for
* https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.
*/
library ERC1967Utils {
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1.
*/
// solhint-disable-next-line private-vars-leading-underscore
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev The `implementation` of the proxy is invalid.
*/
error ERC1967InvalidImplementation(address implementation);
/**
* @dev The `admin` of the proxy is invalid.
*/
error ERC1967InvalidAdmin(address admin);
/**
* @dev The `beacon` of the proxy is invalid.
*/
error ERC1967InvalidBeacon(address beacon);
/**
* @dev An upgrade function sees `msg.value > 0` that may be lost.
*/
error ERC1967NonPayable();
/**
* @dev Returns the current implementation address.
*/
function getImplementation() internal view returns (address) {
return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;
}
/**
* @dev Stores a new address in the ERC-1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
if (newImplementation.code.length == 0) {
revert ERC1967InvalidImplementation(newImplementation);
}
StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;
}
/**
* @dev Performs implementation upgrade with additional setup call if data is nonempty.
* This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
* to avoid stuck value in the contract.
*
* Emits an {IERC1967-Upgraded} event.
*/
function upgradeToAndCall(address newImplementation, bytes memory data) internal {
_setImplementation(newImplementation);
emit IERC1967.Upgraded(newImplementation);
if (data.length > 0) {
Address.functionDelegateCall(newImplementation, data);
} else {
_checkNonPayable();
}
}
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1.
*/
// solhint-disable-next-line private-vars-leading-underscore
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Returns the current admin.
*
* TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using
* the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
* `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
*/
function getAdmin() internal view returns (address) {
return StorageSlot.getAddressSlot(ADMIN_SLOT).value;
}
/**
* @dev Stores a new address in the ERC-1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
if (newAdmin == address(0)) {
revert ERC1967InvalidAdmin(address(0));
}
StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {IERC1967-AdminChanged} event.
*/
function changeAdmin(address newAdmin) internal {
emit IERC1967.AdminChanged(getAdmin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
* This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1.
*/
// solhint-disable-next-line private-vars-leading-underscore
bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;
/**
* @dev Returns the current beacon.
*/
function getBeacon() internal view returns (address) {
return StorageSlot.getAddressSlot(BEACON_SLOT).value;
}
/**
* @dev Stores a new beacon in the ERC-1967 beacon slot.
*/
function _setBeacon(address newBeacon) private {
if (newBeacon.code.length == 0) {
revert ERC1967InvalidBeacon(newBeacon);
}
StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;
address beaconImplementation = IBeacon(newBeacon).implementation();
if (beaconImplementation.code.length == 0) {
revert ERC1967InvalidImplementation(beaconImplementation);
}
}
/**
* @dev Change the beacon and trigger a setup call if data is nonempty.
* This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
* to avoid stuck value in the contract.
*
* Emits an {IERC1967-BeaconUpgraded} event.
*
* CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since
* it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for
* efficiency.
*/
function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {
_setBeacon(newBeacon);
emit IERC1967.BeaconUpgraded(newBeacon);
if (data.length > 0) {
Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
} else {
_checkNonPayable();
}
}
/**
* @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract
* if an upgrade doesn't perform an initialization call.
*/
function _checkNonPayable() private {
if (msg.value > 0) {
revert ERC1967NonPayable();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
/// @custom:storage-location erc7201:openzeppelin.storage.Ownable
struct OwnableStorage {
address _owner;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;
function _getOwnableStorage() private pure returns (OwnableStorage storage $) {
assembly {
$.slot := OwnableStorageLocation
}
}
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
function __Ownable_init(address initialOwner) internal onlyInitializing {
__Ownable_init_unchained(initialOwner);
}
function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
OwnableStorage storage $ = _getOwnableStorage();
return $._owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
OwnableStorage storage $ = _getOwnableStorage();
address oldOwner = $._owner;
$._owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.20;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Storage of the initializable contract.
*
* It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
* when using with upgradeable contracts.
*
* @custom:storage-location erc7201:openzeppelin.storage.Initializable
*/
struct InitializableStorage {
/**
* @dev Indicates that the contract has been initialized.
*/
uint64 _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool _initializing;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;
/**
* @dev The contract is already initialized.
*/
error InvalidInitialization();
/**
* @dev The contract is not initializing.
*/
error NotInitializing();
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint64 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
* number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
* production.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
// Cache values to avoid duplicated sloads
bool isTopLevelCall = !$._initializing;
uint64 initialized = $._initialized;
// Allowed calls:
// - initialSetup: the contract is not in the initializing state and no previous version was
// initialized
// - construction: the contract is initialized at version 1 (no reininitialization) and the
// current contract is just being deployed
bool initialSetup = initialized == 0 && isTopLevelCall;
bool construction = initialized == 1 && address(this).code.length == 0;
if (!initialSetup && !construction) {
revert InvalidInitialization();
}
$._initialized = 1;
if (isTopLevelCall) {
$._initializing = true;
}
_;
if (isTopLevelCall) {
$._initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint64 version) {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing || $._initialized >= version) {
revert InvalidInitialization();
}
$._initialized = version;
$._initializing = true;
_;
$._initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
_checkInitializing();
_;
}
/**
* @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
*/
function _checkInitializing() internal view virtual {
if (!_isInitializing()) {
revert NotInitializing();
}
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing) {
revert InvalidInitialization();
}
if ($._initialized != type(uint64).max) {
$._initialized = type(uint64).max;
emit Initialized(type(uint64).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint64) {
return _getInitializableStorage()._initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _getInitializableStorage()._initializing;
}
/**
* @dev Returns a pointer to the storage namespace.
*/
// solhint-disable-next-line var-name-mixedcase
function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
assembly {
$.slot := INITIALIZABLE_STORAGE
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC1822.sol)
pragma solidity ^0.8.20;
/**
* @dev ERC-1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
* proxy whose upgrades are fully controlled by the current implementation.
*/
interface IERC1822Proxiable {
/**
* @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
* address.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy.
*/
function proxiableUUID() external view returns (bytes32);
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.28;
enum VLFAction {
None,
FetchVLF
}
interface IMitosisVaultVLF {
//=========== NOTE: EVENT DEFINITIONS ===========//
event VLFInitialized(address hubVLFVault, address asset);
event VLFDepositedWithSupply(address indexed asset, address indexed to, address indexed hubVLFVault, uint256 amount);
event VLFAllocated(address indexed hubVLFVault, uint256 amount);
event VLFDeallocated(address indexed hubVLFVault, uint256 amount);
event VLFFetched(address indexed hubVLFVault, uint256 amount);
event VLFReturned(address indexed hubVLFVault, uint256 amount);
event VLFYieldSettled(address indexed hubVLFVault, uint256 amount);
event VLFLossSettled(address indexed hubVLFVault, uint256 amount);
event VLFExtraRewardsSettled(address indexed hubVLFVault, address indexed reward, uint256 amount);
event VLFHalted(address indexed hubVLFVault, VLFAction action);
event VLFResumed(address indexed hubVLFVault, VLFAction action);
event VLFStrategyExecutorSet(address indexed hubVLFVault, address indexed strategyExecutor);
//=========== NOTE: ERROR DEFINITIONS ===========//
error IMitosisVaultVLF__VLFNotInitialized(address hubVLFVault);
error IMitosisVaultVLF__VLFAlreadyInitialized(address hubVLFVault);
error IMitosisVaultVLF__InvalidVLF(address hubVLFVault, address asset);
error IMitosisVaultVLF__StrategyExecutorNotDrained(address hubVLFVault, address strategyExecutor);
//=========== NOTE: View functions ===========//
function isVLFInitialized(address hubVLFVault) external view returns (bool);
function availableVLF(address hubVLFVault) external view returns (uint256);
function vlfStrategyExecutor(address hubVLFVault) external view returns (address);
//=========== NOTE: QUOTE FUNCTIONS ===========//
function quoteDepositWithSupplyVLF(address asset, address to, address hubVLFVault, uint256 amount)
external
view
returns (uint256);
function quoteDeallocateVLF(address hubVLFVault, uint256 amount) external view returns (uint256);
function quoteSettleVLFYield(address hubVLFVault, uint256 amount) external view returns (uint256);
function quoteSettleVLFLoss(address hubVLFVault, uint256 amount) external view returns (uint256);
function quoteSettleVLFExtraRewards(address hubVLFVault, address reward, uint256 amount)
external
view
returns (uint256);
//=========== NOTE: Asset ===========//
function depositWithSupplyVLF(address asset, address to, address hubVLFVault, uint256 amount) external payable;
//=========== NOTE: VLF ===========//
function initializeVLF(address hubVLFVault, address asset) external;
function allocateVLF(address hubVLFVault, uint256 amount) external;
function deallocateVLF(address hubVLFVault, uint256 amount) external payable;
function fetchVLF(address hubVLFVault, uint256 amount) external;
function returnVLF(address hubVLFVault, uint256 amount) external;
function settleVLFYield(address hubVLFVault, uint256 amount) external payable;
function settleVLFLoss(address hubVLFVault, uint256 amount) external payable;
function settleVLFExtraRewards(address hubVLFVault, address reward, uint256 amount) external payable;
//=========== NOTE: Ownable ===========//
function setVLFStrategyExecutor(address hubVLFVault, address strategyExecutor) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @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 ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
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: Apache-2.0
pragma solidity >=0.8.23 <0.9.0;
interface IBeaconBase {
event InstanceAdded(address indexed instance);
event BeaconExecuted(address indexed caller, bytes data, bool success, bytes ret);
error IBeaconBase__IndexOutOfBounds(uint256 max, uint256 given);
error IBeaconBase__BeaconCallFailed(bytes revertData);
function beacon() external view returns (address);
function isInstance(address instance) external view returns (bool);
function instances(uint256 index) external view returns (address);
function instances(uint256[] memory indexes) external view returns (address[] memory);
function instancesLength() external view returns (uint256);
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.28;
library ERC7201Utils {
function storageSlot(string memory namespace) internal pure returns (bytes32 slot) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, sub(keccak256(add(namespace, 0x20), mload(namespace)), 1))
slot := and(keccak256(0x00, 0x20), not(0xff))
}
}
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.28;
library StdError {
error Halted();
error Unauthorized();
error NotFound(string description);
error NotImplemented();
error NotSupported();
error InvalidId(string description);
error InvalidAddress(string description);
error InvalidParameter(string description);
error ZeroAmount();
error ZeroAddress(string description);
error EnumOutOfBounds(uint8 max, uint8 actual);
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.28;
interface IVersioned {
function GIT_TAG() external view returns (string memory);
function GIT_COMMIT() external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.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, bytes memory returndata) = recipient.call{value: amount}("");
if (!success) {
_revert(returndata);
}
}
/**
* @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.1.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.28;
import { IERC20 } from '@oz/token/ERC20/IERC20.sol';
import { IMitosisVault } from '../IMitosisVault.sol';
interface IStrategyExecutor {
//=========== NOTE: EVENT DEFINITIONS ===========//
event TallySet(address indexed implementation);
event StrategistSet(address indexed strategist);
event ExecutorSet(address indexed executor);
function execute(address target, bytes calldata data, uint256 value) external payable returns (bytes memory result);
function execute(address[] calldata targets, bytes[] calldata data, uint256[] calldata values)
external
payable
returns (bytes[] memory results);
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.28;
import { IERC20 } from '@oz/token/ERC20/IERC20.sol';
import { IMitosisVault } from '../IMitosisVault.sol';
import { IStrategyExecutor } from './IStrategyExecutor.sol';
import { ITally } from './tally/ITally.sol';
interface IVLFStrategyExecutor is IStrategyExecutor {
error IVLFStrategyExecutor__TallyTotalBalanceNotZero(address implementation);
error IVLFStrategyExecutor__TallyAlreadySet(address implementation);
error IVLFStrategyExecutor__StrategistNotSet();
error IVLFStrategyExecutor__ExecutorNotSet();
function vault() external view returns (IMitosisVault);
function asset() external view returns (IERC20);
function hubVLFVault() external view returns (address);
function strategist() external view returns (address);
function executor() external view returns (address);
function tally() external view returns (ITally);
function totalBalance() external view returns (uint256);
function storedTotalBalance() external view returns (uint256);
function quoteDeallocateLiquidity(uint256 amount) external view returns (uint256);
function quoteSettleYield(uint256 amount) external view returns (uint256);
function quoteSettleLoss(uint256 amount) external view returns (uint256);
function quoteSettleExtraRewards(address reward, uint256 amount) external view returns (uint256);
function deallocateLiquidity(uint256 amount) external payable;
function fetchLiquidity(uint256 amount) external;
function returnLiquidity(uint256 amount) external;
function settle() external payable;
function settleExtraRewards(address reward, uint256 amount) external payable;
function setTally(address implementation) external;
function setStrategist(address strategist_) external;
function setExecutor(address executor_) external;
function unsetStrategist() external;
function unsetExecutor() external;
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.28;
interface ITally {
function totalBalance(bytes memory context) external view returns (uint256 totalBalance_);
function withdrawableBalance(bytes memory context) external view returns (uint256 withdrawableBalance_);
function pendingDepositBalance(bytes memory context) external view returns (uint256 pendingDepositBalance_);
function pendingWithdrawBalance(bytes memory context) external view returns (uint256 pendingWithdrawBalance_);
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.28;
import { IERC20 } from '@oz/token/ERC20/utils/SafeERC20.sol';
import { IMitosisVault } from '../../interfaces/branch/IMitosisVault.sol';
import { ITally } from '../../interfaces/branch/strategy/tally/ITally.sol';
import { ERC7201Utils } from '../../lib/ERC7201Utils.sol';
abstract contract VLFStrategyExecutorStorageV1 {
using ERC7201Utils for string;
struct StorageV1 {
IMitosisVault vault;
IERC20 asset;
address hubVLFVault;
address strategist;
address executor;
uint256 storedTotalBalance;
ITally tally;
}
string private constant _NAMESPACE = 'mitosis.storage.VLFStrategyExecutorStorage.v1';
bytes32 private immutable _slot = _NAMESPACE.storageSlot();
function _getStorageV1() internal view returns (StorageV1 storage $) {
bytes32 slot = _slot;
// slither-disable-next-line assembly
assembly {
$.slot := slot
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1967.sol)
pragma solidity ^0.8.20;
/**
* @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
*/
interface IERC1967 {
/**
* @dev Emitted when the implementation is upgraded.
*/
event Upgraded(address indexed implementation);
/**
* @dev Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Emitted when the beacon is changed.
*/
event BeaconUpgraded(address indexed beacon);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.20;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC-1967 implementation slot:
* ```solidity
* contract ERC1967 {
* // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(newImplementation.code.length > 0);
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* TIP: Consider using this library along with {SlotDerivation}.
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct Int256Slot {
int256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Int256Slot` with member `value` located at `slot`.
*/
function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
assembly ("memory-safe") {
r.slot := store.slot
}
}
/**
* @dev Returns a `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
assembly ("memory-safe") {
r.slot := store.slot
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)
pragma solidity ^0.8.20;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}// 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.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"remappings": [
"@elliptic-curve-solidity/=dependencies/@elliptic-curve-solidity-0.2.5/",
"@hpl/=node_modules/@hyperlane-xyz/core/contracts/",
"@mito-expedition/=dependencies/mito-expedition-0.0.3/src/",
"@mito-mainnet/=dependencies/mitosis-1.1.0/",
"@mito-tracle/=dependencies/mito-tracle-0.0.1/src/",
"@mito-utils/=dependencies/mito-utils-0.0.1/src/",
"@oz/=dependencies/@openzeppelin-contracts-5.2.0/",
"@ozu/=dependencies/@openzeppelin-contracts-upgradeable-5.2.0/",
"@solady/=dependencies/solady-0.1.21/src/",
"@solmate/=dependencies/solmate-6.8.0/src/",
"@std/=dependencies/forge-std-1.9.6/src/",
"@oz-v4/=dependencies/mito-expedition-0.0.3/dependencies/@openzeppelin-contracts-4.9.6/",
"@ozu-v4/=dependencies/mito-expedition-0.0.3/dependencies/@openzeppelin-contracts-upgradeable-4.9.6/",
"@openzeppelin/contracts-upgradeable/=dependencies/@openzeppelin-contracts-upgradeable-5.2.0/",
"@openzeppelin/contracts/=dependencies/@openzeppelin-contracts-5.2.0/",
"dependencies/mito-expedition-0.0.3:@hpl-v3/=dependencies/mito-expedition-0.0.3/dependencies/@hpl-3.0.0/contracts/",
"dependencies/mito-expedition-0.0.3:@oz-v4/=dependencies/mito-expedition-0.0.3/dependencies/@openzeppelin-contracts-4.9.6/",
"dependencies/mito-expedition-0.0.3:@ozu-v4/=dependencies/mito-expedition-0.0.3/dependencies/@openzeppelin-contracts-upgradeable-4.9.6/",
"node_modules/@hyperlane-xyz/core:@openzeppelin/=node_modules/@openzeppelin/",
"@arbitrum/=node_modules/@arbitrum/",
"@chainlink/=node_modules/@chainlink/",
"@elliptic-curve-solidity-0.2.5/=dependencies/@elliptic-curve-solidity-0.2.5/",
"@eth-optimism/=node_modules/@eth-optimism/",
"@hpl-v3/=dependencies/mito-expedition-0.0.3/dependencies/@hpl-3.0.0/contracts/",
"@hyperlane-xyz/=node_modules/@hyperlane-xyz/",
"@layerzerolabs/=node_modules/@layerzerolabs/",
"@mito/=dependencies/mito-utils-0.0.1/dependencies/mitosis-1.0.1/",
"@murky-0.0.1/=dependencies/mitosis-1.1.0/dependencies/@murky-0.0.1/",
"@murky/=dependencies/mitosis-1.1.0/dependencies/@murky-0.0.1/src/",
"@offchainlabs/=node_modules/@offchainlabs/",
"@openzeppelin-contracts-5.2.0/=dependencies/@openzeppelin-contracts-5.2.0/",
"@openzeppelin-contracts-upgradeable-5.2.0/=dependencies/@openzeppelin-contracts-upgradeable-5.2.0/",
"@scroll-tech/=node_modules/@scroll-tech/",
"@zksync/=node_modules/@zksync/",
"forge-std-1.9.6/=dependencies/forge-std-1.9.6/src/",
"forge-std/=dependencies/solady-0.1.21/test/utils/forge-std/",
"fx-portal/=node_modules/fx-portal/",
"mito-expedition-0.0.3/=dependencies/mito-expedition-0.0.3/src/",
"mito-tracle-0.0.1/=dependencies/mito-tracle-0.0.1/src/",
"mito-utils-0.0.1/=dependencies/mito-utils-0.0.1/src/",
"mitosis-1.1.0/=dependencies/mitosis-1.1.0/",
"proxy/=dependencies/mitosis-1.1.0/lib/proxy/",
"solady-0.1.12/=dependencies/mitosis-1.1.0/dependencies/solady-0.1.12/",
"solady-0.1.21/=dependencies/solady-0.1.21/src/",
"solady/=node_modules/solady/",
"solmate-6.8.0/=dependencies/solmate-6.8.0/src/",
"dependencies/@openzeppelin-contracts-upgradeable-5.1.0:@openzeppelin/contracts/=dependencies/mitosis-1.1.0/dependencies/@openzeppelin-contracts-5.1.0/"
],
"optimizer": {
"enabled": true,
"runs": 150
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": false
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[],"name":"FailedCall","type":"error"},{"inputs":[{"internalType":"bytes","name":"revertData","type":"bytes"}],"name":"IBeaconBase__BeaconCallFailed","type":"error"},{"inputs":[{"internalType":"uint256","name":"max","type":"uint256"},{"internalType":"uint256","name":"given","type":"uint256"}],"name":"IBeaconBase__IndexOutOfBounds","type":"error"},{"inputs":[{"internalType":"string","name":"description","type":"string"}],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"},{"indexed":false,"internalType":"bool","name":"success","type":"bool"},{"indexed":false,"internalType":"bytes","name":"ret","type":"bytes"}],"name":"BeaconExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"instance","type":"address"}],"name":"InstanceAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"GIT_COMMIT","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GIT_TAG","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"beacon","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"callBeacon","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IMitosisVault","name":"vault_","type":"address"},{"internalType":"contract IERC20","name":"asset_","type":"address"},{"internalType":"address","name":"hubVLFVault_","type":"address"},{"internalType":"address","name":"owner_","type":"address"}],"name":"create","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"},{"internalType":"address","name":"initialImpl","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"instances","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"indexes","type":"uint256[]"}],"name":"instances","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"instancesLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"instance","type":"address"}],"name":"isInstance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"}]Contract Creation Code
610100604052601a60c0527f6d69746f7369732e73746f726167652e426561636f6e4261736500000000000060e0527f57d994f767388cf00cd9afe901c0c42d1abe6362a6c4a66b9e3b22731e0aa4e15f527fe7a86ad0e06c4ae4dc708445c1293e0c042f013ca39993c1c203552ace4c12006080523060a052348015610084575f5ffd5b5061008d610092565b610144565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100e25760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101415780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b60805160a051611d8d6101735f395f81816109c5015281816109ee0152610b1301525f610b530152611d8d5ff3fe608060405260043610610105575f3560e01c8063a2f7b3a511610092578063b8a15e3a11610062578063b8a15e3a146102bb578063dc8b99c4146102cf578063dd4d313c146102fb578063e30c39781461030f578063f2fde38b14610323575f5ffd5b8063a2f7b3a51461021c578063abffeffc1461023b578063ad3cb1cc1461025a578063b175eb4d1461028a575f5ffd5b80636b44e6be116100d85780636b44e6be14610185578063715018a6146101b457806379ba5097146101c85780638da5cb5b146101dc5780639ea77676146101f0575f5ffd5b8063485cc955146101095780634f1ef2861461012a57806352d1902d1461013d57806359659e9014610164575b5f5ffd5b348015610114575f5ffd5b5061012861012336600461101d565b610342565b005b610128610138366004611068565b6104a6565b348015610148575f5ffd5b506101516104c5565b6040519081526020015b60405180910390f35b34801561016f575f5ffd5b506101786104e0565b60405161015b919061112b565b348015610190575f5ffd5b506101a461019f36600461113f565b6104f8565b604051901515815260200161015b565b3480156101bf575f5ffd5b50610128610589565b3480156101d3575f5ffd5b5061012861059c565b3480156101e7575f5ffd5b506101786105e4565b3480156101fb575f5ffd5b5061020f61020a36600461115a565b610618565b60405161015b91906111f4565b348015610227575f5ffd5b50610178610236366004611206565b610635565b348015610246575f5ffd5b5061017861025536600461121d565b6106a5565b348015610265575f5ffd5b5061020f604051806040016040528060058152602001640352e302e360dc1b81525081565b348015610295575f5ffd5b5061020f60405180604001604052806006815260200165076312e312e360d41b81525081565b3480156102c6575f5ffd5b5061020f610759565b3480156102da575f5ffd5b506102ee6102e9366004611276565b610775565b60405161015b91906112d5565b348015610306575f5ffd5b50610151610892565b34801561031a575f5ffd5b506101786108a4565b34801561032e575f5ffd5b5061012861033d36600461113f565b6108b9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156103865750825b90505f826001600160401b031660011480156103a15750303b155b9050811580156103af575080155b156103cd5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156103f757845460ff60401b1916600160401b1785555b6103ff61092b565b61040887610933565b61044f308760405161041990610fef565b6001600160a01b03928316815291166020820152604001604051809103905ff080158015610449573d5f5f3e3d5ffd5b50610944565b61045761092b565b831561049d57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b6104ae6109ba565b6104b782610a48565b6104c18282610a50565b5050565b5f6104ce610b08565b505f516020611cf05f395f51905f5290565b5f6104e9610b51565b546001600160a01b0316919050565b5f5f610502610b51565b60018101549091505f0361051857505f92915050565b6001600160a01b0383165f908152600282016020526040902054801580156105715750836001600160a01b0316826001015f8154811061055a5761055a611320565b5f918252602090912001546001600160a01b031614155b1561057f57505f9392505050565b5060019392505050565b610591610b75565b61059a5f610ba7565b565b33806105a66108a4565b6001600160a01b0316146105d8578060405163118cdaa760e01b81526004016105cf919061112b565b60405180910390fd5b6105e181610ba7565b50565b5f807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b6060610622610b75565b61062c8383610bcc565b90505b92915050565b5f5f61063f610b51565b6001810154909150808481811061067257604051631d2a454960e31b8152600481019290925260248201526044016105cf565b505081600101848154811061068957610689611320565b5f918252602090912001546001600160a01b0316949350505050565b5f6106ae610b75565b6040516001600160a01b03808716602483015280861660448301528085166064830152831660848201525f9060a40160408051601f198184030181529190526020810180516001600160e01b0316637c643b2f60e11b17905290505f6107126104e0565b8260405161071f90610ffc565b61072a929190611334565b604051809103905ff080158015610743573d5f5f3e3d5ffd5b50905061074f81610ca5565b9695505050505050565b604051806060016040528060288152602001611d306028913981565b60605f610780610b51565b90505f836001600160401b0381111561079b5761079b611054565b6040519080825280602002602001820160405280156107c4578160200160208202803683370190505b506001830154909150845f5b81811015610886575f8888838181106107eb576107eb611320565b9050602002013590508381108482909161082157604051631d2a454960e31b8152600481019290925260248201526044016105cf565b505085600101818154811061083857610838611320565b905f5260205f20015f9054906101000a90046001600160a01b031685838151811061086557610865611320565b6001600160a01b0390921660209283029190910190910152506001016107d0565b50919695505050505050565b5f61089b610b51565b60010154919050565b5f805f516020611d105f395f51905f52610608565b6108c1610b75565b5f516020611d105f395f51905f5280546001600160a01b0319166001600160a01b03831690811782556108f26105e4565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b61059a610d32565b61093b610d32565b6105e181610d7b565b5f816001600160a01b03163b1161098757604051630b0f5aa160e11b81526020600482015260066024820152653132b0b1b7b760d11b60448201526064016105cf565b61098f61092b565b5f610998610b51565b80546001600160a01b0319166001600160a01b03939093169290921790915550565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610a2a57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610a1e610dac565b6001600160a01b031614155b1561059a5760405163703e46dd60e11b815260040160405180910390fd5b6105e1610b75565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610aaa575060408051601f3d908101601f19168201909252610aa79181019061135f565b60015b610ac95781604051634c9c8ce360e01b81526004016105cf919061112b565b5f516020611cf05f395f51905f528114610af957604051632a87526960e21b8152600481018290526024016105cf565b610b038383610dc0565b505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461059a5760405163703e46dd60e11b815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000090565b33610b7e6105e4565b6001600160a01b03161461059a573360405163118cdaa760e01b81526004016105cf919061112b565b5f516020611d105f395f51905f5280546001600160a01b03191681556104c182610e15565b60605f5f610bd86104e0565b6001600160a01b03168585604051610bf1929190611376565b5f604051808303815f865af19150503d805f8114610c2a576040519150601f19603f3d011682016040523d82523d5f602084013e610c2f565b606091505b5091509150818190610c555760405163a1a3ec0160e01b81526004016105cf91906111f4565b50336001600160a01b03167fb1768283bd4175df317a7fc4574abcbcbbeb5e82044fc1d868116ad2fecc8f4486868585604051610c959493929190611385565b60405180910390a2949350505050565b5f610cae610b51565b6001818101805480830182555f828152602090200180546001600160a01b0319166001600160a01b03871617905554919250610ce9916113d4565b6001600160a01b0383165f81815260028401602052604080822093909355915190917fee3a98e49d5a27452a99d57c90a7f73d4b2e44de88c6ded02e69c4ed964edd5a91a25050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661059a57604051631afcd79f60e31b815260040160405180910390fd5b610d83610d32565b6001600160a01b0381166105d8575f604051631e4fbdf760e01b81526004016105cf919061112b565b5f5f516020611cf05f395f51905f526104e9565b610dc982610e85565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a2805115610e0d57610b038282610edf565b6104c1610f51565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b806001600160a01b03163b5f03610eb15780604051634c9c8ce360e01b81526004016105cf919061112b565b5f516020611cf05f395f51905f5280546001600160a01b0319166001600160a01b0392909216919091179055565b60605f5f846001600160a01b031684604051610efb91906113f3565b5f60405180830381855af49150503d805f8114610f33576040519150601f19603f3d011682016040523d82523d5f602084013e610f38565b606091505b5091509150610f48858383610f70565b95945050505050565b341561059a5760405163b398979f60e01b815260040160405180910390fd5b606082610f8557610f8082610fc6565b610fbf565b8151158015610f9c57506001600160a01b0384163b155b15610fbc5783604051639996b31560e01b81526004016105cf919061112b565b50805b9392505050565b805115610fd65780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b61036f8061140a83390190565b6105778061177983390190565b6001600160a01b03811681146105e1575f5ffd5b5f5f6040838503121561102e575f5ffd5b823561103981611009565b9150602083013561104981611009565b809150509250929050565b634e487b7160e01b5f52604160045260245ffd5b5f5f60408385031215611079575f5ffd5b823561108481611009565b915060208301356001600160401b0381111561109e575f5ffd5b8301601f810185136110ae575f5ffd5b80356001600160401b038111156110c7576110c7611054565b604051601f8201601f19908116603f011681016001600160401b03811182821017156110f5576110f5611054565b60405281815282820160200187101561110c575f5ffd5b816020840160208301375f602083830101528093505050509250929050565b6001600160a01b0391909116815260200190565b5f6020828403121561114f575f5ffd5b8135610fbf81611009565b5f5f6020838503121561116b575f5ffd5b82356001600160401b03811115611180575f5ffd5b8301601f81018513611190575f5ffd5b80356001600160401b038111156111a5575f5ffd5b8560208284010111156111b6575f5ffd5b6020919091019590945092505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f61062c60208301846111c6565b5f60208284031215611216575f5ffd5b5035919050565b5f5f5f5f60808587031215611230575f5ffd5b843561123b81611009565b9350602085013561124b81611009565b9250604085013561125b81611009565b9150606085013561126b81611009565b939692955090935050565b5f5f60208385031215611287575f5ffd5b82356001600160401b0381111561129c575f5ffd5b8301601f810185136112ac575f5ffd5b80356001600160401b038111156112c1575f5ffd5b8560208260051b84010111156111b6575f5ffd5b602080825282518282018190525f918401906040840190835b818110156113155783516001600160a01b03168352602093840193909201916001016112ee565b509095945050505050565b634e487b7160e01b5f52603260045260245ffd5b6001600160a01b03831681526040602082018190525f90611357908301846111c6565b949350505050565b5f6020828403121561136f575f5ffd5b5051919050565b818382375f9101908152919050565b60608152836060820152838560808301375f608085830101525f601f19601f8601168201841515602084015260808382030160408401526113c960808201856111c6565b979650505050505050565b8181038181111561062f57634e487b7160e01b5f52601160045260245ffd5b5f82518060208501845e5f92019182525091905056fe608060405260405161036f38038061036f83398101604081905261002291610108565b61002c8282610033565b5050610139565b61003d8282610041565b5050565b61004a82610053565b61003d8161009d565b8060601b60601c9050684343a0dc92ed22dbfc5481684343a0dc92ed22dbfc5581817f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f38a35050565b6001600160a01b0316803b6100b957636d3e283b5f526004601cfd5b8068911c5a209f08d5ec5e55807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f38a250565b80516001600160a01b0381168114610103575f5ffd5b919050565b5f5f60408385031215610119575f5ffd5b610122836100ed565b9150610130602084016100ed565b90509250929050565b610229806101465f395ff3fe608060405234801561000f575f5ffd5b5060043610610055575f3560e01c80633659cfe6146100595780635c60da1b1461006e578063715018a6146100965780638da5cb5b1461009e578063f2fde38b146100ae575b5f5ffd5b61006c6100673660046101c6565b6100c1565b005b68911c5a209f08d5ec5e545b6040516001600160a01b03909116815260200160405180910390f35b61006c6100d5565b684343a0dc92ed22dbfc5461007a565b61006c6100bc3660046101c6565b6100e8565b6100c961010e565b6100d28161012c565b50565b6100dd61010e565b6100e65f61017c565b565b6100f061010e565b8060601b61010557637448fbae5f526004601cfd5b6100d28161017c565b684343a0dc92ed22dbfc5433146100e6576382b429005f526004601cfd5b6001600160a01b0316803b61014857636d3e283b5f526004601cfd5b8068911c5a209f08d5ec5e55807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f38a250565b8060601b60601c9050684343a0dc92ed22dbfc5481684343a0dc92ed22dbfc5581817f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f38a35050565b5f602082840312156101d6575f5ffd5b81356001600160a01b03811681146101ec575f5ffd5b939250505056fea2646970667358221220aaa54b4cc6d95c6c351955fffffb9283faa24557d56bf85995e2db6e38ddd5dc64736f6c634300081e003360a060405260405161057738038061057783398101604081905261002291610354565b61002c828261003e565b506001600160a01b0316608052610445565b610047826100fb565b6040516001600160a01b038316907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e905f90a28051156100ef576100ea826001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c0573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100e49190610416565b82610209565b505050565b6100f761027c565b5050565b806001600160a01b03163b5f0361013557604051631933b43b60e21b81526001600160a01b03821660048201526024015b60405180910390fd5b807fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b0392831617905560408051635c60da1b60e01b815290515f92841691635c60da1b9160048083019260209291908290030181865afa1580156101ae573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101d29190610416565b9050806001600160a01b03163b5f036100f757604051634c9c8ce360e01b81526001600160a01b038216600482015260240161012c565b60605f5f846001600160a01b031684604051610225919061042f565b5f60405180830381855af49150503d805f811461025d576040519150601f19603f3d011682016040523d82523d5f602084013e610262565b606091505b50909250905061027385838361029d565b95945050505050565b341561029b5760405163b398979f60e01b815260040160405180910390fd5b565b6060826102b2576102ad826102fc565b6102f5565b81511580156102c957506001600160a01b0384163b155b156102f257604051639996b31560e01b81526001600160a01b038516600482015260240161012c565b50805b9392505050565b80511561030c5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80516001600160a01b038116811461033b575f5ffd5b919050565b634e487b7160e01b5f52604160045260245ffd5b5f5f60408385031215610365575f5ffd5b61036e83610325565b60208401519092506001600160401b03811115610389575f5ffd5b8301601f81018513610399575f5ffd5b80516001600160401b038111156103b2576103b2610340565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103e0576103e0610340565b6040528181528282016020018710156103f7575f5ffd5b8160208401602083015e5f602083830101528093505050509250929050565b5f60208284031215610426575f5ffd5b6102f582610325565b5f82518060208501845e5f920191825250919050565b60805161011b61045c5f395f601d015261011b5ff3fe6080604052600a600c565b005b60186014601a565b609d565b565b5f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156076573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906098919060ba565b905090565b365f5f375f5f365f845af43d5f5f3e80801560b6573d5ff35b3d5ffd5b5f6020828403121560c9575f5ffd5b81516001600160a01b038116811460de575f5ffd5b939250505056fea264697066735822122078bbc2f1a009bdc09f3e2367d5b0661dad8c2b7813f3f0a730489bd2306fd3af64736f6c634300081e0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0034663661313561303835346362316462333462613763636331316161363165316637633133626163a264697066735822122031043fdf49d292a53ac7a953e8915e4b59b46624da5beec6def085a660293a3964736f6c634300081e0033
Deployed Bytecode
0x608060405260043610610105575f3560e01c8063a2f7b3a511610092578063b8a15e3a11610062578063b8a15e3a146102bb578063dc8b99c4146102cf578063dd4d313c146102fb578063e30c39781461030f578063f2fde38b14610323575f5ffd5b8063a2f7b3a51461021c578063abffeffc1461023b578063ad3cb1cc1461025a578063b175eb4d1461028a575f5ffd5b80636b44e6be116100d85780636b44e6be14610185578063715018a6146101b457806379ba5097146101c85780638da5cb5b146101dc5780639ea77676146101f0575f5ffd5b8063485cc955146101095780634f1ef2861461012a57806352d1902d1461013d57806359659e9014610164575b5f5ffd5b348015610114575f5ffd5b5061012861012336600461101d565b610342565b005b610128610138366004611068565b6104a6565b348015610148575f5ffd5b506101516104c5565b6040519081526020015b60405180910390f35b34801561016f575f5ffd5b506101786104e0565b60405161015b919061112b565b348015610190575f5ffd5b506101a461019f36600461113f565b6104f8565b604051901515815260200161015b565b3480156101bf575f5ffd5b50610128610589565b3480156101d3575f5ffd5b5061012861059c565b3480156101e7575f5ffd5b506101786105e4565b3480156101fb575f5ffd5b5061020f61020a36600461115a565b610618565b60405161015b91906111f4565b348015610227575f5ffd5b50610178610236366004611206565b610635565b348015610246575f5ffd5b5061017861025536600461121d565b6106a5565b348015610265575f5ffd5b5061020f604051806040016040528060058152602001640352e302e360dc1b81525081565b348015610295575f5ffd5b5061020f60405180604001604052806006815260200165076312e312e360d41b81525081565b3480156102c6575f5ffd5b5061020f610759565b3480156102da575f5ffd5b506102ee6102e9366004611276565b610775565b60405161015b91906112d5565b348015610306575f5ffd5b50610151610892565b34801561031a575f5ffd5b506101786108a4565b34801561032e575f5ffd5b5061012861033d36600461113f565b6108b9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f811580156103865750825b90505f826001600160401b031660011480156103a15750303b155b9050811580156103af575080155b156103cd5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156103f757845460ff60401b1916600160401b1785555b6103ff61092b565b61040887610933565b61044f308760405161041990610fef565b6001600160a01b03928316815291166020820152604001604051809103905ff080158015610449573d5f5f3e3d5ffd5b50610944565b61045761092b565b831561049d57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b6104ae6109ba565b6104b782610a48565b6104c18282610a50565b5050565b5f6104ce610b08565b505f516020611cf05f395f51905f5290565b5f6104e9610b51565b546001600160a01b0316919050565b5f5f610502610b51565b60018101549091505f0361051857505f92915050565b6001600160a01b0383165f908152600282016020526040902054801580156105715750836001600160a01b0316826001015f8154811061055a5761055a611320565b5f918252602090912001546001600160a01b031614155b1561057f57505f9392505050565b5060019392505050565b610591610b75565b61059a5f610ba7565b565b33806105a66108a4565b6001600160a01b0316146105d8578060405163118cdaa760e01b81526004016105cf919061112b565b60405180910390fd5b6105e181610ba7565b50565b5f807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b6060610622610b75565b61062c8383610bcc565b90505b92915050565b5f5f61063f610b51565b6001810154909150808481811061067257604051631d2a454960e31b8152600481019290925260248201526044016105cf565b505081600101848154811061068957610689611320565b5f918252602090912001546001600160a01b0316949350505050565b5f6106ae610b75565b6040516001600160a01b03808716602483015280861660448301528085166064830152831660848201525f9060a40160408051601f198184030181529190526020810180516001600160e01b0316637c643b2f60e11b17905290505f6107126104e0565b8260405161071f90610ffc565b61072a929190611334565b604051809103905ff080158015610743573d5f5f3e3d5ffd5b50905061074f81610ca5565b9695505050505050565b604051806060016040528060288152602001611d306028913981565b60605f610780610b51565b90505f836001600160401b0381111561079b5761079b611054565b6040519080825280602002602001820160405280156107c4578160200160208202803683370190505b506001830154909150845f5b81811015610886575f8888838181106107eb576107eb611320565b9050602002013590508381108482909161082157604051631d2a454960e31b8152600481019290925260248201526044016105cf565b505085600101818154811061083857610838611320565b905f5260205f20015f9054906101000a90046001600160a01b031685838151811061086557610865611320565b6001600160a01b0390921660209283029190910190910152506001016107d0565b50919695505050505050565b5f61089b610b51565b60010154919050565b5f805f516020611d105f395f51905f52610608565b6108c1610b75565b5f516020611d105f395f51905f5280546001600160a01b0319166001600160a01b03831690811782556108f26105e4565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b61059a610d32565b61093b610d32565b6105e181610d7b565b5f816001600160a01b03163b1161098757604051630b0f5aa160e11b81526020600482015260066024820152653132b0b1b7b760d11b60448201526064016105cf565b61098f61092b565b5f610998610b51565b80546001600160a01b0319166001600160a01b03939093169290921790915550565b306001600160a01b037f0000000000000000000000006cb3ae95ac5bc0a2de015bada3cb0c6e5626d364161480610a2a57507f0000000000000000000000006cb3ae95ac5bc0a2de015bada3cb0c6e5626d3646001600160a01b0316610a1e610dac565b6001600160a01b031614155b1561059a5760405163703e46dd60e11b815260040160405180910390fd5b6105e1610b75565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610aaa575060408051601f3d908101601f19168201909252610aa79181019061135f565b60015b610ac95781604051634c9c8ce360e01b81526004016105cf919061112b565b5f516020611cf05f395f51905f528114610af957604051632a87526960e21b8152600481018290526024016105cf565b610b038383610dc0565b505050565b306001600160a01b037f0000000000000000000000006cb3ae95ac5bc0a2de015bada3cb0c6e5626d364161461059a5760405163703e46dd60e11b815260040160405180910390fd5b7fe7a86ad0e06c4ae4dc708445c1293e0c042f013ca39993c1c203552ace4c120090565b33610b7e6105e4565b6001600160a01b03161461059a573360405163118cdaa760e01b81526004016105cf919061112b565b5f516020611d105f395f51905f5280546001600160a01b03191681556104c182610e15565b60605f5f610bd86104e0565b6001600160a01b03168585604051610bf1929190611376565b5f604051808303815f865af19150503d805f8114610c2a576040519150601f19603f3d011682016040523d82523d5f602084013e610c2f565b606091505b5091509150818190610c555760405163a1a3ec0160e01b81526004016105cf91906111f4565b50336001600160a01b03167fb1768283bd4175df317a7fc4574abcbcbbeb5e82044fc1d868116ad2fecc8f4486868585604051610c959493929190611385565b60405180910390a2949350505050565b5f610cae610b51565b6001818101805480830182555f828152602090200180546001600160a01b0319166001600160a01b03871617905554919250610ce9916113d4565b6001600160a01b0383165f81815260028401602052604080822093909355915190917fee3a98e49d5a27452a99d57c90a7f73d4b2e44de88c6ded02e69c4ed964edd5a91a25050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661059a57604051631afcd79f60e31b815260040160405180910390fd5b610d83610d32565b6001600160a01b0381166105d8575f604051631e4fbdf760e01b81526004016105cf919061112b565b5f5f516020611cf05f395f51905f526104e9565b610dc982610e85565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a2805115610e0d57610b038282610edf565b6104c1610f51565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b806001600160a01b03163b5f03610eb15780604051634c9c8ce360e01b81526004016105cf919061112b565b5f516020611cf05f395f51905f5280546001600160a01b0319166001600160a01b0392909216919091179055565b60605f5f846001600160a01b031684604051610efb91906113f3565b5f60405180830381855af49150503d805f8114610f33576040519150601f19603f3d011682016040523d82523d5f602084013e610f38565b606091505b5091509150610f48858383610f70565b95945050505050565b341561059a5760405163b398979f60e01b815260040160405180910390fd5b606082610f8557610f8082610fc6565b610fbf565b8151158015610f9c57506001600160a01b0384163b155b15610fbc5783604051639996b31560e01b81526004016105cf919061112b565b50805b9392505050565b805115610fd65780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b61036f8061140a83390190565b6105778061177983390190565b6001600160a01b03811681146105e1575f5ffd5b5f5f6040838503121561102e575f5ffd5b823561103981611009565b9150602083013561104981611009565b809150509250929050565b634e487b7160e01b5f52604160045260245ffd5b5f5f60408385031215611079575f5ffd5b823561108481611009565b915060208301356001600160401b0381111561109e575f5ffd5b8301601f810185136110ae575f5ffd5b80356001600160401b038111156110c7576110c7611054565b604051601f8201601f19908116603f011681016001600160401b03811182821017156110f5576110f5611054565b60405281815282820160200187101561110c575f5ffd5b816020840160208301375f602083830101528093505050509250929050565b6001600160a01b0391909116815260200190565b5f6020828403121561114f575f5ffd5b8135610fbf81611009565b5f5f6020838503121561116b575f5ffd5b82356001600160401b03811115611180575f5ffd5b8301601f81018513611190575f5ffd5b80356001600160401b038111156111a5575f5ffd5b8560208284010111156111b6575f5ffd5b6020919091019590945092505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f61062c60208301846111c6565b5f60208284031215611216575f5ffd5b5035919050565b5f5f5f5f60808587031215611230575f5ffd5b843561123b81611009565b9350602085013561124b81611009565b9250604085013561125b81611009565b9150606085013561126b81611009565b939692955090935050565b5f5f60208385031215611287575f5ffd5b82356001600160401b0381111561129c575f5ffd5b8301601f810185136112ac575f5ffd5b80356001600160401b038111156112c1575f5ffd5b8560208260051b84010111156111b6575f5ffd5b602080825282518282018190525f918401906040840190835b818110156113155783516001600160a01b03168352602093840193909201916001016112ee565b509095945050505050565b634e487b7160e01b5f52603260045260245ffd5b6001600160a01b03831681526040602082018190525f90611357908301846111c6565b949350505050565b5f6020828403121561136f575f5ffd5b5051919050565b818382375f9101908152919050565b60608152836060820152838560808301375f608085830101525f601f19601f8601168201841515602084015260808382030160408401526113c960808201856111c6565b979650505050505050565b8181038181111561062f57634e487b7160e01b5f52601160045260245ffd5b5f82518060208501845e5f92019182525091905056fe608060405260405161036f38038061036f83398101604081905261002291610108565b61002c8282610033565b5050610139565b61003d8282610041565b5050565b61004a82610053565b61003d8161009d565b8060601b60601c9050684343a0dc92ed22dbfc5481684343a0dc92ed22dbfc5581817f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f38a35050565b6001600160a01b0316803b6100b957636d3e283b5f526004601cfd5b8068911c5a209f08d5ec5e55807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f38a250565b80516001600160a01b0381168114610103575f5ffd5b919050565b5f5f60408385031215610119575f5ffd5b610122836100ed565b9150610130602084016100ed565b90509250929050565b610229806101465f395ff3fe608060405234801561000f575f5ffd5b5060043610610055575f3560e01c80633659cfe6146100595780635c60da1b1461006e578063715018a6146100965780638da5cb5b1461009e578063f2fde38b146100ae575b5f5ffd5b61006c6100673660046101c6565b6100c1565b005b68911c5a209f08d5ec5e545b6040516001600160a01b03909116815260200160405180910390f35b61006c6100d5565b684343a0dc92ed22dbfc5461007a565b61006c6100bc3660046101c6565b6100e8565b6100c961010e565b6100d28161012c565b50565b6100dd61010e565b6100e65f61017c565b565b6100f061010e565b8060601b61010557637448fbae5f526004601cfd5b6100d28161017c565b684343a0dc92ed22dbfc5433146100e6576382b429005f526004601cfd5b6001600160a01b0316803b61014857636d3e283b5f526004601cfd5b8068911c5a209f08d5ec5e55807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f38a250565b8060601b60601c9050684343a0dc92ed22dbfc5481684343a0dc92ed22dbfc5581817f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f38a35050565b5f602082840312156101d6575f5ffd5b81356001600160a01b03811681146101ec575f5ffd5b939250505056fea2646970667358221220aaa54b4cc6d95c6c351955fffffb9283faa24557d56bf85995e2db6e38ddd5dc64736f6c634300081e003360a060405260405161057738038061057783398101604081905261002291610354565b61002c828261003e565b506001600160a01b0316608052610445565b610047826100fb565b6040516001600160a01b038316907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e905f90a28051156100ef576100ea826001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c0573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100e49190610416565b82610209565b505050565b6100f761027c565b5050565b806001600160a01b03163b5f0361013557604051631933b43b60e21b81526001600160a01b03821660048201526024015b60405180910390fd5b807fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b0392831617905560408051635c60da1b60e01b815290515f92841691635c60da1b9160048083019260209291908290030181865afa1580156101ae573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101d29190610416565b9050806001600160a01b03163b5f036100f757604051634c9c8ce360e01b81526001600160a01b038216600482015260240161012c565b60605f5f846001600160a01b031684604051610225919061042f565b5f60405180830381855af49150503d805f811461025d576040519150601f19603f3d011682016040523d82523d5f602084013e610262565b606091505b50909250905061027385838361029d565b95945050505050565b341561029b5760405163b398979f60e01b815260040160405180910390fd5b565b6060826102b2576102ad826102fc565b6102f5565b81511580156102c957506001600160a01b0384163b155b156102f257604051639996b31560e01b81526001600160a01b038516600482015260240161012c565b50805b9392505050565b80511561030c5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80516001600160a01b038116811461033b575f5ffd5b919050565b634e487b7160e01b5f52604160045260245ffd5b5f5f60408385031215610365575f5ffd5b61036e83610325565b60208401519092506001600160401b03811115610389575f5ffd5b8301601f81018513610399575f5ffd5b80516001600160401b038111156103b2576103b2610340565b604051601f8201601f19908116603f011681016001600160401b03811182821017156103e0576103e0610340565b6040528181528282016020018710156103f7575f5ffd5b8160208401602083015e5f602083830101528093505050509250929050565b5f60208284031215610426575f5ffd5b6102f582610325565b5f82518060208501845e5f920191825250919050565b60805161011b61045c5f395f601d015261011b5ff3fe6080604052600a600c565b005b60186014601a565b609d565b565b5f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156076573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906098919060ba565b905090565b365f5f375f5f365f845af43d5f5f3e80801560b6573d5ff35b3d5ffd5b5f6020828403121560c9575f5ffd5b81516001600160a01b038116811460de575f5ffd5b939250505056fea264697066735822122078bbc2f1a009bdc09f3e2367d5b0661dad8c2b7813f3f0a730489bd2306fd3af64736f6c634300081e0033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0034663661313561303835346362316462333462613763636331316161363165316637633133626163a264697066735822122031043fdf49d292a53ac7a953e8915e4b59b46624da5beec6def085a660293a3964736f6c634300081e0033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.