Contract 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c8 2

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x07abc07fc1f400f8953979ab65fe51cc8894280eac847500e8bf37d232b4c9bfInitialize45203452022-01-10 4:14:33323 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH0.001639096649 ETH
0x7e077ec1acd24fa7c543c488a46708fe9b6a627cb83bdf27d79e40dcfb71c8e20x60a0604024412782021-10-22 6:25:35403 days 15 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  Create: Handle0 ETH0.090236985279 ETH
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x869343793de94f4c192909e8115e9d3848ebdf54c6e5cb0641da0e0cfe14480d422170192022-11-29 17:21:464 hrs 22 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0x869343793de94f4c192909e8115e9d3848ebdf54c6e5cb0641da0e0cfe14480d422170192022-11-29 17:21:464 hrs 22 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0xcbbd7447218145b473e2c89d131815560e7745c590adfac21710df59a36bdf20422105052022-11-29 16:51:454 hrs 52 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0xcbbd7447218145b473e2c89d131815560e7745c590adfac21710df59a36bdf20422105052022-11-29 16:51:454 hrs 52 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0xfdbccf95ea3431d9e10790295d800a02e13aa464eb9d1c0150b5c1e48639723d422093302022-11-29 16:46:164 hrs 57 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0xfdbccf95ea3431d9e10790295d800a02e13aa464eb9d1c0150b5c1e48639723d422093302022-11-29 16:46:164 hrs 57 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0xfdbccf95ea3431d9e10790295d800a02e13aa464eb9d1c0150b5c1e48639723d422093302022-11-29 16:46:164 hrs 57 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0xfdbccf95ea3431d9e10790295d800a02e13aa464eb9d1c0150b5c1e48639723d422093302022-11-29 16:46:164 hrs 57 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0x355ebd26fc62f8741ca166973e648b2f42fde563feaa259c52608861097ce0f1422091022022-11-29 16:45:094 hrs 58 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0x355ebd26fc62f8741ca166973e648b2f42fde563feaa259c52608861097ce0f1422091022022-11-29 16:45:094 hrs 58 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0x460a31f13baffb6b6a39aa96e361dd7e085d7c2aca8be096ce6f2a7dea27d036421822812022-11-29 14:45:156 hrs 58 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0x460a31f13baffb6b6a39aa96e361dd7e085d7c2aca8be096ce6f2a7dea27d036421822812022-11-29 14:45:156 hrs 58 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0x0504ddb198d67aa2489e2817466d82a3e0ead4f9750d2bcb571e2928287df43f421792112022-11-29 14:31:577 hrs 12 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0x0504ddb198d67aa2489e2817466d82a3e0ead4f9750d2bcb571e2928287df43f421792112022-11-29 14:31:577 hrs 12 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0x606df24ee655d5c9c2b6e7a08098f96ebd10786237f8a73521527bd60416baef421772672022-11-29 14:23:237 hrs 20 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0x606df24ee655d5c9c2b6e7a08098f96ebd10786237f8a73521527bd60416baef421772672022-11-29 14:23:237 hrs 20 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0xd5b798a0a3a241abdfef0a59f97f28cf703ce21dfc53c46c252d906e91ba6763421770572022-11-29 14:22:267 hrs 21 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0xd5b798a0a3a241abdfef0a59f97f28cf703ce21dfc53c46c252d906e91ba6763421770572022-11-29 14:22:267 hrs 21 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0xd5b798a0a3a241abdfef0a59f97f28cf703ce21dfc53c46c252d906e91ba6763421770572022-11-29 14:22:267 hrs 21 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0xd5b798a0a3a241abdfef0a59f97f28cf703ce21dfc53c46c252d906e91ba6763421770572022-11-29 14:22:267 hrs 21 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0xa84e612d19f1b75872eccb05a6ee180a3b7760d6724d3fe9e6dbdc21cdf4fa7c421590422022-11-29 13:02:498 hrs 41 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0xa84e612d19f1b75872eccb05a6ee180a3b7760d6724d3fe9e6dbdc21cdf4fa7c421590422022-11-29 13:02:498 hrs 41 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0xea4be49d4061d6a5e8ab797c3205372f9719f7f28fee194b0abbd4666fb5b0c7421186992022-11-29 9:54:1611 hrs 49 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0xea4be49d4061d6a5e8ab797c3205372f9719f7f28fee194b0abbd4666fb5b0c7421186992022-11-29 9:54:1611 hrs 49 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
0x19c5dc2c08097f5a7f8f0d25e719798e7a666a097853036d81a7e0aae0d0c563421185632022-11-29 9:53:3311 hrs 50 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0xbd3a27ffcbcaa855ba41e5932378a22e96ed12c80 ETH
[ Download CSV Export 
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
Handle

Compiler Version
v0.8.3+commit.8d00100c

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 24 : Handle.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
pragma abicoder v2;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "../interfaces/Bank/IHandle.sol";
import "../interfaces/Bank/ITreasury.sol";
import "../interfaces/IValidator.sol";
import "../interfaces/Bank/IVaultLibrary.sol";
import "../interfaces/Bank/IComptroller.sol";
import "../interfaces/Bank/IOracle.sol";
import "../interfaces/Bank/IInterest.sol";
import "../interfaces/Bank/IfxToken.sol";
import "./Roles.sol";

/*                                                *\
 *                ,.-"""-.,                       *
 *               /   ===   \                      *
 *              /  =======  \                     *
 *           __|  (o)   (0)  |__                  *
 *          / _|    .---.    |_ \                 *
 *         | /.----/ O O \----.\ |                *
 *          \/     |     |     \/                 *
 *          |                   |                 *
 *          |                   |                 *
 *          |                   |                 *
 *          _\   -.,_____,.-   /_                 *
 *      ,.-"  "-.,_________,.-"  "-.,             *
 *     /          |       |  ╭-╮     \            *
 *    |           l.     .l  ┃ ┃      |           *
 *    |            |     |   ┃ ╰━━╮   |           *
 *    l.           |     |   ┃ ╭╮ ┃  .l           *
 *     |           l.   .l   ┃ ┃┃ ┃  | \,         *
 *     l.           |   |    ╰-╯╰-╯ .l   \,       *
 *      |           |   |           |      \,     *
 *      l.          |   |          .l        |    *
 *       |          |   |          |         |    *
 *       |          |---|          |         |    *
 *       |          |   |          |         |    *
 *       /"-.,__,.-"\   /"-.,__,.-"\"-.,_,.-"\    *
 *      |            \ /            |         |   *
 *      |             |             |         |   *
 *       \__|__|__|__/ \__|__|__|__/ \_|__|__/    *
\*                                                 */

/**
 * @dev Stores the main protocol data and configurations.
        Holds a reference to all protocol contracts.
 */
contract Handle is IHandle, Initializable, UUPSUpgradeable, IValidator, Roles {
    using SafeMath for uint256;

    /** @dev Configured collateral tokens.
             Not necessarily currently valid for deposit. */
    address[] private collateralTokens;
    /** @dev Configured collateral tokens that may be currently deposit. */
    mapping(address => bool) public override isCollateralValid;
    /** @dev Configured collateral data */
    mapping(address => CollateralData) private collateralDetails;
    /** @dev Total collateral balance held by the Treasury.
             mapping(token => collateral balance) */
    mapping(address => uint256) public totalBalances;

    /** @dev Configured and valid fxToken array */
    address[] private validFxTokens;
    /** @dev Valid fxToken mapping */
    mapping(address => bool) public override isFxTokenValid;

    /** @dev mapping(user => mapping(fxToken => vault data)) */
    mapping(address => mapping(address => Vault)) public vaults;

    /** @dev Ratio of maximum Treasury collateral that can be managed by
             the PCT at a given time. */
    uint256 public override pctCollateralUpperBound;
    // Per mille fee settings
    /** @dev Mint fee as a per mille value, or a percentage with 1 decimal. */
    uint256 public override mintFeePerMille;
    /** @dev Burn fee as a per mille value, or a percentage with 1 decimal. */
    uint256 public override burnFeePerMille;
    /** @dev Withdraw fee as a per mille value, or a percentage with 1 decimal. */
    uint256 public override withdrawFeePerMille;
    /** @dev Deposit fee as a per mille value, or a percentage with 1 decimal. */
    uint256 public override depositFeePerMille;

    /** @dev Address sending for protocol fees */
    address public override FeeRecipient;
    /** @dev Canonical Wrapped Ether address */
    address public override WETH;
    /** @dev mapping(token => oracle aggregator) */
    mapping(address => address) public oracles;

    /** @dev Whether all the relevant functions in all protocol contracts
             are currently paused (disabled) for security reasons. */
    bool public override isPaused;

    /** @dev Address for the Treasury contract */
    address payable public override treasury;
    /** @dev Address for the Comptroller contract */
    address public override comptroller;
    /** @dev Address for the VaultLibrary contract */
    address public override vaultLibrary;
    /** @dev Address for the FxKeeperPool contract */
    address public override fxKeeperPool;
    /** @dev Address for the PCT contract */
    address public override pct;
    /** @dev Address for the Liquidator contract */
    address public override liquidator;
    /** @dev Address for the Interest contract */
    address public override interest;
    /** @dev Address for the Referral contract */
    address public override referral;
    /** @dev Address for the Forex contract */
    address public override forex;
    /** @dev Address for the Rewards contract */
    address public override rewards;

    modifier notPaused() {
        require(!isPaused, "Paused");
        _;
    }

    /** @dev Proxy initialisation function */
    function initialize(address weth) public initializer {
        __AccessControl_init();
        _setupRole(ADMIN_ROLE, msg.sender);
        _setRoleAdmin(ADMIN_ROLE, ADMIN_ROLE);
        _setRoleAdmin(OPERATOR_ROLE, ADMIN_ROLE);
        WETH = weth;
    }

    /** @dev Setter for pctCollateralUpperBound */
    function setCollateralUpperBoundPCT(uint256 ratio)
        external
        override
        onlyAdmin
    {
        pctCollateralUpperBound = ratio;
    }

    /** @dev Setter for isPaused */
    function setPaused(bool value) external override onlyAdmin {
        isPaused = value;
    }

    /** @dev Configure an ERC20 as a valid fxToken */
    function setFxToken(address token) public override onlyAdmin {
        require(token != address(0), "Invalid token address");
        if (isFxTokenValid[token] == true) return;
        validFxTokens.push(token);
        isFxTokenValid[token] = true;
        emit ConfigureFxToken(token, false);
    }

    /** @dev Invalidate an existing fxToken and remove it from the protocol */
    function removeFxToken(address token) external override onlyAdmin {
        uint256 tokenIndex = validFxTokens.length;
        for (uint256 i = 0; i < tokenIndex; i++) {
            if (validFxTokens[i] == token) {
                tokenIndex = i;
                break;
            }
        }
        // Assert that token was found.
        assert(tokenIndex < validFxTokens.length);
        delete isFxTokenValid[token];
        if (tokenIndex < validFxTokens.length - 1) {
            // Replace to-be-deleted item with last element and then pop array.
            validFxTokens[tokenIndex] = validFxTokens[validFxTokens.length - 1];
            validFxTokens.pop();
        } else {
            // Token index is last element, so no need to pop array.
            validFxTokens.pop();
        }
        emit ConfigureFxToken(token, true);
    }

    /** @dev Configure an ERC20 as a valid collateral token */
    function setCollateralToken(
        address token,
        uint256 mintCR,
        uint256 liquidationFee,
        uint256 interestRatePerMille
    ) external override onlyOperatorOrAdmin {
        require(mintCR >= 110, "CR");
        CollateralData storage collateral = collateralDetails[token];
        // Only push new collateral token if it does not exist.
        if (collateral.mintCR == 0) collateralTokens.push(token);
        // Re-enable collateral as valid if 1st time or if it was removed.
        if (!isCollateralValid[token]) isCollateralValid[token] = true;
        // Charge interest to write R value for current interest rate.
        IInterest(interest).charge();
        collateral.mintCR = mintCR;
        collateral.liquidationFee = liquidationFee;
        collateral.interestRate = interestRatePerMille;
        emit ConfigureCollateralToken(token);
    }

    /** @dev Invalidate an existing collateral token for new deposits.
             The token will still be valid for existing deposits. */
    function removeCollateralToken(address token) external override onlyAdmin {
        // Cannot remove a token, as this would orphan user collateral. Mark it invalid instead.
        delete isCollateralValid[token];
        emit ConfigureCollateralToken(token);
    }

    /**
     * @dev Update all Handle contract components
     * @param components an array with the address of the components, where:
              index 0: treasury
              index 1: comptroller
              index 2: vaultLibrary
              index 3: fxKeeperPool
              index 4: pct
              index 5: liquidator
              index 6: interest
              index 7: referral
              index 8: forex
              index 9: rewards
     */
    function setComponents(address[] memory components)
        external
        override
        onlyAdmin
    {
        uint256 l = components.length;
        for (uint256 i = 0; i < l; i++) {
            require(components[i] != address(0), "Invalid address");
        }
        treasury = payable(components[0]);
        comptroller = components[1];
        vaultLibrary = components[2];
        fxKeeperPool = components[3];
        pct = components[4];
        liquidator = components[5];
        interest = components[6];
        referral = components[7];
        forex = components[8];
        rewards = components[9];
        for (uint256 i = 0; i < 9; i++) {
            /*
             * Grant operator roles if needed.
             * Skip:
             * - VaultLibrary
             * - fxKeeperPool
             * - referral
             * - forex
             * - rewards (i never reaches 9).
             */
            if (i == 2 || i == 3 || i == 8) continue;
            // Role is only granted if not yet assigned.
            grantRole(OPERATOR_ROLE, components[i]);
        }
    }

    /** @dev Getter for collateralTokens */
    function getAllCollateralTypes()
        public
        view
        override
        returns (address[] memory collateral)
    {
        collateral = collateralTokens;
    }

    /** @dev Getter for collateralDetails */
    function getCollateralDetails(address collateral)
        external
        view
        override
        returns (CollateralData memory)
    {
        return collateralDetails[collateral];
    }

    /**
     * @dev Updates a vault's debt position.
            Can only be called by the comptroller
     * @param account The vault account
     * @param fxToken The vault fxToken
     * @param increase Whether to increase or decrease the position
     */
    function updateDebtPosition(
        address account,
        uint256 amount,
        address fxToken,
        bool increase
    ) external override onlyOperator notPaused {
        // Charge interest.
        IInterest(interest).charge();
        // Compound debt by getting current principal + interest.
        uint256 debt = getDebt(account, fxToken);
        uint256 interest =
            IVaultLibrary(vaultLibrary).calculateInterest(account, fxToken);
        // Mint interest fxTokens for fee recipient.
        if (interest > 0) IfxToken(fxToken).mint(FeeRecipient, interest);
        // Reset R0 value.
        resetVaultR0(account, fxToken);
        // Increase/decrease vault debt.
        vaults[account][fxToken].debt = increase
            ? debt.add(amount)
            : debt.sub(amount);
        emit UpdateDebt(account, fxToken);
    }

    /**
     * @dev Updates a vault's collateral balance.
     * @param account The vault account
     * @param fxToken The vault fxToken
     * @param collateralToken The vault collateral token
     * @param increase Whether to increase or decrease the balance
     */
    function updateCollateralBalance(
        address account,
        uint256 amount,
        address fxToken,
        address collateralToken,
        bool increase
    ) external override onlyOperator notPaused {
        uint256 currentAccountBalance =
            vaults[account][fxToken].collateralBalance[collateralToken];

        vaults[account][fxToken].collateralBalance[collateralToken] = increase
            ? currentAccountBalance.add(amount)
            : currentAccountBalance.sub(amount);

        totalBalances[collateralToken] = increase
            ? totalBalances[collateralToken].add(amount)
            : totalBalances[collateralToken].sub(amount);

        emit UpdateCollateral(account, fxToken, collateralToken);
    }

    /** @dev Setter for FeeRecipient */
    function setFeeRecipient(address feeRecipient)
        external
        override
        onlyAdmin
        validAddress(feeRecipient)
    {
        FeeRecipient = feeRecipient;
    }

    /** @dev Setter for all protocol transaction fees */
    function setFees(
        uint256 _withdrawFeePerMille,
        uint256 _depositFeePerMille,
        uint256 _mintFeePerMille,
        uint256 _burnFeePerMille
    ) external override onlyAdmin {
        withdrawFeePerMille = _withdrawFeePerMille;
        depositFeePerMille = _depositFeePerMille;
        burnFeePerMille = _burnFeePerMille;
        mintFeePerMille = _mintFeePerMille;
    }

    /**
     * @dev Getter for an user's collateral balance for a given collateral type
     * @param account The user's address
     * @param fxToken The vault to check
     * @param collateralType The collateral token address
     * @return balance
     */
    function getCollateralBalance(
        address account,
        address collateralType,
        address fxToken
    ) external view override returns (uint256 balance) {
        balance = vaults[account][fxToken].collateralBalance[collateralType];
    }

    /**
     * @dev Getter for all collateral types deposited into a vault.
     * @param account The vault account
     * @param fxToken The vault fxToken
     * @return collateral Each collateral type deposited
     * @return balances Balance for each collateral type deposited
     */
    function getBalance(address account, address fxToken)
        external
        view
        override
        returns (address[] memory collateral, uint256[] memory balances)
    {
        collateral = getAllCollateralTypes();
        uint256 j = collateral.length;
        uint256[] memory _balances = new uint256[](j);
        for (uint256 i = 0; i < j; i++) {
            _balances[i] = vaults[account][fxToken].collateralBalance[
                collateral[i]
            ];
        }
        balances = _balances;
    }

    /**
     * @dev Getter for a vault's interest collateral R0 value
     * @param account The vault account
     * @param fxToken The vault fxToken
     * @param collateral The collateral token for the R0 value
     * @return R0 The R0 interest value
     */
    function getCollateralR0(
        address account,
        address fxToken,
        address collateral
    ) external view override returns (uint256 R0) {
        R0 = vaults[account][fxToken].R0[collateral];
    }

    /**
     * @dev Sets the R0 values of a vault to the current R values for the vault
            so that interest starts being accrued from this point in time.
     * @param account The vault account
     * @param fxToken The vault fxToken
     */
    function resetVaultR0(address account, address fxToken) private {
        (uint256[] memory R, address[] memory collateralTokens) =
            IInterest(interest).getCurrentR();
        uint256 j = collateralTokens.length;
        Vault storage vault = vaults[account][fxToken];
        for (uint256 i = 0; i < j; i++) {
            vault.R0[collateralTokens[i]] = R[i];
        }
    }

    /**
     * @dev Getter for a vault's debt including interest
     * @param account The vault account
     * @param fxToken The vault fxToken
     * @return debt The amount of fxToken debt outstanding including interest
     */
    function getDebt(address account, address fxToken)
        public
        view
        override
        returns (uint256)
    {
        uint256 debt = vaults[account][fxToken].debt;
        return
            debt.add(
                IVaultLibrary(vaultLibrary).calculateInterest(account, fxToken)
            );
    }

    /**
     * @dev Getter for a vault's debt excluding interest
     * @param account The vault account
     * @param fxToken The vault fxToken
     * @return debt the amount of fxToken debt outstanding excluding interest
     */
    function getPrincipalDebt(address account, address fxToken)
        external
        view
        override
        returns (uint256)
    {
        return vaults[account][fxToken].debt;
    }

    /**
     * @dev Getter for a token unit price in ETH
     * @param token The token to get the price of
     * @return quote The price of 1 token in ETH
     */
    function getTokenPrice(address token)
        public
        view
        override
        returns (uint256 quote)
    {
        if (token == WETH) return 1 ether;
        require(oracles[token] != address(0), "No oracle for token");
        quote = IOracle(oracles[token]).getRate(token);
        require(quote > 0, "Token price is zero");
    }

    /**
     * @dev Sets an oracle for a given token
     * @param token The token to set the oracle for
     * @param oracle The oracle to use for the token
     */
    function setOracle(address token, address oracle)
        external
        override
        onlyAdmin
    {
        require(token != address(0) && oracle != address(0), "IZ");
        oracles[token] = oracle;
    }

    /** @dev Protected UUPS upgrade authorization function */
    function _authorizeUpgrade(address) internal override onlyAdmin {}
}

File 2 of 24 : Initializable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }
}

