ETH Price: $2,325.99 (-1.50%)

Contract

0xC4e34AD5908c4D2508a26C20c8687Ff64CB9e05b
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer Ownersh...160729122022-11-29 3:18:111204 days ago1669691891IN
0xC4e34AD5...64CB9e05b
0 ETH0.00025598.95268254

Advanced mode:
Parent Transaction Hash Method Block
From
To
View All Internal Transactions
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FraxlendPairDeployer

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 100000 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: ISC
pragma solidity ^0.8.17;

// ====================================================================
// |     ______                   _______                             |
// |    / _____________ __  __   / ____(_____  ____ _____  ________   |
// |   / /_  / ___/ __ `| |/_/  / /_  / / __ \/ __ `/ __ \/ ___/ _ \  |
// |  / __/ / /  / /_/ _>  <   / __/ / / / / / /_/ / / / / /__/  __/  |
// | /_/   /_/   \__,_/_/|_|  /_/   /_/_/ /_/\__,_/_/ /_/\___/\___/   |
// |                                                                  |
// ====================================================================
// ====================== 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 "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@rari-capital/solmate/src/utils/SSTORE2.sol";
import "solidity-bytes-utils/contracts/BytesLib.sol";
import "./interfaces/IRateCalculator.sol";
import "./interfaces/IFraxlendWhitelist.sol";
import "./interfaces/IFraxlendPair.sol";
import "./interfaces/IFraxlendPairRegistry.sol";
import "./libraries/SafeERC20.sol";

// solhint-disable no-inline-assembly

