ETH Price: $2,061.04 (-0.04%)
 

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Upgrade Strategy432615172026-03-12 10:46:2111 hrs ago1773312381IN
0x46a5624C...Df14baa92
0 ETH0.000000330.006
Upgrade Strategy432615152026-03-12 10:46:1712 hrs ago1773312377IN
0x46a5624C...Df14baa92
0 ETH0.000000330.006
Upgrade Strategy432605782026-03-12 10:15:0312 hrs ago1773310503IN
0x46a5624C...Df14baa92
0 ETH0.000000290.00525
Upgrade Strategy432605712026-03-12 10:14:4912 hrs ago1773310489IN
0x46a5624C...Df14baa92
0 ETH0.000000290.00525
Upgrade Strategy432600662026-03-12 9:57:5912 hrs ago1773309479IN
0x46a5624C...Df14baa92
0 ETH0.000000290.00525
Upgrade Strategy432326552026-03-11 18:44:1728 hrs ago1773254657IN
0x46a5624C...Df14baa92
0 ETH0.000000330.0061
Upgrade Strategy432132752026-03-11 7:58:1738 hrs ago1773215897IN
0x46a5624C...Df14baa92
0 ETH0.000000410.0075
Upgrade Strategy432012572026-03-11 1:17:4145 hrs ago1773191861IN
0x46a5624C...Df14baa92
0 ETH0.00000060.011
Upgrade Strategy431772212026-03-10 11:56:292 days ago1773143789IN
0x46a5624C...Df14baa92
0 ETH0.000000330.0061
Upgrade Strategy431772112026-03-10 11:56:092 days ago1773143769IN
0x46a5624C...Df14baa92
0 ETH0.000000330.0061
Upgrade Strategy431764472026-03-10 11:30:412 days ago1773142241IN
0x46a5624C...Df14baa92
0 ETH0.000000460.0084
Upgrade Strategy431749012026-03-10 10:39:092 days ago1773139149IN
0x46a5624C...Df14baa92
0 ETH0.000000380.007
Upgrade Strategy431149882026-03-09 1:22:033 days ago1773019323IN
0x46a5624C...Df14baa92
0 ETH0.000000570.01039711
Upgrade Strategy430868842026-03-08 9:45:154 days ago1772963115IN
0x46a5624C...Df14baa92
0 ETH0.000000320.0058982
Upgrade Strategy430519452026-03-07 14:20:375 days ago1772893237IN
0x46a5624C...Df14baa92
0 ETH0.000000360.0066
Upgrade Strategy430286902026-03-07 1:25:275 days ago1772846727IN
0x46a5624C...Df14baa92
0 ETH0.000000310.0056255
Upgrade Strategy430203102026-03-06 20:46:076 days ago1772829967IN
0x46a5624C...Df14baa92
0 ETH0.000000330.006
Upgrade Strategy430203032026-03-06 20:45:536 days ago1772829953IN
0x46a5624C...Df14baa92
0 ETH0.000000330.006
Upgrade Strategy430144082026-03-06 17:29:236 days ago1772818163IN
0x46a5624C...Df14baa92
0 ETH0.000000340.00617359
Upgrade Strategy430045872026-03-06 12:02:016 days ago1772798521IN
0x46a5624C...Df14baa92
0 ETH0.000000920.01683039
Upgrade Strategy429932382026-03-06 5:43:436 days ago1772775823IN
0x46a5624C...Df14baa92
0 ETH0.000000330.0061
Upgrade Strategy429403792026-03-05 0:21:457 days ago1772670105IN
0x46a5624C...Df14baa92
0 ETH0.000000330.006
Upgrade Strategy429403742026-03-05 0:21:357 days ago1772670095IN
0x46a5624C...Df14baa92
0 ETH0.000000330.006
Upgrade Strategy429035982026-03-04 3:55:438 days ago1772596543IN
0x46a5624C...Df14baa92
0 ETH0.000000660.0119993
Upgrade Strategy428752152026-03-03 12:09:379 days ago1772539777IN
0x46a5624C...Df14baa92
0 ETH0.000000280.0051808
View all transactions

Parent Transaction Hash Block From To
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x142f3947...a7DBCb76c
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
MamoStrategyRegistry

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 200 runs

Other Settings:
cancun EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.28;

import {ERC1967Proxy} from "@contracts/ERC1967Proxy.sol";

import {IBaseStrategy} from "@interfaces/IBaseStrategy.sol";
import {IUUPSUpgradeable} from "@interfaces/IUUPSUpgradeable.sol";
import {AccessControlEnumerable} from "@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

/**
 * @title MamoStrategyRegistry
 * @notice This contract is responsible for tracking user strategies, deploying new strategies, and coordinating operations across strategies
 * @dev Uses AccessControlEnumerable for role-based access control and Pausable for emergency stops
 */