File 3 of 24 : UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import "./Initializable.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 *
 * _Available since v4.1._
 */
abstract contract UUPSUpgradeable is Initializable, ERC1967UpgradeUpgradeable {
    function __UUPSUpgradeable_init() internal initializer {
        __ERC1967Upgrade_init_unchained();
        __UUPSUpgradeable_init_unchained();
    }

    function __UUPSUpgradeable_init_unchained() internal initializer {
    }
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
    address private immutable __self = address(this);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        require(address(this) != __self, "Function must be called through delegatecall");
        require(_getImplementation() == __self, "Function must be called through active proxy");
        _;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeTo(address newImplementation) external virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallSecure(newImplementation, new bytes(0), false);
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallSecure(newImplementation, data, true);
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeTo} and {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal override onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;
    uint256[50] private __gap;
}

File 4 of 24 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 5 of 24 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

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

File 6 of 24 : IHandle.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

pragma abicoder v2;

interface IHandle {
    struct Vault {
        // Collateral token address => balance
        mapping(address => uint256) collateralBalance;
        uint256 debt;
        // Collateral token address => R0
        mapping(address => uint256) R0;
    }

    struct CollateralData {
        uint256 mintCR;
        uint256 liquidationFee;
        uint256 interestRate;
    }

    event UpdateDebt(address indexed account, address indexed fxToken);