/// @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 SafeERC20 for IERC20;
    using Strings for uint256;

    // Constants
    uint256 public DEFAULT_MAX_LTV = 75000; // 75% with 1e5 precision
    uint256 public GLOBAL_MAX_LTV = 1e8; // 1000x (100,000%) with 1e5 precision, protects from rounding errors in LTV calc
    uint256 public DEFAULT_LIQ_FEE = 10000; // 10% with 1e5 precision
    uint256 public DEFAULT_MAX_ORACLE_DELAY = 86400; // 1 hour

    address public contractAddress1;
    address public contractAddress2;

    // Admin contracts
    address public CIRCUIT_BREAKER_ADDRESS;
    address public COMPTROLLER_ADDRESS;
    address public TIME_LOCK_ADDRESS;
    address public FRAXLEND_PAIR_REGISTRY_ADDRESS;
    address public FRAXLEND_WHITELIST_ADDRESS;

    // Default swappers
    address[] public defaultSwappers;

    /// @notice Emits when a new pair is deployed
    /// @notice The ```LogDeploy``` event is emitted when a new Pair is deployed
    /// @param _name The name of the Pair
    /// @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 _oracleMultiply The address of the numerator price Oracle
    /// @param _oracleDivide The address of the denominator price Oracle
    /// @param _rateContract The address of the Rate Calculator contract
    /// @param _maxLTV The Maximum Loan-To-Value for a borrower to be considered solvent (1e5 precision)
    /// @param _liquidationFee The fee paid to liquidators given as a % of the repayment (1e5 precision)
    /// @param _maturityDate The maturityDate of the Pair
    event LogDeploy(
        string indexed _name,
        address _address,
        address indexed _asset,
        address indexed _collateral,
        address _oracleMultiply,
        address _oracleDivide,
        address _rateContract,
        uint256 _maxLTV,
        uint256 _liquidationFee,
        uint256 _maturityDate
    );

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

    constructor(
        address _circuitBreaker,
        address _comptroller,
        address _timelock,
        address _fraxlendWhitelist,
        address _fraxlendPairRegistry
    ) Ownable() {
        CIRCUIT_BREAKER_ADDRESS = _circuitBreaker;
        COMPTROLLER_ADDRESS = _comptroller;
        TIME_LOCK_ADDRESS = _timelock;
        FRAXLEND_WHITELIST_ADDRESS = _fraxlendWhitelist;
        FRAXLEND_PAIR_REGISTRY_ADDRESS = _fraxlendPairRegistry;
    }

    // ============================================================================================
    // 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;
    }

    // ============================================================================================
    // 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, 13000);
        contractAddress1 = SSTORE2.write(_firstHalf);
        if (_creationCode.length > 13000) {
            bytes memory _secondHalf = BytesLib.slice(_creationCode, 13000, _creationCode.length - 13000);
            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;
    }

    /// @notice The ```SetTimeLock``` event is emitted when the TIME_LOCK_ADDRESS is set
    /// @param _oldAddress The original address
    /// @param _newAddress The new address
    event SetTimeLock(address _oldAddress, address _newAddress);

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

    /// @notice The ```SetRegistry``` event is emitted when the FRAXLEND_PAIR_REGISTRY_ADDRESS is set
    /// @param _oldAddress The old address
    /// @param _newAddress The new address
    event SetRegistry(address _oldAddress, address _newAddress);

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

    /// @notice The ```SetComptroller``` event is emitted when the COMPTROLLER_ADDRESS is set
    /// @param _oldAddress The old address
    /// @param _newAddress The new address
    event SetComptroller(address _oldAddress, address _newAddress);

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

    /// @notice The ```SetWhitelist``` event is emitted when the FRAXLEND_WHITELIST_ADDRESS is set
    /// @param _oldAddress The old address
    /// @param _newAddress The new address
    event SetWhitelist(address _oldAddress, address _newAddress);

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

    /// @notice The ```SetCircuitBreaker``` event is emitted when the CIRCUIT_BREAKER_ADDRESS is set
    /// @param _oldAddress The old address
    /// @param _newAddress The new address
    event SetCircuitBreaker(address _oldAddress, address _newAddress);

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

    /// @notice The ```SetDefaultMaxLTV``` event is emitted when the DEFAULT_MAX_LTV is set
    /// @param _oldMaxLTV The old max LTV
    /// @param _newMaxLTV The new max LTV
    event SetDefaultMaxLTV(uint256 _oldMaxLTV, uint256 _newMaxLTV);

    /// @notice The ```setDefaultMaxLTV``` function sets the DEFAULT_MAX_LTV
    /// @param _newMaxLTV The new max LTV
    function setDefaultMaxLTV(uint256 _newMaxLTV) external onlyOwner {
        emit SetDefaultMaxLTV(DEFAULT_MAX_LTV, _newMaxLTV);
        DEFAULT_MAX_LTV = _newMaxLTV;
    }

    /// @notice The ```SetDefaultLiquidationFee``` event is emitted when the DEFAULT_LIQ_FEE is set
    /// @param _oldLiquidationFee The old liquidation fee
    /// @param _newLiquidationFee The new liquidation fee
    event SetDefaultLiquidationFee(uint256 _oldLiquidationFee, uint256 _newLiquidationFee);

    /// @notice The ```setDefaultLiquidationFee``` function sets the DEFAULT_LIQ_FEE
    /// @param _newLiquidationFee The new liquidation fee
    function setDefaultLiquidationFee(uint256 _newLiquidationFee) external onlyOwner {
        emit SetDefaultLiquidationFee(DEFAULT_LIQ_FEE, _newLiquidationFee);
        DEFAULT_LIQ_FEE = _newLiquidationFee;
    }

    /// @notice The ```SetDefaultMaxOracleDelay``` event is emitted when the DEFAULT_MAX_ORACLE_DELAY is set
    /// @param _oldMaxOracleDelay The old max oracle delay
    /// @param _newMaxOracleDelay The new max oracle delay
    event SetDefaultMaxOracleDelay(uint256 _oldMaxOracleDelay, uint256 _newMaxOracleDelay);

    /// @notice The ```setDefaultMaxOracleDelay``` function sets the DEFAULT_MAX_ORACLE_DELAY
    /// @param _newMaxOracleDelay The new max oracle delay
    function setDefaultMaxOracleDelay(uint256 _newMaxOracleDelay) external onlyOwner {
        emit SetDefaultMaxOracleDelay(DEFAULT_MAX_ORACLE_DELAY, _newMaxOracleDelay);
        DEFAULT_MAX_ORACLE_DELAY = _newMaxOracleDelay;
    }

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

    /// @notice The ```_deploy``` function is an internal function with deploys the pair
    /// @param _configData abi.encode(address _asset, address _collateral, address _oracleMultiply, address _oracleDivide, uint256 _oracleNormalization, address _rateContract, uint64 _fullUtilizationRate)
    /// @param _immutables abi.encode(address _circuitBreaker, address _comptrollerAddress, address _timeLockAddress, address _fraxlendWhitelistAddress)
    /// @param _customConfigData abi.encode(string _nameOfContract, string _symbolOfContract, uint8 _decimalsOfContract, uint256 _maxLTV, uint256 _liquidationFee, uint256 _maturityDate, uint256 _penaltyRate, address[] _approvedBorrowers, address[] _approvedLenders, uint256 _maxOracleDelay)
    /// @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);
        address[] memory _defaultSwappers = defaultSwappers;
        for (uint256 i = 0; i < _defaultSwappers.length; i++) {
            _fraxlendPair.setSwapper(_defaultSwappers[i], true);
        }

        // Transfer Ownership of FraxlendPair
        _fraxlendPair.transferOwnership(COMPTROLLER_ADDRESS);

        return _pairAddress;
    }

    /// @notice The ```_logDeploy``` function emits a LogDeploy event
    /// @param _name The name of the Pair
    /// @param _pairAddress The address of the Pair
    /// @param _configData abi.encode(address _asset, address _collateral, address _oracleMultiply, address _oracleDivide, uint256 _oracleNormalization, address _rateContract, uint64 _fullUtilizationRate)
    /// @param _maxLTV The Maximum Loan-To-Value for a borrower to be considered solvent (1e5 precision)
    /// @param _liquidationFee The fee paid to liquidators given as a % of the repayment (1e5 precision)
    /// @param _maturityDate The maturityDate of the Pair
    function _logDeploy(
        string memory _name,
        address _pairAddress,
        bytes memory _configData,
        uint256 _maxLTV,
        uint256 _liquidationFee,
        uint256 _maturityDate
    ) private {
        (
            address _asset,
            address _collateral,
            address _oracleMultiply,
            address _oracleDivide,
            ,
            address _rateContract,

        ) = abi.decode(_configData, (address, address, address, address, uint256, address, uint64));
        emit LogDeploy(
            _name,
            _pairAddress,
            _asset,
            _collateral,
            _oracleMultiply,
            _oracleDivide,
            _rateContract,
            _maxLTV,
            _liquidationFee,
            _maturityDate
        );
    }

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

    /// @notice The ```deployWithDefaults``` function allows the deployment of a FraxlendPair with default values
    /// @param _configData abi.encode(address _asset, address _collateral, address _oracleMultiply, address _oracleDivide, uint256 _oracleNormalization, address _rateContract, uint64 _fullUtilizationRate)
    /// @return _pairAddress The address to which the Pair was deployed
    function deployWithDefaults(bytes memory _configData) external returns (address _pairAddress) {
        if (!IFraxlendWhitelist(FRAXLEND_WHITELIST_ADDRESS).fraxlendDeployerWhitelist(msg.sender))
            revert WhitelistedDeployersOnly();

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

        uint256 _length = IFraxlendPairRegistry(FRAXLEND_PAIR_REGISTRY_ADDRESS).deployedPairsLength();
        string memory _name = string(
            abi.encodePacked(
                "Fraxlend Interest Bearing ",
                IERC20(_asset).safeSymbol(),
                " (",
                IERC20(_collateral).safeName(),
                ")",
                " - ",
                (_length + 1).toString()
            )
        );

        string memory _symbol = string(
            abi.encodePacked(
                "f",
                IERC20(_asset).safeSymbol(),
                "(",
                IERC20(_collateral).safeSymbol(),
                ")",
                "-",
                (_length + 1).toString()
            )
        );

        _pairAddress = _deploy(
            _configData,
            abi.encode(CIRCUIT_BREAKER_ADDRESS, COMPTROLLER_ADDRESS, TIME_LOCK_ADDRESS, FRAXLEND_WHITELIST_ADDRESS),
            abi.encode(
                _name,
                _symbol,
                IERC20(_asset).safeDecimals(),
                DEFAULT_MAX_LTV,
                DEFAULT_LIQ_FEE,
                0,
                0,
                new address[](0),
                new address[](0),
                DEFAULT_MAX_ORACLE_DELAY
            )
        );

        IFraxlendPairRegistry(FRAXLEND_PAIR_REGISTRY_ADDRESS).addPair(_pairAddress);

        _logDeploy(_name, _pairAddress, _configData, DEFAULT_MAX_LTV, DEFAULT_LIQ_FEE, 0);
    }

    /// @notice The ```deployCustom``` function allows whitelisted users to deploy custom Term Sheets for OTC debt structuring
    /// @dev Caller must be added to FraxLedWhitelist
    /// @param _configData abi.encode(address _asset, address _collateral, address _oracleMultiply, address _oracleDivide, uint256 _oracleNormalization, address _rateContract, uint64 _fullUtilizationRate)
    /// @param _customConfigData abi.encode(string _nameOfContract, string _symbolOfContract, uint8 _decimalsOfContract, uint256 _maxLTV, uint256 _liquidationFee, uint256 _maturityDate, uint256 _penaltyRate, address[] _approvedBorrowers, address[] _approvedLenders, uint256 _maxOracleDelay)
    /// @return _pairAddress The address to which the Pair was deployed
    function deployCustom(bytes memory _configData, bytes memory _customConfigData)
        external
        returns (address _pairAddress)
    {
        // Ensure caller has proper permissions
        if (!IFraxlendWhitelist(FRAXLEND_WHITELIST_ADDRESS).fraxlendDeployerWhitelist(msg.sender))
            revert WhitelistedDeployersOnly();

        // Decode custom config data
        (string memory _name, , , uint256 _maxLTV, uint256 _liquidationFee, uint256 _maturityDate, , , , ) = abi.decode(
            _customConfigData,
            (string, string, uint8, uint256, uint256, uint256, uint256, address[], address[], uint256)
        );

        // Checks on custom config data
        if (_maxLTV > GLOBAL_MAX_LTV) revert MaxLTVTooLarge();

        _pairAddress = _deploy(
            _configData,
            abi.encode(CIRCUIT_BREAKER_ADDRESS, COMPTROLLER_ADDRESS, TIME_LOCK_ADDRESS, FRAXLEND_WHITELIST_ADDRESS),
            _customConfigData
        );

        IFraxlendPairRegistry(FRAXLEND_PAIR_REGISTRY_ADDRESS).addPair(_pairAddress);

        _logDeploy(_name, _pairAddress, _configData, _maxLTV, _liquidationFee, _maturityDate);
    }

    // ============================================================================================
    // 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 != CIRCUIT_BREAKER_ADDRESS) 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 MaxLTVTooLarge();
    error Create2Failed();
}

// SPDX-License-Identifier: ISC
pragma solidity >=0.8.17;