contract MamoStrategyRegistry is AccessControlEnumerable, Pausable {
    using SafeERC20 for IERC20;
    using EnumerableSet for EnumerableSet.AddressSet;

    // Role definitions
    /// @notice Role identifier for guardians who can pause/unpause the contract
    bytes32 public constant GUARDIAN_ROLE = keccak256("GUARDIAN_ROLE");

    /// @notice Role identifier for the backend that can manage strategies
    bytes32 public constant BACKEND_ROLE = keccak256("BACKEND_ROLE");

    /// @notice Counter for strategy type IDs
    uint256 public nextStrategyTypeId;

    // State variables
    /// @notice Set of all strategy addresses for each user
    mapping(address => EnumerableSet.AddressSet) private _userStrategies;

    /// @notice Mapping of whitelisted implementation addresses
    mapping(address => bool) public whitelistedImplementations;

    /// @notice Maps strategy IDs to their latest implementation
    mapping(uint256 => address) public latestImplementationById;

    /// @notice Maps implementations to their strategy ID
    mapping(address => uint256) public implementationToId;

    // Events
    /// @notice Emitted when a strategy is added for a user
    event StrategyAdded(address indexed user, address strategy, address implementation);

    /// @notice Emitted when a strategy's implementation is updated
    event StrategyImplementationUpdated(
        address indexed strategy, address indexed oldImplementation, address indexed newImplementation
    );

    /// @notice Emitted when a strategy's owner is updated
    event StrategyOwnerUpdated(address indexed strategy, address indexed oldOwner, address indexed newOwner);

    /// @notice Emitted when an implementation is whitelisted
    event ImplementationWhitelisted(address indexed implementation, uint256 indexed strategyType);

    /// @notice Emitted when tokens are recovered from the contract
    event TokenRecovered(address indexed token, address indexed to, uint256 amount);

    /**
     * @notice Constructor that sets up initial roles
     * @dev Grants DEFAULT_ADMIN_ROLE, BACKEND_ROLE, and GUARDIAN_ROLE to the specified addresses
     * @param admin The address to grant the DEFAULT_ADMIN_ROLE to
     * @param backend The address to grant the BACKEND_ROLE to
     * @param guardian The address to grant the GUARDIAN_ROLE to
     */
    constructor(address admin, address backend, address guardian) {
        require(admin != address(0), "Invalid admin address");
        require(backend != address(0), "Invalid backend address");
        require(guardian != address(0), "Invalid guardian address");

        // Set up roles
        _grantRole(DEFAULT_ADMIN_ROLE, admin);
        _grantRole(BACKEND_ROLE, backend);
        _grantRole(GUARDIAN_ROLE, guardian);

        nextStrategyTypeId = 1;
    }

    // ==================== PERMISSIONLESS FUNCTIONS ====================

    /**
     * @notice Updates the implementation of a strategy to the latest implementation of the same type
     * @dev Only callable by the user who owns the strategy
     * @param strategy The address of the strategy to update
     * @param newImplementation The new implementation address
     */
    function upgradeStrategy(address strategy, address newImplementation) external whenNotPaused {
        // Check if the caller is the owner of the strategy
        require(isUserStrategy(msg.sender, strategy), "Caller is not the owner of the strategy");

        // Get the old implementation address
        address oldImplementation = ERC1967Proxy(payable(strategy)).getImplementation();

        require(oldImplementation != newImplementation, "Already using implementation");

        // Get the strategy ID
        uint256 strategyId = implementationToId[oldImplementation];

        // Get the latest implementation for this strategy ID
        address latestImplementation = latestImplementationById[strategyId];

        require(latestImplementation == newImplementation, "Not latest implementation");

        // Check if the latest implementation is whitelisted (should always be true, but checking for safety)
        require(whitelistedImplementations[latestImplementation], "Implementation not whitelisted");

        // Update the implementation through the proxy's upgrade mechanism
        // Call upgradeToAndCall with empty data to just upgrade the implementation
        // If any initialization is needed, it should be done in the new implementation
        IUUPSUpgradeable(strategy).upgradeToAndCall(latestImplementation, new bytes(0));

        emit StrategyImplementationUpdated(strategy, oldImplementation, latestImplementation);
    }

    /**
     * @notice Updates the owner of a strategy
     * @dev Only callable by the current owner of the strategy
     * @param newOwner The address of the new owner
     */
    function updateStrategyOwner(address newOwner) external whenNotPaused {
        address strategy = msg.sender;
        address currentOwner = Ownable(strategy).owner();

        require(newOwner != address(0), "Invalid new owner address");
        require(currentOwner != address(0), "Invalid current owner address");

        // Check if the caller is the current owner of the strategy
        require(isUserStrategy(currentOwner, strategy), "Not authorized to update strategy owner");

        // Remove the strategy from the current owner's list
        _userStrategies[currentOwner].remove(strategy);

        // Add the strategy to the new owner's list
        _userStrategies[newOwner].add(strategy);

        emit StrategyOwnerUpdated(strategy, currentOwner, newOwner);
    }

    // ==================== VIEW FUNCTIONS ====================

    /**
     * @notice Gets all strategies for a user
     * @param user The address of the user
     * @return An array of strategy addresses
     */
    function getUserStrategies(address user) external view returns (address[] memory) {
        uint256 length = _userStrategies[user].length();
        address[] memory strategies = new address[](length);

        for (uint256 i = 0; i < length; i++) {
            strategies[i] = _userStrategies[user].at(i);
        }

        return strategies;
    }

    /**
     * @notice Checks if a strategy belongs to a user
     * @param user The address of the user
     * @param strategy The address of the strategy
     * @return True if the strategy belongs to the user, false otherwise
     */
    function isUserStrategy(address user, address strategy) public view returns (bool) {
        return _userStrategies[user].contains(strategy);
    }

    /**
     * @notice Gets the backend address (first member of the BACKEND_ROLE)
     * @return The address of the backend
     */
    function getBackendAddress() external view returns (address) {
        return getRoleMember(BACKEND_ROLE, 0);
    }

    // ==================== BACKEND FUNCTIONS ====================

    /**
     * @notice Adds an implementation to the whitelist with a strategy type ID
     * @dev Only callable by accounts with the ADMIN_ROLE
     * @param implementation The address of the implementation to whitelist
     * @param strategyTypeId The strategy type ID to assign. If 0, a new ID will be assigned
     * @return assignedStrategyTypeId The assigned strategy type ID
     */
    function whitelistImplementation(address implementation, uint256 strategyTypeId)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
        returns (uint256 assignedStrategyTypeId)
    {
        require(implementation != address(0), "Invalid implementation address");
        require(!whitelistedImplementations[implementation], "Implementation already whitelisted");

        // If strategyTypeId is 0, assign a new strategy type ID
        if (strategyTypeId == 0) {
            assignedStrategyTypeId = nextStrategyTypeId++;
        } else {
            // Otherwise, use the provided strategyTypeId
            assignedStrategyTypeId = strategyTypeId;
        }

        whitelistedImplementations[implementation] = true;
        implementationToId[implementation] = assignedStrategyTypeId;
        latestImplementationById[assignedStrategyTypeId] = implementation;

        emit ImplementationWhitelisted(implementation, assignedStrategyTypeId);
    }

    /**
     * @notice Adds a strategy for a user
     * @dev Only callable by accounts with the BACKEND_ROLE
     * @dev Validates that the strategy has the correct registry address set up
     * @param user The address of the user
     * @param strategy The address of the strategy to add
     */
    function addStrategy(address user, address strategy) external whenNotPaused onlyRole(BACKEND_ROLE) {
        require(user != address(0), "Invalid user address");
        require(strategy != address(0), "Invalid strategy address");

        require(!isUserStrategy(user, strategy), "Strategy already added for user");

        // Get the implementation address
        address implementation = ERC1967Proxy(payable(strategy)).getImplementation();
        require(implementation != address(0), "Invalid implementation");
        require(whitelistedImplementations[implementation], "Implementation not whitelisted");

        address owner = Ownable(strategy).owner();
        require(owner == user, "Strategy owner is not the user");

        // Check the strategy addresses are correct
        IBaseStrategy strategyContract = IBaseStrategy(strategy);

        // Check strategy registry address is set to this registry
        require(
            address(strategyContract.mamoStrategyRegistry()) == address(this), "Strategy registry not set correctly"
        );
        require(
            implementation == latestImplementationById[strategyContract.strategyTypeId()], "Not latest implementation"
        );

        // Add the strategy to the user's strategies
        _userStrategies[user].add(strategy);

        emit StrategyAdded(user, strategy, implementation);
    }
    // ==================== ADMIN FUNCTIONS ====================

    /**
     * @notice Recovers ERC20 tokens accidentally sent to this contract
     * @dev Only callable by the user who owns this strategy
     * @param tokenAddress The address of the token to recover
     * @param to The address to send the tokens to
     * @param amount The amount of tokens to recover
     */
    function recoverERC20(address tokenAddress, address to, uint256 amount) external onlyRole(DEFAULT_ADMIN_ROLE) {
        require(to != address(0), "Cannot send to zero address");
        require(amount > 0, "Amount must be greater than 0");

        IERC20(tokenAddress).safeTransfer(to, amount);

        emit TokenRecovered(tokenAddress, to, amount);
    }

    // ==================== GUARDIAN FUNCTIONS ====================

    /**
     * @notice Pauses the contract in case of emergency
     * @dev Only callable by accounts with the GUARDIAN_ROLE
     * @dev When paused, most functions that modify state will revert
     */
    function pause() external onlyRole(GUARDIAN_ROLE) {
        _pause();
    }

    /**
     * @notice Unpauses the contract after an emergency is resolved
     * @dev Only callable by accounts with the GUARDIAN_ROLE
     * @dev Allows normal operation to resume after the contract was paused
     */
    function unpause() external onlyRole(GUARDIAN_ROLE) {
        _unpause();
    }
}

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.28;