    event UpdateCollateral(
        address indexed account,
        address indexed fxToken,
        address indexed collateralToken
    );

    event ConfigureCollateralToken(address indexed collateralToken);

    event ConfigureFxToken(address indexed fxToken, bool removed);

    function setCollateralUpperBoundPCT(uint256 ratio) external;

    function setPaused(bool value) external;

    function setFxToken(address token) external;

    function removeFxToken(address token) external;

    function setCollateralToken(
        address token,
        uint256 mintCR,
        uint256 liquidationFee,
        uint256 interestRatePerMille
    ) external;

    function removeCollateralToken(address token) external;

    function getAllCollateralTypes()
        external
        view
        returns (address[] memory collateral);

    function getCollateralDetails(address collateral)
        external
        view
        returns (CollateralData memory);

    function WETH() external view returns (address);

    function treasury() external view returns (address payable);

    function comptroller() external view returns (address);

    function vaultLibrary() external view returns (address);

    function fxKeeperPool() external view returns (address);

    function pct() external view returns (address);

    function liquidator() external view returns (address);

    function interest() external view returns (address);

    function referral() external view returns (address);

    function forex() external view returns (address);

    function rewards() external view returns (address);

    function pctCollateralUpperBound() external view returns (uint256);

    function isFxTokenValid(address fxToken) external view returns (bool);

    function isCollateralValid(address collateral) external view returns (bool);

    function setComponents(address[] memory components) external;

    function updateDebtPosition(
        address account,
        uint256 amount,
        address fxToken,
        bool increase
    ) external;

    function updateCollateralBalance(
        address account,
        uint256 amount,
        address fxToken,
        address collateralToken,
        bool increase
    ) external;

    function setFeeRecipient(address feeRecipient) external;

