ETH Price: $1,898.53 (+0.59%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Creation Cod...217378012025-01-30 13:58:4741 days ago1738245527IN
0xaffA38aE...6542BAcc7
0 ETH0.033618755.48699529

Latest 22 internal transactions

Advanced mode:
Parent Transaction Hash Method Block
From
To
0x61010060219880652025-03-06 13:11:597 days ago1741266719
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060219852452025-03-06 3:44:477 days ago1741232687
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060219067012025-02-23 4:40:4718 days ago1740285647
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060219022852025-02-22 13:52:1118 days ago1740232331
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060218620092025-02-16 22:42:4724 days ago1739745767
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060218596702025-02-16 14:51:2324 days ago1739717483
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060218523572025-02-15 14:15:3525 days ago1739628935
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060218332302025-02-12 21:56:2328 days ago1739397383
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060218329302025-02-12 20:56:2328 days ago1739393783
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060218281882025-02-12 4:56:5929 days ago1739336219
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060218231042025-02-11 11:52:3530 days ago1739274755
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060218193772025-02-10 23:23:2330 days ago1739229803
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060218192442025-02-10 22:56:2330 days ago1739228183
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060218097332025-02-09 15:03:5931 days ago1739113439
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060218026302025-02-08 15:15:5932 days ago1739027759
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060218025192025-02-08 14:53:4732 days ago1739026427
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060218008292025-02-08 9:14:1133 days ago1739006051
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060218005252025-02-08 8:12:5933 days ago1739002379
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060217957972025-02-07 16:22:3533 days ago1738945355
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x61010060217774462025-02-05 2:55:1136 days ago1738724111
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x600b5981217378012025-01-30 13:58:4741 days ago1738245527
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
0x600b5981217378012025-01-30 13:58:4741 days ago1738245527
0xaffA38aE...6542BAcc7
 Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FraxlendPairDeployer

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 17 : FraxlendPairDeployer.sol
// SPDX-License-Identifier: ISC
pragma solidity ^0.8.19;

// ====================================================================
// |     ______                   _______                             |
// |    / _____________ __  __   / ____(_____  ____ _____  ________   |
// |   / /_  / ___/ __ `| |/_/  / /_  / / __ \/ __ `/ __ \/ ___/ _ \  |
// |  / __/ / /  / /_/ _>  <   / __/ / / / / / /_/ / / / / /__/  __/  |
// | /_/   /_/   \__,_/_/|_|  /_/   /_/_/ /_/\__,_/_/ /_/\___/\___/   |
// |                                                                  |
// ====================================================================
// ====================== FraxlendPairDeployer ========================
// ====================================================================
// Frax Finance: https://github.com/FraxFinance

// Primary Author
// Drake Evans: https://github.com/DrakeEvans

// Reviewers
// Dennis: https://github.com/denett
// Sam Kazemian: https://github.com/samkazemian
// Travis Moore: https://github.com/FortisFortuna
// Jack Corddry: https://github.com/corddry
// Rich Gee: https://github.com/zer0blockchain

// ====================================================================

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {SSTORE2} from "@rari-capital/solmate/src/utils/SSTORE2.sol";
import {BytesLib} from "solidity-bytes-utils/contracts/BytesLib.sol";
import {IFraxlendWhitelist} from "./interfaces/IFraxlendWhitelist.sol";
import {IFraxlendPair} from "./interfaces/IFraxlendPair.sol";
import {IFraxlendPairRegistry} from "./interfaces/IFraxlendPairRegistry.sol";
import {SafeERC20} from "./libraries/SafeERC20.sol";

// solhint-disable no-inline-assembly

struct ConstructorParams {
    address circuitBreaker;
    address comptroller;
    address timelock;
    address fraxlendWhitelist;
    address fraxlendPairRegistry;
}

/// @title FraxlendPairDeployer
/// @author Drake Evans (Frax Finance) https://github.com/drakeevans
/// @notice Deploys and initializes new FraxlendPairs
/// @dev Uses create2 to deploy the pairs, logs an event, and records a list of all deployed pairs
contract FraxlendPairDeployer is Ownable {
    using Strings for uint256;
    using SafeERC20 for IERC20;

    // Storage
    address public contractAddress1;
    address public contractAddress2;

    // Admin contracts
    address public circuitBreakerAddress;
    address public comptrollerAddress;
    address public timelockAddress;
    address public fraxlendPairRegistryAddress;
    address public fraxlendWhitelistAddress;

    // Default swappers
    address[] public defaultSwappers;

    // Default deposit amount for new pairs
    uint256 public defaultDepositAmt;

    /// @notice Emits when a new pair is deployed
    /// @notice The ```LogDeploy``` event is emitted when a new Pair is deployed
    /// @param address_ The address of the pair
    /// @param asset The address of the Asset Token contract
    /// @param collateral The address of the Collateral Token contract
    /// @param name The name of the Pair
    /// @param configData The config data of the Pair
    /// @param immutables The immutables of the Pair
    /// @param customConfigData The custom config data of the Pair
    event LogDeploy(
        address indexed address_,
        address indexed asset,
        address indexed collateral,
        string name,
        bytes configData,
        bytes immutables,
        bytes customConfigData
    );

    /// @notice List of the names of all deployed Pairs
    address[] public deployedPairsArray;

    constructor(ConstructorParams memory _params) Ownable() {
        circuitBreakerAddress = _params.circuitBreaker;
        comptrollerAddress = _params.comptroller;
        timelockAddress = _params.timelock;
        fraxlendWhitelistAddress = _params.fraxlendWhitelist;
        fraxlendPairRegistryAddress = _params.fraxlendPairRegistry;
    }

    function version() external pure returns (uint256 _major, uint256 _minor, uint256 _patch) {
        return (4, 1, 0);
    }

    // ============================================================================================
    // Functions: View Functions
    // ============================================================================================

    /// @notice The ```deployedPairsLength``` function returns the length of the deployedPairsArray
    /// @return length of array
    function deployedPairsLength() external view returns (uint256) {
        return deployedPairsArray.length;
    }

    /// @notice The ```getAllPairAddresses``` function returns all pair addresses in deployedPairsArray
    /// @return _deployedPairs memory All deployed pair addresses
    function getAllPairAddresses() external view returns (address[] memory _deployedPairs) {
        _deployedPairs = deployedPairsArray;
    }

    function getNextNameSymbol(address _asset) public view returns (string memory _name, string memory _symbol) {
        uint256 _length = IFraxlendPairRegistry(fraxlendPairRegistryAddress).deployedPairsLength();
        _name = string(
            abi.encodePacked("Peapods Interest Bearing ", IERC20(_asset).safeSymbol(), " - ", (_length + 1).toString())
        );
        _symbol = string(abi.encodePacked("pf", IERC20(_asset).safeSymbol(), "-", (_length + 1).toString()));
    }

    // ============================================================================================
    // Functions: Setters
    // ============================================================================================

    /// @notice The ```setCreationCode``` function sets the bytecode for the fraxlendPair
    /// @dev splits the data if necessary to accommodate creation code that is slightly larger than 24kb
    /// @param _creationCode The creationCode for the Fraxlend Pair
    function setCreationCode(bytes calldata _creationCode) external onlyOwner {
        bytes memory _firstHalf = BytesLib.slice(_creationCode, 0, 13_000);
        contractAddress1 = SSTORE2.write(_firstHalf);
        if (_creationCode.length > 13_000) {
            bytes memory _secondHalf = BytesLib.slice(_creationCode, 13_000, _creationCode.length - 13_000);
            contractAddress2 = SSTORE2.write(_secondHalf);
        }
    }

    /// @notice The ```setDefaultSwappers``` function is used to set default list of approved swappers
    /// @param _swappers The list of swappers to set as default allowed
    function setDefaultSwappers(address[] memory _swappers) external onlyOwner {
        defaultSwappers = _swappers;
    }

    function setDefaultDepositAmt(uint256 _amount) external onlyOwner {
        defaultDepositAmt = _amount;
    }

    /// @notice The ```SetTimelock``` event is emitted when the timelockAddress is set
    /// @param oldAddress The original address
    /// @param newAddress The new address
    event SetTimelock(address oldAddress, address newAddress);

    /// @notice The ```setTimelock``` function sets the timelockAddress
    /// @param _newAddress the new time lock address
    function setTimelock(address _newAddress) external onlyOwner {
        emit SetTimelock(timelockAddress, _newAddress);
        timelockAddress = _newAddress;
    }

    /// @notice The ```SetRegistry``` event is emitted when the fraxlendPairRegistryAddress is set
    /// @param oldAddress The old address
    /// @param newAddress The new address
    event SetRegistry(address oldAddress, address newAddress);

    /// @notice The ```setRegistry``` function sets the fraxlendPairRegistryAddress
    /// @param _newAddress The new address
    function setRegistry(address _newAddress) external onlyOwner {
        emit SetRegistry(fraxlendPairRegistryAddress, _newAddress);
        fraxlendPairRegistryAddress = _newAddress;
    }

    /// @notice The ```SetComptroller``` event is emitted when the comptrollerAddress is set
    /// @param oldAddress The old address
    /// @param newAddress The new address
    event SetComptroller(address oldAddress, address newAddress);

    /// @notice The ```setComptroller``` function sets the comptrollerAddress
    /// @param _newAddress The new address
    function setComptroller(address _newAddress) external onlyOwner {
        emit SetComptroller(comptrollerAddress, _newAddress);
        comptrollerAddress = _newAddress;
    }

    /// @notice The ```SetWhitelist``` event is emitted when the fraxlendWhitelistAddress is set
    /// @param oldAddress The old address
    /// @param newAddress The new address
    event SetWhitelist(address oldAddress, address newAddress);

    /// @notice The ```setWhitelist``` function sets the fraxlendWhitelistAddress
    /// @param _newAddress The new address
    function setWhitelist(address _newAddress) external onlyOwner {
        emit SetWhitelist(fraxlendWhitelistAddress, _newAddress);
        fraxlendWhitelistAddress = _newAddress;
    }

    /// @notice The ```SetCircuitBreaker``` event is emitted when the circuitBreakerAddress is set
    /// @param oldAddress The old address
    /// @param newAddress The new address
    event SetCircuitBreaker(address oldAddress, address newAddress);

    /// @notice The ```setCircuitBreaker``` function sets the circuitBreakerAddress
    /// @param _newAddress The new address
    function setCircuitBreaker(address _newAddress) external onlyOwner {
        emit SetCircuitBreaker(circuitBreakerAddress, _newAddress);
        circuitBreakerAddress = _newAddress;
    }

    // ============================================================================================
    // Functions: Internal Methods
    // ============================================================================================

    /// @notice The ```_deploy``` function is an internal function with deploys the pair
    /// @param _configData abi.encode(address _asset, address _collateral, address _oracle, uint32 _maxOracleDeviation, address _rateContract, uint64 _fullUtilizationRate, uint256 _maxLTV, uint256 _cleanLiquidationFee, uint256 _dirtyLiquidationFee, uint256 _protocolLiquidationFee)
    /// @param _immutables abi.encode(address _circuitBreakerAddress, address _comptrollerAddress, address _timelockAddress)
    /// @param _customConfigData abi.encode(string memory _nameOfContract, string memory _symbolOfContract, uint8 _decimalsOfContract)
    /// @return _pairAddress The address to which the Pair was deployed
    function _deploy(bytes memory _configData, bytes memory _immutables, bytes memory _customConfigData)
        private
        returns (address _pairAddress)
    {
        // Get creation code
        bytes memory _creationCode = BytesLib.concat(SSTORE2.read(contractAddress1), SSTORE2.read(contractAddress2));

        // Get bytecode
        bytes memory bytecode = abi.encodePacked(_creationCode, abi.encode(_configData, _immutables, _customConfigData));

        // Generate salt using constructor params
        bytes32 salt = keccak256(abi.encodePacked(_configData, _immutables, _customConfigData));

        /// @solidity memory-safe-assembly
        assembly {
            _pairAddress := create2(0, add(bytecode, 32), mload(bytecode), salt)
        }
        if (_pairAddress == address(0)) revert Create2Failed();

        deployedPairsArray.push(_pairAddress);

        // Set additional values for FraxlendPair
        IFraxlendPair _fraxlendPair = IFraxlendPair(_pairAddress);
        if (defaultDepositAmt > 0) {
            IERC20(_fraxlendPair.asset()).safeTransferFrom(msg.sender, address(this), defaultDepositAmt);
            IERC20(_fraxlendPair.asset()).approve(address(_fraxlendPair), defaultDepositAmt);
            _fraxlendPair.deposit(defaultDepositAmt, msg.sender);
        }
        address[] memory _defaultSwappers = defaultSwappers;
        for (uint256 i = 0; i < _defaultSwappers.length; i++) {
            _fraxlendPair.setSwapper(_defaultSwappers[i], true);
        }

        return _pairAddress;
    }

    // ============================================================================================
    // Functions: External Deploy Methods
    // ============================================================================================

    /// @notice The ```deploy``` function allows the deployment of a FraxlendPair with default values
    /// @param _configData abi.encode(address _asset, address _collateral, address _oracle, uint32 _maxOracleDeviation, address _rateContract, uint64 _fullUtilizationRate, uint256 _maxLTV, uint256 _cleanLiquidationFee, uint256 _dirtyLiquidationFee, uint256 _protocolLiquidationFee)
    /// @return _pairAddress The address to which the Pair was deployed
    function deploy(bytes memory _configData) external returns (address _pairAddress) {
        if (!IFraxlendWhitelist(fraxlendWhitelistAddress).fraxlendDeployerWhitelist(msg.sender)) {
            revert WhitelistedDeployersOnly();
        }

        (address _asset, address _collateral,,,,,,,,) = abi.decode(
            _configData, (address, address, address, uint32, address, uint64, uint256, uint256, uint256, uint256)
        );

        (string memory _name, string memory _symbol) = getNextNameSymbol(_asset);

        bytes memory _immutables = abi.encode(circuitBreakerAddress, comptrollerAddress, timelockAddress);
        bytes memory _customConfigData = abi.encode(_name, _symbol, IERC20(_asset).safeDecimals());

        _pairAddress = _deploy(_configData, _immutables, _customConfigData);

        IFraxlendPairRegistry(fraxlendPairRegistryAddress).addPair(_pairAddress);

        emit LogDeploy(_pairAddress, _asset, _collateral, _name, _configData, _immutables, _customConfigData);
    }

    // ============================================================================================
    // Functions: Admin
    // ============================================================================================

    /// @notice The ```globalPause``` function calls the pause() function on a given set of pair addresses
    /// @dev Ignores reverts when calling pause()
    /// @param _addresses Addresses to attempt to pause()
    /// @return _updatedAddresses Addresses for which pause() was successful
    function globalPause(address[] memory _addresses) external returns (address[] memory _updatedAddresses) {
        if (msg.sender != circuitBreakerAddress) revert CircuitBreakerOnly();

        address _pairAddress;
        uint256 _lengthOfArray = _addresses.length;
        _updatedAddresses = new address[](_lengthOfArray);
        for (uint256 i = 0; i < _lengthOfArray;) {
            _pairAddress = _addresses[i];
            try IFraxlendPair(_pairAddress).pause() {
                _updatedAddresses[i] = _addresses[i];
            } catch {}
            unchecked {
                i = i + 1;
            }
        }
    }

    // ============================================================================================
    // Errors
    // ============================================================================================

    error CircuitBreakerOnly();
    error WhitelistedDeployersOnly();
    error Create2Failed();
}

File 2 of 17 : IERC20.sol
// 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 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 amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` 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 amount) external returns (bool);
}