import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol";
import {Proxy} from "@openzeppelin/contracts/proxy/Proxy.sol";

/**
 * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an
 * implementation address that can be changed. This address is stored in storage in the location specified by
 * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967], so that it doesn't conflict with the storage layout of the
 * implementation behind the proxy.
 *
 * @notice This is a modified version of the OpenZeppelin ERC1967Proxy contract that exposes the
 * getImplementation function to allow external contracts to read the implementation address.
 * This is needed for the MamoStrategyRegistry to verify the implementation of strategy proxies.
 */
contract ERC1967Proxy is Proxy {
    /**
     * @dev Initializes the upgradeable proxy with an initial implementation specified by `implementation`.
     *
     * If `_data` is nonempty, it's used as data in a delegate call to `implementation`. This will typically be an
     * encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.
     *
     * Requirements:
     *
     * - If `data` is empty, `msg.value` must be zero.
     */
    constructor(address implementation, bytes memory _data) payable {
        ERC1967Utils.upgradeToAndCall(implementation, _data);
    }

    /**
     * @dev Returns the current implementation address.
     *
     * 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.
     * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`
     */
    function _implementation() internal view virtual override returns (address) {
        return ERC1967Utils.getImplementation();
    }

    /**
     * @dev Returns the current implementation address.
     * @notice This function is added to the OpenZeppelin implementation to allow external
     * contracts to read the implementation address directly from the proxy.
     * @return The address of the current implementation contract.
     */
    function getImplementation() external view returns (address) {
        return _implementation();
    }
}

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.28;

import {IMamoStrategyRegistry} from "@interfaces/IMamoStrategyRegistry.sol";

/**
 * @title IBaseStrategy
 * @notice Interface for the base strategy contract
 */
interface IBaseStrategy {
    /**
     * @notice Gets the Mamo Strategy Registry contract
     * @return The Mamo Strategy Registry contract
     */
    function mamoStrategyRegistry() external view returns (IMamoStrategyRegistry);

    /**
     * @notice Gets the strategy type ID
     * @return The strategy type ID
     */
    function strategyTypeId() external view returns (uint256);
}

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.28;

/**
 * @dev Interface for the UUPS (Universal Upgradeable Proxy Standard) pattern.
 * This interface defines the methods that a UUPS proxy implementation should expose.
 */