    function setFees(
        uint256 withdrawFeePerMille,
        uint256 depositFeePerMille,
        uint256 mintFeePerMille,
        uint256 burnFeePerMille
    ) external;

    function getCollateralBalance(
        address account,
        address collateralType,
        address fxToken
    ) external view returns (uint256 balance);

    function getBalance(address account, address fxToken)
        external
        view
        returns (address[] memory collateral, uint256[] memory balances);

    function getDebt(address owner, address fxToken)
        external
        view
        returns (uint256 _debt);

    function getPrincipalDebt(address owner, address fxToken)
        external
        view
        returns (uint256 _debt);

    function getCollateralR0(
        address account,
        address fxToken,
        address collateral
    ) external view returns (uint256 R0);

    function getTokenPrice(address token) external view returns (uint256 quote);

    function setOracle(address fxToken, address oracle) external;

    function FeeRecipient() external view returns (address);

    function mintFeePerMille() external view returns (uint256);

    function burnFeePerMille() external view returns (uint256);

    function withdrawFeePerMille() external view returns (uint256);

    function depositFeePerMille() external view returns (uint256);

    function isPaused() external view returns (bool);
}

File 7 of 24 : ITreasury.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

interface ITreasury {
    function depositCollateral(
        address account,
        uint256 depositAmount,
        address collateralType,
        address fxToken,
        address referral
    ) external;

    function depositCollateralETH(
        address account,
        address fxToken,
        address referral
    ) external payable;

    function withdrawCollateral(
        address collateralToken,
        address to,
        uint256 amount,
        address fxToken
    ) external;

    function withdrawCollateralETH(
        address to,
        uint256 amount,
        address fxToken
    ) external;

    function withdrawCollateralFrom(
        address from,
        address collateralToken,
        address to,
        uint256 amount,
        address fxToken
    ) external;

    function forceWithdrawCollateral(
        address from,
        address collateralToken,
        address to,
        uint256 amount,
        address fxToken
    ) external;

    function forceWithdrawAnyCollateral(
        address from,
        address to,
        uint256 amount,
        address fxToken,
        bool requireFullAmount
    )
        external
        returns (
            address[] memory collateralTypes,
            uint256[] memory collateralAmounts
        );

    function requestFundsPCT(address token, uint256 amount) external;

    function setMaximumTotalDepositAllowed(uint256 value) external;
}

File 8 of 24 : IValidator.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

interface IValidator {
    modifier dueBy(uint256 date) {
        require(block.timestamp <= date, "Transaction has exceeded deadline");
        _;
    }

    modifier validAddress(address _address) {
        require(_address != address(0), "Invalid Address");
        _;
    }
}

File 9 of 24 : IVaultLibrary.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

interface IVaultLibrary {
    function doesMeetRatio(address account, address fxToken)
        external
        view
        returns (bool);

    function getFreeCollateralAsEth(address account, address fxToken)
        external
        view
        returns (uint256);

    function getFreeCollateralAsEthFromMinimumRatio(
        address account,
        address fxToken,
        uint256 minimumRatio
    ) external view returns (uint256);

    function getMinimumRatio(address account, address fxToken)
        external
        view
        returns (uint256 ratio);

    function getMinimumCollateral(
        uint256 tokenAmount,
        uint256 ratio,
        uint256 unitPrice
    ) external view returns (uint256 minimum);

    function getDebtAsEth(address account, address fxToken)
        external
        view
        returns (uint256 debt);

    function getTotalCollateralBalanceAsEth(address account, address fxToken)
        external
        view
        returns (uint256 balance);

    function getCurrentRatio(address account, address fxToken)
        external
        view
        returns (uint256 ratio);

    function getCollateralForAmount(
        address account,
        address fxToken,
        uint256 amountEth
    )
        external
        view
        returns (
            address[] memory collateralTypes,
            uint256[] memory collateralAmounts,
            bool metAmount
        );

    function getDecimalsAmount(
        uint256 amount,
        uint8 fromDecimals,
        uint8 toDecimals
    ) external pure returns (uint256);

    function calculateInterest(address account, address fxToken)
        external
        view
        returns (uint256 interest);

    function getInterestRate(address account, address fxToken)
        external
        view
        returns (uint256 rate);

    function getInterestDeltaR(address account, address fxToken)
        external
        view
        returns (uint256 dR);

    function getLiquidationFee(address account, address fxToken)
        external
        view
        returns (uint256 fee);

    function getCollateralShares(address account, address fxToken)
        external
        view
        returns (uint256[] memory shares);

    function getCollateralTypesSortedByLiquidationRank()
        external
        view
        returns (address[] memory sortedCollateralTypes);

    function getNewMinimumRatio(
        address account,
        address fxToken,
        address collateralToken,
        uint256 collateralAmount,
        uint256 collateralQuote,
        bool isDeposit
    ) external view returns (uint256 ratio, uint256 newCollateralAsEther);

    function canMint(
        address account,
        address fxToken,
        address collateralToken,
        uint256 collateralAmount,
        uint256 tokenAmount,
        uint256 fxQuote,
        uint256 collateralQuote
    ) external view returns (bool);

    function quickSort(
        uint256[] memory array,
        int256 left,
        int256 right
    ) external pure;

    function getTokenUnit(address token) external view returns (uint256);
}

File 10 of 24 : IComptroller.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
pragma abicoder v2;

interface IComptroller {
    event MintToken(
        uint256 tokenRate,
        uint256 amountMinted,
        address indexed token
    );

    event BurnToken(uint256 amountBurned, address indexed token);

    function mintWithEth(
        uint256 tokenAmountDesired,
        address fxToken,
        uint256 deadline,
        address referral
    ) external payable;

    function mint(
        uint256 amountDesired,
        address fxToken,
        address collateralToken,
        uint256 collateralAmount,
        uint256 deadline,
        address referral
    ) external;

    function mintWithoutCollateral(
        uint256 tokenAmountDesired,
        address token,
        uint256 deadline,
        address referral
    ) external;

    function burn(
        uint256 amount,
        address token,
        uint256 deadline
    ) external;

    function setMinimumMintingAmount(uint256 amount) external;

    function minimumMintingAmount() external view returns (uint256);
}

File 11 of 24 : IOracle.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

interface IOracle {
    /**
     * @notice Returns the price of 1 fxAsset in ETH
     * @param fxAsset the asset to get a rate for
     * @return unitPrice the cost of a single fxAsset in ETH
     */
    function getRate(address fxAsset) external view returns (uint256 unitPrice);

    /**
     * @notice A setter function to add or update an oracle for a given fx asset.
     * @param fxAsset the asset to update
     * @param oracle the oracle to set for the fxAsset
     */
    function setOracle(address fxAsset, address oracle) external;
}

File 12 of 24 : IInterest.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
pragma abicoder v2;

interface IInterest {
    struct ExternalAssetData {
        bytes32 makerDaoCollateralIlk;
    }

    function setCollateralExternalAssetData(
        address collateral,
        bytes32 makerDaoCollateralIlk
    ) external;

    function unsetCollateralExternalAssetData(address collateral) external;

    function setMaxExternalSourceInterest(uint256 interestPerMille) external;

    function charge() external;

    function getCurrentR()
        external
        view
        returns (uint256[] memory R, address[] memory collateralTokens);

    function setDataSource(address source) external;

    function tryUpdateRates() external;

    function updateRates() external;

    function fetchRate(address token) external view returns (uint256);
}

File 13 of 24 : IfxToken.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IfxToken is IERC20 {
    function mint(address account, uint256 amount) external;

    function burn(address account, uint256 amount) external;
}

File 14 of 24 : Roles.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";

