S Price: $0.451178 (+5.42%)
    /

    Contract

    0xa8EaA86861B488DFAE3362fCf99ce316C479760d

    Overview

    S Balance

    Sonic LogoSonic LogoSonic Logo0 S

    S Value

    $0.00

    Multichain Info

    No addresses found
    Transaction Hash
    Method
    Block
    Age
    From
    To
    Deploy57050792025-01-28 18:58:2842 days ago1738090708IN
    0xa8EaA868...6C479760d
    0 S0.0516531955
    Deploy57046782025-01-28 18:54:0542 days ago1738090445IN
    0xa8EaA868...6C479760d
    0 S0.0516551755
    Deploy57039572025-01-28 18:46:3942 days ago1738089999IN
    0xa8EaA868...6C479760d
    0 S0.0516512155
    Deploy57037712025-01-28 18:43:5142 days ago1738089831IN
    0xa8EaA868...6C479760d
    0 S0.0516558355
    Deploy57035662025-01-28 18:41:1442 days ago1738089674IN
    0xa8EaA868...6C479760d
    0 S0.0516558355
    Deploy57032952025-01-28 18:37:4442 days ago1738089464IN
    0xa8EaA868...6C479760d
    0 S0.0516551755
    Deploy57025132025-01-28 18:28:0642 days ago1738088886IN
    0xa8EaA868...6C479760d
    0 S0.0516545155
    Deploy57022702025-01-28 18:24:5142 days ago1738088691IN
    0xa8EaA868...6C479760d
    0 S0.0516551755
    Deploy57019922025-01-28 18:21:1442 days ago1738088474IN
    0xa8EaA868...6C479760d
    0 S0.0516558355
    Deploy57016432025-01-28 18:16:4642 days ago1738088206IN
    0xa8EaA868...6C479760d
    0 S0.0516518755
    Deploy57014092025-01-28 18:13:5342 days ago1738088033IN
    0xa8EaA868...6C479760d
    0 S0.0516531955
    Deploy57011712025-01-28 18:10:3842 days ago1738087838IN
    0xa8EaA868...6C479760d
    0 S0.0516531955
    Deploy57008232025-01-28 18:06:3242 days ago1738087592IN
    0xa8EaA868...6C479760d
    0 S0.0516545155
    Deploy57005502025-01-28 18:02:4842 days ago1738087368IN
    0xa8EaA868...6C479760d
    0 S0.0516512155
    Deploy57002652025-01-28 17:59:2842 days ago1738087168IN
    0xa8EaA868...6C479760d
    0 S0.0516545155
    Deploy56790852025-01-28 13:17:0643 days ago1738070226IN
    0xa8EaA868...6C479760d
    0 S0.0516538555

    Parent Transaction Hash Block Age From To Amount
    View All Internal Transactions
    Loading...
    Loading

    Contract Source Code Verified (Exact Match)

    Contract Name:
    VicunaSwapxIchiDeployer

    Compiler Version
    v0.8.23+commit.f704f362

    Optimization Enabled:
    Yes with 200 runs

    Other Settings:
    paris EvmVersion
    File 1 of 40 : VicunaSwapxIchiDeployer.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.0;
    import "./infra/StrategyFactory.sol";
    import "./interfaces/beefy/IStrategyV7.sol";
    import "./strategies/Ichi/StrategyIchi.sol";
    import "./vaults/BeefyVaultV7Factory.sol";
    import "@openzeppelin-5/contracts/token/ERC20/ERC20.sol";
    contract VicunaSwapxIchiDeployer {
    string public constant STRATEGY_NAME = "vifi-ichi-swapx-2";
    address public constant STRATEGIST = address(0x2A86Ebd12573f4633453899156DA81345AC1d57D);
    address public constant FACTORY = address(0x9Df377a9c4FadFb1f7Bde79B92E31033D06a05A4);
    address public constant SWAPPER = address(0x46112C2618B57a4e03492E727957123E5097dF25);
    address public constant SWAPX_TOKEN = address(0xA04BC7140c26fc9BB1F36B1A604C7A5a88fb0E70);
    BeefyVaultV7Factory public vaultFactory = BeefyVaultV7Factory(address(0xffC494f0ED0C4d1ba5B830bcc8CbdC969b36A3Fc));
    StrategyFactory public strategyFactory = StrategyFactory(address(0x9Df377a9c4FadFb1f7Bde79B92E31033D06a05A4));
    event Deployed(string name, string symbol, address vault, address strategy);
    function deploy(
    string calldata name,
    string calldata symbol,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 2 of 40 : Ownable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // 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);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 3 of 40 : draft-IERC6093.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
    pragma solidity ^0.8.20;
    /**
    * @dev Standard ERC20 Errors
    * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
    */
    interface IERC20Errors {
    /**
    * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
    * @param sender Address whose tokens are being transferred.
    * @param balance Current balance for the interacting account.
    * @param needed Minimum amount required to perform a transfer.
    */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
    /**
    * @dev Indicates a failure with the token `sender`. Used in transfers.
    * @param sender Address whose tokens are being transferred.
    */
    error ERC20InvalidSender(address sender);
    /**
    * @dev Indicates a failure with the token `receiver`. Used in transfers.
    * @param receiver Address to which tokens are being transferred.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 4 of 40 : BeaconProxy.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/BeaconProxy.sol)
    pragma solidity ^0.8.20;
    import {IBeacon} from "./IBeacon.sol";
    import {Proxy} from "../Proxy.sol";
    import {ERC1967Utils} from "../ERC1967/ERC1967Utils.sol";
    /**
    * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.
    *
    * The beacon address can only be set once during construction, and cannot be changed afterwards. It is stored in an
    * immutable variable to avoid unnecessary storage reads, and also in the beacon storage slot specified by
    * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] so that it can be accessed externally.
    *
    * CAUTION: Since the beacon address can never be changed, you must ensure that you either control the beacon, or trust
    * the beacon to not upgrade the implementation maliciously.
    *
    * IMPORTANT: Do not use the implementation logic to modify the beacon storage slot. Doing so would leave the proxy in
    * an inconsistent state where the beacon storage slot does not match the beacon address.
    */
    contract BeaconProxy is Proxy {
    // An immutable address for the beacon to avoid unnecessary SLOADs before each delegate call.
    address private immutable _beacon;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 5 of 40 : IBeacon.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    // 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);
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 6 of 40 : UpgradeableBeacon.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/UpgradeableBeacon.sol)
    pragma solidity ^0.8.20;
    import {IBeacon} from "./IBeacon.sol";
    import {Ownable} from "../../access/Ownable.sol";
    /**
    * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their
    * implementation contract, which is where they will delegate all function calls.
    *
    * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.
    */
    contract UpgradeableBeacon is IBeacon, Ownable {
    address private _implementation;
    /**
    * @dev The `implementation` of the beacon is invalid.
    */
    error BeaconInvalidImplementation(address implementation);
    /**
    * @dev Emitted when the implementation returned by the beacon is changed.
    */
    event Upgraded(address indexed implementation);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 7 of 40 : ERC1967Utils.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Utils.sol)
    pragma solidity ^0.8.20;
    import {IBeacon} from "../beacon/IBeacon.sol";
    import {Address} from "../../utils/Address.sol";
    import {StorageSlot} from "../../utils/StorageSlot.sol";
    /**
    * @dev This abstract contract provides getters and event emitting update functions for
    * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
    */
    library ERC1967Utils {
    // We re-declare ERC-1967 events here because they can't be used directly from IERC1967.
    // This will be fixed in Solidity 0.8.21. At that point we should remove these events.
    /**
    * @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);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 8 of 40 : Proxy.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // 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.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 9 of 40 : ERC20.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)
    pragma solidity ^0.8.20;
    import {IERC20} from "./IERC20.sol";
    import {IERC20Metadata} from "./extensions/IERC20Metadata.sol";
    import {Context} from "../../utils/Context.sol";
    import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol";
    /**
    * @dev Implementation of the {IERC20} interface.
    *
    * This implementation is agnostic to the way tokens are created. This means
    * that a supply mechanism has to be added in a derived contract using {_mint}.
    *
    * TIP: For a detailed writeup see our guide
    * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
    * to implement supply mechanisms].
    *
    * The default value of {decimals} is 18. To change this, you should override
    * this function so it returns a different value.
    *
    * We have followed general OpenZeppelin Contracts guidelines: functions revert
    * instead returning `false` on failure. This behavior is nonetheless
    * conventional and does not conflict with the expectations of ERC20
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 10 of 40 : IERC20Metadata.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)
    pragma solidity ^0.8.20;
    import {IERC20} from "../IERC20.sol";
    /**
    * @dev Interface for the optional metadata functions from the ERC20 standard.
    */
    interface IERC20Metadata is IERC20 {
    /**
    * @dev Returns the name of the token.
    */
    function name() external view returns (string memory);
    /**
    * @dev Returns the symbol of the token.
    */
    function symbol() external view returns (string memory);
    /**
    * @dev Returns the decimals places of the token.
    */
    function decimals() external view returns (uint8);
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 11 of 40 : IERC20Permit.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)
    pragma solidity ^0.8.20;
    /**
    * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
    * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
    *
    * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
    * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
    * need to send a transaction, and thus is not required to hold Ether at all.
    *
    * ==== Security Considerations
    *
    * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
    * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
    * considered as an intention to spend the allowance in any specific way. The second is that because permits have
    * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
    * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
    * generally recommended is:
    *
    * ```solidity
    * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
    * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
    * doThing(..., value);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 12 of 40 : IERC20.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
    pragma solidity ^0.8.20;
    /**
    * @dev Interface of the ERC20 standard as defined in the EIP.
    */
    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.
    */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 13 of 40 : SafeERC20.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)
    pragma solidity ^0.8.20;
    import {IERC20} from "../IERC20.sol";
    import {IERC20Permit} from "../extensions/IERC20Permit.sol";
    import {Address} from "../../../utils/Address.sol";
    /**
    * @title SafeERC20
    * @dev Wrappers around ERC20 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 {
    using Address for address;
    /**
    * @dev An operation with an ERC20 token failed.
    */
    error SafeERC20FailedOperation(address token);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 14 of 40 : Address.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
    pragma solidity ^0.8.20;
    /**
    * @dev Collection of functions related to the address type
    */
    library Address {
    /**
    * @dev The ETH balance of the account is not enough to perform the operation.
    */
    error AddressInsufficientBalance(address account);
    /**
    * @dev There's no code at `target` (it is not a contract).
    */
    error AddressEmptyCode(address target);
    /**
    * @dev A call to an address target failed. The target may have reverted.
    */
    error FailedInnerCall();
    /**
    * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 15 of 40 : Context.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // 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;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 16 of 40 : StorageSlot.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v5.0.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 ERC1967 implementation slot:
    * ```solidity
    * contract ERC1967 {
    * 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;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 17 of 40 : OwnableUpgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
    pragma solidity ^0.8.0;
    import "../utils/ContextUpgradeable.sol";
    import {Initializable} from "../proxy/utils/Initializable.sol";
    /**
    * @dev Contract module which provides a basic access control mechanism, where
    * there is an account (an owner) that can be granted exclusive access to
    * specific functions.
    *
    * By default, the owner account will be the one that deploys the contract. This
    * can later be changed with {transferOwnership}.
    *
    * This module is used through inheritance. It will make available the modifier
    * `onlyOwner`, which can be applied to your functions to restrict their use to
    * the owner.
    */
    abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    /**
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 18 of 40 : ClonesUpgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.9.0) (proxy/Clones.sol)
    pragma solidity ^0.8.0;
    /**
    * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for
    * deploying minimal proxy contracts, also known as "clones".
    *
    * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies
    * > a minimal bytecode implementation that delegates all calls to a known, fixed address.
    *
    * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
    * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
    * deterministic method.
    *
    * _Available since v3.4._
    */
    library ClonesUpgradeable {
    /**
    * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
    *
    * This function uses the create opcode, which should never revert.
    */
    function clone(address implementation) internal returns (address instance) {
    /// @solidity memory-safe-assembly
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 19 of 40 : Initializable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
    pragma solidity ^0.8.2;
    import "../../utils/AddressUpgradeable.sol";
    /**
    * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
    * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
    * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
    * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
    *
    * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
    * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
    * case an upgrade adds a module that needs to be initialized.
    *
    * For example:
    *
    * [.hljs-theme-light.nopadding]
    * ```solidity
    * contract MyToken is ERC20Upgradeable {
    * function initialize() initializer public {
    * __ERC20_init("MyToken", "MTK");
    * }
    * }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 20 of 40 : PausableUpgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
    pragma solidity ^0.8.0;
    import "../utils/ContextUpgradeable.sol";
    import {Initializable} from "../proxy/utils/Initializable.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 PausableUpgradeable is Initializable, ContextUpgradeable {
    /**
    * @dev Emitted when the pause is triggered by `account`.
    */
    event Paused(address account);
    /**
    * @dev Emitted when the pause is lifted by `account`.
    */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 21 of 40 : ReentrancyGuardUpgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
    pragma solidity ^0.8.0;
    import {Initializable} from "../proxy/utils/Initializable.sol";
    /**
    * @dev Contract module that helps prevent reentrant calls to a function.
    *
    * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
    * available, which can be applied to functions to make sure there are no nested
    * (reentrant) calls to them.
    *
    * Note that because there is a single `nonReentrant` guard, functions marked as
    * `nonReentrant` may not call one another. This can be worked around by making
    * those functions `private`, and then adding `external` `nonReentrant` entry
    * points to them.
    *
    * TIP: If you would like to learn more about reentrancy and alternative ways
    * to protect against it, check out our blog post
    * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
    */
    abstract contract ReentrancyGuardUpgradeable is Initializable {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 22 of 40 : ERC20Upgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)
    pragma solidity ^0.8.0;
    import "./IERC20Upgradeable.sol";
    import "./extensions/IERC20MetadataUpgradeable.sol";
    import "../../utils/ContextUpgradeable.sol";
    import {Initializable} from "../../proxy/utils/Initializable.sol";
    /**
    * @dev Implementation of the {IERC20} interface.
    *
    * This implementation is agnostic to the way tokens are created. This means
    * that a supply mechanism has to be added in a derived contract using {_mint}.
    * For a generic mechanism see {ERC20PresetMinterPauser}.
    *
    * TIP: For a detailed writeup see our guide
    * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
    * to implement supply mechanisms].
    *
    * The default value of {decimals} is 18. To change this, you should override
    * this function so it returns a different value.
    *
    * We have followed general OpenZeppelin Contracts guidelines: functions revert
    * instead returning `false` on failure. This behavior is nonetheless
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 23 of 40 : IERC20MetadataUpgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
    pragma solidity ^0.8.0;
    import "../IERC20Upgradeable.sol";
    /**
    * @dev Interface for the optional metadata functions from the ERC20 standard.
    *
    * _Available since v4.1._
    */
    interface IERC20MetadataUpgradeable is IERC20Upgradeable {
    /**
    * @dev Returns the name of the token.
    */
    function name() external view returns (string memory);
    /**
    * @dev Returns the symbol of the token.
    */
    function symbol() external view returns (string memory);
    /**
    * @dev Returns the decimals places of the token.
    */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 24 of 40 : IERC20PermitUpgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)
    pragma solidity ^0.8.0;
    /**
    * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
    * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
    *
    * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
    * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
    * need to send a transaction, and thus is not required to hold Ether at all.
    *
    * ==== Security Considerations
    *
    * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
    * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
    * considered as an intention to spend the allowance in any specific way. The second is that because permits have
    * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
    * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
    * generally recommended is:
    *
    * ```solidity
    * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
    * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
    * doThing(..., value);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 25 of 40 : IERC20Upgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
    pragma solidity ^0.8.0;
    /**
    * @dev Interface of the ERC20 standard as defined in the EIP.
    */
    interface IERC20Upgradeable {
    /**
    * @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 amount of tokens in existence.
    */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 26 of 40 : SafeERC20Upgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)
    pragma solidity ^0.8.0;
    import "../IERC20Upgradeable.sol";
    import "../extensions/IERC20PermitUpgradeable.sol";
    import "../../../utils/AddressUpgradeable.sol";
    /**
    * @title SafeERC20
    * @dev Wrappers around ERC20 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 SafeERC20Upgradeable {
    using AddressUpgradeable for address;
    /**
    * @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(IERC20Upgradeable token, address to, uint256 value) internal {
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 27 of 40 : AddressUpgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
    pragma solidity ^0.8.1;
    /**
    * @dev Collection of functions related to the address type
    */
    library AddressUpgradeable {
    /**
    * @dev Returns true if `account` is a contract.
    *
    * [IMPORTANT]
    * ====
    * It is unsafe to assume that an address for which this function returns
    * false is an externally-owned account (EOA) and not a contract.
    *
    * Among others, `isContract` will return false for the following
    * types of addresses:
    *
    * - an externally-owned account
    * - a contract in construction
    * - an address where a contract will be created
    * - an address where a contract lived, but was destroyed
    *
    * Furthermore, `isContract` will also return true if the target contract within
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 28 of 40 : ContextUpgradeable.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    // OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
    pragma solidity ^0.8.0;
    import {Initializable} from "../proxy/utils/Initializable.sol";
    /**
    * @dev Provides information about the current execution context, including the
    * sender of the transaction and its data. While these are generally available
    * via msg.sender and msg.data, they should not be accessed in such a direct
    * manner, since when dealing with meta-transactions the account sending and
    * paying for execution may not be the actual sender (as far as an application
    * is concerned).
    *
    * This contract is only required for intermediate, library-like contracts.
    */
    abstract contract ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }
    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
    return msg.sender;
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 29 of 40 : StrategyFactory.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.20;
    import "@openzeppelin-5/contracts/proxy/beacon/BeaconProxy.sol";
    import "@openzeppelin-5/contracts/proxy/beacon/UpgradeableBeacon.sol";
    import "@openzeppelin-5/contracts/access/Ownable.sol";
    // Minimal proxy pattern for creating new Beefy strategies
    contract StrategyFactory is Ownable {
    /// @notice instance mapping to strategy name with version.
    mapping (string => UpgradeableBeacon) public instances;
    /// @notice approved rebalancer mapping
    mapping (address => bool) public rebalancers;
    /// @notice Pause state by strategyName
    mapping (string => bool) public strategyPause;
    /// @notice deployed strategy types
    string[] public strategyTypes;
    /// @notice The address of the native token
    address public native;
    /// @notice The address of the keeper
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 30 of 40 : IBeefySwapper.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.0;
    interface IBeefySwapper {
    function swap(
    address fromToken,
    address toToken,
    uint256 amountIn
    ) external returns (uint256 amountOut);
    function swap(
    address fromToken,
    address toToken,
    uint256 amountIn,
    uint256 minAmountOut
    ) external returns (uint256 amountOut);
    function getAmountOut(
    address _fromToken,
    address _toToken,
    uint256 _amountIn
    ) external view returns (uint256 amountOut);
    function swapInfo(
    address _fromToken,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 31 of 40 : IStrategyFactory.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.0;
    interface IStrategyFactory {
    function createStrategy(string calldata _strategyName) external returns (address);
    function native() external view returns (address);
    function keeper() external view returns (address);
    function rebalancers(address) external view returns (bool);
    function beefyFeeRecipient() external view returns (address);
    function beefyFeeConfig() external view returns (address);
    function globalPause() external view returns (bool);
    function strategyPause(string calldata stratName) external view returns (bool);
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 32 of 40 : IStrategyV7.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.0;
    import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
    interface IStrategyV7 {
    function vault() external view returns (address);
    function want() external view returns (IERC20Upgradeable);
    function beforeDeposit() external;
    function deposit() external;
    function withdraw(uint256) external;
    function balanceOf() external view returns (uint256);
    function balanceOfWant() external view returns (uint256);
    function balanceOfPool() external view returns (uint256);
    function harvest() external;
    function retireStrat() external;
    function panic() external;
    function pause() external;
    function unpause() external;
    function paused() external view returns (bool);
    function unirouter() external view returns (address);
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 33 of 40 : IFeeConfig.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.0;
    interface IFeeConfig {
    struct FeeCategory {
    uint256 total;
    uint256 beefy;
    uint256 call;
    uint256 strategist;
    string label;
    bool active;
    }
    struct AllFees {
    FeeCategory performance;
    uint256 deposit;
    uint256 withdraw;
    }
    function getFees(address strategy) external view returns (FeeCategory memory);
    function stratFeeId(address strategy) external view returns (uint256);
    function setStratFeeId(uint256 feeId) external;
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 34 of 40 : IRewardPool.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    // SPDX-License-Identifier: MIT
    pragma solidity >=0.6.0 <0.9.0;
    interface IRewardPool {
    function deposit(uint256 amount) external;
    function stake(uint256 amount) external;
    function withdraw(uint256 amount) external;
    function earned(address account) external view returns (uint256);
    function getReward() external;
    function getReward(address account) external;
    function getRewards() external;
    function collectReward() external;
    function balanceOf(address account) external view returns (uint256);
    function stakingToken() external view returns (address);
    function rewardsToken() external view returns (address);
    function emergency() external view returns (bool);
    function emergencyWithdraw() external;
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 35 of 40 : IWrappedNative.sol
    1
    2
    3
    4
    5
    6
    7
    8
    // SPDX-License-Identifier: MIT
    pragma solidity >=0.6.0 <0.9.0;
    interface IWrappedNative {
    function deposit() external payable;
    function withdraw(uint256 wad) external;
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 36 of 40 : BaseAllToNativeFactoryStrat.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.20;
    import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
    import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
    import "@openzeppelin-5/contracts/token/ERC20/utils/SafeERC20.sol";
    import "../../interfaces/beefy/IBeefySwapper.sol";
    import "../../interfaces/beefy/IStrategyFactory.sol";
    import "../../interfaces/common/IFeeConfig.sol";
    import "../../interfaces/common/IWrappedNative.sol";
    abstract contract BaseAllToNativeFactoryStrat is OwnableUpgradeable, PausableUpgradeable {
    using SafeERC20 for IERC20;
    struct Addresses {
    address want;
    address depositToken;
    address factory;
    address vault;
    address swapper;
    address strategist;
    }
    address[] public rewards;
    mapping(address => uint) public minAmounts; // tokens minimum amount to be swapped
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 37 of 40 : IchiVault.sol
    1
    2
    3
    4
    5
    6
    7
    8
    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.0;
    interface IchiVault {
    function token0() external view returns (address);
    function token1() external view returns (address);
    function deposit(uint deposit0, uint deposit1, address to) external returns (uint shares);
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 38 of 40 : StrategyIchi.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.0;
    import "../Common/BaseAllToNativeFactoryStrat.sol";
    import "../../interfaces/common/IRewardPool.sol";
    import "./IchiVault.sol";
    contract StrategyIchi is BaseAllToNativeFactoryStrat {
    using SafeERC20 for IERC20;
    IRewardPool public gauge;
    address public lpToken0;
    address public lpToken1;
    function initialize(
    address _gauge,
    bool _harvestOnDeposit,
    address[] calldata _rewards,
    Addresses calldata _addresses
    ) public initializer {
    __BaseStrategy_init(_addresses, _rewards);
    gauge = IRewardPool(_gauge);
    if (_harvestOnDeposit) setHarvestOnDeposit(true);
    lpToken0 = IchiVault(want).token0();
    lpToken1 = IchiVault(want).token1();
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 39 of 40 : BeefyVaultV7.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.0;
    import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
    import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
    import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
    import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
    import "../interfaces/beefy/IStrategyV7.sol";
    /**
    * @dev Implementation of a vault to deposit funds for yield optimizing.
    * This is the contract that receives funds and that users interface with.
    * The yield optimizing strategy itself is implemented in a separate 'Strategy.sol' contract.
    */
    contract BeefyVaultV7 is ERC20Upgradeable, OwnableUpgradeable, ReentrancyGuardUpgradeable {
    using SafeERC20Upgradeable for IERC20Upgradeable;
    struct StratCandidate {
    address implementation;
    uint proposedTime;
    }
    // The last proposed strategy to switch to.
    StratCandidate public stratCandidate;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    File 40 of 40 : BeefyVaultV7Factory.sol
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.0;
    import "./BeefyVaultV7.sol";
    import "@openzeppelin/contracts-upgradeable/proxy/ClonesUpgradeable.sol";
    // Beefy Finance Vault V7 Proxy Factory
    // Minimal proxy pattern for creating new Beefy vaults
    contract BeefyVaultV7Factory {
    using ClonesUpgradeable for address;
    // Contract template for deploying proxied Beefy vaults
    BeefyVaultV7 public instance;
    event ProxyCreated(address proxy);
    // Initializes the Factory with an instance of the Beefy Vault V7
    constructor(address _instance) {
    if (_instance == address(0)) {
    instance = new BeefyVaultV7();
    } else {
    instance = BeefyVaultV7(_instance);
    }
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Settings
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    {
    "optimizer": {
    "enabled": true,
    "runs": 200
    },
    "evmVersion": "paris",
    "outputSelection": {
    "*": {
    "*": [
    "evm.bytecode",
    "evm.deployedBytecode",
    "devdoc",
    "userdoc",
    "metadata",
    "abi"
    ]
    }
    },
    "libraries": {}
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Contract Security Audit

    Contract ABI

    API
    [{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"address","name":"strategy","type":"address"}],"name":"Deployed","type":"event"},{"inputs":[],"name":"FACTORY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STRATEGIST","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STRATEGY_NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SWAPPER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SWAPX_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"want","type":"address"},{"internalType":"address","name":"deposit","type":"address"},{"internalType":"address","name":"gauge","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deploy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"strategyFactory","outputs":[{"internalType":"contract StrategyFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultFactory","outputs":[{"internalType":"contract BeefyVaultV7Factory","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

    6080604052600080546001600160a01b031990811673ffc494f0ed0c4d1ba5b830bcc8cbdc969b36a3fc1790915560018054909116739df377a9c4fadfb1f7bde79b92e31033d06a05a417905534801561005857600080fd5b50610a4a806100686000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80639ef357101161005b5780639ef3571014610138578063ac12e15a1461014b578063d8a06f7314610160578063dfbffa8c1461017357600080fd5b80632dd310001461008d5780636edd5446146100c5578063700d85ae146101025780639cfdede31461011d575b600080fd5b6100a8739df377a9c4fadfb1f7bde79b92e31033d06a05a481565b6040516001600160a01b0390911681526020015b60405180910390f35b6100f5604051806040016040528060118152602001703b34b33496b4b1b43496b9bbb0b83c169960791b81525081565b6040516100bc91906106ca565b6100a87346112c2618b57a4e03492e727957123e5097df2581565b6100a8732a86ebd12573f4633453899156da81345ac1d57d81565b6001546100a8906001600160a01b031681565b61015e61015936600461077a565b61018e565b005b6000546100a8906001600160a01b031681565b6100a873a04bc7140c26fc9bb1f36b1a604c7a5a88fb0e7081565b60008060009054906101000a90046001600160a01b03166001600160a01b0316631c7c80316040518163ffffffff1660e01b81526004016020604051808303816000875af11580156101e4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610208919061082c565b60015460408051808201825260118152703b34b33496b4b1b43496b9bbb0b83c169960791b6020820152905163116fd50160e01b81529293506000926001600160a01b039092169163116fd50191610262916004016106ca565b6020604051808303816000875af1158015610281573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a5919061082c565b6040805160c0810182526001600160a01b0389811682528881166020830152739df377a9c4fadfb1f7bde79b92e31033d06a05a482840152851660608201527346112c2618b57a4e03492e727957123e5097df256080820152732a86ebd12573f4633453899156da81345ac1d57d60a0820152815160018082528184019093529293509160009181602001602082028036833701905050905073a04bc7140c26fc9bb1f36b1a604c7a5a88fb0e708160008151811061036657610366610850565b60200260200101906001600160a01b031690816001600160a01b031681525050836001600160a01b0316634d12d4b6848e8e8e8e60006040518763ffffffff1660e01b81526004016103bd9695949392919061088f565b600060405180830381600087803b1580156103d757600080fd5b505af11580156103eb573d6000803e3d6000fd5b505060405163d97d1c3b60e01b81526001600160a01b038616925063d97d1c3b9150610422908990600090869088906004016108db565b600060405180830381600087803b15801561043c57600080fd5b505af1158015610450573d6000803e3d6000fd5b50506040516323b872dd60e01b8152336004820152306024820152604481018890526001600160a01b038b1692506323b872dd91506064016020604051808303816000875af11580156104a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cb919061098b565b5060405163095ea7b360e01b81526001600160a01b0385811660048301526024820187905289169063095ea7b3906044016020604051808303816000875af115801561051b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053f919061098b565b5060405163b6b55f2560e01b8152600481018690526001600160a01b0385169063b6b55f2590602401600060405180830381600087803b15801561058257600080fd5b505af1158015610596573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820152600092506001600160a01b03871691506370a0823190602401602060405180830381865afa1580156105e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060591906109ad565b60405163a9059cbb60e01b8152336004820152602481018290529091506001600160a01b0386169063a9059cbb906044016020604051808303816000875af1158015610655573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610679919061098b565b507fa976293196c06b4e8497c10bb48e776035a3510460c0f8542310b92f324c19b98d8d8d8d89896040516106b3969594939291906109c6565b60405180910390a150505050505050505050505050565b60006020808352835180602085015260005b818110156106f8578581018301518582016040015282016106dc565b506000604082860101526040601f19601f8301168501019250505092915050565b60008083601f84011261072b57600080fd5b50813567ffffffffffffffff81111561074357600080fd5b60208301915083602082850101111561075b57600080fd5b9250929050565b6001600160a01b038116811461077757600080fd5b50565b60008060008060008060008060c0898b03121561079657600080fd5b883567ffffffffffffffff808211156107ae57600080fd5b6107ba8c838d01610719565b909a50985060208b01359150808211156107d357600080fd5b506107e08b828c01610719565b90975095505060408901356107f481610762565b9350606089013561080481610762565b9250608089013561081481610762565b8092505060a089013590509295985092959890939650565b60006020828403121561083e57600080fd5b815161084981610762565b9392505050565b634e487b7160e01b600052603260045260246000fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03871681526080602082018190526000906108b49083018789610866565b82810360408401526108c7818688610866565b915050826060830152979650505050505050565b6001600160a01b03858116825284151560208084019190915261012060408401819052855190840181905260009261014085019287810192855b81811015610933578451841686529482019493820193600101610915565b5050508293508086511660608601528060208701511660808601528060408701511660a08601528060608701511660c08601528060808701511660e08601528060a08701511661010086015250505095945050505050565b60006020828403121561099d57600080fd5b8151801515811461084957600080fd5b6000602082840312156109bf57600080fd5b5051919050565b6080815260006109da60808301888a610866565b82810360208401526109ed818789610866565b6001600160a01b03958616604085015293909416606090920191909152509594505050505056fea26469706673582212202628df0a632e27cdb1fa4b3bc0282b52470d54abd2ec335f719c3fa08da06eab64736f6c63430008170033

    Deployed Bytecode

    0x608060405234801561001057600080fd5b50600436106100885760003560e01c80639ef357101161005b5780639ef3571014610138578063ac12e15a1461014b578063d8a06f7314610160578063dfbffa8c1461017357600080fd5b80632dd310001461008d5780636edd5446146100c5578063700d85ae146101025780639cfdede31461011d575b600080fd5b6100a8739df377a9c4fadfb1f7bde79b92e31033d06a05a481565b6040516001600160a01b0390911681526020015b60405180910390f35b6100f5604051806040016040528060118152602001703b34b33496b4b1b43496b9bbb0b83c169960791b81525081565b6040516100bc91906106ca565b6100a87346112c2618b57a4e03492e727957123e5097df2581565b6100a8732a86ebd12573f4633453899156da81345ac1d57d81565b6001546100a8906001600160a01b031681565b61015e61015936600461077a565b61018e565b005b6000546100a8906001600160a01b031681565b6100a873a04bc7140c26fc9bb1f36b1a604c7a5a88fb0e7081565b60008060009054906101000a90046001600160a01b03166001600160a01b0316631c7c80316040518163ffffffff1660e01b81526004016020604051808303816000875af11580156101e4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610208919061082c565b60015460408051808201825260118152703b34b33496b4b1b43496b9bbb0b83c169960791b6020820152905163116fd50160e01b81529293506000926001600160a01b039092169163116fd50191610262916004016106ca565b6020604051808303816000875af1158015610281573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a5919061082c565b6040805160c0810182526001600160a01b0389811682528881166020830152739df377a9c4fadfb1f7bde79b92e31033d06a05a482840152851660608201527346112c2618b57a4e03492e727957123e5097df256080820152732a86ebd12573f4633453899156da81345ac1d57d60a0820152815160018082528184019093529293509160009181602001602082028036833701905050905073a04bc7140c26fc9bb1f36b1a604c7a5a88fb0e708160008151811061036657610366610850565b60200260200101906001600160a01b031690816001600160a01b031681525050836001600160a01b0316634d12d4b6848e8e8e8e60006040518763ffffffff1660e01b81526004016103bd9695949392919061088f565b600060405180830381600087803b1580156103d757600080fd5b505af11580156103eb573d6000803e3d6000fd5b505060405163d97d1c3b60e01b81526001600160a01b038616925063d97d1c3b9150610422908990600090869088906004016108db565b600060405180830381600087803b15801561043c57600080fd5b505af1158015610450573d6000803e3d6000fd5b50506040516323b872dd60e01b8152336004820152306024820152604481018890526001600160a01b038b1692506323b872dd91506064016020604051808303816000875af11580156104a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cb919061098b565b5060405163095ea7b360e01b81526001600160a01b0385811660048301526024820187905289169063095ea7b3906044016020604051808303816000875af115801561051b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053f919061098b565b5060405163b6b55f2560e01b8152600481018690526001600160a01b0385169063b6b55f2590602401600060405180830381600087803b15801561058257600080fd5b505af1158015610596573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820152600092506001600160a01b03871691506370a0823190602401602060405180830381865afa1580156105e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060591906109ad565b60405163a9059cbb60e01b8152336004820152602481018290529091506001600160a01b0386169063a9059cbb906044016020604051808303816000875af1158015610655573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610679919061098b565b507fa976293196c06b4e8497c10bb48e776035a3510460c0f8542310b92f324c19b98d8d8d8d89896040516106b3969594939291906109c6565b60405180910390a150505050505050505050505050565b60006020808352835180602085015260005b818110156106f8578581018301518582016040015282016106dc565b506000604082860101526040601f19601f8301168501019250505092915050565b60008083601f84011261072b57600080fd5b50813567ffffffffffffffff81111561074357600080fd5b60208301915083602082850101111561075b57600080fd5b9250929050565b6001600160a01b038116811461077757600080fd5b50565b60008060008060008060008060c0898b03121561079657600080fd5b883567ffffffffffffffff808211156107ae57600080fd5b6107ba8c838d01610719565b909a50985060208b01359150808211156107d357600080fd5b506107e08b828c01610719565b90975095505060408901356107f481610762565b9350606089013561080481610762565b9250608089013561081481610762565b8092505060a089013590509295985092959890939650565b60006020828403121561083e57600080fd5b815161084981610762565b9392505050565b634e487b7160e01b600052603260045260246000fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03871681526080602082018190526000906108b49083018789610866565b82810360408401526108c7818688610866565b915050826060830152979650505050505050565b6001600160a01b03858116825284151560208084019190915261012060408401819052855190840181905260009261014085019287810192855b81811015610933578451841686529482019493820193600101610915565b5050508293508086511660608601528060208701511660808601528060408701511660a08601528060608701511660c08601528060808701511660e08601528060a08701511661010086015250505095945050505050565b60006020828403121561099d57600080fd5b8151801515811461084957600080fd5b6000602082840312156109bf57600080fd5b5051919050565b6080815260006109da60808301888a610866565b82810360208401526109ed818789610866565b6001600160a01b03958616604085015293909416606090920191909152509594505050505056fea26469706673582212202628df0a632e27cdb1fa4b3bc0282b52470d54abd2ec335f719c3fa08da06eab64736f6c63430008170033

    Block Age Transaction Gas Used Reward
    view all blocks ##produced##

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

    Validator Index Block Age Amount
    View All Withdrawals

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