interface IUUPSUpgradeable {
    /**
     * @dev Upgrades the implementation to `newImplementation` and calls a function on the new implementation.
     * This function is only callable through the proxy, not through the implementation.
     * @param newImplementation Address of the new implementation
     * @param data Data to send as msg.data in the low level call.
     * It usually encodes a function call to the implementation.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) external payable;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (access/extensions/AccessControlEnumerable.sol)

pragma solidity ^0.8.20;

import {IAccessControlEnumerable} from "./IAccessControlEnumerable.sol";
import {AccessControl} from "../AccessControl.sol";
import {EnumerableSet} from "../../utils/structs/EnumerableSet.sol";

/**
 * @dev Extension of {AccessControl} that allows enumerating the members of each role.
 */
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {
    using EnumerableSet for EnumerableSet.AddressSet;

    mapping(bytes32 role => EnumerableSet.AddressSet) private _roleMembers;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {
        return _roleMembers[role].at(index);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {
        return _roleMembers[role].length();
    }

    /**
     * @dev Return all accounts that have `role`
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function getRoleMembers(bytes32 role) public view virtual returns (address[] memory) {
        return _roleMembers[role].values();
    }

    /**
     * @dev Overload {AccessControl-_grantRole} to track enumerable memberships
     */
    function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {
        bool granted = super._grantRole(role, account);
        if (granted) {
            _roleMembers[role].add(account);
        }
        return granted;
    }

    /**
     * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships
     */
    function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {
        bool revoked = super._revokeRole(role, account);
        if (revoked) {
            _roleMembers[role].remove(account);
        }
        return revoked;
    }
}

// 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.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.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 Ownable is Context {
    address private _owner;

    /**
     * @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.
     */
    constructor(address initialOwner) {
        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) {
        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 {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// 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.0.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    bool private _paused;

    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    /**
     * @dev The operation failed because the contract is paused.
     */
    error EnforcedPause();

    /**
     * @dev The operation failed because the contract is not paused.
     */
    error ExpectedPause();

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        if (paused()) {
            revert EnforcedPause();
        }
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        if (!paused()) {
            revert ExpectedPause();
        }
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```solidity
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position is the index of the value in the `values` array plus 1.
        // Position 0 is used to mean a value is not in the set.
        mapping(bytes32 value => uint256) _positions;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._positions[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We cache the value's position to prevent multiple reads from the same storage slot
        uint256 position = set._positions[value];

        if (position != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 valueIndex = position - 1;
            uint256 lastIndex = set._values.length - 1;

            if (valueIndex != lastIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the lastValue to the index where the value to delete is
                set._values[valueIndex] = lastValue;
                // Update the tracked position of the lastValue (that was just moved)
                set._positions[lastValue] = position;
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the tracked position for the deleted slot
            delete set._positions[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._positions[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        assembly ("memory-safe") {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly ("memory-safe") {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly ("memory-safe") {
            result := store
        }

        return result;
    }
}

// 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) (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: BUSL-1.1
pragma solidity 0.8.28;

/**
 * @title IMamoStrategyRegistry
 * @dev Interface for the MamoStrategyRegistry contract
 */
interface IMamoStrategyRegistry {
    /**
     * @notice Pauses the contract
     * @dev Only callable by accounts with the GUARDIAN_ROLE
     */
    function pause() external;

    /**
     * @notice Unpauses the contract
     * @dev Only callable by accounts with the GUARDIAN_ROLE
     */
    function unpause() external;

    /**
     * @notice Adds an implementation to the whitelist with a strategy type ID
     * @dev Only callable by accounts with the ADMIN_ROLE
     * @param implementation The address of the implementation to whitelist
     * @param strategyTypeId The strategy type ID to assign. If 0, a new ID will be assigned
     * @return assignedStrategyTypeId The assigned strategy type ID
     */
    function whitelistImplementation(address implementation, uint256 strategyTypeId)
        external
        returns (uint256 assignedStrategyTypeId);

    /**
     * @notice Checks if an implementation is whitelisted
     * @param implementation The address of the implementation to check
     * @return True if the implementation is whitelisted, false otherwise
     */
    function whitelistedImplementations(address implementation) external view returns (bool);

    /**
     * @notice Gets the strategy ID for an implementation
     * @param implementation The address of the implementation
     * @return The strategy ID as a uint256 value
     */
    function implementationId(address implementation) external view returns (uint256);

    /**
     * @notice Gets the latest implementation for a strategy ID
     * @param strategyId The strategy ID as a uint256 value
     * @return The address of the latest implementation for the strategy ID
     */
    function latestImplementationById(uint256 strategyId) external view returns (address);

    /**
     * @notice Adds a strategy for a user
     * @dev Only callable by accounts with the BACKEND_ROLE
     * @param user The address of the user
     * @param strategy The address of the strategy to add
     */
    function addStrategy(address user, address strategy) external;

    /**
     * @notice Removes a strategy for a user
     * @dev Only callable by accounts with the BACKEND_ROLE
     * @param user The address of the user
     * @param strategy The address of the strategy to remove
     */
    function removeStrategy(address user, address strategy) external;

    /**
     * @notice Updates the implementation of a strategy
     * @dev Only callable by the user who owns the strategy
     * @param strategy The address of the strategy to update
     * @param newImplementation The new implementation address
     */
    function upgradeStrategy(address strategy, address newImplementation) external;

    /**
     * @notice Gets all strategies for a user
     * @param user The address of the user
     * @return An array of strategy addresses
     */
    function getUserStrategies(address user) external view returns (address[] memory);

    /**
     * @notice Checks if a strategy belongs to a user
     * @param user The address of the user
     * @param strategy The address of the strategy
     * @return True if the strategy belongs to the user, false otherwise
     */
    function isUserStrategy(address user, address strategy) external view returns (bool);

    /**
     * @notice Gets the implementation address for a strategy
     * @param strategy The address of the strategy (proxy)
     * @return implementation The address of the implementation
     */
    function getStrategyImplementation(address strategy) external view returns (address);

    /**
     * @notice Gets the backend address (first member of the BACKEND_ROLE)
     * @return The address of the backend
     */
    function getBackendAddress() external view returns (address);

    /**
     * @notice Updates the owner of a strategy
     * @dev Only callable by the current owner of the strategy
     * @param newOwner The address of the new owner
     */
    function updateStrategyOwner(address newOwner) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (access/extensions/IAccessControlEnumerable.sol)

pragma solidity ^0.8.20;

import {IAccessControl} from "../IAccessControl.sol";

/**
 * @dev External interface of AccessControlEnumerable declared to support ERC-165 detection.
 */
interface IAccessControlEnumerable is IAccessControl {
    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) external view returns (address);

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) external view returns (uint256);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)

pragma solidity ^0.8.20;

import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address account => bool) hasRole;
        bytes32 adminRole;
    }

    mapping(bytes32 role => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with an {AccessControlUnauthorizedAccount} error including the required role.
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual returns (bool) {
        return _roles[role].hasRole[account];
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
     * is missing `role`.
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert AccessControlUnauthorizedAccount(account, role);
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address callerConfirmation) public virtual {
        if (callerConfirmation != _msgSender()) {
            revert AccessControlBadConfirmation();
        }

        _revokeRole(role, callerConfirmation);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
        if (!hasRole(role, account)) {
            _roles[role].hasRole[account] = true;
            emit RoleGranted(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
        if (hasRole(role, account)) {
            _roles[role].hasRole[account] = false;
            emit RoleRevoked(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (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.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);
}

File 19 of 27 : IERC1967.sol
// 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.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/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) (access/IAccessControl.sol)

pragma solidity ^0.8.20;

/**
 * @dev External interface of AccessControl declared to support ERC-165 detection.
 */
interface IAccessControl {
    /**
     * @dev The `account` is missing a role.
     */
    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);

    /**
     * @dev The caller of a function is not the expected one.
     *
     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
     */
    error AccessControlBadConfirmation();

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call. This account bears the admin role (for the granted role).
     * Expected in cases where the role was granted using the internal {AccessControl-_grantRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     */
    function renounceRole(bytes32 role, address callerConfirmation) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 24 of 27 : IERC20.sol
// 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";

File 25 of 27 : IERC165.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";

File 26 of 27 : Errors.sol
// 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.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);
}

Settings
{
  "remappings": [
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "@forge-std/=lib/forge-std/src/",
    "@addresses/=addresses/",
    "@contracts/=src/",
    "@interfaces/=src/interfaces/",
    "@libraries/=src/libraries/",
    "@script/=script/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@surl/=lib/surl/src/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "@test/=test/",
    "@openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
    "ds-test/=lib/surl/lib/forge-std/lib/ds-test/src/",
    "openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
    "solidity-stringutils/=lib/surl/lib/solidity-stringutils/",
    "surl/=lib/surl/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": true,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"admin","type":"address"},{"internalType":"address","name":"backend","type":"address"},{"internalType":"address","name":"guardian","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"},{"indexed":true,"internalType":"uint256","name":"strategyType","type":"uint256"}],"name":"ImplementationWhitelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"strategy","type":"address"},{"indexed":false,"internalType":"address","name":"implementation","type":"address"}],"name":"StrategyAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"strategy","type":"address"},{"indexed":true,"internalType":"address","name":"oldImplementation","type":"address"},{"indexed":true,"internalType":"address","name":"newImplementation","type":"address"}],"name":"StrategyImplementationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"strategy","type":"address"},{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"StrategyOwnerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenRecovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"BACKEND_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GUARDIAN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"strategy","type":"address"}],"name":"addStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBackendAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMembers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserStrategies","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"implementationToId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"strategy","type":"address"}],"name":"isUserStrategy","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"latestImplementationById","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextStrategyTypeId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"updateStrategyOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"strategy","type":"address"},{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"},{"internalType":"uint256","name":"strategyTypeId","type":"uint256"}],"name":"whitelistImplementation","outputs":[{"internalType":"uint256","name":"assignedStrategyTypeId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedImplementations","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

0x60803461026f57601f611e4b38819003918201601f19168301916001600160401b038311848410176102735780849260609460405283398101031261026f5761004781610287565b61005f604061005860208501610287565b9301610287565b6002805460ff191690556001600160a01b03821691821561022a576001600160a01b0384169081156101e5576001600160a01b0383169485156101a0576100c2946100ac6100b79361029b565b610167575b50610311565b610121575b50610391565b6100db575b600160035560405161190990816104828239f35b5f516020611e2b5f395f51905f525f52600160205261011a907fe8fad4b49f5ba25b2c682cfec2ac50a7a40bbd1e12ab51733ec3e9c2f6f1c5db610411565b505f6100c7565b5f516020611dcb5f395f51905f525f526001602052610160907feb2b7e9fb33bd214e4eb1341cc6227bfa8ae181327e69ed47f46972bd2e9abbb610411565b505f6100bc565b5f80526001602052610199907fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49610411565b505f6100b1565b60405162461bcd60e51b815260206004820152601860248201527f496e76616c696420677561726469616e206164647265737300000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601760248201527f496e76616c6964206261636b656e6420616464726573730000000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601560248201527f496e76616c69642061646d696e206164647265737300000000000000000000006044820152606490fd5b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b038216820361026f57565b6001600160a01b0381165f9081525f516020611e0b5f395f51905f52602052604090205460ff1661030c576001600160a01b03165f8181525f516020611e0b5f395f51905f5260205260408120805460ff191660011790553391905f516020611d8b5f395f51905f528180a4600190565b505f90565b6001600160a01b0381165f9081525f516020611deb5f395f51905f52602052604090205460ff1661030c576001600160a01b03165f8181525f516020611deb5f395f51905f5260205260408120805460ff191660011790553391905f516020611dcb5f395f51905f52905f516020611d8b5f395f51905f529080a4600190565b6001600160a01b0381165f9081525f516020611dab5f395f51905f52602052604090205460ff1661030c576001600160a01b03165f8181525f516020611dab5f395f51905f5260205260408120805460ff191660011790553391905f516020611e2b5f395f51905f52905f516020611d8b5f395f51905f529080a4600190565b6001810190825f528160205260405f2054155f1461047a578054680100000000000000008110156102735760018101808355811015610466578390825f5260205f20015554915f5260205260405f2055600190565b634e487b7160e01b5f52603260045260245ffd5b5050505f9056fe6080806040526004361015610012575f80fd5b5f905f3560e01c90816301ffc9a71461134a575080630d5f7cbc146112ed5780631171bda9146111845780631806694314610cf8578063248a9ca314610cc657806324ea54f414610c8c5780632f2ff15d14610c2757806336568abe14610be15780633cd8ed4a14610a575780633ddad6e1146108765780633f4ba83a146108105780635c975abb146107ee57806367dee1061461058757806379f02fd4146104b25780638456cb59146104575780639010d07c1461041157806391d14854146103c857806392c2becc1461038d578063a217fddf14610371578063a3246ad3146102fd578063b01402c6146102df578063ca15c873146102b5578063d547741f1461026e578063edb39a40146101f4578063fcff48ed146101b5578063fd5ab9ef146101825763fd62df0714610147575f80fd5b3461017f57602036600319011261017f576020906040906001600160a01b0361016e6113b7565b168152600783522054604051908152f35b80fd5b503461017f57602036600319011261017f57602090600435815260068252604060018060a01b0391205416604051908152f35b503461017f57602036600319011261017f5760209060ff906040906001600160a01b036101e06113b7565b168152600584522054166040519015158152f35b503461017f578060031936011261017f577f25cf2b509f2a7f322675b2a5322b182f44ad2c03ac941a0af17c9b178f5d5d5f81526001602052604081209081541561025a5790815260208082205460405160039390931b1c6001600160a01b0316825290f35b634e487b7160e01b81526032600452602490fd5b503461017f57604036600319011261017f576102b160043561028e6113cd565b906102ac6102a7825f525f602052600160405f20015490565b6115e8565b61163b565b5080f35b503461017f57602036600319011261017f5760406020916004358152600183522054604051908152f35b503461017f578060031936011261017f576020600354604051908152f35b503461017f57602036600319011261017f576004358152600160205260408120604051918260208354918281520192825260208220915b81811061035b576103578561034b81870382611425565b604051918291826113e3565b0390f35b8254845260209093019260019283019201610334565b503461017f578060031936011261017f57602090604051908152f35b503461017f578060031936011261017f5760206040517f25cf2b509f2a7f322675b2a5322b182f44ad2c03ac941a0af17c9b178f5d5d5f8152f35b503461017f57604036600319011261017f5760406103e46113cd565b91600435815280602052209060018060a01b03165f52602052602060ff60405f2054166040519015158152f35b503461017f57604036600319011261017f5761043e60406020926004358152600184522060243590611675565b905460405160039290921b1c6001600160a01b03168152f35b503461017f578060031936011261017f57610470611579565b610478611620565b600160ff1960025416176002557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a180f35b503461017f57602036600319011261017f576001600160a01b036104d46113b7565b16808252600460205260408220546104eb81611512565b916104f96040519384611425565b818352601f1961050883611512565b01366020850137835b828110610526576040518061035786826113e3565b818552600460205261053b8160408720611675565b9054855160039290921b1c6001600160a01b031690821015610573576001600160a01b0316600582901b850160200152600101610511565b634e487b7160e01b86526032600452602486fd5b503461071f57604036600319011261071f576105a16113b7565b6105a96113cd565b906105b2611620565b335f5260046020526105df60405f209160018060a01b031680926001915f520160205260405f2054151590565b156107995760405163557887a160e11b815291602083600481855afa928315610714575f93610768575b506001600160a01b0390811692169081831461072357815f52600760205260405f20545f52600660205261064b60018060a01b0360405f2054169384146114c6565b825f52600560205261066360ff60405f20541661147a565b604051610671602082611425565b5f808252602082019190368337823b1561071f575f9060646040518094819363278f794360e11b8352896004840152604060248401525180918160448501528484015e8181018301859052601f01601f1916810103018183865af18015610714576106ff575b507f9263afc9abb2146cde7bb3be21ede745fdd8f79f13e0fc0ba1115746778dee928480a480f35b61070c9194505f90611425565b5f925f6106d7565b6040513d5f823e3d90fd5b5f80fd5b60405162461bcd60e51b815260206004820152601c60248201527f416c7265616479207573696e6720696d706c656d656e746174696f6e000000006044820152606490fd5b61078b91935060203d602011610792575b6107838183611425565b81019061145b565b915f610609565b503d610779565b60405162461bcd60e51b815260206004820152602760248201527f43616c6c6572206973206e6f7420746865206f776e6572206f662074686520736044820152667472617465677960c81b6064820152608490fd5b3461071f575f36600319011261071f57602060ff600254166040519015158152f35b3461071f575f36600319011261071f57610828611579565b60025460ff8116156108675760ff19166002557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a1005b638dfc202b60e01b5f5260045ffd5b3461071f57602036600319011261071f5761088f6113b7565b610897611620565b604051638da5cb5b60e01b815290602082600481335afa918215610714575f92610a36575b506001600160a01b03169081156109f1576001600160a01b031680156109ac57805f5260046020526108ff3360405f206001915f520160205260405f2054151590565b1561095757805f5260046020526109193360405f2061180e565b50815f52600460205261092f3360405f2061169e565b50337f5c5d105233e9bd0a6244b4af448118b51a254de475b948b59e019dd5e51708d05f80a4005b60405162461bcd60e51b815260206004820152602760248201527f4e6f7420617574686f72697a656420746f2075706461746520737472617465676044820152663c9037bbb732b960c91b6064820152608490fd5b60405162461bcd60e51b815260206004820152601d60248201527f496e76616c69642063757272656e74206f776e657220616464726573730000006044820152606490fd5b60405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206e6577206f776e65722061646472657373000000000000006044820152606490fd5b610a5091925060203d602011610792576107838183611425565b90826108bc565b3461071f57604036600319011261071f57610a706113b7565b60243590610a7c61152a565b6001600160a01b0316908115610b9c57815f52600560205260ff60405f205416610b4c5780610b435750600354905f198214610b2f57816001602093016003555b815f526005835260405f20600160ff19825416179055815f52600783528060405f2055805f526006835260405f20826bffffffffffffffffffffffff60a01b82541617905580604051927f52c0c0cf5b8ced69aa47a5759d7d3178a7230d505fd3a766df5c40765ddd96f05f80a38152f35b634e487b7160e01b5f52601160045260245ffd5b90602091610abd565b60405162461bcd60e51b815260206004820152602260248201527f496d706c656d656e746174696f6e20616c72656164792077686974656c697374604482015261195960f21b6064820152608490fd5b60405162461bcd60e51b815260206004820152601e60248201527f496e76616c696420696d706c656d656e746174696f6e206164647265737300006044820152606490fd5b3461071f57604036600319011261071f57610bfa6113cd565b336001600160a01b03821603610c1857610c169060043561163b565b005b63334bd91960e11b5f5260045ffd5b3461071f57604036600319011261071f57600435610c436113cd565b610c5b6102a7835f525f602052600160405f20015490565b610c65818361170c565b610c6b57005b5f91825260016020526040909120610c16916001600160a01b03169061169e565b3461071f575f36600319011261071f5760206040517f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a50418152f35b3461071f57602036600319011261071f576020610cf06004355f525f602052600160405f20015490565b604051908152f35b3461071f57604036600319011261071f57610d116113b7565b610d196113cd565b90610d22611620565b335f9081527f48c7bdbf6e737fbd4f28e9ac2ee21ca1cecfc20cb008a302f41dcc98ef949678602052604090205460ff161561114d576001600160a01b0316908115611111576001600160a01b031680156110cc57815f526004602052610d9a8160405f206001915f520160205260405f2054151590565b6110875760405163557887a160e11b8152602081600481855afa908115610714575f91611068575b506001600160a01b031690811561102a57815f526005602052610deb60ff60405f20541661147a565b604051638da5cb5b60e01b8152602081600481855afa80156107145784915f9161100b575b506001600160a01b031603610fc657604051635b69ee8960e11b8152602081600481855afa908115610714575f91610f84575b50306001600160a01b0390911603610f335760405163147663f760e31b8152602081600481855afa908115610714575f91610edf575b50907fbed8e8f7f7f40bdcad9266ea78deccef9b9590fcb85909285332b9550c9ba4cc926040925f526006602052610ebd60018060a01b03845f20541682146114c6565b845f526004602052610ed182845f2061169e565b5082519182526020820152a2005b9190506020823d602011610f2b575b81610efb60209383611425565b8101031261071f5790517fbed8e8f7f7f40bdcad9266ea78deccef9b9590fcb85909285332b9550c9ba4cc610e79565b3d9150610eee565b60405162461bcd60e51b815260206004820152602360248201527f5374726174656779207265676973747279206e6f742073657420636f72726563604482015262746c7960e81b6064820152608490fd5b90506020813d602011610fbe575b81610f9f60209383611425565b8101031261071f57516001600160a01b038116810361071f5784610e43565b3d9150610f92565b60405162461bcd60e51b815260206004820152601e60248201527f5374726174656779206f776e6572206973206e6f7420746865207573657200006044820152606490fd5b611024915060203d602011610792576107838183611425565b85610e10565b60405162461bcd60e51b815260206004820152601660248201527524b73b30b634b21034b6b83632b6b2b73a30ba34b7b760511b6044820152606490fd5b611081915060203d602011610792576107838183611425565b83610dc2565b60405162461bcd60e51b815260206004820152601f60248201527f537472617465677920616c726561647920616464656420666f722075736572006044820152606490fd5b60405162461bcd60e51b815260206004820152601860248201527f496e76616c6964207374726174656779206164647265737300000000000000006044820152606490fd5b60405162461bcd60e51b8152602060048201526014602482015273496e76616c69642075736572206164647265737360601b6044820152606490fd5b63e2517d3f60e01b5f52336004527f25cf2b509f2a7f322675b2a5322b182f44ad2c03ac941a0af17c9b178f5d5d5f60245260445ffd5b3461071f57606036600319011261071f5761119d6113b7565b6111a56113cd565b604435906111b161152a565b6001600160a01b03169182156112a85781156112635760018060a01b03169060205f6040518281019063a9059cbb60e01b8252866024820152846044820152604481526111ff606482611425565b519082865af115610714575f513d61125a5750813b155b6112475760207f879f92dded0f26b83c3e00b12e0395dc72cfc3077343d1854ed6988edd1f909691604051908152a3005b50635274afe760e01b5f5260045260245ffd5b60011415611216565b60405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606490fd5b60405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f742073656e6420746f207a65726f206164647265737300000000006044820152606490fd5b3461071f57604036600319011261071f57602061134061130b6113b7565b6113136113cd565b6001600160a01b039182165f90815260048552604080822092909316815260019091016020522054151590565b6040519015158152f35b3461071f57602036600319011261071f576004359063ffffffff60e01b821680920361071f57602091635a05180f60e01b811490811561138c575b5015158152f35b637965db0b60e01b8114915081156113a6575b5083611385565b6301ffc9a760e01b1490508361139f565b600435906001600160a01b038216820361071f57565b602435906001600160a01b038216820361071f57565b60206040818301928281528451809452019201905f5b8181106114065750505090565b82516001600160a01b03168452602093840193909201916001016113f9565b90601f8019910116810190811067ffffffffffffffff82111761144757604052565b634e487b7160e01b5f52604160045260245ffd5b9081602091031261071f57516001600160a01b038116810361071f5790565b1561148157565b60405162461bcd60e51b815260206004820152601e60248201527f496d706c656d656e746174696f6e206e6f742077686974656c697374656400006044820152606490fd5b156114cd57565b60405162461bcd60e51b815260206004820152601960248201527f4e6f74206c617465737420696d706c656d656e746174696f6e000000000000006044820152606490fd5b67ffffffffffffffff81116114475760051b60200190565b335f9081527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5602052604090205460ff161561156257565b63e2517d3f60e01b5f52336004525f60245260445ffd5b335f9081527f8a40f0b47fdc2a0ce293b772acfc7508c8315a4d462786c1adc3a56f92ca2d05602052604090205460ff16156115b157565b63e2517d3f60e01b5f52336004527f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a504160245260445ffd5b5f8181526020818152604080832033845290915290205460ff161561160a5750565b63e2517d3f60e01b5f523360045260245260445ffd5b60ff6002541661162c57565b63d93c066560e01b5f5260045ffd5b611645828261178e565b918261165057505090565b5f91825260016020526040909120611671916001600160a01b03169061180e565b5090565b805482101561168a575f5260205f2001905f90565b634e487b7160e01b5f52603260045260245ffd5b5f828152600182016020526040902054611706578054906801000000000000000082101561144757826116f16116db846001809601855584611675565b819391549060031b91821b915f19901b19161790565b90558054925f520160205260405f2055600190565b50505f90565b5f818152602081815260408083206001600160a01b038616845290915290205460ff16611706575f818152602081815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b5f818152602081815260408083206001600160a01b038616845290915290205460ff1615611706575f818152602081815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b906001820191815f528260205260405f20548015155f146118cb575f198101818111610b2f5782545f19810191908211610b2f57818103611896575b50505080548015611882575f1901906118638282611675565b8154905f199060031b1b19169055555f526020525f6040812055600190565b634e487b7160e01b5f52603160045260245ffd5b6118b66118a66116db9386611675565b90549060031b1c92839286611675565b90555f528360205260405f20555f808061184a565b505050505f9056fea2646970667358221220132926779519bc4c127563eab216d18f2e8d9a1ce10de5b344d83f998efc81ba64736f6c634300081c00332f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8a40f0b47fdc2a0ce293b772acfc7508c8315a4d462786c1adc3a56f92ca2d0525cf2b509f2a7f322675b2a5322b182f44ad2c03ac941a0af17c9b178f5d5d5f48c7bdbf6e737fbd4f28e9ac2ee21ca1cecfc20cb008a302f41dcc98ef949678ad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb555435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a5041000000000000000000000000dca82e03057329f53ed4173429d46b0511e46fb80000000000000000000000002ab03887829ea8632d972cf3816b825fe7fc5e7300000000000000000000000026c158a4cd56d148c554190a95a921d90f00c160

Deployed Bytecode

0x6080806040526004361015610012575f80fd5b5f905f3560e01c90816301ffc9a71461134a575080630d5f7cbc146112ed5780631171bda9146111845780631806694314610cf8578063248a9ca314610cc657806324ea54f414610c8c5780632f2ff15d14610c2757806336568abe14610be15780633cd8ed4a14610a575780633ddad6e1146108765780633f4ba83a146108105780635c975abb146107ee57806367dee1061461058757806379f02fd4146104b25780638456cb59146104575780639010d07c1461041157806391d14854146103c857806392c2becc1461038d578063a217fddf14610371578063a3246ad3146102fd578063b01402c6146102df578063ca15c873146102b5578063d547741f1461026e578063edb39a40146101f4578063fcff48ed146101b5578063fd5ab9ef146101825763fd62df0714610147575f80fd5b3461017f57602036600319011261017f576020906040906001600160a01b0361016e6113b7565b168152600783522054604051908152f35b80fd5b503461017f57602036600319011261017f57602090600435815260068252604060018060a01b0391205416604051908152f35b503461017f57602036600319011261017f5760209060ff906040906001600160a01b036101e06113b7565b168152600584522054166040519015158152f35b503461017f578060031936011261017f577f25cf2b509f2a7f322675b2a5322b182f44ad2c03ac941a0af17c9b178f5d5d5f81526001602052604081209081541561025a5790815260208082205460405160039390931b1c6001600160a01b0316825290f35b634e487b7160e01b81526032600452602490fd5b503461017f57604036600319011261017f576102b160043561028e6113cd565b906102ac6102a7825f525f602052600160405f20015490565b6115e8565b61163b565b5080f35b503461017f57602036600319011261017f5760406020916004358152600183522054604051908152f35b503461017f578060031936011261017f576020600354604051908152f35b503461017f57602036600319011261017f576004358152600160205260408120604051918260208354918281520192825260208220915b81811061035b576103578561034b81870382611425565b604051918291826113e3565b0390f35b8254845260209093019260019283019201610334565b503461017f578060031936011261017f57602090604051908152f35b503461017f578060031936011261017f5760206040517f25cf2b509f2a7f322675b2a5322b182f44ad2c03ac941a0af17c9b178f5d5d5f8152f35b503461017f57604036600319011261017f5760406103e46113cd565b91600435815280602052209060018060a01b03165f52602052602060ff60405f2054166040519015158152f35b503461017f57604036600319011261017f5761043e60406020926004358152600184522060243590611675565b905460405160039290921b1c6001600160a01b03168152f35b503461017f578060031936011261017f57610470611579565b610478611620565b600160ff1960025416176002557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a180f35b503461017f57602036600319011261017f576001600160a01b036104d46113b7565b16808252600460205260408220546104eb81611512565b916104f96040519384611425565b818352601f1961050883611512565b01366020850137835b828110610526576040518061035786826113e3565b818552600460205261053b8160408720611675565b9054855160039290921b1c6001600160a01b031690821015610573576001600160a01b0316600582901b850160200152600101610511565b634e487b7160e01b86526032600452602486fd5b503461071f57604036600319011261071f576105a16113b7565b6105a96113cd565b906105b2611620565b335f5260046020526105df60405f209160018060a01b031680926001915f520160205260405f2054151590565b156107995760405163557887a160e11b815291602083600481855afa928315610714575f93610768575b506001600160a01b0390811692169081831461072357815f52600760205260405f20545f52600660205261064b60018060a01b0360405f2054169384146114c6565b825f52600560205261066360ff60405f20541661147a565b604051610671602082611425565b5f808252602082019190368337823b1561071f575f9060646040518094819363278f794360e11b8352896004840152604060248401525180918160448501528484015e8181018301859052601f01601f1916810103018183865af18015610714576106ff575b507f9263afc9abb2146cde7bb3be21ede745fdd8f79f13e0fc0ba1115746778dee928480a480f35b61070c9194505f90611425565b5f925f6106d7565b6040513d5f823e3d90fd5b5f80fd5b60405162461bcd60e51b815260206004820152601c60248201527f416c7265616479207573696e6720696d706c656d656e746174696f6e000000006044820152606490fd5b61078b91935060203d602011610792575b6107838183611425565b81019061145b565b915f610609565b503d610779565b60405162461bcd60e51b815260206004820152602760248201527f43616c6c6572206973206e6f7420746865206f776e6572206f662074686520736044820152667472617465677960c81b6064820152608490fd5b3461071f575f36600319011261071f57602060ff600254166040519015158152f35b3461071f575f36600319011261071f57610828611579565b60025460ff8116156108675760ff19166002557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a1005b638dfc202b60e01b5f5260045ffd5b3461071f57602036600319011261071f5761088f6113b7565b610897611620565b604051638da5cb5b60e01b815290602082600481335afa918215610714575f92610a36575b506001600160a01b03169081156109f1576001600160a01b031680156109ac57805f5260046020526108ff3360405f206001915f520160205260405f2054151590565b1561095757805f5260046020526109193360405f2061180e565b50815f52600460205261092f3360405f2061169e565b50337f5c5d105233e9bd0a6244b4af448118b51a254de475b948b59e019dd5e51708d05f80a4005b60405162461bcd60e51b815260206004820152602760248201527f4e6f7420617574686f72697a656420746f2075706461746520737472617465676044820152663c9037bbb732b960c91b6064820152608490fd5b60405162461bcd60e51b815260206004820152601d60248201527f496e76616c69642063757272656e74206f776e657220616464726573730000006044820152606490fd5b60405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206e6577206f776e65722061646472657373000000000000006044820152606490fd5b610a5091925060203d602011610792576107838183611425565b90826108bc565b3461071f57604036600319011261071f57610a706113b7565b60243590610a7c61152a565b6001600160a01b0316908115610b9c57815f52600560205260ff60405f205416610b4c5780610b435750600354905f198214610b2f57816001602093016003555b815f526005835260405f20600160ff19825416179055815f52600783528060405f2055805f526006835260405f20826bffffffffffffffffffffffff60a01b82541617905580604051927f52c0c0cf5b8ced69aa47a5759d7d3178a7230d505fd3a766df5c40765ddd96f05f80a38152f35b634e487b7160e01b5f52601160045260245ffd5b90602091610abd565b60405162461bcd60e51b815260206004820152602260248201527f496d706c656d656e746174696f6e20616c72656164792077686974656c697374604482015261195960f21b6064820152608490fd5b60405162461bcd60e51b815260206004820152601e60248201527f496e76616c696420696d706c656d656e746174696f6e206164647265737300006044820152606490fd5b3461071f57604036600319011261071f57610bfa6113cd565b336001600160a01b03821603610c1857610c169060043561163b565b005b63334bd91960e11b5f5260045ffd5b3461071f57604036600319011261071f57600435610c436113cd565b610c5b6102a7835f525f602052600160405f20015490565b610c65818361170c565b610c6b57005b5f91825260016020526040909120610c16916001600160a01b03169061169e565b3461071f575f36600319011261071f5760206040517f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a50418152f35b3461071f57602036600319011261071f576020610cf06004355f525f602052600160405f20015490565b604051908152f35b3461071f57604036600319011261071f57610d116113b7565b610d196113cd565b90610d22611620565b335f9081527f48c7bdbf6e737fbd4f28e9ac2ee21ca1cecfc20cb008a302f41dcc98ef949678602052604090205460ff161561114d576001600160a01b0316908115611111576001600160a01b031680156110cc57815f526004602052610d9a8160405f206001915f520160205260405f2054151590565b6110875760405163557887a160e11b8152602081600481855afa908115610714575f91611068575b506001600160a01b031690811561102a57815f526005602052610deb60ff60405f20541661147a565b604051638da5cb5b60e01b8152602081600481855afa80156107145784915f9161100b575b506001600160a01b031603610fc657604051635b69ee8960e11b8152602081600481855afa908115610714575f91610f84575b50306001600160a01b0390911603610f335760405163147663f760e31b8152602081600481855afa908115610714575f91610edf575b50907fbed8e8f7f7f40bdcad9266ea78deccef9b9590fcb85909285332b9550c9ba4cc926040925f526006602052610ebd60018060a01b03845f20541682146114c6565b845f526004602052610ed182845f2061169e565b5082519182526020820152a2005b9190506020823d602011610f2b575b81610efb60209383611425565b8101031261071f5790517fbed8e8f7f7f40bdcad9266ea78deccef9b9590fcb85909285332b9550c9ba4cc610e79565b3d9150610eee565b60405162461bcd60e51b815260206004820152602360248201527f5374726174656779207265676973747279206e6f742073657420636f72726563604482015262746c7960e81b6064820152608490fd5b90506020813d602011610fbe575b81610f9f60209383611425565b8101031261071f57516001600160a01b038116810361071f5784610e43565b3d9150610f92565b60405162461bcd60e51b815260206004820152601e60248201527f5374726174656779206f776e6572206973206e6f7420746865207573657200006044820152606490fd5b611024915060203d602011610792576107838183611425565b85610e10565b60405162461bcd60e51b815260206004820152601660248201527524b73b30b634b21034b6b83632b6b2b73a30ba34b7b760511b6044820152606490fd5b611081915060203d602011610792576107838183611425565b83610dc2565b60405162461bcd60e51b815260206004820152601f60248201527f537472617465677920616c726561647920616464656420666f722075736572006044820152606490fd5b60405162461bcd60e51b815260206004820152601860248201527f496e76616c6964207374726174656779206164647265737300000000000000006044820152606490fd5b60405162461bcd60e51b8152602060048201526014602482015273496e76616c69642075736572206164647265737360601b6044820152606490fd5b63e2517d3f60e01b5f52336004527f25cf2b509f2a7f322675b2a5322b182f44ad2c03ac941a0af17c9b178f5d5d5f60245260445ffd5b3461071f57606036600319011261071f5761119d6113b7565b6111a56113cd565b604435906111b161152a565b6001600160a01b03169182156112a85781156112635760018060a01b03169060205f6040518281019063a9059cbb60e01b8252866024820152846044820152604481526111ff606482611425565b519082865af115610714575f513d61125a5750813b155b6112475760207f879f92dded0f26b83c3e00b12e0395dc72cfc3077343d1854ed6988edd1f909691604051908152a3005b50635274afe760e01b5f5260045260245ffd5b60011415611216565b60405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606490fd5b60405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f742073656e6420746f207a65726f206164647265737300000000006044820152606490fd5b3461071f57604036600319011261071f57602061134061130b6113b7565b6113136113cd565b6001600160a01b039182165f90815260048552604080822092909316815260019091016020522054151590565b6040519015158152f35b3461071f57602036600319011261071f576004359063ffffffff60e01b821680920361071f57602091635a05180f60e01b811490811561138c575b5015158152f35b637965db0b60e01b8114915081156113a6575b5083611385565b6301ffc9a760e01b1490508361139f565b600435906001600160a01b038216820361071f57565b602435906001600160a01b038216820361071f57565b60206040818301928281528451809452019201905f5b8181106114065750505090565b82516001600160a01b03168452602093840193909201916001016113f9565b90601f8019910116810190811067ffffffffffffffff82111761144757604052565b634e487b7160e01b5f52604160045260245ffd5b9081602091031261071f57516001600160a01b038116810361071f5790565b1561148157565b60405162461bcd60e51b815260206004820152601e60248201527f496d706c656d656e746174696f6e206e6f742077686974656c697374656400006044820152606490fd5b156114cd57565b60405162461bcd60e51b815260206004820152601960248201527f4e6f74206c617465737420696d706c656d656e746174696f6e000000000000006044820152606490fd5b67ffffffffffffffff81116114475760051b60200190565b335f9081527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5602052604090205460ff161561156257565b63e2517d3f60e01b5f52336004525f60245260445ffd5b335f9081527f8a40f0b47fdc2a0ce293b772acfc7508c8315a4d462786c1adc3a56f92ca2d05602052604090205460ff16156115b157565b63e2517d3f60e01b5f52336004527f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a504160245260445ffd5b5f8181526020818152604080832033845290915290205460ff161561160a5750565b63e2517d3f60e01b5f523360045260245260445ffd5b60ff6002541661162c57565b63d93c066560e01b5f5260045ffd5b611645828261178e565b918261165057505090565b5f91825260016020526040909120611671916001600160a01b03169061180e565b5090565b805482101561168a575f5260205f2001905f90565b634e487b7160e01b5f52603260045260245ffd5b5f828152600182016020526040902054611706578054906801000000000000000082101561144757826116f16116db846001809601855584611675565b819391549060031b91821b915f19901b19161790565b90558054925f520160205260405f2055600190565b50505f90565b5f818152602081815260408083206001600160a01b038616845290915290205460ff16611706575f818152602081815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b5f818152602081815260408083206001600160a01b038616845290915290205460ff1615611706575f818152602081815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b906001820191815f528260205260405f20548015155f146118cb575f198101818111610b2f5782545f19810191908211610b2f57818103611896575b50505080548015611882575f1901906118638282611675565b8154905f199060031b1b19169055555f526020525f6040812055600190565b634e487b7160e01b5f52603160045260245ffd5b6118b66118a66116db9386611675565b90549060031b1c92839286611675565b90555f528360205260405f20555f808061184a565b505050505f9056fea2646970667358221220132926779519bc4c127563eab216d18f2e8d9a1ce10de5b344d83f998efc81ba64736f6c634300081c0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.