abstract contract Roles is AccessControlUpgradeable {
    bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE");
    bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");

    modifier onlyOperator() {
        require(hasRole(OPERATOR_ROLE, msg.sender), "NO");
        _;
    }

    modifier onlyAdmin() {
        require(hasRole(ADMIN_ROLE, msg.sender), "NA");
        _;
    }

    modifier onlyOperatorOrAdmin() {
        require(
            hasRole(OPERATOR_ROLE, msg.sender) ||
                hasRole(ADMIN_ROLE, msg.sender),
            "NW"
        );
        _;
    }

    modifier onlyAddressOrOperatorExcludeAdmin(address addressAllowed) {
        // Protect user deposits from abuse
        require(
            msg.sender == addressAllowed ||
                (hasRole(OPERATOR_ROLE, msg.sender) &&
                    !hasRole(ADMIN_ROLE, msg.sender)),
            "NW"
        );
        _;
    }
}

File 15 of 24 : ERC1967UpgradeUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.2;

import "../beacon/IBeaconUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import "../utils/Initializable.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 *
 * @custom:oz-upgrades-unsafe-allow delegatecall
 */
abstract contract ERC1967UpgradeUpgradeable is Initializable {
    function __ERC1967Upgrade_init() internal initializer {
        __ERC1967Upgrade_init_unchained();
    }

    function __ERC1967Upgrade_init_unchained() internal initializer {
    }
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallSecure(
        address newImplementation,
        bytes memory data,
        bool forceCall
    ) internal {
        address oldImplementation = _getImplementation();

        // Initial upgrade and setup call
        _setImplementation(newImplementation);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(newImplementation, data);
        }

        // Perform rollback test if not already in progress
        StorageSlotUpgradeable.BooleanSlot storage rollbackTesting = StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT);
        if (!rollbackTesting.value) {
            // Trigger rollback using upgradeTo from the new implementation
            rollbackTesting.value = true;
            _functionDelegateCall(
                newImplementation,
                abi.encodeWithSignature("upgradeTo(address)", oldImplementation)
            );
            rollbackTesting.value = false;
            // Check rollback was effective
            require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades");
            // Finally reset to the new implementation and log the upgrade
            _upgradeTo(newImplementation);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Emitted when the beacon is upgraded.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(
        address newBeacon,
        bytes memory data,
        bool forceCall
    ) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
        }
    }

    /**
     * @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) private returns (bytes memory) {
        require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed");
    }
    uint256[50] private __gap;
}

File 16 of 24 : IBeaconUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeaconUpgradeable {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

File 17 of 24 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 18 of 24 : StorageSlotUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlotUpgradeable {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        assembly {
            r.slot := slot
        }
    }
}

File 19 of 24 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";

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

    function __AccessControl_init_unchained() internal initializer {
    }
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

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

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

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        StringsUpgradeable.toHexString(uint160(account), 20),
                        " is missing role ",
                        StringsUpgradeable.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

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

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

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

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

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

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

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
    uint256[49] private __gap;
}

File 20 of 24 : IAccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControlUpgradeable {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

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

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

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

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

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

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

File 21 of 24 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

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

    function __Context_init_unchained() internal initializer {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
    uint256[50] private __gap;
}

File 22 of 24 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

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

File 23 of 24 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal initializer {
        __ERC165_init_unchained();
    }

    function __ERC165_init_unchained() internal initializer {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }
    uint256[50] private __gap;
}

File 24 of 24 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165Upgradeable {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

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

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collateralToken","type":"address"}],"name":"ConfigureCollateralToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"fxToken","type":"address"},{"indexed":false,"internalType":"bool","name":"removed","type":"bool"}],"name":"ConfigureFxToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"fxToken","type":"address"},{"indexed":true,"internalType":"address","name":"collateralToken","type":"address"}],"name":"UpdateCollateral","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"fxToken","type":"address"}],"name":"UpdateDebt","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FeeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"burnFeePerMille","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"comptroller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositFeePerMille","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"forex","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fxKeeperPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllCollateralTypes","outputs":[{"internalType":"address[]","name":"collateral","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"fxToken","type":"address"}],"name":"getBalance","outputs":[{"internalType":"address[]","name":"collateral","type":"address[]"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"collateralType","type":"address"},{"internalType":"address","name":"fxToken","type":"address"}],"name":"getCollateralBalance","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collateral","type":"address"}],"name":"getCollateralDetails","outputs":[{"components":[{"internalType":"uint256","name":"mintCR","type":"uint256"},{"internalType":"uint256","name":"liquidationFee","type":"uint256"},{"internalType":"uint256","name":"interestRate","type":"uint256"}],"internalType":"struct IHandle.CollateralData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"fxToken","type":"address"},{"internalType":"address","name":"collateral","type":"address"}],"name":"getCollateralR0","outputs":[{"internalType":"uint256","name":"R0","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"fxToken","type":"address"}],"name":"getDebt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"fxToken","type":"address"}],"name":"getPrincipalDebt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getTokenPrice","outputs":[{"internalType":"uint256","name":"quote","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"weth","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"interest","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isCollateralValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isFxTokenValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liquidator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintFeePerMille","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"oracles","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pct","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pctCollateralUpperBound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"referral","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"removeCollateralToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"removeFxToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewards","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"mintCR","type":"uint256"},{"internalType":"uint256","name":"liquidationFee","type":"uint256"},{"internalType":"uint256","name":"interestRatePerMille","type":"uint256"}],"name":"setCollateralToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"ratio","type":"uint256"}],"name":"setCollateralUpperBoundPCT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"components","type":"address[]"}],"name":"setComponents","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"feeRecipient","type":"address"}],"name":"setFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_withdrawFeePerMille","type":"uint256"},{"internalType":"uint256","name":"_depositFeePerMille","type":"uint256"},{"internalType":"uint256","name":"_mintFeePerMille","type":"uint256"},{"internalType":"uint256","name":"_burnFeePerMille","type":"uint256"}],"name":"setFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"setFxToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"oracle","type":"address"}],"name":"setOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"value","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"fxToken","type":"address"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"bool","name":"increase","type":"bool"}],"name":"updateCollateralBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"fxToken","type":"address"},{"internalType":"bool","name":"increase","type":"bool"}],"name":"updateDebtPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"vaultLibrary","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"vaults","outputs":[{"internalType":"uint256","name":"debt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawFeePerMille","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60a06040523060601b60805234801561001757600080fd5b5060805160601c6136d661004b6000396000818161111901528181611159015281816112a201526112e201526136d66000f3fe6080604052600436106103505760003560e01c806391d14854116101c6578063bd9e5200116100f7578063d547741f11610095578063eb0a8b911161006f578063eb0a8b9114610aee578063ec94578e14610b0f578063f5b541a614610b30578063ffcd9da614610b5257610350565b8063d547741f14610a97578063e74b981b14610ab7578063e75fd0b514610ad757610350565b8063c4d66de8116100d1578063c4d66de814610a09578063cf07947d14610a29578063d02641a014610a49578063d4fac45d14610a6957610350565b8063bd9e520014610954578063c392f76614610996578063c462b520146109b757610350565b8063a217fddf11610164578063ad5c46481161013e578063ad5c4648146108b4578063addd5099146108d5578063aee9c8721461090c578063b187bd261461093957610350565b8063a217fddf14610835578063a300733d1461084a578063a364c9721461089457610350565b80639cfd9669116101a05780639cfd9669146107ab5780639df5138a146107cc5780639ec5a894146107e3578063a0f026ff1461080457610350565b806391d148541461075457806394f9059f146107745780639931286d1461079457610350565b80634046ebae116102a05780635fe3b5671161023e578063732409931161021857806373240993146106c257806375b238fc146106e2578063803c97b314610704578063877034f11461073457610350565b80635fe3b5671461065b57806361d027b31461067c5780636fcba377146106a257610350565b80634d635e701161027a5780634d635e70146105cc5780634f1ef286146106085780635c38eb3a1461061b5780635eb0ac1a1461063b57610350565b80634046ebae1461057457806341e3f28114610595578063498b5ae8146105ac57610350565b806327ab02b91161030d5780632f2ff15d116102e75780632f2ff15d146104bd57806331695c4e146104dd57806336568abe146105345780633659cfe61461055457610350565b806327ab02b91461045a578063294d499e1461047b5780632b4557591461049d57610350565b806301964f361461035557806301ffc9a71461037f5780631441a5a9146103af57806316c38b3c146103e8578063181e20a71461040a578063248a9ca31461042a575b600080fd5b34801561036157600080fd5b5061036c6101025481565b6040519081526020015b60405180910390f35b34801561038b57600080fd5b5061039f61039a36600461321d565b610b73565b6040519015158152602001610376565b3480156103bb57600080fd5b50610111546103d0906001600160a01b031681565b6040516001600160a01b039091168152602001610376565b3480156103f457600080fd5b506104086104033660046131c7565b610bac565b005b34801561041657600080fd5b50610408610425366004612f81565b610bfd565b34801561043657600080fd5b5061036c6104453660046131e1565b600090815260c9602052604090206001015490565b34801561046657600080fd5b5061010d546103d0906001600160a01b031681565b34801561048757600080fd5b50610490610da8565b6040516103769190613362565b3480156104a957600080fd5b506104086104b8366004612e41565b610e0a565b3480156104c957600080fd5b506104086104d83660046131f9565b611064565b3480156104e957600080fd5b5061036c6104f8366004612e95565b6001600160a01b039283166000908152610101602090815260408083209486168352938152838220929094168152600290910190925290205490565b34801561054057600080fd5b5061040861054f3660046131f9565b611090565b34801561056057600080fd5b5061040861056f366004612e41565b61110e565b34801561058057600080fd5b5061010f546103d0906001600160a01b031681565b3480156105a157600080fd5b5061036c6101055481565b3480156105b857600080fd5b5061036c6105c7366004612e5d565b6111d7565b3480156105d857600080fd5b5061036c6105e7366004612e5d565b61010160209081526000928352604080842090915290825290206001015481565b610408610616366004612edf565b611297565b34801561062757600080fd5b50610408610636366004612e5d565b61134d565b34801561064757600080fd5b5061040861065636600461306e565b611401565b34801561066757600080fd5b5061010b546103d0906001600160a01b031681565b34801561068857600080fd5b5061010a546103d09061010090046001600160a01b031681565b3480156106ae57600080fd5b506104086106bd36600461325d565b611872565b3480156106ce57600080fd5b506104086106dd366004613034565b6118c1565b3480156106ee57600080fd5b5061036c60008051602061368183398151915281565b34801561071057600080fd5b5061039f61071f366004612e41565b60fc6020526000908152604090205460ff1681565b34801561074057600080fd5b5061040861074f366004612fe4565b611ac1565b34801561076057600080fd5b5061039f61076f3660046131f9565b611d43565b34801561078057600080fd5b5061040861078f366004612e41565b611d6e565b3480156107a057600080fd5b5061036c6101035481565b3480156107b757600080fd5b5061010e546103d0906001600160a01b031681565b3480156107d857600080fd5b5061036c6101065481565b3480156107ef57600080fd5b50610113546103d0906001600160a01b031681565b34801561081057600080fd5b5061039f61081f366004612e41565b6101006020526000908152604090205460ff1681565b34801561084157600080fd5b5061036c600081565b34801561085657600080fd5b5061036c610865366004612e5d565b6001600160a01b0391821660009081526101016020908152604080832093909416825291909152206001015490565b3480156108a057600080fd5b506104086108af3660046131e1565b611deb565b3480156108c057600080fd5b50610108546103d0906001600160a01b031681565b3480156108e157600080fd5b506103d06108f0366004612e41565b610109602052600090815260409020546001600160a01b031681565b34801561091857600080fd5b5061036c610927366004612e41565b60fe6020526000908152604090205481565b34801561094557600080fd5b5061010a5461039f9060ff1681565b34801561096057600080fd5b5061097461096f366004612e41565b611e25565b6040805182518152602080840151908201529181015190820152606001610376565b3480156109a257600080fd5b50610110546103d0906001600160a01b031681565b3480156109c357600080fd5b5061036c6109d2366004612e95565b6001600160a01b03928316600090815261010160209081526040808320938616835292815282822093909416815291909252205490565b348015610a1557600080fd5b50610408610a24366004612e41565b611e8b565b348015610a3557600080fd5b50610408610a44366004612e41565b611f71565b348015610a5557600080fd5b5061036c610a64366004612e41565b6120bc565b348015610a7557600080fd5b50610a89610a84366004612e5d565b612219565b604051610376929190613375565b348015610aa357600080fd5b50610408610ab23660046131f9565b612349565b348015610ac357600080fd5b50610408610ad2366004612e41565b61236f565b348015610ae357600080fd5b5061036c6101045481565b348015610afa57600080fd5b5061010c546103d0906001600160a01b031681565b348015610b1b57600080fd5b50610107546103d0906001600160a01b031681565b348015610b3c57600080fd5b5061036c60008051602061363a83398151915281565b348015610b5e57600080fd5b50610112546103d0906001600160a01b031681565b60006001600160e01b03198216637965db0b60e01b1480610ba457506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b610bc460008051602061368183398151915233611d43565b610be95760405162461bcd60e51b8152600401610be0906134d7565b60405180910390fd5b61010a805460ff1916911515919091179055565b610c1560008051602061363a83398151915233611d43565b610c465760405162461bcd60e51b81526020600482015260026024820152614e4f60f01b6044820152606401610be0565b61010a5460ff1615610c835760405162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b6044820152606401610be0565b6001600160a01b03808616600090815261010160209081526040808320878516845282528083209386168352929052205481610cc857610cc38186612410565b610cd2565b610cd28186612423565b6001600160a01b03808816600090815261010160209081526040808320898516845282528083209388168352929052205581610d30576001600160a01b038316600090815260fe6020526040902054610d2b9086612410565b610d53565b6001600160a01b038316600090815260fe6020526040902054610d539086612423565b6001600160a01b03808516600081815260fe60205260408082209490945592519092878316928a16917f2027a0219b5bbff94e3a2050ec5c3ab5fafaaffe9c131dd57d2366b04423eff39190a4505050505050565b606060fb805480602002602001604051908101604052809291908181526020018280548015610e0057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610de2575b5050505050905090565b610e2260008051602061368183398151915233611d43565b610e3e5760405162461bcd60e51b8152600401610be0906134d7565b60ff5460005b81811015610eac57826001600160a01b031660ff8281548110610e7757634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03161415610e9a57809150610eac565b80610ea4816135dd565b915050610e44565b5060ff548110610ecc57634e487b7160e01b600052600160045260246000fd5b6001600160a01b038216600090815261010060205260409020805460ff1916905560ff54610efc9060019061357f565b811015610fdf5760ff8054610f139060019061357f565b81548110610f3157634e487b7160e01b600052603260045260246000fd5b60009182526020909120015460ff80546001600160a01b039092169183908110610f6b57634e487b7160e01b600052603260045260246000fd5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060ff805480610fb857634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b0319169055019055611021565b60ff805480610ffe57634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b03191690550190555b604051600181526001600160a01b038316907ffb41d6cdd88df98fceed3d16a841a5d7353cd0f003ab68854b734248bfdee04d9060200160405180910390a25050565b600082815260c9602052604090206001015461108181335b61242f565b61108b8383612493565b505050565b6001600160a01b03811633146111005760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610be0565b61110a8282612519565b5050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156111575760405162461bcd60e51b8152600401610be0906133f1565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611189612580565b6001600160a01b0316146111af5760405162461bcd60e51b8152600401610be09061343d565b6111b8816125ae565b604080516000808252602082019092526111d4918391906125e2565b50565b6001600160a01b0382811660008181526101016020908152604080832086861680855292528083206001015461010c54915163021c24a560e61b8152600481019590955260248501929092529193909261128f929091169063870929409060440160206040518083038186803b15801561125057600080fd5b505afa158015611264573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112889190613245565b8290612423565b949350505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156112e05760405162461bcd60e51b8152600401610be0906133f1565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611312612580565b6001600160a01b0316146113385760405162461bcd60e51b8152600401610be09061343d565b611341826125ae565b61110a828260016125e2565b61136560008051602061368183398151915233611d43565b6113815760405162461bcd60e51b8152600401610be0906134d7565b6001600160a01b038216158015906113a157506001600160a01b03811615155b6113d25760405162461bcd60e51b815260206004820152600260248201526124ad60f11b6044820152606401610be0565b6001600160a01b0391821660009081526101096020526040902080546001600160a01b03191691909216179055565b61141960008051602061368183398151915233611d43565b6114355760405162461bcd60e51b8152600401610be0906134d7565b805160005b818110156114d05760006001600160a01b031683828151811061146d57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031614156114be5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b6044820152606401610be0565b806114c8816135dd565b91505061143a565b50816000815181106114f257634e487b7160e01b600052603260045260246000fd5b602002602001015161010a60016101000a8154816001600160a01b0302191690836001600160a01b031602179055508160018151811061154257634e487b7160e01b600052603260045260246000fd5b602002602001015161010b60006101000a8154816001600160a01b0302191690836001600160a01b031602179055508160028151811061159257634e487b7160e01b600052603260045260246000fd5b602002602001015161010c60006101000a8154816001600160a01b0302191690836001600160a01b03160217905550816003815181106115e257634e487b7160e01b600052603260045260246000fd5b602002602001015161010d60006101000a8154816001600160a01b0302191690836001600160a01b031602179055508160048151811061163257634e487b7160e01b600052603260045260246000fd5b602002602001015161010e60006101000a8154816001600160a01b0302191690836001600160a01b031602179055508160058151811061168257634e487b7160e01b600052603260045260246000fd5b602002602001015161010f60006101000a8154816001600160a01b0302191690836001600160a01b03160217905550816006815181106116d257634e487b7160e01b600052603260045260246000fd5b602002602001015161011060006101000a8154816001600160a01b0302191690836001600160a01b031602179055508160078151811061172257634e487b7160e01b600052603260045260246000fd5b602002602001015161011160006101000a8154816001600160a01b0302191690836001600160a01b031602179055508160088151811061177257634e487b7160e01b600052603260045260246000fd5b602002602001015161011260006101000a8154816001600160a01b0302191690836001600160a01b03160217905550816009815181106117c257634e487b7160e01b600052603260045260246000fd5b602002602001015161011360006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060005b600981101561108b57806002148061180c5750806003145b806118175750806008145b1561182157611860565b61186060008051602061363a83398151915284838151811061185357634e487b7160e01b600052603260045260246000fd5b6020026020010151611064565b8061186a816135dd565b9150506117f4565b61188a60008051602061368183398151915233611d43565b6118a65760405162461bcd60e51b8152600401610be0906134d7565b61010593909355610106919091556101049190915561010355565b6118d960008051602061363a83398151915233611d43565b806118f757506118f760008051602061368183398151915233611d43565b6119285760405162461bcd60e51b81526020600482015260026024820152614e5760f01b6044820152606401610be0565b606e83101561195e5760405162461bcd60e51b815260206004820152600260248201526121a960f11b6044820152606401610be0565b6001600160a01b038416600090815260fd6020526040902080546119c85760fb80546001810182556000919091527f3e7257b7272bb46d49cd6019b04ddee20da7c0cb13f7c1ec3391291b2ccebabc0180546001600160a01b0319166001600160a01b0387161790555b6001600160a01b038516600090815260fc602052604090205460ff16611a0c576001600160a01b038516600090815260fc60205260409020805460ff191660011790555b61011060009054906101000a90046001600160a01b03166001600160a01b031663551619136040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611a5d57600080fd5b505af1158015611a71573d6000803e3d6000fd5b5050508482555060018101839055600281018290556040516001600160a01b038616907f38bfbff5a2ab4e85e1292bfc75e2e0b39855907deca3889448ce609117c8530f90600090a25050505050565b611ad960008051602061363a83398151915233611d43565b611b0a5760405162461bcd60e51b81526020600482015260026024820152614e4f60f01b6044820152606401610be0565b61010a5460ff1615611b475760405162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b6044820152606401610be0565b61011060009054906101000a90046001600160a01b03166001600160a01b031663551619136040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611b9857600080fd5b505af1158015611bac573d6000803e3d6000fd5b505050506000611bbc85846111d7565b61010c5460405163021c24a560e61b81526001600160a01b03888116600483015286811660248301529293506000929091169063870929409060440160206040518083038186803b158015611c1057600080fd5b505afa158015611c24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c489190613245565b90508015611cb857610107546040516340c10f1960e01b81526001600160a01b03918216600482015260248101839052908516906340c10f1990604401600060405180830381600087803b158015611c9f57600080fd5b505af1158015611cb3573d6000803e3d6000fd5b505050505b611cc2868561272d565b82611cd657611cd18286612410565b611ce0565b611ce08286612423565b6001600160a01b03808816600081815261010160209081526040808320948a1680845294909152808220600101949094559251919290917f2d1a59a877ca0f4ce2a4bff5fdbf6e60dabcd7a049afa997fdc2f61bebc68c389190a3505050505050565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b611d8660008051602061368183398151915233611d43565b611da25760405162461bcd60e51b8152600401610be0906134d7565b6001600160a01b038116600081815260fc6020526040808220805460ff19169055517f38bfbff5a2ab4e85e1292bfc75e2e0b39855907deca3889448ce609117c8530f9190a250565b611e0360008051602061368183398151915233611d43565b611e1f5760405162461bcd60e51b8152600401610be0906134d7565b61010255565b611e4960405180606001604052806000815260200160008152602001600081525090565b506001600160a01b0316600090815260fd6020908152604091829020825160608101845281548152600182015492810192909252600201549181019190915290565b600054610100900460ff1680611ea4575060005460ff16155b611ec05760405162461bcd60e51b8152600401610be090613489565b600054610100900460ff16158015611ee2576000805461ffff19166101011790555b611eea61288c565b611f026000805160206136818339815191523361290f565b611f1a60008051602061368183398151915280612919565b611f4060008051602061363a833981519152600080516020613681833981519152612919565b61010880546001600160a01b0319166001600160a01b038416179055801561110a576000805461ff00191690555050565b611f8960008051602061368183398151915233611d43565b611fa55760405162461bcd60e51b8152600401610be0906134d7565b6001600160a01b038116611ff35760405162461bcd60e51b8152602060048201526015602482015274496e76616c696420746f6b656e206164647265737360581b6044820152606401610be0565b6001600160a01b0381166000908152610100602052604090205460ff1615156001141561201f576111d4565b60ff805460018082019092557fe08ec2af2cfc251225e1968fd6ca21e4044f129bffa95bac3503be8bdb30a3670180546001600160a01b0319166001600160a01b038416908117909155600081815261010060209081526040808320805460ff1916909517909455925190815290917ffb41d6cdd88df98fceed3d16a841a5d7353cd0f003ab68854b734248bfdee04d910160405180910390a250565b610108546000906001600160a01b03838116911614156120e55750670de0b6b3a7640000610ba7565b6001600160a01b0382811660009081526101096020526040902054166121435760405162461bcd60e51b815260206004820152601360248201527227379037b930b1b632903337b9103a37b5b2b760691b6044820152606401610be0565b6001600160a01b0382811660008181526101096020526040908190205490516337cef79160e01b81526004810192909252909116906337cef7919060240160206040518083038186803b15801561219957600080fd5b505afa1580156121ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d19190613245565b905060008111610ba75760405162461bcd60e51b8152602060048201526013602482015272546f6b656e207072696365206973207a65726f60681b6044820152606401610be0565b606080612224610da8565b805190925060008167ffffffffffffffff81111561225257634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561227b578160200160208202803683370190505b50905060005b8281101561233c576001600160a01b03808816600090815261010160209081526040808320938a16835292905290812086519091908790849081106122d657634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000205482828151811061231f57634e487b7160e01b600052603260045260246000fd5b602090810291909101015280612334816135dd565b915050612281565b5080925050509250929050565b600082815260c96020526040902060010154612365813361107c565b61108b8383612519565b61238760008051602061368183398151915233611d43565b6123a35760405162461bcd60e51b8152600401610be0906134d7565b806001600160a01b0381166123ec5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964204164647265737360881b6044820152606401610be0565b5061010780546001600160a01b0319166001600160a01b0392909216919091179055565b600061241c828461357f565b9392505050565b600061241c8284613548565b6124398282611d43565b61110a57612451816001600160a01b03166014612964565b61245c836020612964565b60405160200161246d9291906132ed565b60408051601f198184030181529082905262461bcd60e51b8252610be0916004016133be565b61249d8282611d43565b61110a57600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff191660011790556124d53390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6125238282611d43565b1561110a57600082815260c9602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6125c660008051602061368183398151915233611d43565b6111d45760405162461bcd60e51b8152600401610be0906134d7565b60006125ec612580565b90506125f784612b46565b6000835111806126045750815b15612615576126138484612beb565b505b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143805460ff1661272657805460ff191660011781556040516001600160a01b038316602482015261269490869060440160408051601f198184030181529190526020810180516001600160e01b0316631b2ce7f360e11b179052612beb565b50805460ff191681556126a5612580565b6001600160a01b0316826001600160a01b03161461271d5760405162461bcd60e51b815260206004820152602f60248201527f45524331393637557067726164653a207570677261646520627265616b73206660448201526e75727468657220757067726164657360881b6064820152608401610be0565b61272685612cd6565b5050505050565b60008061011060009054906101000a90046001600160a01b03166001600160a01b031663d56a5c736040518163ffffffff1660e01b815260040160006040518083038186803b15801561277f57600080fd5b505afa158015612793573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526127bb919081019061310a565b80516001600160a01b03808816600090815261010160209081526040808320938a16835292905290812093955091935091905b828110156128835784818151811061281657634e487b7160e01b600052603260045260246000fd5b602002602001015182600201600086848151811061284457634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550808061287b906135dd565b9150506127ee565b50505050505050565b600054610100900460ff16806128a5575060005460ff16155b6128c15760405162461bcd60e51b8152600401610be090613489565b600054610100900460ff161580156128e3576000805461ffff19166101011790555b6128eb612d16565b6128f3612d16565b6128fb612d16565b80156111d4576000805461ff001916905550565b61110a8282612493565b600082815260c96020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b60606000612973836002613560565b61297e906002613548565b67ffffffffffffffff8111156129a457634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156129ce576020820181803683370190505b509050600360fc1b816000815181106129f757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612a3457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000612a58846002613560565b612a63906001613548565b90505b6001811115612af7576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612aa557634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110612ac957634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93612af0816135c6565b9050612a66565b50831561241c5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610be0565b803b612baa5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610be0565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060823b612c4a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610be0565b600080846001600160a01b031684604051612c6591906132d1565b600060405180830381855af49150503d8060008114612ca0576040519150601f19603f3d011682016040523d82523d6000602084013e612ca5565b606091505b5091509150612ccd828260405180606001604052806027815260200161365a60279139612d80565b95945050505050565b612cdf81612b46565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b600054610100900460ff1680612d2f575060005460ff16155b612d4b5760405162461bcd60e51b8152600401610be090613489565b600054610100900460ff161580156128fb576000805461ffff191661010117905580156111d4576000805461ff001916905550565b60608315612d8f57508161241c565b825115612d9f5782518084602001fd5b8160405162461bcd60e51b8152600401610be091906133be565b600082601f830112612dc9578081fd5b81516020612dde612dd983613524565b6134f3565b80838252828201915082860187848660051b8901011115612dfd578586fd5b855b85811015612e24578151612e1281613624565b84529284019290840190600101612dff565b5090979650505050505050565b80358015158114610ba757600080fd5b600060208284031215612e52578081fd5b813561241c81613624565b60008060408385031215612e6f578081fd5b8235612e7a81613624565b91506020830135612e8a81613624565b809150509250929050565b600080600060608486031215612ea9578081fd5b8335612eb481613624565b92506020840135612ec481613624565b91506040840135612ed481613624565b809150509250925092565b60008060408385031215612ef1578182fd5b8235612efc81613624565b915060208381013567ffffffffffffffff80821115612f19578384fd5b818601915086601f830112612f2c578384fd5b813581811115612f3e57612f3e61360e565b612f50601f8201601f191685016134f3565b91508082528784828501011115612f65578485fd5b8084840185840137810190920192909252919491935090915050565b600080600080600060a08688031215612f98578081fd5b8535612fa381613624565b9450602086013593506040860135612fba81613624565b92506060860135612fca81613624565b9150612fd860808701612e31565b90509295509295909350565b60008060008060808587031215612ff9578384fd5b843561300481613624565b935060208501359250604085013561301b81613624565b915061302960608601612e31565b905092959194509250565b60008060008060808587031215613049578182fd5b843561305481613624565b966020860135965060408601359560600135945092505050565b60006020808385031215613080578182fd5b823567ffffffffffffffff811115613096578283fd5b8301601f810185136130a6578283fd5b80356130b4612dd982613524565b80828252848201915084840188868560051b87010111156130d3578687fd5b8694505b838510156130fe5780356130ea81613624565b8352600194909401939185019185016130d7565b50979650505050505050565b6000806040838503121561311c578182fd5b825167ffffffffffffffff80821115613133578384fd5b818501915085601f830112613146578384fd5b81516020613156612dd983613524565b8083825282820191508286018a848660051b8901011115613175578889fd5b8896505b84871015613197578051835260019690960195918301918301613179565b50918801519196509093505050808211156131b0578283fd5b506131bd85828601612db9565b9150509250929050565b6000602082840312156131d8578081fd5b61241c82612e31565b6000602082840312156131f2578081fd5b5035919050565b6000806040838503121561320b578182fd5b823591506020830135612e8a81613624565b60006020828403121561322e578081fd5b81356001600160e01b03198116811461241c578182fd5b600060208284031215613256578081fd5b5051919050565b60008060008060808587031215613272578182fd5b5050823594602084013594506040840135936060013592509050565b6000815180845260208085019450808401835b838110156132c65781516001600160a01b0316875295820195908201906001016132a1565b509495945050505050565b600082516132e3818460208701613596565b9190910192915050565b60007f416363657373436f6e74726f6c3a206163636f756e742000000000000000000082528351613325816017850160208801613596565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613356816028840160208801613596565b01602801949350505050565b60006020825261241c602083018461328e565b600060408252613388604083018561328e565b828103602084810191909152845180835285820192820190845b81811015612e24578451835293830193918301916001016133a2565b60006020825282518060208401526133dd816040850160208701613596565b601f01601f19169190910160400192915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252600290820152614e4160f01b604082015260600190565b604051601f8201601f1916810167ffffffffffffffff8111828210171561351c5761351c61360e565b604052919050565b600067ffffffffffffffff82111561353e5761353e61360e565b5060051b60200190565b6000821982111561355b5761355b6135f8565b500190565b600081600019048311821515161561357a5761357a6135f8565b500290565b600082821015613591576135916135f8565b500390565b60005b838110156135b1578181015183820152602001613599565b838111156135c0576000848401525b50505050565b6000816135d5576135d56135f8565b506000190190565b60006000198214156135f1576135f16135f8565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146111d457600080fdfe97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a26469706673582212203f148d8a55598631097df1633f1274e3f29a9457055e898b02261244df7cd50464736f6c63430008030033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.