interface IFraxlendWhitelist {
    function fraxlendDeployerWhitelist(address) external view returns (bool);

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

    function owner() external view returns (address);

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

    function renounceOwnership() external;

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

    function setOracleContractWhitelist(address[] calldata _addresses, bool _bool) external;

    function setRateContractWhitelist(address[] calldata _addresses, bool _bool) external;

    function transferOwnership(address newOwner) external;
}

// SPDX-License-Identifier: ISC
pragma solidity >=0.8.17;

interface IRateCalculator {
    function name() external pure returns (string memory);

    function requireValidInitData(bytes calldata _initData) external pure;

    function getConstants() external pure returns (bytes memory _calldata);

    function getNewRate(bytes calldata _data, bytes calldata _initData) external pure returns (uint64 _newRatePerSec);
}

File 4 of 16 : IFraxlendPair.sol
// SPDX-License-Identifier: ISC
pragma solidity >=0.8.17;

interface IFraxlendPair {
    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 TIME_LOCK_ADDRESS() external view returns (address);

    function addCollateral(uint256 _collateralAmount, address _borrower) external;

    function addInterest()
        external
        returns (uint256 _interestEarned, uint256 _feesAmount, uint256 _feesShare, uint64 _newRate);

    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,
        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);
}

// SPDX-License-Identifier: ISC
pragma solidity ^0.8.17;

interface IFraxlendPairRegistry {
    function addPair(address _pairAddress) external;

    function addSalt(address _pairAddress, bytes32 _salt) external;

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

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

    function deployedPairsBySalt(bytes32) external view returns (address);

    function deployedPairsLength() external view returns (uint256);

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

    function deployedSaltsLength() external view returns (uint256);

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

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

    function getAllPairSalts() external view returns (address[] memory _deployedSaltsArray);

    function owner() external view returns (address);

    function renounceOwnership() external;

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

    function transferOwnership(address newOwner) external;
}

// SPDX-License-Identifier: ISC
pragma solidity ^0.8.17;

import "@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);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_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) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @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] = _HEX_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);
    }
}

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