File 3 of 17 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @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 {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @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 {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _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);
    }
}

File 4 of 17 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 5 of 17 : SSTORE2.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Read and write to persistent storage at a fraction of the cost.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/SSTORE2.sol)
/// @author Modified from 0xSequence (https://github.com/0xSequence/sstore2/blob/master/contracts/SSTORE2.sol)
library SSTORE2 {
    uint256 internal constant DATA_OFFSET = 1; // We skip the first byte as it's a STOP opcode to ensure the contract can't be called.

    /*//////////////////////////////////////////////////////////////
                               WRITE LOGIC
    //////////////////////////////////////////////////////////////*/

    function write(bytes memory data) internal returns (address pointer) {
        // Prefix the bytecode with a STOP opcode to ensure it cannot be called.
        bytes memory runtimeCode = abi.encodePacked(hex"00", data);

        bytes memory creationCode = abi.encodePacked(
            //---------------------------------------------------------------------------------------------------------------//
            // Opcode  | Opcode + Arguments  | Description  | Stack View                                                     //
            //---------------------------------------------------------------------------------------------------------------//
            // 0x60    |  0x600B             | PUSH1 11     | codeOffset                                                     //
            // 0x59    |  0x59               | MSIZE        | 0 codeOffset                                                   //
            // 0x81    |  0x81               | DUP2         | codeOffset 0 codeOffset                                        //
            // 0x38    |  0x38               | CODESIZE     | codeSize codeOffset 0 codeOffset                               //
            // 0x03    |  0x03               | SUB          | (codeSize - codeOffset) 0 codeOffset                           //
            // 0x80    |  0x80               | DUP          | (codeSize - codeOffset) (codeSize - codeOffset) 0 codeOffset   //
            // 0x92    |  0x92               | SWAP3        | codeOffset (codeSize - codeOffset) 0 (codeSize - codeOffset)   //
            // 0x59    |  0x59               | MSIZE        | 0 codeOffset (codeSize - codeOffset) 0 (codeSize - codeOffset) //
            // 0x39    |  0x39               | CODECOPY     | 0 (codeSize - codeOffset)                                      //
            // 0xf3    |  0xf3               | RETURN       |                                                                //
            //---------------------------------------------------------------------------------------------------------------//
            hex"60_0B_59_81_38_03_80_92_59_39_F3", // Returns all code in the contract except for the first 11 (0B in hex) bytes.
            runtimeCode // The bytecode we want the contract to have after deployment. Capped at 1 byte less than the code size limit.
        );

        assembly {
            // Deploy a new contract with the generated creation code.
            // We start 32 bytes into the code to avoid copying the byte length.
            pointer := create(0, add(creationCode, 32), mload(creationCode))
        }

        require(pointer != address(0), "DEPLOYMENT_FAILED");
    }

    /*//////////////////////////////////////////////////////////////
                               READ LOGIC
    //////////////////////////////////////////////////////////////*/

    function read(address pointer) internal view returns (bytes memory) {
        return readBytecode(pointer, DATA_OFFSET, pointer.code.length - DATA_OFFSET);
    }

    function read(address pointer, uint256 start) internal view returns (bytes memory) {
        start += DATA_OFFSET;

        return readBytecode(pointer, start, pointer.code.length - start);
    }

    function read(
        address pointer,
        uint256 start,
        uint256 end
    ) internal view returns (bytes memory) {
        start += DATA_OFFSET;
        end += DATA_OFFSET;

        require(pointer.code.length >= end, "OUT_OF_BOUNDS");

        return readBytecode(pointer, start, end - start);
    }

    /*//////////////////////////////////////////////////////////////
                          INTERNAL HELPER LOGIC
    //////////////////////////////////////////////////////////////*/

    function readBytecode(
        address pointer,
        uint256 start,
        uint256 size
    ) private view returns (bytes memory data) {
        assembly {
            // Get a pointer to some free memory.
            data := mload(0x40)

            // Update the free memory pointer to prevent overriding our data.
            // We use and(x, not(31)) as a cheaper equivalent to sub(x, mod(x, 32)).
            // Adding 31 to size and running the result through the logic above ensures
            // the memory pointer remains word-aligned, following the Solidity convention.
            mstore(0x40, add(data, and(add(add(size, 32), 31), not(31))))

            // Store the size of the data in the first 32 byte chunk of free memory.
            mstore(data, size)

            // Copy the code into memory right after the 32 bytes we used to store the size.
            extcodecopy(pointer, add(data, 32), start, size)
        }
    }
}

File 6 of 17 : BytesLib.sol
// SPDX-License-Identifier: Unlicense
/*
 * @title Solidity Bytes Arrays Utils
 * @author Gonçalo Sá <[email protected]>
 *
 * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.
 *      The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.
 */
pragma solidity >=0.8.0 <0.9.0;


library BytesLib {
    function concat(
        bytes memory _preBytes,
        bytes memory _postBytes
    )
        internal
        pure
        returns (bytes memory)
    {
        bytes memory tempBytes;

        assembly {
            // Get a location of some free memory and store it in tempBytes as
            // Solidity does for memory variables.
            tempBytes := mload(0x40)

            // Store the length of the first bytes array at the beginning of
            // the memory for tempBytes.
            let length := mload(_preBytes)
            mstore(tempBytes, length)

            // Maintain a memory counter for the current write location in the
            // temp bytes array by adding the 32 bytes for the array length to
            // the starting location.
            let mc := add(tempBytes, 0x20)
            // Stop copying when the memory counter reaches the length of the
            // first bytes array.
            let end := add(mc, length)

            for {
                // Initialize a copy counter to the start of the _preBytes data,
                // 32 bytes into its memory.
                let cc := add(_preBytes, 0x20)
            } lt(mc, end) {
                // Increase both counters by 32 bytes each iteration.
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                // Write the _preBytes data into the tempBytes memory 32 bytes
                // at a time.
                mstore(mc, mload(cc))
            }

            // Add the length of _postBytes to the current length of tempBytes
            // and store it as the new length in the first 32 bytes of the
            // tempBytes memory.
            length := mload(_postBytes)
            mstore(tempBytes, add(length, mload(tempBytes)))

            // Move the memory counter back from a multiple of 0x20 to the
            // actual end of the _preBytes data.
            mc := end
            // Stop copying when the memory counter reaches the new combined
            // length of the arrays.
            end := add(mc, length)

            for {
                let cc := add(_postBytes, 0x20)
            } lt(mc, end) {
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                mstore(mc, mload(cc))
            }

            // Update the free-memory pointer by padding our last write location
            // to 32 bytes: add 31 bytes to the end of tempBytes to move to the
            // next 32 byte block, then round down to the nearest multiple of
            // 32. If the sum of the length of the two arrays is zero then add
            // one before rounding down to leave a blank 32 bytes (the length block with 0).
            mstore(0x40, and(
              add(add(end, iszero(add(length, mload(_preBytes)))), 31),
              not(31) // Round down to the nearest 32 bytes.
            ))
        }

        return tempBytes;
    }

    function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {
        assembly {
            // Read the first 32 bytes of _preBytes storage, which is the length
            // of the array. (We don't need to use the offset into the slot
            // because arrays use the entire slot.)
            let fslot := sload(_preBytes.slot)
            // Arrays of 31 bytes or less have an even value in their slot,
            // while longer arrays have an odd value. The actual length is
            // the slot divided by two for odd values, and the lowest order
            // byte divided by two for even values.
            // If the slot is even, bitwise and the slot with 255 and divide by
            // two to get the length. If the slot is odd, bitwise and the slot
            // with -1 and divide by two.
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)
            let newlength := add(slength, mlength)
            // slength can contain both the length and contents of the array
            // if length < 32 bytes so let's prepare for that
            // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
            switch add(lt(slength, 32), lt(newlength, 32))
            case 2 {
                // Since the new array still fits in the slot, we just need to
                // update the contents of the slot.
                // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length
                sstore(
                    _preBytes.slot,
                    // all the modifications to the slot are inside this
                    // next block
                    add(
                        // we can just add to the slot contents because the
                        // bytes we want to change are the LSBs
                        fslot,
                        add(
                            mul(
                                div(
                                    // load the bytes from memory
                                    mload(add(_postBytes, 0x20)),
                                    // zero all bytes to the right
                                    exp(0x100, sub(32, mlength))
                                ),
                                // and now shift left the number of bytes to
                                // leave space for the length in the slot
                                exp(0x100, sub(32, newlength))
                            ),
                            // increase length by the double of the memory
                            // bytes length
                            mul(mlength, 2)
                        )
                    )
                )
            }
            case 1 {
                // The stored value fits in the slot, but the combined value
                // will exceed it.
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes.slot)
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes.slot, add(mul(newlength, 2), 1))

                // The contents of the _postBytes array start 32 bytes into
                // the structure. Our first read should obtain the `submod`
                // bytes that can fit into the unused space in the last word
                // of the stored array. To get this, we read 32 bytes starting
                // from `submod`, so the data we read overlaps with the array
                // contents by `submod` bytes. Masking the lowest-order
                // `submod` bytes allows us to add that value directly to the
                // stored value.

                let submod := sub(32, slength)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(
                    sc,
                    add(
                        and(
                            fslot,
                            0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00
                        ),
                        and(mload(mc), mask)
                    )
                )

                for {
                    mc := add(mc, 0x20)
                    sc := add(sc, 1)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
            default {
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes.slot)
                // Start copying to the last used word of the stored array.
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes.slot, add(mul(newlength, 2), 1))

                // Copy over the first `submod` bytes of the new data as in
                // case 1 above.
                let slengthmod := mod(slength, 32)
                let mlengthmod := mod(mlength, 32)
                let submod := sub(32, slengthmod)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(sc, add(sload(sc), and(mload(mc), mask)))

                for {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
        }
    }

    function slice(
        bytes memory _bytes,
        uint256 _start,
        uint256 _length
    )
        internal
        pure
        returns (bytes memory)
    {
        require(_length + 31 >= _length, "slice_overflow");
        require(_bytes.length >= _start + _length, "slice_outOfBounds");

        bytes memory tempBytes;

        assembly {
            switch iszero(_length)
            case 0 {
                // Get a location of some free memory and store it in tempBytes as
                // Solidity does for memory variables.
                tempBytes := mload(0x40)

                // The first word of the slice result is potentially a partial
                // word read from the original array. To read it, we calculate
                // the length of that partial word and start copying that many
                // bytes into the array. The first word we copy will start with
                // data we don't care about, but the last `lengthmod` bytes will
                // land at the beginning of the contents of the new array. When
                // we're done copying, we overwrite the full first word with
                // the actual length of the slice.
                let lengthmod := and(_length, 31)

                // The multiplication in the next line is necessary
                // because when slicing multiples of 32 bytes (lengthmod == 0)
                // the following copy loop was copying the origin's length
                // and then ending prematurely not copying everything it should.
                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
                let end := add(mc, _length)

                for {
                    // The multiplication in the next line has the same exact purpose
                    // as the one above.
                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
                } lt(mc, end) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    mstore(mc, mload(cc))
                }

                mstore(tempBytes, _length)

                //update free-memory pointer
                //allocating the array padded to 32 bytes like the compiler does now
                mstore(0x40, and(add(mc, 31), not(31)))
            }
            //if we want a zero-length slice let's just return a zero-length array
            default {
                tempBytes := mload(0x40)
                //zero out the 32 bytes slice we are about to return
                //we need to do it because Solidity does not garbage collect
                mstore(tempBytes, 0)

                mstore(0x40, add(tempBytes, 0x20))
            }
        }

        return tempBytes;
    }

    function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {
        require(_bytes.length >= _start + 20, "toAddress_outOfBounds");
        address tempAddress;

        assembly {
            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
        }

        return tempAddress;
    }

    function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {
        require(_bytes.length >= _start + 1 , "toUint8_outOfBounds");
        uint8 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x1), _start))
        }

        return tempUint;
    }

    function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) {
        require(_bytes.length >= _start + 2, "toUint16_outOfBounds");
        uint16 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x2), _start))
        }

        return tempUint;
    }

    function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) {
        require(_bytes.length >= _start + 4, "toUint32_outOfBounds");
        uint32 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x4), _start))
        }

        return tempUint;
    }

    function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) {
        require(_bytes.length >= _start + 8, "toUint64_outOfBounds");
        uint64 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x8), _start))
        }

        return tempUint;
    }

    function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) {
        require(_bytes.length >= _start + 12, "toUint96_outOfBounds");
        uint96 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0xc), _start))
        }

        return tempUint;
    }

    function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {
        require(_bytes.length >= _start + 16, "toUint128_outOfBounds");
        uint128 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x10), _start))
        }

        return tempUint;
    }

    function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {
        require(_bytes.length >= _start + 32, "toUint256_outOfBounds");
        uint256 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x20), _start))
        }

        return tempUint;
    }

    function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {
        require(_bytes.length >= _start + 32, "toBytes32_outOfBounds");
        bytes32 tempBytes32;

        assembly {
            tempBytes32 := mload(add(add(_bytes, 0x20), _start))
        }

        return tempBytes32;
    }

    function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {
        bool success = true;

        assembly {
            let length := mload(_preBytes)

            // if lengths don't match the arrays are not equal
            switch eq(length, mload(_postBytes))
            case 1 {
                // cb is a circuit breaker in the for loop since there's
                //  no said feature for inline assembly loops
                // cb = 1 - don't breaker
                // cb = 0 - break
                let cb := 1

                let mc := add(_preBytes, 0x20)
                let end := add(mc, length)

                for {
                    let cc := add(_postBytes, 0x20)
                // the next line is the loop condition:
                // while(uint256(mc < end) + cb == 2)
                } eq(add(lt(mc, end), cb), 2) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    // if any of these checks fails then arrays are not equal
                    if iszero(eq(mload(mc), mload(cc))) {
                        // unsuccess:
                        success := 0
                        cb := 0
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }

    function equalStorage(
        bytes storage _preBytes,
        bytes memory _postBytes
    )
        internal
        view
        returns (bool)
    {
        bool success = true;

        assembly {
            // we know _preBytes_offset is 0
            let fslot := sload(_preBytes.slot)
            // Decode the length of the stored array like in concatStorage().
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)

            // if lengths don't match the arrays are not equal
            switch eq(slength, mlength)
            case 1 {
                // slength can contain both the length and contents of the array
                // if length < 32 bytes so let's prepare for that
                // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
                if iszero(iszero(slength)) {
                    switch lt(slength, 32)
                    case 1 {
                        // blank the last byte which is the length
                        fslot := mul(div(fslot, 0x100), 0x100)

                        if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {
                            // unsuccess:
                            success := 0
                        }
                    }
                    default {
                        // cb is a circuit breaker in the for loop since there's
                        //  no said feature for inline assembly loops
                        // cb = 1 - don't breaker
                        // cb = 0 - break
                        let cb := 1

                        // get the keccak hash to get the contents of the array
                        mstore(0x0, _preBytes.slot)
                        let sc := keccak256(0x0, 0x20)

                        let mc := add(_postBytes, 0x20)
                        let end := add(mc, mlength)

                        // the next line is the loop condition:
                        // while(uint256(mc < end) + cb == 2)
                        for {} eq(add(lt(mc, end), cb), 2) {
                            sc := add(sc, 1)
                            mc := add(mc, 0x20)
                        } {
                            if iszero(eq(sload(sc), mload(mc))) {
                                // unsuccess:
                                success := 0
                                cb := 0
                            }
                        }
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }
}

File 7 of 17 : IFraxlendWhitelist.sol
// SPDX-License-Identifier: ISC
pragma solidity >=0.8.19;

interface IFraxlendWhitelist {
    event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event SetFraxlendDeployerWhitelist(address indexed _address, bool _bool);

    function acceptOwnership() external;

    function fraxlendDeployerWhitelist(address) external view returns (bool);

    function owner() external view returns (address);

    function pendingOwner() external view returns (address);

    function renounceOwnership() external;

    function setFraxlendDeployerWhitelist(address[] memory _addresses, bool _bool) external;

    function transferOwnership(address newOwner) external;
}

File 8 of 17 : IFraxlendPair.sol
// SPDX-License-Identifier: ISC
pragma solidity >=0.8.19;

interface IFraxlendPair {
    struct CurrentRateInfo {
        uint32 lastBlock;
        uint32 feeToProtocolRate; // Fee amount 1e5 precision
        uint64 lastTimestamp;
        uint64 ratePerSec;
        uint64 fullUtilizationRate;
    }

    struct VaultAccount {
        uint128 amount; // Total amount, analogous to market cap
        uint128 shares; // Total shares, analogous to shares outstanding
    }

    function CIRCUIT_BREAKER_ADDRESS() external view returns (address);

    function COMPTROLLER_ADDRESS() external view returns (address);

    function DEPLOYER_ADDRESS() external view returns (address);

    function FRAXLEND_WHITELIST_ADDRESS() external view returns (address);

    function timelockAddress() external view returns (address);

    function addCollateral(uint256 _collateralAmount, address _borrower) external;

    function addInterest(bool _returnAccounting)
        external
        returns (
            uint256 _interestEarned,
            uint256 _feesAmount,
            uint256 _feesShare,
            CurrentRateInfo memory,
            VaultAccount memory,
            VaultAccount memory
        );

    function allowance(address owner, address spender) external view returns (uint256);

    function approve(address spender, uint256 amount) external returns (bool);

    function approvedBorrowers(address) external view returns (bool);

    function approvedLenders(address) external view returns (bool);

    function asset() external view returns (address);

    function balanceOf(address account) external view returns (uint256);

    function borrowAsset(uint256 _borrowAmount, uint256 _collateralAmount, address _receiver)
        external
        returns (uint256 _shares);

    function borrowerWhitelistActive() external view returns (bool);

    function changeFee(uint32 _newFee) external;

    function cleanLiquidationFee() external view returns (uint256);

    function collateralContract() external view returns (address);

    function currentRateInfo()
        external
        view
        returns (
            uint32 lastBlock,
            uint32 feeToProtocolRate,
            uint64 lastTimestamp,
            uint64 ratePerSec,
            uint64 fullUtilizationRate
        );

    function decimals() external view returns (uint8);

    function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool);

    function deposit(uint256 _amount, address _receiver) external returns (uint256 _sharesReceived);

    function dirtyLiquidationFee() external view returns (uint256);

    function exchangeRateInfo() external view returns (uint32 lastTimestamp, uint224 exchangeRate);

    function getConstants()
        external
        pure
        returns (
            uint256 _LTV_PRECISION,
            uint256 _LIQ_PRECISION,
            uint256 _UTIL_PREC,
            uint256 _FEE_PRECISION,
            uint256 _EXCHANGE_PRECISION,
            uint64 _DEFAULT_INT,
            uint16 _DEFAULT_PROTOCOL_FEE,
            uint256 _MAX_PROTOCOL_FEE
        );

    function getImmutableAddressBool()
        external
        view
        returns (
            address _assetContract,
            address _collateralContract,
            address _oracleMultiply,
            address _oracleDivide,
            address _rateContract,
            address _DEPLOYER_CONTRACT,
            address _COMPTROLLER_ADDRESS,
            address _FRAXLEND_WHITELIST,
            bool _borrowerWhitelistActive,
            bool _lenderWhitelistActive
        );

    function getImmutableUint256()
        external
        view
        returns (
            uint256 _oracleNormalization,
            uint256 _maxLTV,
            uint256 _cleanLiquidationFee,
            uint256 _maturityDate,
            uint256 _penaltyRate
        );

    function getPairAccounting()
        external
        view
        returns (
            uint128 _totalAssetAmount,
            uint128 _totalAssetShares,
            uint128 _totalBorrowAmount,
            uint128 _totalBorrowShares,
            uint256 _totalCollateral
        );

    function getUserSnapshot(address _address)
        external
        view
        returns (uint256 _userAssetShares, uint256 _userBorrowShares, uint256 _userCollateralBalance);

    function increaseAllowance(address spender, uint256 addedValue) external returns (bool);

    function lenderWhitelistActive() external view returns (bool);

    function leveragedPosition(
        address _swapperAddress,
        uint256 _borrowAmount,
        uint256 _initialCollateralAmount,
        uint256 _amountCollateralOutMin,
        address[] memory _path
    ) external returns (uint256 _totalCollateralBalance);

    function liquidate(uint128 _sharesToLiquidate, uint256 _deadline, address _borrower)
        external
        returns (uint256 _collateralForLiquidator);

    function maturityDate() external view returns (uint256);

    function maxLTV() external view returns (uint256);

    function maxOracleDelay() external view returns (uint256);

    function name() external view returns (string memory);

    function oracleDivide() external view returns (address);

    function oracleMultiply() external view returns (address);

    function oracleNormalization() external view returns (uint256);

    function owner() external view returns (address);

    function pause() external;

    function paused() external view returns (bool);

    function penaltyRate() external view returns (uint256);

    function rateContract() external view returns (address);

    function redeem(uint256 _shares, address _receiver, address _owner) external returns (uint256 _amountToReturn);

    function removeCollateral(uint256 _collateralAmount, address _receiver) external;

    function renounceOwnership() external;

    function repayAsset(uint256 _shares, address _borrower) external returns (uint256 _amountToRepay);

    function repayAssetWithCollateral(
        address _swapperAddress,
        uint256 _collateralToSwap,
        uint256 _amountAssetOutMin,
        uint256 _swapDeadline,
        address[] memory _path
    ) external returns (uint256 _amountAssetOut);

    function setApprovedBorrowers(address[] memory _borrowers, bool _approval) external;

    function setApprovedLenders(address[] memory _lenders, bool _approval) external;

    function setMaxOracleDelay(uint256 _newDelay) external;

    function setSwapper(address _swapper, bool _approval) external;

    function setTimelock(address _newAddress) external;

    function swappers(address) external view returns (bool);

    function symbol() external view returns (string memory);

    function toAssetAmount(uint256 _shares, bool _roundUp) external view returns (uint256);

    function toAssetShares(uint256 _amount, bool _roundUp) external view returns (uint256);

    function toBorrowAmount(uint256 _shares, bool _roundUp) external view returns (uint256);

    function toBorrowShares(uint256 _amount, bool _roundUp) external view returns (uint256);

    function totalAsset() external view returns (uint128 amount, uint128 shares);

    function totalBorrow() external view returns (uint128 amount, uint128 shares);

    function totalCollateral() external view returns (uint256);

    function totalSupply() external view returns (uint256);

    function transfer(address to, uint256 amount) external returns (bool);

    function transferFrom(address from, address to, uint256 amount) external returns (bool);

    function transferOwnership(address newOwner) external;

    function unpause() external;

    function updateExchangeRate() external returns (uint256 _exchangeRate);

    function userBorrowShares(address) external view returns (uint256);

    function userCollateralBalance(address) external view returns (uint256);

    function version() external pure returns (uint256 _major, uint256 _minor, uint256 _patch);

    function withdrawFees(uint128 _shares, address _recipient) external returns (uint256 _amountToTransfer);
}

File 9 of 17 : IFraxlendPairRegistry.sol
// SPDX-License-Identifier: ISC
pragma solidity ^0.8.19;

interface IFraxlendPairRegistry {
    event AddPair(address pairAddress);
    event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event SetDeployer(address deployer, bool _bool);

    function acceptOwnership() external;

    function addPair(address _pairAddress) external;

    function deployedPairsArray(uint256) external view returns (address);

    function deployedPairsByName(string memory) external view returns (address);

    function deployedPairsLength() external view returns (uint256);

    function deployers(address) external view returns (bool);

    function getAllPairAddresses() external view returns (address[] memory _deployedPairsArray);

    function owner() external view returns (address);

    function pendingOwner() external view returns (address);

    function renounceOwnership() external;

    function setDeployers(address[] memory _deployers, bool _bool) external;

    function transferOwnership(address newOwner) external;
}

File 10 of 17 : SafeERC20.sol
// SPDX-License-Identifier: ISC
pragma solidity ^0.8.19;

import {IERC20} from "@openzeppelin/contracts/interfaces/IERC20.sol";
import {SafeERC20 as OZSafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

// solhint-disable avoid-low-level-calls
// solhint-disable max-line-length

/// @title SafeERC20 provides helper functions for safe transfers as well as safe metadata access
/// @author Library originally written by @Boring_Crypto github.com/boring_crypto, modified by Drake Evans (Frax Finance) github.com/drakeevans
/// @dev original: https://github.com/boringcrypto/BoringSolidity/blob/fed25c5d43cb7ce20764cd0b838e21a02ea162e9/contracts/libraries/BoringERC20.sol
library SafeERC20 {
    bytes4 private constant SIG_SYMBOL = 0x95d89b41; // symbol()
    bytes4 private constant SIG_NAME = 0x06fdde03; // name()
    bytes4 private constant SIG_DECIMALS = 0x313ce567; // decimals()

    function returnDataToString(bytes memory data) internal pure returns (string memory) {
        if (data.length >= 64) {
            return abi.decode(data, (string));
        } else if (data.length == 32) {
            uint8 i = 0;
            while (i < 32 && data[i] != 0) {
                i++;
            }
            bytes memory bytesArray = new bytes(i);
            for (i = 0; i < 32 && data[i] != 0; i++) {
                bytesArray[i] = data[i];
            }
            return string(bytesArray);
        } else {
            return "???";
        }
    }

    /// @notice Provides a safe ERC20.symbol version which returns '???' as fallback string.
    /// @param token The address of the ERC-20 token contract.
    /// @return (string) Token symbol.
    function safeSymbol(IERC20 token) internal view returns (string memory) {
        (bool success, bytes memory data) = address(token).staticcall(abi.encodeWithSelector(SIG_SYMBOL));
        return success ? returnDataToString(data) : "???";
    }

    /// @notice Provides a safe ERC20.name version which returns '???' as fallback string.
    /// @param token The address of the ERC-20 token contract.
    /// @return (string) Token name.
    function safeName(IERC20 token) internal view returns (string memory) {
        (bool success, bytes memory data) = address(token).staticcall(abi.encodeWithSelector(SIG_NAME));
        return success ? returnDataToString(data) : "???";
    }

    /// @notice Provides a safe ERC20.decimals version which returns '18' as fallback value.
    /// @param token The address of the ERC-20 token contract.
    /// @return (uint8) Token decimals.
    function safeDecimals(IERC20 token) internal view returns (uint8) {
        (bool success, bytes memory data) = address(token).staticcall(abi.encodeWithSelector(SIG_DECIMALS));
        return success && data.length == 32 ? abi.decode(data, (uint8)) : 18;
    }

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        OZSafeERC20.safeTransfer(token, to, value);
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        OZSafeERC20.safeTransferFrom(token, from, to, value);
    }
}

File 11 of 17 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @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;
    }
}

File 12 of 17 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

File 13 of 17 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 14 of 17 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)

pragma solidity ^0.8.0;

import "../token/ERC20/IERC20.sol";

File 15 of 17 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../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 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.encodeWithSelector(token.transfer.selector, 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.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 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.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to
     * 0 before setting it to a non-zero value.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @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 silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 16 of 17 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (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.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 17 of 17 : Address.sol
// 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 Address {
    /**
     * @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
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @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.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @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, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * 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.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @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`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) 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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

Settings
{
  "remappings": [
    "ds-test/=lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "@chainlink/=node_modules/@chainlink/",
    "@ensdomains/=node_modules/@ensdomains/",
    "@eth-optimism/=node_modules/@eth-optimism/",
    "@mean-finance/=node_modules/@mean-finance/",
    "@openzeppelin/=node_modules/@openzeppelin/",
    "@rari-capital/=node_modules/@rari-capital/",
    "@uniswap/=node_modules/@uniswap/",
    "base64-sol/=node_modules/base64-sol/",
    "eth-gas-reporter/=node_modules/eth-gas-reporter/",
    "hardhat/=node_modules/hardhat/",
    "solidity-bytes-utils/=node_modules/solidity-bytes-utils/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"components":[{"internalType":"address","name":"circuitBreaker","type":"address"},{"internalType":"address","name":"comptroller","type":"address"},{"internalType":"address","name":"timelock","type":"address"},{"internalType":"address","name":"fraxlendWhitelist","type":"address"},{"internalType":"address","name":"fraxlendPairRegistry","type":"address"}],"internalType":"struct ConstructorParams","name":"_params","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CircuitBreakerOnly","type":"error"},{"inputs":[],"name":"Create2Failed","type":"error"},{"inputs":[],"name":"WhitelistedDeployersOnly","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"address_","type":"address"},{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":true,"internalType":"address","name":"collateral","type":"address"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"bytes","name":"configData","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"immutables","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"customConfigData","type":"bytes"}],"name":"LogDeploy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetCircuitBreaker","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetComptroller","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetRegistry","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetTimelock","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetWhitelist","type":"event"},{"inputs":[],"name":"circuitBreakerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"comptrollerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractAddress1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractAddress2","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultDepositAmt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"defaultSwappers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_configData","type":"bytes"}],"name":"deploy","outputs":[{"internalType":"address","name":"_pairAddress","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"deployedPairsArray","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deployedPairsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fraxlendPairRegistryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fraxlendWhitelistAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllPairAddresses","outputs":[{"internalType":"address[]","name":"_deployedPairs","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"}],"name":"getNextNameSymbol","outputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"globalPause","outputs":[{"internalType":"address[]","name":"_updatedAddresses","type":"address[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAddress","type":"address"}],"name":"setCircuitBreaker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAddress","type":"address"}],"name":"setComptroller","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_creationCode","type":"bytes"}],"name":"setCreationCode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"setDefaultDepositAmt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_swappers","type":"address[]"}],"name":"setDefaultSwappers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAddress","type":"address"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAddress","type":"address"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAddress","type":"address"}],"name":"setWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelockAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"_major","type":"uint256"},{"internalType":"uint256","name":"_minor","type":"uint256"},{"internalType":"uint256","name":"_patch","type":"uint256"}],"stateMutability":"pure","type":"function"}]

608060405234801561001057600080fd5b506040516124fa3803806124fa83398101604081905261002f91610118565b610038336100ac565b8051600380546001600160a01b03199081166001600160a01b03938416179091556020830151600480548316918416919091179055604083015160058054831691841691909117905560608301516007805483169184169190911790556080909201516006805490931691161790556101b5565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b038116811461011357600080fd5b919050565b600060a082840312801561012b57600080fd5b5060405160a081016001600160401b038111828210171561015c57634e487b7160e01b600052604160045260246000fd5b604052610168836100fc565b8152610176602084016100fc565b6020820152610187604084016100fc565b6040820152610198606084016100fc565b60608201526101a9608084016100fc565b60808201529392505050565b612336806101c46000396000f3fe608060405234801561001057600080fd5b50600436106101a85760003560e01c80636c191eee116100f957806389f09bd411610097578063a91ee0dc11610071578063a91ee0dc14610386578063bdacb30314610399578063cff9d0c6146103ac578063f2fde38b146103bf57600080fd5b806389f09bd4146103595780638bad38dd146103625780638da5cb5b1461037557600080fd5b80637ec9e156116100d35780637ec9e156146102ff57806382beee8914610312578063854cff2f1461032557806385692c9d1461033857600080fd5b80636c191eee146102d1578063715018a6146102e45780637bc02806146102ec57600080fd5b80634bc66f32116101665780635e7b4e40116101405780635e7b4e4014610290578063607b6d16146102a357806368bde41f146102ab57806369285727146102be57600080fd5b80634bc66f321461024a57806354ea39281461025d57806354fd4d501461027057600080fd5b8062774360146101ad57806306c75b6a146101dd57806331c315df146101f257806336683100146102055780634793221d146102175780634929242714610237575b600080fd5b6101c06101bb366004611ba9565b6103d2565b6040516001600160a01b0390911681526020015b60405180910390f35b6101f06101eb366004611c29565b6105df565b005b6101c0610200366004611c9d565b6106e3565b600a545b6040519081526020016101d4565b61022a610225366004611ccb565b61070d565b6040516101d49190611d79565b6003546101c0906001600160a01b031681565b6005546101c0906001600160a01b031681565b6007546101c0906001600160a01b031681565b6040805160048152600160208201526000918101919091526060016101d4565b6006546101c0906001600160a01b031681565b61022a61085a565b6004546101c0906001600160a01b031681565b6101c06102cc366004611c9d565b6108bc565b6101f06102df366004611ccb565b6108cc565b6101f06108eb565b6001546101c0906001600160a01b031681565b6002546101c0906001600160a01b031681565b6101f0610320366004611dc5565b6108ff565b6101f0610333366004611dc5565b610970565b61034b610346366004611dc5565b6109e1565b6040516101d4929190611e32565b61020960095481565b6101f0610370366004611dc5565b610aee565b6000546001600160a01b03166101c0565b6101f0610394366004611dc5565b610b5f565b6101f06103a7366004611dc5565b610bd0565b6101f06103ba366004611c9d565b610c41565b6101f06103cd366004611dc5565b610c4e565b60075460405163147d305b60e31b81523360048201526000916001600160a01b03169063a3e982d890602401602060405180830381865afa15801561041b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043f9190611e60565b61045c576040516393afd58960e01b815260040160405180910390fd5b600080838060200190518101906104739190611e9a565b50505050505050509150915060008061048b846109e1565b600354600454600554604080516001600160a01b0394851660208201529284169083015291909116606082015291935091506000906080016040516020818303038152906040529050600083836104ea886001600160a01b0316610ccc565b6040516020016104fc93929190611f53565b6040516020818303038152906040529050610518888383610d8c565b60065460405163615bdddb60e11b81526001600160a01b03808416600483015292995091169063c2b7bbb690602401600060405180830381600087803b15801561056157600080fd5b505af1158015610575573d6000803e3d6000fd5b50505050846001600160a01b0316866001600160a01b0316886001600160a01b03167f9303649990c462969a3c46d4e2c758166e92f5a4b18c67f26d3e58d2b0660e67878c87876040516105cc9493929190611f8c565b60405180910390a4505050505050919050565b6105e76111a0565b600061062c83838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525092506132c891506111fa9050565b905061063781611307565b600180546001600160a01b0319166001600160a01b03929092169190911790556132c88211156106de5760006106b184848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506132c892506106ac915082905087611fef565b6111fa565b90506106bc81611307565b600280546001600160a01b0319166001600160a01b0392909216919091179055505b505050565b600a81815481106106f357600080fd5b6000918252602090912001546001600160a01b0316905081565b6003546060906001600160a01b0316331461073b5760405163363afff160e21b815260040160405180910390fd5b81516000908067ffffffffffffffff81111561075957610759611b3a565b604051908082528060200260200182016040528015610782578160200160208202803683370190505b50925060005b81811015610852578481815181106107a2576107a2612002565b60200260200101519250826001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156107e757600080fd5b505af19250505080156107f8575060015b1561084a5784818151811061080f5761080f612002565b602002602001015184828151811061082957610829612002565b60200260200101906001600160a01b031690816001600160a01b0316815250505b600101610788565b505050919050565b6060600a8054806020026020016040519081016040528092919081815260200182805480156108b257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610894575b5050505050905090565b600881815481106106f357600080fd5b6108d46111a0565b80516108e7906008906020840190611ac0565b5050565b6108f36111a0565b6108fd60006113ac565b565b6109076111a0565b600354604080516001600160a01b03928316815291831660208301527f4cb8c9e37efb94c6cdbd2a80fe36cee1957b5584d1a1986fa2bae115180af59a910160405180910390a1600380546001600160a01b0319166001600160a01b0392909216919091179055565b6109786111a0565b600754604080516001600160a01b03928316815291831660208301527fe8664b925e623f88e598288ed83ff0a0c9b17d50f56ec07db74f075ca4c1d57b910160405180910390a1600780546001600160a01b0319166001600160a01b0392909216919091179055565b6060806000600660009054906101000a90046001600160a01b03166001600160a01b031663366831006040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5d9190612018565b9050610a71846001600160a01b03166113fc565b610a84610a7f836001612031565b6114b7565b604051602001610a95929190612044565b6040516020818303038152906040529250610ab8846001600160a01b03166113fc565b610ac6610a7f836001612031565b604051602001610ad79291906120ab565b604051602081830303815290604052915050915091565b610af66111a0565b600454604080516001600160a01b03928316815291831660208301527ff45d882a72fce9d8d7a7e2e196a338d4d9d4057510b4b9ddf91a7066104d2eaf910160405180910390a1600480546001600160a01b0319166001600160a01b0392909216919091179055565b610b676111a0565b600654604080516001600160a01b03928316815291831660208301527fa6cdf06494ab3c79fae6cca5316f6324ff80979c2a51d8f239aee07a4aecd35b910160405180910390a1600680546001600160a01b0319166001600160a01b0392909216919091179055565b610bd86111a0565b600554604080516001600160a01b03928316815291831660208301527f91aa98337922135c1d3ae8654f8d0b938c01a35c402eb21e568af3755e4dcd79910160405180910390a1600580546001600160a01b0319166001600160a01b0392909216919091179055565b610c496111a0565b600955565b610c566111a0565b6001600160a01b038116610cc05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b610cc9816113ac565b50565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b1790529051600091829182916001600160a01b03861691610d1291906120f5565b600060405180830381855afa9150503d8060008114610d4d576040519150601f19603f3d011682016040523d82523d6000602084013e610d52565b606091505b5091509150818015610d65575080516020145b610d70576012610d84565b80806020019051810190610d849190612111565b949350505050565b6001546000908190610dc490610daa906001600160a01b031661154a565b600254610dbf906001600160a01b031661154a565b611571565b9050600081868686604051602001610dde93929190612134565b60408051601f1981840301815290829052610dfc9291602001612177565b60405160208183030381529060405290506000868686604051602001610e24939291906121a6565b604051602081830303815290604052805190602001209050808251602084016000f593506001600160a01b038416610e6f57604051630252d9f760e11b815260040160405180910390fd5b600a80546001810182556000919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b0319166001600160a01b03861617905560095484901561109057610f3f3330600954846001600160a01b03166338d52e0f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2e91906121e9565b6001600160a01b03169291906115ee565b806001600160a01b03166338d52e0f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa191906121e9565b60095460405163095ea7b360e01b81526001600160a01b038481166004830152602482019290925291169063095ea7b3906044016020604051808303816000875af1158015610ff4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110189190611e60565b50600954604051636e553f6560e01b815260048101919091523360248201526001600160a01b03821690636e553f65906044016020604051808303816000875af115801561106a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108e9190612018565b505b600060088054806020026020016040519081016040528092919081815260200182805480156110e857602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116110ca575b5050505050905060005b815181101561119357826001600160a01b0316633f2617cb83838151811061111c5761111c612002565b60209081029190910101516040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260016024820152604401600060405180830381600087803b15801561116f57600080fd5b505af1158015611183573d6000803e3d6000fd5b5050600190920191506110f29050565b5050505050509392505050565b6000546001600160a01b031633146108fd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610cb7565b60608161120881601f612031565b10156112475760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401610cb7565b6112518284612031565b845110156112955760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401610cb7565b6060821580156112b457604051915060008252602082016040526112fe565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156112ed5780518352602092830192016112d5565b5050858452601f01601f1916604052505b50949350505050565b6000808260405160200161131b9190612206565b604051602081830303815290604052905060008160405160200161133f919061222c565b60405160208183030381529060405290508051602082016000f092506001600160a01b0383166113a55760405162461bcd60e51b81526020600482015260116024820152701111541313d65351539517d19052531151607a1b6044820152606401610cb7565b5050919050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b179052905160609160009182916001600160a01b0386169161144391906120f5565b600060405180830381855afa9150503d806000811461147e576040519150601f19603f3d011682016040523d82523d6000602084013e611483565b606091505b5091509150816114ae57604051806040016040528060038152602001623f3f3f60e81b815250610d84565b610d8481611600565b606060006114c48361178a565b600101905060008167ffffffffffffffff8111156114e4576114e4611b3a565b6040519080825280601f01601f19166020018201604052801561150e576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461151857509392505050565b606061156b826001611566816001600160a01b0384163b611fef565b611862565b92915050565b6060806040519050835180825260208201818101602087015b818310156115a257805183526020928301920161158a565b50855184518101855292509050808201602086015b818310156115cf5780518352602092830192016115b7565b508651929092011591909101601f01601f191660405250905092915050565b6115fa84848484611885565b50505050565b6060604082511061161f578180602001905181019061156b9190612260565b81516020036117665760005b60208160ff161080156116605750828160ff168151811061164e5761164e612002565b01602001516001600160f81b03191615155b15611677578061166f816122ce565b91505061162b565b60008160ff1667ffffffffffffffff81111561169557611695611b3a565b6040519080825280601f01601f1916602001820160405280156116bf576020820181803683370190505b509050600091505b60208260ff161080156116fc5750838260ff16815181106116ea576116ea612002565b01602001516001600160f81b03191615155b1561175f57838260ff168151811061171657611716612002565b602001015160f81c60f81b818360ff168151811061173657611736612002565b60200101906001600160f81b031916908160001a90535081611757816122ce565b9250506116c7565b9392505050565b50506040805180820190915260038152623f3f3f60e81b602082015290565b919050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106117c95772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106117f5576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061181357662386f26fc10000830492506010015b6305f5e100831061182b576305f5e100830492506008015b612710831061183f57612710830492506004015b60648310611851576064830492506002015b600a831061156b5760010192915050565b60408051603f8301601f19168101909152818152818360208301863c9392505050565b604080516001600160a01b038581166024830152848116604483015260648083018590528351808403909101815260849092018352602080830180516001600160e01b03166323b872dd60e01b17905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908401526115fa9287929160009161191d91851690849061199d565b905080516000148061193e57508080602001905181019061193e9190611e60565b6106de5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610cb7565b6060610d84848460008585600080866001600160a01b031685876040516119c491906120f5565b60006040518083038185875af1925050503d8060008114611a01576040519150601f19603f3d011682016040523d82523d6000602084013e611a06565b606091505b5091509150611a1787838387611a22565b979650505050505050565b60608315611a91578251600003611a8a576001600160a01b0385163b611a8a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610cb7565b5081610d84565b610d848383815115611aa65781518083602001fd5b8060405162461bcd60e51b8152600401610cb791906122ed565b828054828255906000526020600020908101928215611b15579160200282015b82811115611b1557825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611ae0565b50611b21929150611b25565b5090565b5b80821115611b215760008155600101611b26565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611b7957611b79611b3a565b604052919050565b600067ffffffffffffffff821115611b9b57611b9b611b3a565b50601f01601f191660200190565b600060208284031215611bbb57600080fd5b813567ffffffffffffffff811115611bd257600080fd5b8201601f81018413611be357600080fd5b8035611bf6611bf182611b81565b611b50565b818152856020838501011115611c0b57600080fd5b81602084016020830137600091810160200191909152949350505050565b60008060208385031215611c3c57600080fd5b823567ffffffffffffffff811115611c5357600080fd5b8301601f81018513611c6457600080fd5b803567ffffffffffffffff811115611c7b57600080fd5b856020828401011115611c8d57600080fd5b6020919091019590945092505050565b600060208284031215611caf57600080fd5b5035919050565b6001600160a01b0381168114610cc957600080fd5b600060208284031215611cdd57600080fd5b813567ffffffffffffffff811115611cf457600080fd5b8201601f81018413611d0557600080fd5b803567ffffffffffffffff811115611d1f57611d1f611b3a565b8060051b611d2f60208201611b50565b91825260208184018101929081019087841115611d4b57600080fd5b6020850194505b83851015611a175784359250611d6783611cb6565b82825260209485019490910190611d52565b602080825282518282018190526000918401906040840190835b81811015611dba5783516001600160a01b0316835260209384019390920191600101611d93565b509095945050505050565b600060208284031215611dd757600080fd5b813561175f81611cb6565b60005b83811015611dfd578181015183820152602001611de5565b50506000910152565b60008151808452611e1e816020860160208601611de2565b601f01601f19169290920160200192915050565b604081526000611e456040830185611e06565b8281036020840152611e578185611e06565b95945050505050565b600060208284031215611e7257600080fd5b8151801515811461175f57600080fd5b805167ffffffffffffffff8116811461178557600080fd5b6000806000806000806000806000806101408b8d031215611eba57600080fd5b8a51611ec581611cb6565b60208c0151909a50611ed681611cb6565b60408c0151909950611ee781611cb6565b60608c015190985063ffffffff81168114611f0157600080fd5b60808c0151909750611f1281611cb6565b9550611f2060a08c01611e82565b60c08c015160e08d01516101008e0151610120909e01519c9f9b9e50999c989b979a919990989097909650945092505050565b606081526000611f666060830186611e06565b8281036020840152611f788186611e06565b91505060ff83166040830152949350505050565b608081526000611f9f6080830187611e06565b8281036020840152611fb18187611e06565b90508281036040840152611fc58186611e06565b90508281036060840152611a178185611e06565b634e487b7160e01b600052601160045260246000fd5b8181038181111561156b5761156b611fd9565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561202a57600080fd5b5051919050565b8082018082111561156b5761156b611fd9565b7f506561706f647320496e7465726573742042656172696e67200000000000000081526000835161207c816019850160208801611de2565b6201016960ed1b601991840191820152835161209f81601c840160208801611de2565b01601c01949350505050565b61383360f11b8152600083516120c8816002850160208801611de2565b602d60f81b60029184019182015283516120e9816003840160208801611de2565b01600301949350505050565b60008251612107818460208701611de2565b9190910192915050565b60006020828403121561212357600080fd5b815160ff8116811461175f57600080fd5b6060815260006121476060830186611e06565b82810360208401526121598186611e06565b9050828103604084015261216d8185611e06565b9695505050505050565b60008351612189818460208801611de2565b83519083019061219d818360208801611de2565b01949350505050565b600084516121b8818460208901611de2565b8451908301906121cc818360208901611de2565b84519101906121df818360208801611de2565b0195945050505050565b6000602082840312156121fb57600080fd5b815161175f81611cb6565b600081526000825161221f816001850160208701611de2565b9190910160010192915050565b6a600b5981380380925939f360a81b8152815160009061225381600b850160208701611de2565b91909101600b0192915050565b60006020828403121561227257600080fd5b815167ffffffffffffffff81111561228957600080fd5b8201601f8101841361229a57600080fd5b80516122a8611bf182611b81565b8181528560208385010111156122bd57600080fd5b611e57826020830160208601611de2565b600060ff821660ff81036122e4576122e4611fd9565b60010192915050565b60208152600061175f6020830184611e0656fea264697066735822122005675e2d39fc8d210b0255db9fa9361f7ddc5d6d8d4efe5f24c9231f7263a57d64736f6c634300081c003300000000000000000000000021fe3e26e824783ca7e374355a8d30ae8bbf6e3700000000000000000000000021fe3e26e824783ca7e374355a8d30ae8bbf6e3700000000000000000000000021fe3e26e824783ca7e374355a8d30ae8bbf6e370000000000000000000000006fe0ee8ec229698145c2a580bee4b0cc64944420000000000000000000000000bb0364f0767f96cfda060c39550ab34518b5e380

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101a85760003560e01c80636c191eee116100f957806389f09bd411610097578063a91ee0dc11610071578063a91ee0dc14610386578063bdacb30314610399578063cff9d0c6146103ac578063f2fde38b146103bf57600080fd5b806389f09bd4146103595780638bad38dd146103625780638da5cb5b1461037557600080fd5b80637ec9e156116100d35780637ec9e156146102ff57806382beee8914610312578063854cff2f1461032557806385692c9d1461033857600080fd5b80636c191eee146102d1578063715018a6146102e45780637bc02806146102ec57600080fd5b80634bc66f32116101665780635e7b4e40116101405780635e7b4e4014610290578063607b6d16146102a357806368bde41f146102ab57806369285727146102be57600080fd5b80634bc66f321461024a57806354ea39281461025d57806354fd4d501461027057600080fd5b8062774360146101ad57806306c75b6a146101dd57806331c315df146101f257806336683100146102055780634793221d146102175780634929242714610237575b600080fd5b6101c06101bb366004611ba9565b6103d2565b6040516001600160a01b0390911681526020015b60405180910390f35b6101f06101eb366004611c29565b6105df565b005b6101c0610200366004611c9d565b6106e3565b600a545b6040519081526020016101d4565b61022a610225366004611ccb565b61070d565b6040516101d49190611d79565b6003546101c0906001600160a01b031681565b6005546101c0906001600160a01b031681565b6007546101c0906001600160a01b031681565b6040805160048152600160208201526000918101919091526060016101d4565b6006546101c0906001600160a01b031681565b61022a61085a565b6004546101c0906001600160a01b031681565b6101c06102cc366004611c9d565b6108bc565b6101f06102df366004611ccb565b6108cc565b6101f06108eb565b6001546101c0906001600160a01b031681565b6002546101c0906001600160a01b031681565b6101f0610320366004611dc5565b6108ff565b6101f0610333366004611dc5565b610970565b61034b610346366004611dc5565b6109e1565b6040516101d4929190611e32565b61020960095481565b6101f0610370366004611dc5565b610aee565b6000546001600160a01b03166101c0565b6101f0610394366004611dc5565b610b5f565b6101f06103a7366004611dc5565b610bd0565b6101f06103ba366004611c9d565b610c41565b6101f06103cd366004611dc5565b610c4e565b60075460405163147d305b60e31b81523360048201526000916001600160a01b03169063a3e982d890602401602060405180830381865afa15801561041b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043f9190611e60565b61045c576040516393afd58960e01b815260040160405180910390fd5b600080838060200190518101906104739190611e9a565b50505050505050509150915060008061048b846109e1565b600354600454600554604080516001600160a01b0394851660208201529284169083015291909116606082015291935091506000906080016040516020818303038152906040529050600083836104ea886001600160a01b0316610ccc565b6040516020016104fc93929190611f53565b6040516020818303038152906040529050610518888383610d8c565b60065460405163615bdddb60e11b81526001600160a01b03808416600483015292995091169063c2b7bbb690602401600060405180830381600087803b15801561056157600080fd5b505af1158015610575573d6000803e3d6000fd5b50505050846001600160a01b0316866001600160a01b0316886001600160a01b03167f9303649990c462969a3c46d4e2c758166e92f5a4b18c67f26d3e58d2b0660e67878c87876040516105cc9493929190611f8c565b60405180910390a4505050505050919050565b6105e76111a0565b600061062c83838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525092506132c891506111fa9050565b905061063781611307565b600180546001600160a01b0319166001600160a01b03929092169190911790556132c88211156106de5760006106b184848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506132c892506106ac915082905087611fef565b6111fa565b90506106bc81611307565b600280546001600160a01b0319166001600160a01b0392909216919091179055505b505050565b600a81815481106106f357600080fd5b6000918252602090912001546001600160a01b0316905081565b6003546060906001600160a01b0316331461073b5760405163363afff160e21b815260040160405180910390fd5b81516000908067ffffffffffffffff81111561075957610759611b3a565b604051908082528060200260200182016040528015610782578160200160208202803683370190505b50925060005b81811015610852578481815181106107a2576107a2612002565b60200260200101519250826001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156107e757600080fd5b505af19250505080156107f8575060015b1561084a5784818151811061080f5761080f612002565b602002602001015184828151811061082957610829612002565b60200260200101906001600160a01b031690816001600160a01b0316815250505b600101610788565b505050919050565b6060600a8054806020026020016040519081016040528092919081815260200182805480156108b257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610894575b5050505050905090565b600881815481106106f357600080fd5b6108d46111a0565b80516108e7906008906020840190611ac0565b5050565b6108f36111a0565b6108fd60006113ac565b565b6109076111a0565b600354604080516001600160a01b03928316815291831660208301527f4cb8c9e37efb94c6cdbd2a80fe36cee1957b5584d1a1986fa2bae115180af59a910160405180910390a1600380546001600160a01b0319166001600160a01b0392909216919091179055565b6109786111a0565b600754604080516001600160a01b03928316815291831660208301527fe8664b925e623f88e598288ed83ff0a0c9b17d50f56ec07db74f075ca4c1d57b910160405180910390a1600780546001600160a01b0319166001600160a01b0392909216919091179055565b6060806000600660009054906101000a90046001600160a01b03166001600160a01b031663366831006040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5d9190612018565b9050610a71846001600160a01b03166113fc565b610a84610a7f836001612031565b6114b7565b604051602001610a95929190612044565b6040516020818303038152906040529250610ab8846001600160a01b03166113fc565b610ac6610a7f836001612031565b604051602001610ad79291906120ab565b604051602081830303815290604052915050915091565b610af66111a0565b600454604080516001600160a01b03928316815291831660208301527ff45d882a72fce9d8d7a7e2e196a338d4d9d4057510b4b9ddf91a7066104d2eaf910160405180910390a1600480546001600160a01b0319166001600160a01b0392909216919091179055565b610b676111a0565b600654604080516001600160a01b03928316815291831660208301527fa6cdf06494ab3c79fae6cca5316f6324ff80979c2a51d8f239aee07a4aecd35b910160405180910390a1600680546001600160a01b0319166001600160a01b0392909216919091179055565b610bd86111a0565b600554604080516001600160a01b03928316815291831660208301527f91aa98337922135c1d3ae8654f8d0b938c01a35c402eb21e568af3755e4dcd79910160405180910390a1600580546001600160a01b0319166001600160a01b0392909216919091179055565b610c496111a0565b600955565b610c566111a0565b6001600160a01b038116610cc05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b610cc9816113ac565b50565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b1790529051600091829182916001600160a01b03861691610d1291906120f5565b600060405180830381855afa9150503d8060008114610d4d576040519150601f19603f3d011682016040523d82523d6000602084013e610d52565b606091505b5091509150818015610d65575080516020145b610d70576012610d84565b80806020019051810190610d849190612111565b949350505050565b6001546000908190610dc490610daa906001600160a01b031661154a565b600254610dbf906001600160a01b031661154a565b611571565b9050600081868686604051602001610dde93929190612134565b60408051601f1981840301815290829052610dfc9291602001612177565b60405160208183030381529060405290506000868686604051602001610e24939291906121a6565b604051602081830303815290604052805190602001209050808251602084016000f593506001600160a01b038416610e6f57604051630252d9f760e11b815260040160405180910390fd5b600a80546001810182556000919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b0319166001600160a01b03861617905560095484901561109057610f3f3330600954846001600160a01b03166338d52e0f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2e91906121e9565b6001600160a01b03169291906115ee565b806001600160a01b03166338d52e0f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa191906121e9565b60095460405163095ea7b360e01b81526001600160a01b038481166004830152602482019290925291169063095ea7b3906044016020604051808303816000875af1158015610ff4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110189190611e60565b50600954604051636e553f6560e01b815260048101919091523360248201526001600160a01b03821690636e553f65906044016020604051808303816000875af115801561106a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108e9190612018565b505b600060088054806020026020016040519081016040528092919081815260200182805480156110e857602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116110ca575b5050505050905060005b815181101561119357826001600160a01b0316633f2617cb83838151811061111c5761111c612002565b60209081029190910101516040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260016024820152604401600060405180830381600087803b15801561116f57600080fd5b505af1158015611183573d6000803e3d6000fd5b5050600190920191506110f29050565b5050505050509392505050565b6000546001600160a01b031633146108fd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610cb7565b60608161120881601f612031565b10156112475760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401610cb7565b6112518284612031565b845110156112955760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401610cb7565b6060821580156112b457604051915060008252602082016040526112fe565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156112ed5780518352602092830192016112d5565b5050858452601f01601f1916604052505b50949350505050565b6000808260405160200161131b9190612206565b604051602081830303815290604052905060008160405160200161133f919061222c565b60405160208183030381529060405290508051602082016000f092506001600160a01b0383166113a55760405162461bcd60e51b81526020600482015260116024820152701111541313d65351539517d19052531151607a1b6044820152606401610cb7565b5050919050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60408051600481526024810182526020810180516001600160e01b03166395d89b4160e01b179052905160609160009182916001600160a01b0386169161144391906120f5565b600060405180830381855afa9150503d806000811461147e576040519150601f19603f3d011682016040523d82523d6000602084013e611483565b606091505b5091509150816114ae57604051806040016040528060038152602001623f3f3f60e81b815250610d84565b610d8481611600565b606060006114c48361178a565b600101905060008167ffffffffffffffff8111156114e4576114e4611b3a565b6040519080825280601f01601f19166020018201604052801561150e576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461151857509392505050565b606061156b826001611566816001600160a01b0384163b611fef565b611862565b92915050565b6060806040519050835180825260208201818101602087015b818310156115a257805183526020928301920161158a565b50855184518101855292509050808201602086015b818310156115cf5780518352602092830192016115b7565b508651929092011591909101601f01601f191660405250905092915050565b6115fa84848484611885565b50505050565b6060604082511061161f578180602001905181019061156b9190612260565b81516020036117665760005b60208160ff161080156116605750828160ff168151811061164e5761164e612002565b01602001516001600160f81b03191615155b15611677578061166f816122ce565b91505061162b565b60008160ff1667ffffffffffffffff81111561169557611695611b3a565b6040519080825280601f01601f1916602001820160405280156116bf576020820181803683370190505b509050600091505b60208260ff161080156116fc5750838260ff16815181106116ea576116ea612002565b01602001516001600160f81b03191615155b1561175f57838260ff168151811061171657611716612002565b602001015160f81c60f81b818360ff168151811061173657611736612002565b60200101906001600160f81b031916908160001a90535081611757816122ce565b9250506116c7565b9392505050565b50506040805180820190915260038152623f3f3f60e81b602082015290565b919050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106117c95772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106117f5576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061181357662386f26fc10000830492506010015b6305f5e100831061182b576305f5e100830492506008015b612710831061183f57612710830492506004015b60648310611851576064830492506002015b600a831061156b5760010192915050565b60408051603f8301601f19168101909152818152818360208301863c9392505050565b604080516001600160a01b038581166024830152848116604483015260648083018590528351808403909101815260849092018352602080830180516001600160e01b03166323b872dd60e01b17905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908401526115fa9287929160009161191d91851690849061199d565b905080516000148061193e57508080602001905181019061193e9190611e60565b6106de5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610cb7565b6060610d84848460008585600080866001600160a01b031685876040516119c491906120f5565b60006040518083038185875af1925050503d8060008114611a01576040519150601f19603f3d011682016040523d82523d6000602084013e611a06565b606091505b5091509150611a1787838387611a22565b979650505050505050565b60608315611a91578251600003611a8a576001600160a01b0385163b611a8a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610cb7565b5081610d84565b610d848383815115611aa65781518083602001fd5b8060405162461bcd60e51b8152600401610cb791906122ed565b828054828255906000526020600020908101928215611b15579160200282015b82811115611b1557825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611ae0565b50611b21929150611b25565b5090565b5b80821115611b215760008155600101611b26565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611b7957611b79611b3a565b604052919050565b600067ffffffffffffffff821115611b9b57611b9b611b3a565b50601f01601f191660200190565b600060208284031215611bbb57600080fd5b813567ffffffffffffffff811115611bd257600080fd5b8201601f81018413611be357600080fd5b8035611bf6611bf182611b81565b611b50565b818152856020838501011115611c0b57600080fd5b81602084016020830137600091810160200191909152949350505050565b60008060208385031215611c3c57600080fd5b823567ffffffffffffffff811115611c5357600080fd5b8301601f81018513611c6457600080fd5b803567ffffffffffffffff811115611c7b57600080fd5b856020828401011115611c8d57600080fd5b6020919091019590945092505050565b600060208284031215611caf57600080fd5b5035919050565b6001600160a01b0381168114610cc957600080fd5b600060208284031215611cdd57600080fd5b813567ffffffffffffffff811115611cf457600080fd5b8201601f81018413611d0557600080fd5b803567ffffffffffffffff811115611d1f57611d1f611b3a565b8060051b611d2f60208201611b50565b91825260208184018101929081019087841115611d4b57600080fd5b6020850194505b83851015611a175784359250611d6783611cb6565b82825260209485019490910190611d52565b602080825282518282018190526000918401906040840190835b81811015611dba5783516001600160a01b0316835260209384019390920191600101611d93565b509095945050505050565b600060208284031215611dd757600080fd5b813561175f81611cb6565b60005b83811015611dfd578181015183820152602001611de5565b50506000910152565b60008151808452611e1e816020860160208601611de2565b601f01601f19169290920160200192915050565b604081526000611e456040830185611e06565b8281036020840152611e578185611e06565b95945050505050565b600060208284031215611e7257600080fd5b8151801515811461175f57600080fd5b805167ffffffffffffffff8116811461178557600080fd5b6000806000806000806000806000806101408b8d031215611eba57600080fd5b8a51611ec581611cb6565b60208c0151909a50611ed681611cb6565b60408c0151909950611ee781611cb6565b60608c015190985063ffffffff81168114611f0157600080fd5b60808c0151909750611f1281611cb6565b9550611f2060a08c01611e82565b60c08c015160e08d01516101008e0151610120909e01519c9f9b9e50999c989b979a919990989097909650945092505050565b606081526000611f666060830186611e06565b8281036020840152611f788186611e06565b91505060ff83166040830152949350505050565b608081526000611f9f6080830187611e06565b8281036020840152611fb18187611e06565b90508281036040840152611fc58186611e06565b90508281036060840152611a178185611e06565b634e487b7160e01b600052601160045260246000fd5b8181038181111561156b5761156b611fd9565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561202a57600080fd5b5051919050565b8082018082111561156b5761156b611fd9565b7f506561706f647320496e7465726573742042656172696e67200000000000000081526000835161207c816019850160208801611de2565b6201016960ed1b601991840191820152835161209f81601c840160208801611de2565b01601c01949350505050565b61383360f11b8152600083516120c8816002850160208801611de2565b602d60f81b60029184019182015283516120e9816003840160208801611de2565b01600301949350505050565b60008251612107818460208701611de2565b9190910192915050565b60006020828403121561212357600080fd5b815160ff8116811461175f57600080fd5b6060815260006121476060830186611e06565b82810360208401526121598186611e06565b9050828103604084015261216d8185611e06565b9695505050505050565b60008351612189818460208801611de2565b83519083019061219d818360208801611de2565b01949350505050565b600084516121b8818460208901611de2565b8451908301906121cc818360208901611de2565b84519101906121df818360208801611de2565b0195945050505050565b6000602082840312156121fb57600080fd5b815161175f81611cb6565b600081526000825161221f816001850160208701611de2565b9190910160010192915050565b6a600b5981380380925939f360a81b8152815160009061225381600b850160208701611de2565b91909101600b0192915050565b60006020828403121561227257600080fd5b815167ffffffffffffffff81111561228957600080fd5b8201601f8101841361229a57600080fd5b80516122a8611bf182611b81565b8181528560208385010111156122bd57600080fd5b611e57826020830160208601611de2565b600060ff821660ff81036122e4576122e4611fd9565b60010192915050565b60208152600061175f6020830184611e0656fea264697066735822122005675e2d39fc8d210b0255db9fa9361f7ddc5d6d8d4efe5f24c9231f7263a57d64736f6c634300081c0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000021fe3e26e824783ca7e374355a8d30ae8bbf6e3700000000000000000000000021fe3e26e824783ca7e374355a8d30ae8bbf6e3700000000000000000000000021fe3e26e824783ca7e374355a8d30ae8bbf6e370000000000000000000000006fe0ee8ec229698145c2a580bee4b0cc64944420000000000000000000000000bb0364f0767f96cfda060c39550ab34518b5e380

-----Decoded View---------------
Arg [0] : _params (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000021fe3e26e824783ca7e374355a8d30ae8bbf6e37
Arg [1] : 00000000000000000000000021fe3e26e824783ca7e374355a8d30ae8bbf6e37
Arg [2] : 00000000000000000000000021fe3e26e824783ca7e374355a8d30ae8bbf6e37
Arg [3] : 0000000000000000000000006fe0ee8ec229698145c2a580bee4b0cc64944420
Arg [4] : 000000000000000000000000bb0364f0767f96cfda060c39550ab34518b5e380


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
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  ]
[ 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.