// SPDX-License-Identifier: Unlicense
/*
 * @title Solidity Bytes Arrays Utils
 * @author Gonçalo Sá <goncalo.sa@consensys.net>
 *
 * @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;
    }
}

// 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)
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing 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 12 of 16 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)

pragma solidity ^0.8.0;

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-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;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    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));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    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");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    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");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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
     * ====
     *
     * [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://diligence.consensys.net/posts/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.5.11/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 functionCall(target, data, "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");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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);
            }
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-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);
}

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

Settings
{
  "metadata": {
    "bytecodeHash": "none"
  },
  "optimizer": {
    "enabled": true,
    "runs": 100000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"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"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CircuitBreakerOnly","type":"error"},{"inputs":[],"name":"Create2Failed","type":"error"},{"inputs":[],"name":"MaxLTVTooLarge","type":"error"},{"inputs":[],"name":"WhitelistedDeployersOnly","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"_name","type":"string"},{"indexed":false,"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":"address","name":"_oracleMultiply","type":"address"},{"indexed":false,"internalType":"address","name":"_oracleDivide","type":"address"},{"indexed":false,"internalType":"address","name":"_rateContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"_maxLTV","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_liquidationFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_maturityDate","type":"uint256"}],"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":"uint256","name":"_oldLiquidationFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_newLiquidationFee","type":"uint256"}],"name":"SetDefaultLiquidationFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_oldMaxLTV","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_newMaxLTV","type":"uint256"}],"name":"SetDefaultMaxLTV","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_oldMaxOracleDelay","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_newMaxOracleDelay","type":"uint256"}],"name":"SetDefaultMaxOracleDelay","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":"CIRCUIT_BREAKER_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COMPTROLLER_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_LIQ_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_MAX_LTV","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_MAX_ORACLE_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FRAXLEND_PAIR_REGISTRY_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FRAXLEND_WHITELIST_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GLOBAL_MAX_LTV","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIME_LOCK_ADDRESS","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":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"defaultSwappers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_configData","type":"bytes"},{"internalType":"bytes","name":"_customConfigData","type":"bytes"}],"name":"deployCustom","outputs":[{"internalType":"address","name":"_pairAddress","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_configData","type":"bytes"}],"name":"deployWithDefaults","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":"getAllPairAddresses","outputs":[{"internalType":"address[]","name":"_deployedPairs","type":"address[]"}],"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":"_newLiquidationFee","type":"uint256"}],"name":"setDefaultLiquidationFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newMaxLTV","type":"uint256"}],"name":"setDefaultMaxLTV","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newMaxOracleDelay","type":"uint256"}],"name":"setDefaultMaxOracleDelay","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":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052620124f86001556305f5e100600255612710600355620151806004553480156200002d57600080fd5b5060405162002ff738038062002ff783398101604081905262000050916200012b565b6200005b33620000be565b600780546001600160a01b03199081166001600160a01b03978816179091556008805482169587169590951790945560098054851693861693909317909255600b80548416918516919091179055600a805490921692169190911790556200019b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200012657600080fd5b919050565b600080600080600060a086880312156200014457600080fd5b6200014f866200010e565b94506200015f602087016200010e565b93506200016f604087016200010e565b92506200017f606087016200010e565b91506200018f608087016200010e565b90509295509295909350565b612e4c80620001ab6000396000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c806382beee891161010f578063ad0c3bb5116100a2578063d5b9380a11610071578063d5b9380a14610435578063ef14900d14610448578063f2fde38b14610468578063fbaa8b851461047b57600080fd5b8063ad0c3bb5146103e6578063cff4c59a14610406578063d249a1ec14610419578063d3d695a31461042c57600080fd5b80638bad38dd116100de5780638bad38dd1461038f5780638da5cb5b146103a25780638eeff2e3146103c0578063a91ee0dc146103d357600080fd5b806382beee8914610343578063854cff2f14610356578063891682d2146103695780638926af071461037c57600080fd5b80634b77e25e116101875780636c191eee116101565780636c191eee146102e8578063715018a6146102fb5780637bc02806146103035780637ec9e1561461032357600080fd5b80634b77e25e146102a4578063607b6d16146102ad578063657a409c146102b557806369285727146102d557600080fd5b80632040825b116101c35780632040825b1461026057806331c315df14610269578063366831001461027c5780634793221d1461028457600080fd5b806306c75b6a146101ea5780630d4e693b146101ff5780631a56a9631461021b575b600080fd5b6101fd6101f8366004612287565b61049b565b005b61020860015481565b6040519081526020015b60405180910390f35b600a5461023b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610212565b61020860025481565b61023b6102773660046122f9565b6105e9565b600d54610208565b6102976102923660046123d6565b610620565b60405161021291906124c6565b61020860045481565b6102976107ba565b60095461023b9073ffffffffffffffffffffffffffffffffffffffff1681565b61023b6102e33660046122f9565b610829565b6101fd6102f63660046123d6565b610839565b6101fd610858565b60055461023b9073ffffffffffffffffffffffffffffffffffffffff1681565b60065461023b9073ffffffffffffffffffffffffffffffffffffffff1681565b6101fd6103513660046124d9565b61086c565b6101fd6103643660046124d9565b61090f565b6101fd6103773660046124d9565b6109b2565b6101fd61038a3660046122f9565b610a55565b6101fd61039d3660046124d9565b610a9e565b60005473ffffffffffffffffffffffffffffffffffffffff1661023b565b6101fd6103ce3660046122f9565b610b41565b6101fd6103e13660046124d9565b610b8a565b60075461023b9073ffffffffffffffffffffffffffffffffffffffff1681565b61023b61041436600461258d565b610c2d565b6101fd6104273660046122f9565b610e5c565b61020860035481565b61023b6104433660046125f1565b610ea5565b600b5461023b9073ffffffffffffffffffffffffffffffffffffffff1681565b6101fd6104763660046124d9565b611294565b60085461023b9073ffffffffffffffffffffffffffffffffffffffff1681565b6104a3611350565b60006104e883838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525092506132c891506113d19050565b90506104f38161154b565b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169190911790556132c88211156105e457600061059284848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506132c8925061058d915082905087612655565b6113d1565b905061059d8161154b565b600680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055505b505050565b600d81815481106105f957600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60075460609073ffffffffffffffffffffffffffffffffffffffff163314610674576040517fd8ebffc400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81516000908067ffffffffffffffff81111561069257610692612312565b6040519080825280602002602001820160405280156106bb578160200160208202803683370190505b50925060005b818110156107b2578481815181106106db576106db612668565b602002602001015192508273ffffffffffffffffffffffffffffffffffffffff16638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561072d57600080fd5b505af192505050801561073e575060015b156107aa5784818151811061075557610755612668565b602002602001015184828151811061076f5761076f612668565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b6001016106c1565b505050919050565b6060600d80548060200260200160405190810160405280929190818152602001828054801561081f57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116107f4575b5050505050905090565b600c81815481106105f957600080fd5b610841611350565b805161085490600c9060208401906121e8565b5050565b610860611350565b61086a6000611623565b565b610874611350565b6007546040805173ffffffffffffffffffffffffffffffffffffffff928316815291831660208301527f4cb8c9e37efb94c6cdbd2a80fe36cee1957b5584d1a1986fa2bae115180af59a910160405180910390a1600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610917611350565b600b546040805173ffffffffffffffffffffffffffffffffffffffff928316815291831660208301527fe8664b925e623f88e598288ed83ff0a0c9b17d50f56ec07db74f075ca4c1d57b910160405180910390a1600b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6109ba611350565b6009546040805173ffffffffffffffffffffffffffffffffffffffff928316815291831660208301527f582d6cc2f042c43e00e0dd5c187f575daac294216d2afa075d9e1e27b0a40a94910160405180910390a1600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610a5d611350565b60035460408051918252602082018390527f83c59ddc22715f292f4e05cba006e64bdfe60a72da813e8f76ebbee79d2fba86910160405180910390a1600355565b610aa6611350565b6008546040805173ffffffffffffffffffffffffffffffffffffffff928316815291831660208301527ff45d882a72fce9d8d7a7e2e196a338d4d9d4057510b4b9ddf91a7066104d2eaf910160405180910390a1600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610b49611350565b60015460408051918252602082018390527fa567e1ae300225465b686dab494f9f1535ca322eccbe1c80be0499209a6fdb89910160405180910390a1600155565b610b92611350565b600a546040805173ffffffffffffffffffffffffffffffffffffffff928316815291831660208301527fa6cdf06494ab3c79fae6cca5316f6324ff80979c2a51d8f239aee07a4aecd35b910160405180910390a1600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600b546040517fa3e982d800000000000000000000000000000000000000000000000000000000815233600482015260009173ffffffffffffffffffffffffffffffffffffffff169063a3e982d890602401602060405180830381865afa158015610c9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc09190612697565b610cf6576040517f93afd58900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060008085806020019051810190610d1091906127a2565b5050505095509550955050509350600254831115610d5a576040517fb0f7b0bf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600754600854600954600b546040805173ffffffffffffffffffffffffffffffffffffffff9586166020820152938516908401529083166060830152919091166080820152610dbd90889060a00160405160208183030381529060405288611698565b600a546040517fc2b7bbb600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff808416600483015292975091169063c2b7bbb690602401600060405180830381600087803b158015610e2c57600080fd5b505af1158015610e40573d6000803e3d6000fd5b50505050610e52848689868686611a22565b5050505092915050565b610e64611350565b60045460408051918252602082018390527fa2c3ed48b9529860394fe436f5a2fb7277d623773d57f7bde13866af0c5bca75910160405180910390a1600455565b600b546040517fa3e982d800000000000000000000000000000000000000000000000000000000815233600482015260009173ffffffffffffffffffffffffffffffffffffffff169063a3e982d890602401602060405180830381865afa158015610f14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f389190612697565b610f6e576040517f93afd58900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008083806020019051810190610f859190612892565b5050505050915091506000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663366831006040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ffd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110219190612931565b905060006110448473ffffffffffffffffffffffffffffffffffffffff16611b2a565b6110638473ffffffffffffffffffffffffffffffffffffffff16611c42565b61107661107185600161294a565b611cc4565b6040516020016110889392919061295d565b604051602081830303815290604052905060006110ba8573ffffffffffffffffffffffffffffffffffffffff16611b2a565b6110d98573ffffffffffffffffffffffffffffffffffffffff16611b2a565b6110e761107186600161294a565b6040516020016110f993929190612a44565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152828252600754600854600954600b5473ffffffffffffffffffffffffffffffffffffffff9384166020880152918316948601949094529281166060850152909116608083015291506111f090889060a00160405160208183030381529060405284846111a58a73ffffffffffffffffffffffffffffffffffffffff16611df9565b600154600354604080516000808252602082018181528284019093526004546111dc98979695949391928392909160608301612b74565b604051602081830303815290604052611698565b600a546040517fc2b7bbb600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff808416600483015292985091169063c2b7bbb690602401600060405180830381600087803b15801561125f57600080fd5b505af1158015611273573d6000803e3d6000fd5b5050505061128a8287896001546003546000611a22565b5050505050919050565b61129c611350565b73ffffffffffffffffffffffffffffffffffffffff8116611344576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61134d81611623565b50565b60005473ffffffffffffffffffffffffffffffffffffffff16331461086a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161133b565b6060816113df81601f61294a565b1015611447576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f77000000000000000000000000000000000000604482015260640161133b565b611451828461294a565b845110156114bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e6473000000000000000000000000000000604482015260640161133b565b6060821580156114da5760405191506000825260208201604052611542565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156115135780518352602092830192016114fb565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b6000808260405160200161155f9190612c05565b60405160208183030381529060405290506000816040516020016115839190612c2b565b60405160208183030381529060405290508051602082016000f0925073ffffffffffffffffffffffffffffffffffffffff831661161c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4445504c4f594d454e545f4641494c4544000000000000000000000000000000604482015260640161133b565b5050919050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60055460009081906116ea906116c39073ffffffffffffffffffffffffffffffffffffffff16611eec565b6006546116e59073ffffffffffffffffffffffffffffffffffffffff16611eec565b611f20565b905060008186868660405160200161170493929190612c70565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526117409291602001612cb3565b6040516020818303038152906040529050600086868660405160200161176893929190612ce2565b604051602081830303815290604052805190602001209050808251602084016000f5935073ffffffffffffffffffffffffffffffffffffffff84166117d9576040517f04a5b3ee00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600d805460018101825560009182527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8716179055600c805460408051602080840282018101909252828152889493909290918301828280156118ac57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311611881575b5050505050905060005b8151811015611990578273ffffffffffffffffffffffffffffffffffffffff16633f2617cb8383815181106118ed576118ed612668565b60209081029190910101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260016024820152604401600060405180830381600087803b15801561196557600080fd5b505af1158015611979573d6000803e3d6000fd5b50505050808061198890612d25565b9150506118b6565b506008546040517ff2fde38b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201529083169063f2fde38b90602401600060405180830381600087803b1580156119fe57600080fd5b505af1158015611a12573d6000803e3d6000fd5b5050505050505050509392505050565b600080600080600088806020019051810190611a3e9190612892565b5095505094509450945094508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff168c604051611a869190612d5d565b60405180910390207fb7f7e57b7bb3a5186ad1bd43405339ba361555344aec7a4be01968e88ee3883e8d8787878f8f8f604051611b15979695949392919073ffffffffffffffffffffffffffffffffffffffff978816815295871660208701529386166040860152919094166060840152608083019390935260a082019290925260c081019190915260e00190565b60405180910390a45050505050505050505050565b60408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f95d89b41000000000000000000000000000000000000000000000000000000001790529051606091600091829173ffffffffffffffffffffffffffffffffffffffff861691611bac9190612d5d565b600060405180830381855afa9150503d8060008114611be7576040519150601f19603f3d011682016040523d82523d6000602084013e611bec565b606091505b509150915081611c31576040518060400160405280600381526020017f3f3f3f0000000000000000000000000000000000000000000000000000000000815250611c3a565b611c3a81611fbb565b949350505050565b60408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f06fdde03000000000000000000000000000000000000000000000000000000001790529051606091600091829173ffffffffffffffffffffffffffffffffffffffff861691611bac9190612d5d565b606081600003611d0757505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115611d315780611d1b81612d25565b9150611d2a9050600a83612da8565b9150611d0b565b60008167ffffffffffffffff811115611d4c57611d4c612312565b6040519080825280601f01601f191660200182016040528015611d76576020820181803683370190505b5090505b8415611c3a57611d8b600183612655565b9150611d98600a86612dbc565b611da390603061294a565b60f81b818381518110611db857611db8612668565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611df2600a86612da8565b9450611d7a565b60408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f313ce5670000000000000000000000000000000000000000000000000000000017905290516000918291829173ffffffffffffffffffffffffffffffffffffffff861691611e7a9190612d5d565b600060405180830381855afa9150503d8060008114611eb5576040519150601f19603f3d011682016040523d82523d6000602084013e611eba565b606091505b5091509150818015611ecd575080516020145b611ed8576012611c3a565b80806020019051810190611c3a9190612dd0565b6060611f1a826001611f158173ffffffffffffffffffffffffffffffffffffffff84163b612655565b6121a7565b92915050565b6060806040519050835180825260208201818101602087015b81831015611f51578051835260209283019201611f39565b50855184518101855292509050808201602086015b81831015611f7e578051835260209283019201611f66565b508651929092011591909101601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660405250905092915050565b60606040825110611fda5781806020019051810190611f1a9190612deb565b81516020036121695760005b60208160ff161080156120335750828160ff168151811061200957612009612668565b01602001517fff000000000000000000000000000000000000000000000000000000000000001615155b1561204a578061204281612e20565b915050611fe6565b60008160ff1667ffffffffffffffff81111561206857612068612312565b6040519080825280601f01601f191660200182016040528015612092576020820181803683370190505b509050600091505b60208260ff161080156120e75750838260ff16815181106120bd576120bd612668565b01602001517fff000000000000000000000000000000000000000000000000000000000000001615155b1561216257838260ff168151811061210157612101612668565b602001015160f81c60f81b818360ff168151811061212157612121612668565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508161215a81612e20565b92505061209a565b9392505050565b505060408051808201909152600381527f3f3f3f0000000000000000000000000000000000000000000000000000000000602082015290565b919050565b60408051603f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168101909152818152818360208301863c9392505050565b828054828255906000526020600020908101928215612262579160200282015b8281111561226257825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190612208565b5061226e929150612272565b5090565b5b8082111561226e5760008155600101612273565b6000806020838503121561229a57600080fd5b823567ffffffffffffffff808211156122b257600080fd5b818501915085601f8301126122c657600080fd5b8135818111156122d557600080fd5b8660208285010111156122e757600080fd5b60209290920196919550909350505050565b60006020828403121561230b57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561238857612388612312565b604052919050565b600067ffffffffffffffff8211156123aa576123aa612312565b5060051b60200190565b73ffffffffffffffffffffffffffffffffffffffff8116811461134d57600080fd5b600060208083850312156123e957600080fd5b823567ffffffffffffffff81111561240057600080fd5b8301601f8101851361241157600080fd5b803561242461241f82612390565b612341565b81815260059190911b8201830190838101908783111561244357600080fd5b928401925b8284101561246a57833561245b816123b4565b82529284019290840190612448565b979650505050505050565b600081518084526020808501945080840160005b838110156124bb57815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101612489565b509495945050505050565b6020815260006121626020830184612475565b6000602082840312156124eb57600080fd5b8135612162816123b4565b600067ffffffffffffffff82111561251057612510612312565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f83011261254d57600080fd5b813561255b61241f826124f6565b81815284602083860101111561257057600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156125a057600080fd5b823567ffffffffffffffff808211156125b857600080fd5b6125c48683870161253c565b935060208501359150808211156125da57600080fd5b506125e78582860161253c565b9150509250929050565b60006020828403121561260357600080fd5b813567ffffffffffffffff81111561261a57600080fd5b611c3a8482850161253c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115611f1a57611f1a612626565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000602082840312156126a957600080fd5b8151801515811461216257600080fd5b60005b838110156126d45781810151838201526020016126bc565b50506000910152565b600082601f8301126126ee57600080fd5b81516126fc61241f826124f6565b81815284602083860101111561271157600080fd5b611c3a8260208301602087016126b9565b805160ff811681146121a257600080fd5b600082601f83011261274457600080fd5b8151602061275461241f83612390565b82815260059290921b8401810191818101908684111561277357600080fd5b8286015b8481101561279757805161278a816123b4565b8352918301918301612777565b509695505050505050565b6000806000806000806000806000806101408b8d0312156127c257600080fd5b8a5167ffffffffffffffff808211156127da57600080fd5b6127e68e838f016126dd565b9b5060208d01519150808211156127fc57600080fd5b6128088e838f016126dd565b9a5061281660408e01612722565b995060608d0151985060808d0151975060a08d0151965060c08d0151955060e08d015191508082111561284857600080fd5b6128548e838f01612733565b94506101008d015191508082111561286b57600080fd5b506128788d828e01612733565b9250506101208b015190509295989b9194979a5092959850565b600080600080600080600060e0888a0312156128ad57600080fd5b87516128b8816123b4565b60208901519097506128c9816123b4565b60408901519096506128da816123b4565b60608901519095506128eb816123b4565b608089015160a08a01519195509350612903816123b4565b60c089015190925067ffffffffffffffff8116811461292157600080fd5b8091505092959891949750929550565b60006020828403121561294357600080fd5b5051919050565b80820180821115611f1a57611f1a612626565b7f467261786c656e6420496e7465726573742042656172696e672000000000000081526000845161299581601a8501602089016126b9565b7f2028000000000000000000000000000000000000000000000000000000000000601a9184019182015284516129d281601c8401602089016126b9565b8082019150507f2900000000000000000000000000000000000000000000000000000000000000601c8201527f202d200000000000000000000000000000000000000000000000000000000000601d8201528351612a378160208401602088016126b9565b0160200195945050505050565b7f6600000000000000000000000000000000000000000000000000000000000000815260008451612a7c8160018501602089016126b9565b7f28000000000000000000000000000000000000000000000000000000000000006001918401918201528451612ab98160028401602089016126b9565b7f2900000000000000000000000000000000000000000000000000000000000000600292909101918201527f2d0000000000000000000000000000000000000000000000000000000000000060038201528351612b1d8160048401602088016126b9565b0160040195945050505050565b60008151808452612b428160208601602086016126b9565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000610140808352612b888184018e612b2a565b90508281036020840152612b9c818d612b2a565b905060ff8b16604084015289606084015288608084015260ff881660a084015260ff871660c084015282810360e0840152612bd78187612475565b9050828103610100840152612bec8186612475565b915050826101208301529b9a5050505050505050505050565b6000815260008251612c1e8160018501602087016126b9565b9190910160010192915050565b7f600b5981380380925939f3000000000000000000000000000000000000000000815260008251612c6381600b8501602087016126b9565b91909101600b0192915050565b606081526000612c836060830186612b2a565b8281036020840152612c958186612b2a565b90508281036040840152612ca98185612b2a565b9695505050505050565b60008351612cc58184602088016126b9565b835190830190612cd98183602088016126b9565b01949350505050565b60008451612cf48184602089016126b9565b845190830190612d088183602089016126b9565b8451910190612d1b8183602088016126b9565b0195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612d5657612d56612626565b5060010190565b60008251612d6f8184602087016126b9565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082612db757612db7612d79565b500490565b600082612dcb57612dcb612d79565b500690565b600060208284031215612de257600080fd5b61216282612722565b600060208284031215612dfd57600080fd5b815167ffffffffffffffff811115612e1457600080fd5b611c3a848285016126dd565b600060ff821660ff8103612e3657612e36612626565b6001019291505056fea164736f6c6343000811000a000000000000000000000000fd3065c629ee890fd74f43b802c2fea4b7279b8c000000000000000000000000168200cf227d4543302686124ac28ae0eaf2ca0b0000000000000000000000008412ebf45bac1b340bbe8f318b928c466c4e39ca000000000000000000000000118c1462aa28bf2ea304f78f49c3388cfd93234e000000000000000000000000d6e9d27c75afd88ad24cd5edccdc76fd2fc3a751

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101e55760003560e01c806382beee891161010f578063ad0c3bb5116100a2578063d5b9380a11610071578063d5b9380a14610435578063ef14900d14610448578063f2fde38b14610468578063fbaa8b851461047b57600080fd5b8063ad0c3bb5146103e6578063cff4c59a14610406578063d249a1ec14610419578063d3d695a31461042c57600080fd5b80638bad38dd116100de5780638bad38dd1461038f5780638da5cb5b146103a25780638eeff2e3146103c0578063a91ee0dc146103d357600080fd5b806382beee8914610343578063854cff2f14610356578063891682d2146103695780638926af071461037c57600080fd5b80634b77e25e116101875780636c191eee116101565780636c191eee146102e8578063715018a6146102fb5780637bc02806146103035780637ec9e1561461032357600080fd5b80634b77e25e146102a4578063607b6d16146102ad578063657a409c146102b557806369285727146102d557600080fd5b80632040825b116101c35780632040825b1461026057806331c315df14610269578063366831001461027c5780634793221d1461028457600080fd5b806306c75b6a146101ea5780630d4e693b146101ff5780631a56a9631461021b575b600080fd5b6101fd6101f8366004612287565b61049b565b005b61020860015481565b6040519081526020015b60405180910390f35b600a5461023b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610212565b61020860025481565b61023b6102773660046122f9565b6105e9565b600d54610208565b6102976102923660046123d6565b610620565b60405161021291906124c6565b61020860045481565b6102976107ba565b60095461023b9073ffffffffffffffffffffffffffffffffffffffff1681565b61023b6102e33660046122f9565b610829565b6101fd6102f63660046123d6565b610839565b6101fd610858565b60055461023b9073ffffffffffffffffffffffffffffffffffffffff1681565b60065461023b9073ffffffffffffffffffffffffffffffffffffffff1681565b6101fd6103513660046124d9565b61086c565b6101fd6103643660046124d9565b61090f565b6101fd6103773660046124d9565b6109b2565b6101fd61038a3660046122f9565b610a55565b6101fd61039d3660046124d9565b610a9e565b60005473ffffffffffffffffffffffffffffffffffffffff1661023b565b6101fd6103ce3660046122f9565b610b41565b6101fd6103e13660046124d9565b610b8a565b60075461023b9073ffffffffffffffffffffffffffffffffffffffff1681565b61023b61041436600461258d565b610c2d565b6101fd6104273660046122f9565b610e5c565b61020860035481565b61023b6104433660046125f1565b610ea5565b600b5461023b9073ffffffffffffffffffffffffffffffffffffffff1681565b6101fd6104763660046124d9565b611294565b60085461023b9073ffffffffffffffffffffffffffffffffffffffff1681565b6104a3611350565b60006104e883838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525092506132c891506113d19050565b90506104f38161154b565b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169190911790556132c88211156105e457600061059284848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506132c8925061058d915082905087612655565b6113d1565b905061059d8161154b565b600680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055505b505050565b600d81815481106105f957600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60075460609073ffffffffffffffffffffffffffffffffffffffff163314610674576040517fd8ebffc400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81516000908067ffffffffffffffff81111561069257610692612312565b6040519080825280602002602001820160405280156106bb578160200160208202803683370190505b50925060005b818110156107b2578481815181106106db576106db612668565b602002602001015192508273ffffffffffffffffffffffffffffffffffffffff16638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561072d57600080fd5b505af192505050801561073e575060015b156107aa5784818151811061075557610755612668565b602002602001015184828151811061076f5761076f612668565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b6001016106c1565b505050919050565b6060600d80548060200260200160405190810160405280929190818152602001828054801561081f57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116107f4575b5050505050905090565b600c81815481106105f957600080fd5b610841611350565b805161085490600c9060208401906121e8565b5050565b610860611350565b61086a6000611623565b565b610874611350565b6007546040805173ffffffffffffffffffffffffffffffffffffffff928316815291831660208301527f4cb8c9e37efb94c6cdbd2a80fe36cee1957b5584d1a1986fa2bae115180af59a910160405180910390a1600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610917611350565b600b546040805173ffffffffffffffffffffffffffffffffffffffff928316815291831660208301527fe8664b925e623f88e598288ed83ff0a0c9b17d50f56ec07db74f075ca4c1d57b910160405180910390a1600b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6109ba611350565b6009546040805173ffffffffffffffffffffffffffffffffffffffff928316815291831660208301527f582d6cc2f042c43e00e0dd5c187f575daac294216d2afa075d9e1e27b0a40a94910160405180910390a1600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610a5d611350565b60035460408051918252602082018390527f83c59ddc22715f292f4e05cba006e64bdfe60a72da813e8f76ebbee79d2fba86910160405180910390a1600355565b610aa6611350565b6008546040805173ffffffffffffffffffffffffffffffffffffffff928316815291831660208301527ff45d882a72fce9d8d7a7e2e196a338d4d9d4057510b4b9ddf91a7066104d2eaf910160405180910390a1600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610b49611350565b60015460408051918252602082018390527fa567e1ae300225465b686dab494f9f1535ca322eccbe1c80be0499209a6fdb89910160405180910390a1600155565b610b92611350565b600a546040805173ffffffffffffffffffffffffffffffffffffffff928316815291831660208301527fa6cdf06494ab3c79fae6cca5316f6324ff80979c2a51d8f239aee07a4aecd35b910160405180910390a1600a80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600b546040517fa3e982d800000000000000000000000000000000000000000000000000000000815233600482015260009173ffffffffffffffffffffffffffffffffffffffff169063a3e982d890602401602060405180830381865afa158015610c9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc09190612697565b610cf6576040517f93afd58900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060008085806020019051810190610d1091906127a2565b5050505095509550955050509350600254831115610d5a576040517fb0f7b0bf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600754600854600954600b546040805173ffffffffffffffffffffffffffffffffffffffff9586166020820152938516908401529083166060830152919091166080820152610dbd90889060a00160405160208183030381529060405288611698565b600a546040517fc2b7bbb600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff808416600483015292975091169063c2b7bbb690602401600060405180830381600087803b158015610e2c57600080fd5b505af1158015610e40573d6000803e3d6000fd5b50505050610e52848689868686611a22565b5050505092915050565b610e64611350565b60045460408051918252602082018390527fa2c3ed48b9529860394fe436f5a2fb7277d623773d57f7bde13866af0c5bca75910160405180910390a1600455565b600b546040517fa3e982d800000000000000000000000000000000000000000000000000000000815233600482015260009173ffffffffffffffffffffffffffffffffffffffff169063a3e982d890602401602060405180830381865afa158015610f14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f389190612697565b610f6e576040517f93afd58900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008083806020019051810190610f859190612892565b5050505050915091506000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663366831006040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ffd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110219190612931565b905060006110448473ffffffffffffffffffffffffffffffffffffffff16611b2a565b6110638473ffffffffffffffffffffffffffffffffffffffff16611c42565b61107661107185600161294a565b611cc4565b6040516020016110889392919061295d565b604051602081830303815290604052905060006110ba8573ffffffffffffffffffffffffffffffffffffffff16611b2a565b6110d98573ffffffffffffffffffffffffffffffffffffffff16611b2a565b6110e761107186600161294a565b6040516020016110f993929190612a44565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152828252600754600854600954600b5473ffffffffffffffffffffffffffffffffffffffff9384166020880152918316948601949094529281166060850152909116608083015291506111f090889060a00160405160208183030381529060405284846111a58a73ffffffffffffffffffffffffffffffffffffffff16611df9565b600154600354604080516000808252602082018181528284019093526004546111dc98979695949391928392909160608301612b74565b604051602081830303815290604052611698565b600a546040517fc2b7bbb600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff808416600483015292985091169063c2b7bbb690602401600060405180830381600087803b15801561125f57600080fd5b505af1158015611273573d6000803e3d6000fd5b5050505061128a8287896001546003546000611a22565b5050505050919050565b61129c611350565b73ffffffffffffffffffffffffffffffffffffffff8116611344576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61134d81611623565b50565b60005473ffffffffffffffffffffffffffffffffffffffff16331461086a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161133b565b6060816113df81601f61294a565b1015611447576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f77000000000000000000000000000000000000604482015260640161133b565b611451828461294a565b845110156114bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e6473000000000000000000000000000000604482015260640161133b565b6060821580156114da5760405191506000825260208201604052611542565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156115135780518352602092830192016114fb565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b6000808260405160200161155f9190612c05565b60405160208183030381529060405290506000816040516020016115839190612c2b565b60405160208183030381529060405290508051602082016000f0925073ffffffffffffffffffffffffffffffffffffffff831661161c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4445504c4f594d454e545f4641494c4544000000000000000000000000000000604482015260640161133b565b5050919050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60055460009081906116ea906116c39073ffffffffffffffffffffffffffffffffffffffff16611eec565b6006546116e59073ffffffffffffffffffffffffffffffffffffffff16611eec565b611f20565b905060008186868660405160200161170493929190612c70565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526117409291602001612cb3565b6040516020818303038152906040529050600086868660405160200161176893929190612ce2565b604051602081830303815290604052805190602001209050808251602084016000f5935073ffffffffffffffffffffffffffffffffffffffff84166117d9576040517f04a5b3ee00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600d805460018101825560009182527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8716179055600c805460408051602080840282018101909252828152889493909290918301828280156118ac57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311611881575b5050505050905060005b8151811015611990578273ffffffffffffffffffffffffffffffffffffffff16633f2617cb8383815181106118ed576118ed612668565b60209081029190910101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260016024820152604401600060405180830381600087803b15801561196557600080fd5b505af1158015611979573d6000803e3d6000fd5b50505050808061198890612d25565b9150506118b6565b506008546040517ff2fde38b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff91821660048201529083169063f2fde38b90602401600060405180830381600087803b1580156119fe57600080fd5b505af1158015611a12573d6000803e3d6000fd5b5050505050505050509392505050565b600080600080600088806020019051810190611a3e9190612892565b5095505094509450945094508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff168c604051611a869190612d5d565b60405180910390207fb7f7e57b7bb3a5186ad1bd43405339ba361555344aec7a4be01968e88ee3883e8d8787878f8f8f604051611b15979695949392919073ffffffffffffffffffffffffffffffffffffffff978816815295871660208701529386166040860152919094166060840152608083019390935260a082019290925260c081019190915260e00190565b60405180910390a45050505050505050505050565b60408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f95d89b41000000000000000000000000000000000000000000000000000000001790529051606091600091829173ffffffffffffffffffffffffffffffffffffffff861691611bac9190612d5d565b600060405180830381855afa9150503d8060008114611be7576040519150601f19603f3d011682016040523d82523d6000602084013e611bec565b606091505b509150915081611c31576040518060400160405280600381526020017f3f3f3f0000000000000000000000000000000000000000000000000000000000815250611c3a565b611c3a81611fbb565b949350505050565b60408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f06fdde03000000000000000000000000000000000000000000000000000000001790529051606091600091829173ffffffffffffffffffffffffffffffffffffffff861691611bac9190612d5d565b606081600003611d0757505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115611d315780611d1b81612d25565b9150611d2a9050600a83612da8565b9150611d0b565b60008167ffffffffffffffff811115611d4c57611d4c612312565b6040519080825280601f01601f191660200182016040528015611d76576020820181803683370190505b5090505b8415611c3a57611d8b600183612655565b9150611d98600a86612dbc565b611da390603061294a565b60f81b818381518110611db857611db8612668565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611df2600a86612da8565b9450611d7a565b60408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f313ce5670000000000000000000000000000000000000000000000000000000017905290516000918291829173ffffffffffffffffffffffffffffffffffffffff861691611e7a9190612d5d565b600060405180830381855afa9150503d8060008114611eb5576040519150601f19603f3d011682016040523d82523d6000602084013e611eba565b606091505b5091509150818015611ecd575080516020145b611ed8576012611c3a565b80806020019051810190611c3a9190612dd0565b6060611f1a826001611f158173ffffffffffffffffffffffffffffffffffffffff84163b612655565b6121a7565b92915050565b6060806040519050835180825260208201818101602087015b81831015611f51578051835260209283019201611f39565b50855184518101855292509050808201602086015b81831015611f7e578051835260209283019201611f66565b508651929092011591909101601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660405250905092915050565b60606040825110611fda5781806020019051810190611f1a9190612deb565b81516020036121695760005b60208160ff161080156120335750828160ff168151811061200957612009612668565b01602001517fff000000000000000000000000000000000000000000000000000000000000001615155b1561204a578061204281612e20565b915050611fe6565b60008160ff1667ffffffffffffffff81111561206857612068612312565b6040519080825280601f01601f191660200182016040528015612092576020820181803683370190505b509050600091505b60208260ff161080156120e75750838260ff16815181106120bd576120bd612668565b01602001517fff000000000000000000000000000000000000000000000000000000000000001615155b1561216257838260ff168151811061210157612101612668565b602001015160f81c60f81b818360ff168151811061212157612121612668565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508161215a81612e20565b92505061209a565b9392505050565b505060408051808201909152600381527f3f3f3f0000000000000000000000000000000000000000000000000000000000602082015290565b919050565b60408051603f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168101909152818152818360208301863c9392505050565b828054828255906000526020600020908101928215612262579160200282015b8281111561226257825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909116178255602090920191600190910190612208565b5061226e929150612272565b5090565b5b8082111561226e5760008155600101612273565b6000806020838503121561229a57600080fd5b823567ffffffffffffffff808211156122b257600080fd5b818501915085601f8301126122c657600080fd5b8135818111156122d557600080fd5b8660208285010111156122e757600080fd5b60209290920196919550909350505050565b60006020828403121561230b57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561238857612388612312565b604052919050565b600067ffffffffffffffff8211156123aa576123aa612312565b5060051b60200190565b73ffffffffffffffffffffffffffffffffffffffff8116811461134d57600080fd5b600060208083850312156123e957600080fd5b823567ffffffffffffffff81111561240057600080fd5b8301601f8101851361241157600080fd5b803561242461241f82612390565b612341565b81815260059190911b8201830190838101908783111561244357600080fd5b928401925b8284101561246a57833561245b816123b4565b82529284019290840190612448565b979650505050505050565b600081518084526020808501945080840160005b838110156124bb57815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101612489565b509495945050505050565b6020815260006121626020830184612475565b6000602082840312156124eb57600080fd5b8135612162816123b4565b600067ffffffffffffffff82111561251057612510612312565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f83011261254d57600080fd5b813561255b61241f826124f6565b81815284602083860101111561257057600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156125a057600080fd5b823567ffffffffffffffff808211156125b857600080fd5b6125c48683870161253c565b935060208501359150808211156125da57600080fd5b506125e78582860161253c565b9150509250929050565b60006020828403121561260357600080fd5b813567ffffffffffffffff81111561261a57600080fd5b611c3a8482850161253c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115611f1a57611f1a612626565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000602082840312156126a957600080fd5b8151801515811461216257600080fd5b60005b838110156126d45781810151838201526020016126bc565b50506000910152565b600082601f8301126126ee57600080fd5b81516126fc61241f826124f6565b81815284602083860101111561271157600080fd5b611c3a8260208301602087016126b9565b805160ff811681146121a257600080fd5b600082601f83011261274457600080fd5b8151602061275461241f83612390565b82815260059290921b8401810191818101908684111561277357600080fd5b8286015b8481101561279757805161278a816123b4565b8352918301918301612777565b509695505050505050565b6000806000806000806000806000806101408b8d0312156127c257600080fd5b8a5167ffffffffffffffff808211156127da57600080fd5b6127e68e838f016126dd565b9b5060208d01519150808211156127fc57600080fd5b6128088e838f016126dd565b9a5061281660408e01612722565b995060608d0151985060808d0151975060a08d0151965060c08d0151955060e08d015191508082111561284857600080fd5b6128548e838f01612733565b94506101008d015191508082111561286b57600080fd5b506128788d828e01612733565b9250506101208b015190509295989b9194979a5092959850565b600080600080600080600060e0888a0312156128ad57600080fd5b87516128b8816123b4565b60208901519097506128c9816123b4565b60408901519096506128da816123b4565b60608901519095506128eb816123b4565b608089015160a08a01519195509350612903816123b4565b60c089015190925067ffffffffffffffff8116811461292157600080fd5b8091505092959891949750929550565b60006020828403121561294357600080fd5b5051919050565b80820180821115611f1a57611f1a612626565b7f467261786c656e6420496e7465726573742042656172696e672000000000000081526000845161299581601a8501602089016126b9565b7f2028000000000000000000000000000000000000000000000000000000000000601a9184019182015284516129d281601c8401602089016126b9565b8082019150507f2900000000000000000000000000000000000000000000000000000000000000601c8201527f202d200000000000000000000000000000000000000000000000000000000000601d8201528351612a378160208401602088016126b9565b0160200195945050505050565b7f6600000000000000000000000000000000000000000000000000000000000000815260008451612a7c8160018501602089016126b9565b7f28000000000000000000000000000000000000000000000000000000000000006001918401918201528451612ab98160028401602089016126b9565b7f2900000000000000000000000000000000000000000000000000000000000000600292909101918201527f2d0000000000000000000000000000000000000000000000000000000000000060038201528351612b1d8160048401602088016126b9565b0160040195945050505050565b60008151808452612b428160208601602086016126b9565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000610140808352612b888184018e612b2a565b90508281036020840152612b9c818d612b2a565b905060ff8b16604084015289606084015288608084015260ff881660a084015260ff871660c084015282810360e0840152612bd78187612475565b9050828103610100840152612bec8186612475565b915050826101208301529b9a5050505050505050505050565b6000815260008251612c1e8160018501602087016126b9565b9190910160010192915050565b7f600b5981380380925939f3000000000000000000000000000000000000000000815260008251612c6381600b8501602087016126b9565b91909101600b0192915050565b606081526000612c836060830186612b2a565b8281036020840152612c958186612b2a565b90508281036040840152612ca98185612b2a565b9695505050505050565b60008351612cc58184602088016126b9565b835190830190612cd98183602088016126b9565b01949350505050565b60008451612cf48184602089016126b9565b845190830190612d088183602089016126b9565b8451910190612d1b8183602088016126b9565b0195945050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612d5657612d56612626565b5060010190565b60008251612d6f8184602087016126b9565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082612db757612db7612d79565b500490565b600082612dcb57612dcb612d79565b500690565b600060208284031215612de257600080fd5b61216282612722565b600060208284031215612dfd57600080fd5b815167ffffffffffffffff811115612e1457600080fd5b611c3a848285016126dd565b600060ff821660ff8103612e3657612e36612626565b6001019291505056fea164736f6c6343000811000a

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

000000000000000000000000fd3065c629ee890fd74f43b802c2fea4b7279b8c000000000000000000000000168200cf227d4543302686124ac28ae0eaf2ca0b0000000000000000000000008412ebf45bac1b340bbe8f318b928c466c4e39ca000000000000000000000000118c1462aa28bf2ea304f78f49c3388cfd93234e000000000000000000000000d6e9d27c75afd88ad24cd5edccdc76fd2fc3a751

-----Decoded View---------------
Arg [0] : _circuitBreaker (address): 0xfd3065C629ee890Fd74F43b802c2fea4B7279B8c
Arg [1] : _comptroller (address): 0x168200cF227D4543302686124ac28aE0eaf2cA0B
Arg [2] : _timelock (address): 0x8412ebf45bAC1B340BbE8F318b928C466c4E39CA
Arg [3] : _fraxlendWhitelist (address): 0x118C1462AA28bF2ea304f78f49C3388cfd93234e
Arg [4] : _fraxlendPairRegistry (address): 0xD6E9D27C75Afd88ad24Cd5EdccdC76fd2fc3A751

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000fd3065c629ee890fd74f43b802c2fea4b7279b8c
Arg [1] : 000000000000000000000000168200cf227d4543302686124ac28ae0eaf2ca0b
Arg [2] : 0000000000000000000000008412ebf45bac1b340bbe8f318b928c466c4e39ca
Arg [3] : 000000000000000000000000118c1462aa28bf2ea304f78f49c3388cfd93234e
Arg [4] : 000000000000000000000000d6e9d27c75afd88ad24cd5edccdc76fd2fc3a751


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.