POL Price: $0.162861 (+7.46%)
 

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Claim Rent For T...414979372023-04-13 21:33:171006 days ago1681421597IN
0x6Ef682F0...80c37dA33
0 POL0.04152419143
Claim Rent For T...414979012023-04-13 21:31:591006 days ago1681421519IN
0x6Ef682F0...80c37dA33
0 POL0.04370395150.50658454
Claim Rent For T...414978992023-04-13 21:31:551006 days ago1681421515IN
0x6Ef682F0...80c37dA33
0 POL0.0455895157
Claim Rent For T...414978962023-04-13 21:31:491006 days ago1681421509IN
0x6Ef682F0...80c37dA33
0 POL0.04450997153.28234679
Claim Rent For T...414978912023-04-13 21:31:391006 days ago1681421499IN
0x6Ef682F0...80c37dA33
0 POL0.04791253165
Claim Rent For T...414977122023-04-13 21:24:141006 days ago1681421054IN
0x6Ef682F0...80c37dA33
0 POL0.04255669146.55568781
Claim Rent For T...414977072023-04-13 21:24:021006 days ago1681421042IN
0x6Ef682F0...80c37dA33
0 POL0.04474732154.10503136
Claim Rent For T...414977032023-04-13 21:23:541006 days ago1681421034IN
0x6Ef682F0...80c37dA33
0 POL0.04442798153
Claim Rent For T...414976992023-04-13 21:23:451006 days ago1681421025IN
0x6Ef682F0...80c37dA33
0 POL0.04181457144
Claim Rent For T...414938302023-04-13 18:51:321006 days ago1681411892IN
0x6Ef682F0...80c37dA33
0 POL0.0709532244.34688236
Claim Rent For T...414938262023-04-13 18:51:241006 days ago1681411884IN
0x6Ef682F0...80c37dA33
0 POL0.07520816259
Claim Rent For T...414938232023-04-13 18:51:161006 days ago1681411876IN
0x6Ef682F0...80c37dA33
0 POL0.06417375221
Claim Rent For T...414937762023-04-13 18:49:061006 days ago1681411746IN
0x6Ef682F0...80c37dA33
0 POL0.06794868234
Claim Rent For T...414937412023-04-13 18:47:501006 days ago1681411670IN
0x6Ef682F0...80c37dA33
0 POL0.07520816259
Claim Rent For T...414937352023-04-13 18:47:381006 days ago1681411658IN
0x6Ef682F0...80c37dA33
0 POL0.06915548238.15594352
Claim Rent For T...414937322023-04-13 18:47:321006 days ago1681411652IN
0x6Ef682F0...80c37dA33
0 POL0.06823906235
Claim Rent For T...414936942023-04-13 18:46:101006 days ago1681411570IN
0x6Ef682F0...80c37dA33
0 POL0.05923731204
Claim Rent For T...414921172023-04-13 17:44:501006 days ago1681407890IN
0x6Ef682F0...80c37dA33
0 POL0.06527231224.78318042
Claim Rent For T...414920782023-04-13 17:43:261006 days ago1681407806IN
0x6Ef682F0...80c37dA33
0 POL0.06954698228.72858856
Claim Rent For T...405771232023-03-20 20:01:341030 days ago1679342494IN
0x6Ef682F0...80c37dA33
0 POL0.04269203147
Claim Rent For T...405756052023-03-20 18:56:041030 days ago1679338564IN
0x6Ef682F0...80c37dA33
0 POL0.03687813127
Claim Rent For T...405756032023-03-20 18:56:001030 days ago1679338560IN
0x6Ef682F0...80c37dA33
0 POL0.03496678115
Claim Rent For T...405444622023-03-19 23:42:491031 days ago1679269369IN
0x6Ef682F0...80c37dA33
0 POL0.0290379100
Claim Rent For T...405433932023-03-19 23:01:121031 days ago1679266872IN
0x6Ef682F0...80c37dA33
0 POL0.0205813370.87749079
Claim Rent For T...405428472023-03-19 22:39:371031 days ago1679265577IN
0x6Ef682F0...80c37dA33
0 POL0.0270052493
View all transactions

Parent Transaction Hash Block From To
View All Internal Transactions
Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
USDRTreasury

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 10001 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";

import "./constants/addresses.sol";
import "./constants/roles.sol";
import "./interfaces/IExchange.sol";
import "./interfaces/ILiquidityManager.sol";
import "./interfaces/IRWACalculator.sol";
import "./interfaces/IPriceOracle.sol";
import "./interfaces/ITokenSwap.sol";
import "./interfaces/ITreasury.sol";
import "./interfaces/ITreasuryTracker.sol";
import "./interfaces/IUSDR.sol";
import "./tokens/interfaces/ITangibleERC20.sol";
import "./tangibleInterfaces/IInstantLiquidity.sol";
import "./tangibleInterfaces/ITangibleMarketplace.sol";
import "./tangibleInterfaces/ITangibleRentShare.sol";
import "./tangibleInterfaces/ITangibleRevenueShare.sol";
import "./tangibleInterfaces/ITangiblePiNFT.sol";
import "./AddressAccessor.sol";

bytes32 constant INCENTIVE_VAULT_ADDRESS = bytes32(keccak256("IncentiveVault"));

interface IIncentiveVault {
    function availableAmount() external view returns (uint256);

    function withdraw(uint256 amount) external;
}

interface ITreasuryTrackerExt is ITreasuryTracker {
    //fractions
    function getFractionContractsInTreasury()
        external
        view
        returns (address[] memory);

    function getFractionTokensInTreasury(address ftnft)
        external
        view
        returns (uint256[] memory);

    //tnfts
    function getTnftCategoriesInTreasury()
        external
        view
        returns (address[] memory);

    function getTnftTokensInTreasury(address tnft)
        external
        view
        returns (uint256[] memory);
}

contract USDRTreasury is AddressAccessor, ITreasury, IERC721Receiver {
    using SafeERC20 for IERC20;

    uint8 public incentiveThreshold;
    uint8 public tngblBurnThreshold;
    uint8 public purchaseStableMintedRedeemedThreshold;
    uint8 public purchaseStableMarketcapThreshold;

    uint256 public rebaseAmount;

    address private lastReceivedNFT;
    uint256 private lastReceivedTokenId;

    bool public emergencyStop;

    constructor() {
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
        incentiveThreshold = 130;
        tngblBurnThreshold = 130;
        purchaseStableMintedRedeemedThreshold = 50;
        purchaseStableMarketcapThreshold = 15;
    }

    function setThresholds(
        uint8 _purchaseStableMintedRedeemedThreshold,
        uint8 _purchaseStableMarketcapThreshold,
        uint8 _tngblThreshold,
        uint8 _incentiveThreshold
    ) external onlyRole(DEFAULT_ADMIN_ROLE) {
        purchaseStableMintedRedeemedThreshold = _purchaseStableMintedRedeemedThreshold;
        purchaseStableMarketcapThreshold = _purchaseStableMarketcapThreshold;
        tngblBurnThreshold = _tngblThreshold;
        incentiveThreshold = _incentiveThreshold;
    }

    function multicall(address[] calldata contracts, bytes[] calldata data)
        external
        onlyRole(CONTROLLER_ROLE)
        returns (bytes[] memory results)
    {
        uint256 n = contracts.length;
        results = new bytes[](n);
        for (uint256 i; i < n; i++) {
            (bool success, bytes memory result) = contracts[i].call(data[i]);
            if (success == false) {
                assembly {
                    let ptr := mload(0x40)
                    let size := returndatasize()
                    returndatacopy(ptr, 0, size)
                    revert(ptr, size)
                }
            }
            results[i] = result;
        }
        _verifyBacking(100, true);
    }

    function triggerRebase()
        external
        onlyRole(CONTROLLER_ROLE)
        returns (uint256)
    {
        ITreasury.TreasuryValue memory value = getTreasuryValue();
        (address incentiveVault, address usdr, address exchange) = abi.decode(
            addressProvider.getAddresses(
                abi.encode(
                    INCENTIVE_VAULT_ADDRESS,
                    USDR_ADDRESS,
                    USDR_EXCHANGE_ADDRESS
                )
            ),
            (address, address, address)
        );
        uint256 amount = rebaseAmount;
        uint256 incentiveAmount = IIncentiveVault(incentiveVault)
            .availableAmount();
        if (incentiveAmount > 0) {
            IIncentiveVault(incentiveVault).withdraw(incentiveAmount);
            amount += incentiveAmount;
        }
        require(amount > 0);
        uint256 marketCap = IExchange(exchange).scaleToUnderlying(
            IERC20(usdr).totalSupply()
        );
        if (marketCap + amount > value.total) {
            amount = amount / 2;
        }
        IUSDR(usdr).rebase(amount);
        rebaseAmount = 0;
        return amount;
    }

    //workaround for purchasing initial sale RE
    function purchaseReInitialSale(
        IERC20 paymentToken,
        address ftnft,
        uint256 fractTokenId,
        uint256 share,
        uint256 ptAmount
    ) external {
        (address rePurchaseManager, address marketplace) = abi.decode(
            addressProvider.getAddresses(
                abi.encode(
                    RE_PURCHASE_MANAGER_ADDRESS,
                    TANGIBLE_MARKETPLACE_ADDRESS
                )
            ),
            (address, address)
        );
        require(msg.sender == rePurchaseManager, "only RePM allowed");

        paymentToken.approve(marketplace, ptAmount);
        //purchase ftnft
        ITangibleMarketplace(marketplace).buyFraction(
            ITangibleFractionsNFT(ftnft),
            fractTokenId,
            share
        );
        //update tracker
        updateTrackerFtnft(
            ftnft,
            lastReceivedTokenId,
            true,
            ptAmount,
            IERC20Metadata(address(paymentToken)).decimals()
        );
    }

    function _swapToTreasuryToken(address tokenFrom, uint256 amount)
        internal
        returns (uint256)
    {
        require(
            IERC20(tokenFrom).balanceOf(address(this)) <= amount,
            "not enough token"
        );
        (address tokenSwap, address underlying) = abi.decode(
            addressProvider.getAddresses(
                abi.encode(TOKEN_SWAP_ADDRESS, UNDERLYING_ADDRESS)
            ),
            (address, address)
        );
        uint256 amountOut = ITokenSwap(tokenSwap).quoteOut(
            tokenFrom,
            underlying,
            amount
        );
        IERC20(tokenFrom).approve(tokenSwap, amount);
        return
            ITokenSwap(tokenSwap).exchange(
                tokenFrom,
                underlying,
                amount,
                amountOut,
                ITokenSwap.EXCHANGE_TYPE.EXACT_INPUT
            );
    }

    function getTreasuryValue()
        public
        view
        returns (ITreasury.TreasuryValue memory value)
    {
        AddressHolder memory ah;
        (
            ah.calculator,
            ah.oracle,
            ah.tngbl,
            ah.underlying,
            ah.usdr,
            ah.liquidityManager,
            ah.tngblLiquidityManager,
            ah.promissory
        ) = abi.decode(
            addressProvider.getAddresses(
                abi.encode(
                    RWA_CALCULATOR_ADDRESS,
                    TNGBL_ORACLE_ADDRESS,
                    TNGBL_ADDRESS,
                    UNDERLYING_ADDRESS,
                    USDR_ADDRESS,
                    LIQUIDITY_MANAGER_ADDRESS,
                    TNGBL_LIQUIDITY_MANAGER_ADDRESS,
                    PROMISSORY_ADDRESS
                )
            ),
            (
                address,
                address,
                address,
                address,
                address,
                address,
                address,
                address
            )
        );
        {
            uint256 underlyingMultiplier = 10 **
                (18 - IERC20Metadata(ah.underlying).decimals());
            value.stable =
                IERC20(ah.underlying).balanceOf(address(this)) *
                underlyingMultiplier;
            value.usdr = IERC20(ah.usdr).balanceOf(address(this)) * 1e9;

            (
                value.rwa,
                value.rwaVaults,
                value.rwaEscrow,
                value.rwaValueNotLatest
            ) = IRWACalculator(ah.calculator).calculate(IERC20(ah.underlying));
            value.rwa *= underlyingMultiplier;
            value.rwaEscrow *= underlyingMultiplier;
            value.rwaVaults *= underlyingMultiplier;
        }
        {
            uint256 TNGBL = 10**IERC20Metadata(ah.tngbl).decimals();
            uint256 tngblPrice = IPriceOracle(ah.oracle).quote(TNGBL);
            value.tngbl =
                (IERC20(ah.tngbl).balanceOf(address(this)) * tngblPrice) /
                TNGBL;
            (uint256 tngblAmount, uint256 underlyingAmount) = ILiquidityManager(
                ah.tngblLiquidityManager
            ).getTokenAmounts();
            value.tngblLiquidity.tngbl = (tngblAmount * tngblPrice) / TNGBL;
            value.tngblLiquidity.underlying = underlyingAmount;
            value.tngblLiquidity.liquidity =
                value.tngblLiquidity.tngbl +
                underlyingAmount;
        }
        value.liquidity = ILiquidityManager(ah.liquidityManager).liquidity();
        value.debt =
            IERC20(ah.promissory).totalSupply() *
            (10**(18 - IERC20Metadata(ah.promissory).decimals()));
        value.total =
            value.stable +
            value.usdr +
            value.rwa +
            value.tngbl +
            value.liquidity +
            value.tngblLiquidity.liquidity +
            value.rwaVaults +
            value.rwaEscrow;
        if (value.debt < value.total) value.total = value.total - value.debt;
        else value.total = 0;
    }

    function withdraw(
        address stableToken,
        uint256 amount,
        address receiver
    ) external override validToken(stableToken) {
        (address usdrExchange, address promissory) = abi.decode(
            addressProvider.getAddresses(
                abi.encode(USDR_EXCHANGE_ADDRESS, PROMISSORY_ADDRESS)
            ),
            (address, address)
        );
        require(
            msg.sender == usdrExchange || msg.sender == promissory,
            "not allowed"
        );
        IERC20(stableToken).safeTransfer(receiver, amount);
    }

    //add fraction storage payment!!!!!!!

    function defractionalize(
        ITangibleFractionsNFT ftnft,
        uint256[] memory tokenIds
    ) external onlyRole(CONTROLLER_ROLE) {
        ftnft.defractionalize(tokenIds);
        uint256 length = tokenIds.length;
        ITreasuryTracker tracker = ITreasuryTracker(
            _fetchAddress(TREASURY_TRACKER_ADDRESS)
        );
        for (uint256 i = 1; i < length; i++) {
            tracker.ftnftTreasuryPlaced(address(ftnft), tokenIds[i], false);
        }
        // the last received nft is the one underlying in ftnft
        address tnft = address(ftnft.tnft());
        uint256 tnftTokenId = ftnft.tnftTokenId();
        if (IERC721(tnft).ownerOf(tnftTokenId) == address(this)) {
            tracker.ftnftTreasuryPlaced(address(ftnft), tokenIds[0], false);
            tracker.tnftTreasuryPlaced(tnft, tnftTokenId, true);
        } else {
            tracker.updateFractionData(address(ftnft), tokenIds[0]);
        }
        IERC20 revenueToken = IERC20(_fetchAddress(REVENUE_TOKEN_ADDRESS));
        if (revenueToken.balanceOf(address(this)) > 0) {
            _swapToTreasuryToken(
                address(revenueToken),
                revenueToken.balanceOf(address(this))
            );
        }
    }

    function updateTrackerFtnftExt(
        address ftnft,
        uint256 tokenId,
        bool placed
    ) external onlyRole(TRACKER_ROLE) {
        updateTrackerFtnft(ftnft, tokenId, placed, 0, 0);
    }

    function updateTrackerFtnft(
        address ftnft,
        uint256 tokenId,
        bool placed,
        uint256 ptAmount,
        uint8 ptDecimals
    ) internal {
        AddressHolder memory ah;
        (ah.tracker, ah.calculator, ah.marketplace) = abi.decode(
            addressProvider.getAddresses(
                abi.encode(
                    TREASURY_TRACKER_ADDRESS,
                    RWA_CALCULATOR_ADDRESS,
                    TANGIBLE_MARKETPLACE_ADDRESS
                )
            ),
            (address, address, address)
        );
        ITreasuryTracker(ah.tracker).ftnftTreasuryPlaced(
            ftnft,
            tokenId,
            placed
        );
        (string memory currency, uint256 value) = IRWACalculator(ah.calculator)
            .calcFractionNativeValue(
                ftnft,
                ITangibleFractionsNFT(ftnft).fractionShares(tokenId)
            );
        IFactoryExt factory = ITangibleMarketplace(ah.marketplace).factory();
        placed
            ? ITreasuryTracker(ah.tracker).addValueAfterPurchase(
                currency,
                value,
                factory
                    .fractionToTnftAndId(ITangibleFractionsNFT(ftnft))
                    .initialSaleDone,
                ptAmount,
                ptDecimals
            )
            : ITreasuryTracker(ah.tracker).subValueAfterPurchase(
                currency,
                value
            );
    }

    function updateTrackerTnftExt(
        address tnft,
        uint256 tokenId,
        bool placed
    ) external onlyRole(TRACKER_ROLE) {
        updateTrackerTnft(tnft, tokenId, placed);
    }

    function updateTrackerTnft(
        address tnft,
        uint256 tokenId,
        bool placed
    ) internal {
        (address tracker, address rwaCalculator) = abi.decode(
            addressProvider.getAddresses(
                abi.encode(TREASURY_TRACKER_ADDRESS, RWA_CALCULATOR_ADDRESS)
            ),
            (address, address)
        );
        ITreasuryTracker(tracker).tnftTreasuryPlaced(tnft, tokenId, placed);
        (string memory currency, uint256 value) = IRWACalculator(rwaCalculator)
            .calcTnftNativeValue(
                tnft,
                ITangibleNFT(tnft).tokensFingerprint(tokenId)
            );
        placed
            ? ITreasuryTracker(tracker).addValueAfterPurchase(
                currency,
                value,
                true,
                0,
                0
            )
            : ITreasuryTracker(tracker).subValueAfterPurchase(currency, value);
    }

    function toggleStop() external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (emergencyStop) {
            emergencyStop = false;
        } else {
            emergencyStop = true;
        }
    }

    function withdrawToken(address token)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        (address underlying, address tngbl) = abi.decode(
            addressProvider.getAddresses(
                abi.encode(UNDERLYING_ADDRESS, TNGBL_ADDRESS)
            ),
            (address, address)
        );
        if (token == tngbl || token == underlying) {
            require(emergencyStop, "emergency stop required");
        }
        IERC20(token).safeTransfer(
            msg.sender,
            IERC20(token).balanceOf(address(this))
        );
    }

    function withdrawDepositNFT(
        address _nft,
        uint256[] calldata _tokenIds,
        bool ftnft,
        bool depositing
    ) external onlyRole(DEFAULT_ADMIN_ROLE) {
        _withdrawDepositNFT(_nft, _tokenIds, ftnft, depositing);
    }

    function _withdrawDepositNFT(
        address _nft,
        uint256[] calldata _tokenIds,
        bool ftnft,
        bool depositing
    ) internal {
        require(emergencyStop, "emergency stop required");
        uint256 length = _tokenIds.length;

        for (uint256 i; i < length; i++) {
            depositing //send to treasury
                ? IERC721(_nft).safeTransferFrom(
                    msg.sender,
                    address(this),
                    _tokenIds[i]
                ) //send to caller
                : IERC721(_nft).safeTransferFrom(
                    address(this),
                    msg.sender,
                    _tokenIds[i]
                );
            if (!ftnft) {
                updateTrackerTnft(
                    _nft,
                    _tokenIds[i],
                    depositing ? true : false
                );
            } else {
                updateTrackerFtnft(
                    _nft,
                    _tokenIds[i],
                    depositing ? true : false,
                    0,
                    0
                );
            }
        }
    }

    function claimRentForToken(
        address revenueShare,
        address contractAddress,
        uint256 tokenId
    ) external onlyRole(CONTROLLER_ROLE) {
        address revenueToken = ITangibleRevenueShare(revenueShare)
            .revenueToken();
        uint256 balanceBefore = IERC20(revenueToken).balanceOf(address(this));
        ITangibleRevenueShare(revenueShare).claimForToken(
            contractAddress,
            tokenId
        );
        uint256 claimedAmount = IERC20(revenueToken).balanceOf(address(this)) -
            balanceBefore;
        rebaseAmount += _swapToTreasuryToken(revenueToken, claimedAmount);

        emit RentClaimed(revenueToken, claimedAmount);
    }

    function payFractionStorage(
        address ftnft,
        uint256 tokenId,
        uint256 amount
    ) external onlyRole(CONTROLLER_ROLE) {
        (address marketplace, address tokenSwap, address underlying) = abi
            .decode(
                addressProvider.getAddresses(
                    abi.encode(
                        TANGIBLE_MARKETPLACE_ADDRESS,
                        TOKEN_SWAP_ADDRESS,
                        UNDERLYING_ADDRESS
                    )
                ),
                (address, address, address)
            );
        IFactoryExt factory = ITangibleMarketplace(marketplace).factory();
        IFractionStorageManager manager = factory.storageManagers(
            ITangibleFractionsNFT(ftnft)
        );
        factory.defUSD().approve(address(manager), amount);

        uint256 reserveAmount = ITokenSwap(tokenSwap).quoteIn(
            underlying,
            address(factory.defUSD()),
            amount
        );

        IERC20(underlying).approve(tokenSwap, reserveAmount);
        ITokenSwap(tokenSwap).exchange(
            underlying,
            address(factory.defUSD()),
            reserveAmount,
            amount,
            ITokenSwap.EXCHANGE_TYPE.EXACT_OUTPUT
        );
        manager.payShareStorage(tokenId);
    }

    function onERC721Received(
        address, /*operator*/
        address, /*seller*/
        uint256 tokenId,
        bytes calldata /*data*/
    ) external override returns (bytes4) {
        lastReceivedNFT = msg.sender;
        lastReceivedTokenId = tokenId;
        require(
            IERC721(lastReceivedNFT).ownerOf(lastReceivedTokenId) ==
                address(this),
            "Not owner"
        );
        return IERC721Receiver.onERC721Received.selector;
    }

    function _fetchAddress(bytes32 contractAddress)
        internal
        view
        returns (address)
    {
        return addressProvider.getAddress(contractAddress);
    }

    function _verifyBacking(uint8 threshold, bool includeTNGBL) internal view {
        address usdr = _fetchAddress(USDR_ADDRESS);
        ITreasury.TreasuryValue memory tv = getTreasuryValue();
        uint256 scaledMarketCap = IERC20(usdr).totalSupply() * 1e9;
        uint256 backing = tv.total;
        if (!includeTNGBL) {
            backing = backing - tv.tngbl - tv.tngblLiquidity.tngbl;
        }
        require(
            (scaledMarketCap * threshold) / 100 <= backing,
            "insufficient backing"
        );
    }

    modifier validToken(address token) {
        (address underlying, address tngbl) = abi.decode(
            addressProvider.getAddresses(
                abi.encode(UNDERLYING_ADDRESS, TNGBL_ADDRESS)
            ),
            (address, address)
        );
        require(token == underlying || token == tngbl, "invalid token");
        _;
    }
}

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

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * 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 AccessControl is Context, IAccessControl, ERC165 {
    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);
        _;
    }

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

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

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @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 virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.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 virtual 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.
     *
     * May emit a {RoleGranted} event.
     */
    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.
     *
     * May emit a {RoleRevoked} event.
     */
    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 revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    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.
     *
     * May emit a {RoleGranted} event.
     *
     * [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}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    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);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 5 of 43 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 6 of 43 : addresses.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

bytes32 constant pDAI_ADDRESS = bytes32(keccak256("pDAI"));
bytes32 constant INSTANT_LIQUIDITY_ADDRESS = bytes32(
    keccak256("InstantLiquidity")
);
bytes32 constant LIQUIDITY_MANAGER_ADDRESS = bytes32(
    keccak256("LiquidityManager")
);
bytes32 constant TNGBL_LIQUIDITY_MANAGER_ADDRESS = bytes32(
    keccak256("TNGBLLiquidityManager")
);
bytes32 constant PROMISSORY_ADDRESS = bytes32(keccak256("pDAI"));
bytes32 constant RWA_CALCULATOR_ADDRESS = bytes32(keccak256("RWACalculator"));
bytes32 constant TANGIBLE_MARKETPLACE_ADDRESS = bytes32(
    keccak256("TangibleMarketplace")
);
bytes32 constant TANGIBLE_PRICE_MANAGER_ADDRESS = bytes32(
    keccak256("TangiblePriceManager")
);
bytes32 constant TANGIBLE_RENT_SHARE_ADDRESS = bytes32(
    keccak256("TangibleRentShare")
);
bytes32 constant TANGIBLE_REVENUE_SHARE_ADDRESS = bytes32(
    keccak256("TangibleRevenueShare")
);
bytes32 constant TANGIBLE_PINFT_ADDRESS = bytes32(keccak256("TangiblePINFT"));
bytes32 constant TNGBL_ADDRESS = bytes32(keccak256("TNGBL"));
bytes32 constant TNGBL_ORACLE_ADDRESS = bytes32(keccak256("TNGBLPriceOracle"));
bytes32 constant TOKEN_SWAP_ADDRESS = bytes32(keccak256("TokenSwap"));
bytes32 constant TREASURY_ADDRESS = bytes32(keccak256("USDRTreasury"));
bytes32 constant TREASURY_TRACKER_ADDRESS = bytes32(
    keccak256("TreasuryTracker")
);
bytes32 constant UNDERLYING_ADDRESS = bytes32(keccak256("underlying"));
bytes32 constant REVENUE_TOKEN_ADDRESS = bytes32(keccak256("revenueToken"));
bytes32 constant UNISWAP_V3_FACTORY_ADDRESS = bytes32(
    keccak256("uniswapV3Factory")
);
bytes32 constant UNISWAP_V3_NFT_MANAGER_ADDRESS = bytes32(
    keccak256("uniswapV3NonfungiblePositionManager")
);
bytes32 constant UNISWAP_V3_POOL_ADDRESS = bytes32(keccak256("uniswapV3Pool"));
bytes32 constant UNISWAP_V3_SWAP_ROUTER_ADDRESS = bytes32(
    keccak256("uniswapV3SwapRouter")
);
bytes32 constant UNISWAP_V3_TOKEN_MATH_ADDRESS = bytes32(
    keccak256("LiquidityTokenMath")
);
bytes32 constant USDR_ADDRESS = bytes32(keccak256("USDR"));
bytes32 constant USDR_EXCHANGE_ADDRESS = bytes32(keccak256("USDRExchange"));
//treasury managers
bytes32 constant RE_PURCHASE_MANAGER_ADDRESS = bytes32(
    keccak256("RePurchaseManager")
);
bytes32 constant RE_SELL_MANAGER_ADDRESS = bytes32(keccak256("ReSellManager"));
bytes32 constant GOLD_PURCHASE_MANAGER_ADDRESS = bytes32(
    keccak256("GoldPurchaseManager")
);
bytes32 constant GOLD_SELL_MANAGER_ADDRESS = bytes32(
    keccak256("GoldSellManager")
);
bytes32 constant DAI_USD_ORACLE_ADDRESS = bytes32(keccak256("DaiUsdOracle"));
bytes32 constant CURRENCY_FEED_ADDRESS = bytes32(keccak256("CurrencyFeed"));
bytes32 constant VAULTS_TRACKER_ADDRESS = bytes32(keccak256("VaultsTracker"));

File 7 of 43 : roles.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

bytes32 constant BURNER_ROLE = bytes32(keccak256("BURNER"));
bytes32 constant MINTER_ROLE = bytes32(keccak256("MINTER"));
bytes32 constant CONTROLLER_ROLE = bytes32(keccak256("CONTROLLER"));
bytes32 constant TRACKER_ROLE = bytes32(keccak256("TRACKER"));
bytes32 constant ROUTER_POLICY_ROLE = bytes32(keccak256("ROUTER_POLICY"));

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

interface IExchange {
    function scaleFromUnderlying(uint256 amount)
        external
        view
        returns (uint256);

    function scaleToUnderlying(uint256 amount) external view returns (uint256);

    function swapFromUnderlying(uint256 amountIn, address to)
        external
        returns (uint256 amountOut);

    function updateMintingStats(int128[7] calldata delta) external;
}

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

interface ILiquidityManager {
    function getTokenAmounts()
        external
        view
        returns (uint256 tokenAmount, uint256 underlyingAmount);

    function liquidity() external view returns (uint256);

    function increaseLiquidity(uint256 underlyingAmount)
        external
        returns (
            uint128 liquidity,
            uint256 amount0,
            uint256 amount1
        );
}

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

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

interface IRWACalculator {
    function calculate(IERC20 treasuryToken)
        external
        view
        returns (
            uint256,
            uint256,
            uint256,
            bool
        );

    function fetchPaymentTokenAndAmountFtnft(
        address ftnft,
        uint256 fractionId,
        uint256 share
    )
        external
        view
        returns (
            IERC20,
            uint256,
            bool
        );

    function fetchPaymentTokenAndAmountTnft(
        address tnft,
        uint256 fingerprint,
        uint256 tokenId,
        uint256 _years,
        bool unminted
    )
        external
        view
        returns (
            IERC20,
            uint256,
            bool
        );

    function calcFractionNativeValue(address ftnft, uint256 share)
        external
        view
        returns (string memory currency, uint256 value);

    function calcTnftNativeValue(address tnft, uint256 fingerprint)
        external
        view
        returns (string memory currency, uint256 value);
}

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

interface IPriceOracle {
    function quote(uint256 amountIn) external view returns (uint256);
}

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

interface ITokenSwap {
    enum EXCHANGE_TYPE {
        EXACT_INPUT,
        EXACT_OUTPUT
    }

    function quoteOut(
        address tokenIn,
        address tokenOut,
        uint256 amountIn
    ) external view returns (uint256);

    function quoteIn(
        address tokenIn,
        address tokenOut,
        uint256 amountOut
    ) external view returns (uint256);

    function exchange(
        address tokenIn,
        address tokenOut,
        uint256 amountIn,
        uint256 minAmountOut,
        EXCHANGE_TYPE exchangeType
    ) external returns (uint256);
}

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

interface ITreasury {
    struct TNGBLLiquidity {
        uint256 tngbl;
        uint256 underlying;
        uint256 liquidity;
    }

    struct TreasuryValue {
        uint256 stable;
        uint256 usdr;
        uint256 rwa;
        uint256 tngbl;
        uint256 liquidity;
        TNGBLLiquidity tngblLiquidity;
        uint256 debt;
        uint256 total;
        uint256 rwaVaults;
        uint256 rwaEscrow;
        bool rwaValueNotLatest;
    }

    struct AddressHolder {
        address calculator;
        address oracle;
        address tngbl;
        address underlying;
        address usdr;
        address liquidityManager;
        address tngblLiquidityManager;
        address promissory;
        address tracker;
        address marketplace;
    }

    event RentClaimed(address indexed rentToken, uint256 amountClaimed);
    event TNGBLClaimed(address indexed tngbl, uint256 claimedAmountTngbl);
    event RevenueShareClaimed(
        address indexed revenueToken,
        uint256 claimedAmountRev
    );

    function purchaseStableMintedRedeemedThreshold()
        external
        view
        returns (uint8);

    function purchaseStableMarketcapThreshold() external view returns (uint8);

    function multicall(address[] calldata contracts, bytes[] calldata data)
        external
        returns (bytes[] memory results);

    function withdraw(
        address token,
        uint256 amount,
        address receiver
    ) external;

    function getTreasuryValue() external view returns (TreasuryValue memory);

    function updateTrackerFtnftExt(
        address ftnft,
        uint256 tokenId,
        bool placed
    ) external;

    function updateTrackerTnftExt(
        address tnft,
        uint256 tokenId,
        bool placed
    ) external;

    function purchaseReInitialSale(
        IERC20 paymentToken,
        address ftnft,
        uint256 fractTokenId,
        uint256 share,
        uint256 ptAmount
    ) external;
}

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";

interface ITreasuryTracker {
    struct FractionIdData {
        address tnft;
        uint256 tnftTokenId;
        uint256 share;
        uint256 fractionId;
    }

    function tnftTreasuryPlaced(
        address tnft,
        uint256 tokenId,
        bool placed
    ) external;

    function ftnftTreasuryPlaced(
        address ftnft,
        uint256 tokenId,
        bool placed
    ) external;

    function updateFractionData(address ftnft, uint256 tokenId) external;

    function getFractionTokensDataInTreasury(address ftnft)
        external
        view
        returns (FractionIdData[] memory fData);

    function getRwaUsdValue(IERC20Metadata token)
        external
        view
        returns (
            uint256 usdValue,
            uint256 usdValueEscrow,
            bool priceUpToDate
        );

    function addValueAfterPurchase(
        string calldata currency,
        uint256 value,
        bool notInEscrow,
        uint256 ptAmount,
        uint8 ptDecimals
    ) external;

    function subValueAfterPurchase(string calldata currency, uint256 value)
        external;
}

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";

interface IUSDR is IERC20Upgradeable {
    function burn(address account, uint256 amount) external;

    function mint(address account, uint256 amount) external;

    function rebase(uint256 supplyDelta) external;
}

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

interface ITangibleERC20 {
    function approve(address who, uint256 amount) external;

    function burn(uint256 amount) external;
}

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

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

/// @title IInstantLiquidity defines interaface of InstantLiquidity engine
interface IInstantLiquidity {
    struct InstantLot {
        address nft;
        uint256 tokenId;
        address seller;
        bool fraction;
    }

    event ExchangeAddressSet(
        address indexed oldAddress,
        address indexed newAddress
    );

    event FactoryAddressSet(
        address indexed oldAddress,
        address indexed newAddress
    );

    event TNGBLOracleAddressSet(
        address indexed oldAddress,
        address indexed newAddress
    );

    event IILCalculatorAddressSet(
        address indexed oldAddress,
        address indexed newAddress
    );

    event DefaultToken(IERC20 token);

    function sellInstant(
        ITangibleNFT _nft,
        uint256 _fingerprint,
        uint256 _tokenId
    ) external;

    function buyInstant(ITangibleNFT _nft, uint256 _tokenId) external;

    function sellInstantFraction(ITangibleFractionsNFT _nft, uint256 _tokenId)
        external;

    function buyFractionInstant(
        ITangibleFractionsNFT _ftnft,
        uint256 _tokenFractId
    ) external;

    function withdrawUSDC() external;

    function withdrawTNGBL() external;
}

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

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

interface IFactoryExt {
    struct TnftWithId {
        ITangibleNFT tnft;
        uint256 tnftTokenId;
        bool initialSaleDone;
    }

    function storageManagers(ITangibleFractionsNFT ftnft)
        external
        view
        returns (IFractionStorageManager);

    function defUSD() external view returns (IERC20);

    function paymentTokens(IERC20 token) external view returns (bool);

    function fractionToTnftAndId(ITangibleFractionsNFT fraction)
        external
        view
        returns (TnftWithId memory);

    function initReSeller() external view returns (address);
}

/// @title ITangibleMarketplace interface defines the interface of the Marketplace
interface ITangibleMarketplace {
    struct Lot {
        ITangibleNFT nft;
        IERC20 paymentToken;
        uint256 tokenId;
        address seller;
        uint256 price;
        bool minted;
    }

    struct LotFract {
        ITangibleFractionsNFT nft;
        IERC20 paymentToken;
        uint256 tokenId;
        address seller;
        uint256 price; //total wanted price for share
        uint256 minShare;
        uint256 initialShare;
    }

    function marketplace(address tnft, uint256 tokenId)
        external
        view
        returns (Lot memory);

    function marketplaceFract(address ftnft, uint256 fractionId)
        external
        view
        returns (LotFract memory);

    function factory() external view returns (IFactoryExt);

    /// @dev The function allows anyone to put on sale the TangibleNFTs they own
    /// if price is 0 - use oracle when selling
    function sellBatch(
        ITangibleNFT nft,
        IERC20 paymentToken,
        uint256[] calldata tokenIds,
        uint256[] calldata price
    ) external;

    /// @dev The function allows the owner of the minted TangibleNFT items to remove them from the Marketplace
    function stopBatchSale(ITangibleNFT nft, uint256[] calldata tokenIds)
        external;

    /// @dev The function allows the user to buy any TangibleNFT from the Marketplace for USDC
    function buy(
        ITangibleNFT nft,
        uint256 tokenId,
        uint256 _years
    ) external;

    /// @dev The function allows the user to buy any TangibleNFT from the Marketplace for USDC this is for unminted items
    function buyUnminted(
        ITangibleNFT nft,
        uint256 _fingerprint,
        uint256 _years,
        bool _onlyLock
    ) external;

    function buyFraction(
        ITangibleFractionsNFT ftnft,
        uint256 fractTokenId,
        uint256 share
    ) external;

    function sellFraction(
        ITangibleFractionsNFT ftnft,
        IERC20 paymentToken,
        uint256 fractTokenId,
        uint256[] calldata shares,
        uint256 price,
        uint256 minPurchaseShare
    ) external;

    /// @dev The function which buys additional storage to token.
    function payStorage(
        ITangibleNFT nft,
        uint256 tokenId,
        uint256 _years
    ) external;

    function sellFractionInitial(
        ITangibleNFT tnft,
        IERC20 paymentToken,
        uint256 tokenId,
        uint256 keepShare,
        uint256 sellShare,
        uint256 sellSharePrice,
        uint256 minPurchaseShare
    ) external returns (ITangibleFractionsNFT ftnft, uint256 tokenToSell);

    function stopFractSale(ITangibleFractionsNFT ftnft, uint256 tokenId)
        external;
}

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

interface ITangibleRentShare {
    function forToken(address contractAddress, uint256 tokenId)
        external
        returns (address);
}

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

interface ITangibleRevenueShare {
    function claimForToken(address contractAddress, uint256 tokenId) external;

    function revenueToken() external view returns (address);
}

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

interface ITangiblePiNFT {
    function claim(uint256 tokenId, uint256 amount) external;

    function claimableIncome(uint256 tokenId)
        external
        view
        returns (uint256, uint256);
}

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

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

import "./AddressProvider.sol";

abstract contract AddressAccessor is AccessControl {
    AddressProvider public addressProvider;

    function setAddressProvider(AddressProvider _addressProvider)
        public
        virtual
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        addressProvider = _addressProvider;
    }
}

abstract contract AddressAccessorUpgradable is AccessControlUpgradeable {
    AddressProvider public addressProvider;

    function setAddressProvider(AddressProvider _addressProvider)
        public
        virtual
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        addressProvider = _addressProvider;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @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;
}

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

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.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 ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

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 IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[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);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

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

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

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

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

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

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

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

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

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

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

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

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

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

interface ITangibleNFT {
    function storagePricePerYear() external view returns (uint256);

    function storagePercentagePricePerYear() external view returns (uint256);

    function storagePriceFixed() external view returns (bool);

    function storageRequired() external view returns (bool);

    function tnftToPassiveNft(uint256 tokenId) external view returns (uint256);

    function claim(uint256 tokenId, uint256 amount) external;

    function tokensFingerprint(uint256 tokenId) external view returns (uint256);
}

interface ITangibleFractionsNFT {
    function defractionalize(uint256[] memory tokenIds) external;

    function tnft() external view returns (ITangibleNFT nft);

    function tnftTokenId() external view returns (uint256 tokenId);

    function tnftFingerprint() external view returns (uint256 fingerprint);

    function fractionShares(uint256 fractionId)
        external
        view
        returns (uint256 share);

    function fullShare() external view returns (uint256 fullShare);

    function claim(uint256 fractionId, uint256 amount) external;

    function claimableIncome(uint256 fractionId)
        external
        view
        returns (uint256);
}

interface IFractionStorageManager {
    function payShareStorage(uint256 tokenId) external;
}

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

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 onlyInitializing {
    }

    function __AccessControl_init_unchained() internal onlyInitializing {
    }
    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);
        _;
    }

    /**
     * @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 virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @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 virtual {
        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 virtual 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.
     *
     * May emit a {RoleGranted} event.
     */
    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.
     *
     * May emit a {RoleRevoked} event.
     */
    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 revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    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.
     *
     * May emit a {RoleGranted} event.
     *
     * [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}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    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);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.9;

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

contract AddressProvider is OwnableUpgradeable {
    event UpdatedAddress(bytes32 indexed component, address indexed newAddress);

    mapping(bytes32 => address) public getAddress;

    function initialize() public initializer {
        __Ownable_init();
    }

    function setAddress(bytes32 component, address address_)
        external
        onlyOwner
    {
        getAddress[component] = address_;
        emit UpdatedAddress(component, address_);
    }

    function getAddresses(bytes calldata components)
        external
        view
        returns (bytes memory)
    {
        uint256 length = components.length;
        bytes memory result = new bytes(length);
        uint256 ptr;
        assembly {
            ptr := add(result, 0x20)
        }
        for (uint256 i = 0; i < length; i += 32) {
            address address_ = getAddress[bytes32(components[i:(i + 32)])];
            assembly {
                mstore(ptr, address_)
                ptr := add(ptr, 0x20)
            }
        }
        return result;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

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

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

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 onlyInitializing {
    }

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

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

pragma solidity ^0.8.0;

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

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 onlyInitializing {
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 40 of 43 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * 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.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

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

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }
}

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

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

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

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

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

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rentToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountClaimed","type":"uint256"}],"name":"RentClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"revenueToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"claimedAmountRev","type":"uint256"}],"name":"RevenueShareClaimed","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":"tngbl","type":"address"},{"indexed":false,"internalType":"uint256","name":"claimedAmountTngbl","type":"uint256"}],"name":"TNGBLClaimed","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"addressProvider","outputs":[{"internalType":"contract AddressProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"revenueShare","type":"address"},{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"claimRentForToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITangibleFractionsNFT","name":"ftnft","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"defractionalize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyStop","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTreasuryValue","outputs":[{"components":[{"internalType":"uint256","name":"stable","type":"uint256"},{"internalType":"uint256","name":"usdr","type":"uint256"},{"internalType":"uint256","name":"rwa","type":"uint256"},{"internalType":"uint256","name":"tngbl","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"components":[{"internalType":"uint256","name":"tngbl","type":"uint256"},{"internalType":"uint256","name":"underlying","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"internalType":"struct ITreasury.TNGBLLiquidity","name":"tngblLiquidity","type":"tuple"},{"internalType":"uint256","name":"debt","type":"uint256"},{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"rwaVaults","type":"uint256"},{"internalType":"uint256","name":"rwaEscrow","type":"uint256"},{"internalType":"bool","name":"rwaValueNotLatest","type":"bool"}],"internalType":"struct ITreasury.TreasuryValue","name":"value","type":"tuple"}],"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":[],"name":"incentiveThreshold","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"contracts","type":"address[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"ftnft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"payFractionStorage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"paymentToken","type":"address"},{"internalType":"address","name":"ftnft","type":"address"},{"internalType":"uint256","name":"fractTokenId","type":"uint256"},{"internalType":"uint256","name":"share","type":"uint256"},{"internalType":"uint256","name":"ptAmount","type":"uint256"}],"name":"purchaseReInitialSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"purchaseStableMarketcapThreshold","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"purchaseStableMintedRedeemedThreshold","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebaseAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":[{"internalType":"contract AddressProvider","name":"_addressProvider","type":"address"}],"name":"setAddressProvider","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_purchaseStableMintedRedeemedThreshold","type":"uint8"},{"internalType":"uint8","name":"_purchaseStableMarketcapThreshold","type":"uint8"},{"internalType":"uint8","name":"_tngblThreshold","type":"uint8"},{"internalType":"uint8","name":"_incentiveThreshold","type":"uint8"}],"name":"setThresholds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tngblBurnThreshold","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleStop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"triggerRebase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"ftnft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bool","name":"placed","type":"bool"}],"name":"updateTrackerFtnftExt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tnft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bool","name":"placed","type":"bool"}],"name":"updateTrackerTnftExt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"stableToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nft","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"bool","name":"ftnft","type":"bool"},{"internalType":"bool","name":"depositing","type":"bool"}],"name":"withdrawDepositNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506200001f6000336200003e565b6001805463ffffffff60a01b1916630799414160a11b179055620000df565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620000db576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556200009a3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b615a3880620000ef6000396000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c806363a599a41161010457806393a12825116100a2578063c9b1bb2411610071578063c9b1bb24146104ad578063d547741f146104c0578063d72b3842146104d3578063dd315e70146104e657600080fd5b806393a12825146104815780639a70eef114610494578063a217fddf1461049c578063baee865e146104a457600080fd5b80636f27acb5116100de5780636f27acb5146103fe57806385fbda9b14610411578063894760691461043757806391d148541461044a57600080fd5b806363a599a4146103be57806363fb0b96146103cb57806369328dec146103eb57600080fd5b80632f2ff15d1161017c5780634036656f1161014b5780634036656f1461035e578063417b4dca1461037157806356192124146103845780636324bdbc1461039757600080fd5b80632f2ff15d146102d957806334909aab146102ec57806336568abe1461032357806338ec5a301461033657600080fd5b80631a5fa2e3116101b85780631a5fa2e314610261578063200ae02b14610276578063248a9ca31461028b5780632954018c146102ae57600080fd5b806301ffc9a7146101df5780630c7d393114610207578063150b7a021461021d575b600080fd5b6101f26101ed366004614ae5565b6104f9565b60405190151581526020015b60405180910390f35b61020f610592565b6040519081526020016101fe565b61023061022b366004614b3c565b6109bb565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016101fe565b61027461026f366004614bdb565b610afd565b005b61027e610b43565b6040516101fe9190614bf8565b61020f610299366004614c9a565b60009081526020819052604090206001015490565b6001546102c1906001600160a01b031681565b6040516001600160a01b0390911681526020016101fe565b6102746102e7366004614cb3565b611571565b6001546103119074010000000000000000000000000000000000000000900460ff1681565b60405160ff90911681526020016101fe565b610274610331366004614cb3565b61159b565b6001546103119077010000000000000000000000000000000000000000000000900460ff1681565b61027461036c366004614cf1565b611627565b61027461037f366004614d33565b611662565b610274610392366004614dc8565b611d0c565b60015461031190760100000000000000000000000000000000000000000000900460ff1681565b6005546101f29060ff1681565b6103de6103d9366004614ecf565b612363565b6040516101fe9190614f93565b6102746103f9366004615013565b6124f3565b61027461040c366004615059565b61281c565b600154610311907501000000000000000000000000000000000000000000900460ff1681565b610274610445366004614bdb565b61293c565b6101f2610458366004614cb3565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b61027461048f3660046150b5565b612b8b565b610274612ea0565b61020f600081565b61020f60025481565b6102746104bb366004614cf1565b612f10565b6102746104ce366004614cb3565b612f48565b6102746104e1366004615106565b612f6d565b6102746104f4366004615147565b613227565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061058c57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60007f70546d1c92f8c2132ae23a23f5177aa8526356051c7510df99f50e012d2215296105be81613247565b60006105c8610b43565b600154604080517f8541fe357c2181e26fc7e72af17a53e071d733c15d4819f155d10ed9ef98c92260208201527f46368cfe9eb4bdc14a0db9efb4fd64daed77c6c7eed07a5ecc8636d750f4116c818301527fd7b5cea1258f7a2acae3ed88fa9155d7a4e8425cafbbe0267f7d8ac75968341a6060808301919091528251808303909101815260808201928390527f7b7dfa5500000000000000000000000000000000000000000000000000000000909252929350600092839283926001600160a01b0390911691637b7dfa55916106a2916084016151c4565b60006040518083038186803b1580156106ba57600080fd5b505afa1580156106ce573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106f69190810190615226565b806020019051810190610709919061526f565b925092509250600060025490506000846001600160a01b03166391f7cfb96040518163ffffffff1660e01b815260040160206040518083038186803b15801561075157600080fd5b505afa158015610765573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078991906152b1565b90508015610813576040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290526001600160a01b03861690632e1a7d4d90602401600060405180830381600087803b1580156107ec57600080fd5b505af1158015610800573d6000803e3d6000fd5b50505050808261081091906152f9565b91505b6000821161082057600080fd5b6000836001600160a01b03166327c6b4ba866001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561086a57600080fd5b505afa15801561087e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a291906152b1565b6040518263ffffffff1660e01b81526004016108c091815260200190565b60206040518083038186803b1580156108d857600080fd5b505afa1580156108ec573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091091906152b1565b60e088015190915061092284836152f9565b111561093657610933600284615311565b92505b6040517fbc4f2d6d000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b0386169063bc4f2d6d90602401600060405180830381600087803b15801561099157600080fd5b505af11580156109a5573d6000803e3d6000fd5b5050600060025550929850505050505050505090565b600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000163390811790915560048481556040517f6352211e0000000000000000000000000000000000000000000000000000000081529081018590526000913091636352211e9060240160206040518083038186803b158015610a3f57600080fd5b505afa158015610a53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a77919061534c565b6001600160a01b031614610ad25760405162461bcd60e51b815260206004820152600960248201527f4e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b507f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6000610b0881613247565b50600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b610b4b614a67565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810191909152600154604080517fdc17c944fa6555801ea40fd8f1e96329b99e57d49e638ff09fa13246c8de84ef60208201527fae439099f665034391cd98cdef153f4746a600e19bb1c12bec8eb425d4440b79918101919091527fe17af420adc2ecb8bbc8370891481cb5eba8e79cd9efc541de57bf34f6bf4e9f60608201527fadbe96ac53cb4ca392e9ee5a7e23c7d7c8450cb015ceaad4d4677fae1c0bb1a460808201527f46368cfe9eb4bdc14a0db9efb4fd64daed77c6c7eed07a5ecc8636d750f4116c60a08201527f6878742ff510854cb02c186504af5267007c4a6d33f490fc28ec83e83e1458e160c08201527f34c2298c7a97dba95967713c1899a52b07fabcdd815495cb99dc62c772bb880f60e08201527f8abf076f9a0dc454561c8dc5ab0d193b64f6859d8b5bb48463c1fa0a530ab04b6101008201526001600160a01b0390911690637b7dfa5590610120016040516020818303038152906040526040518263ffffffff1660e01b8152600401610d1791906151c4565b60006040518083038186803b158015610d2f57600080fd5b505afa158015610d43573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d6b9190810190615226565b806020019051810190610d7e9190615369565b6001600160a01b0390811660e08a015290811660c089015290811660a08801529081166080870152908116606086018190529181166040808701919091529281166020808701919091529316845281517f313ce5670000000000000000000000000000000000000000000000000000000081529151600093919263313ce567926004808301939192829003018186803b158015610e1a57600080fd5b505afa158015610e2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e529190615419565b610e5d906012615436565b610e6890600a615579565b60608301516040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015291925082916001600160a01b03909116906370a082319060240160206040518083038186803b158015610ecb57600080fd5b505afa158015610edf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0391906152b1565b610f0d9190615588565b835260808201516040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b158015610f6d57600080fd5b505afa158015610f81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa591906152b1565b610fb390633b9aca00615588565b6020840152815160608301516040517f50003ca60000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201529116906350003ca69060240160806040518083038186803b15801561101957600080fd5b505afa15801561102d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105191906155c5565b1515610140870152610120860152610100850152604084018181528291611079908390615588565b90525061012083018051829190611091908390615588565b905250610100830180518291906110a9908390615588565b9150818152505050600081604001516001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156110f057600080fd5b505afa158015611104573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111289190615419565b61113390600a615579565b9050600082602001516001600160a01b031663ed1bd76c836040518263ffffffff1660e01b815260040161116991815260200190565b60206040518083038186803b15801561118157600080fd5b505afa158015611195573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b991906152b1565b60408085015190517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919250839183916001600160a01b0316906370a082319060240160206040518083038186803b15801561121c57600080fd5b505afa158015611230573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125491906152b1565b61125e9190615588565b6112689190615311565b8460600181815250506000808460c001516001600160a01b031663d73cc4df6040518163ffffffff1660e01b8152600401604080518083038186803b1580156112b057600080fd5b505afa1580156112c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e891906155fb565b9092509050836112f88484615588565b6113029190615311565b60a08701805191909152805160200182905251516113219082906152f9565b8660a001516040018181525050505050508060a001516001600160a01b0316631a6865026040518163ffffffff1660e01b815260040160206040518083038186803b15801561136f57600080fd5b505afa158015611383573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a791906152b1565b8260800181815250508060e001516001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ed57600080fd5b505afa158015611401573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114259190615419565b611430906012615436565b61143b90600a615579565b8160e001516001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561147857600080fd5b505afa15801561148c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b091906152b1565b6114ba9190615588565b8260c00181815250508161012001518261010001518360a0015160400151846080015185606001518660400151876020015188600001516114fb91906152f9565b61150591906152f9565b61150f91906152f9565b61151991906152f9565b61152391906152f9565b61152d91906152f9565b61153791906152f9565b60e0830181905260c08301511015611566578160c001518260e0015161155d919061561f565b60e08301525090565b600060e08301525090565b60008281526020819052604090206001015461158c81613247565b6115968383613251565b505050565b6001600160a01b03811633146116195760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610ac9565b611623828261330d565b5050565b7fd35fc1ee130ff0f414ed7fa1c28eb137e6e5a7514e5520dcbf996fbe7cba366c61165181613247565b61165c8484846133aa565b50505050565b7f70546d1c92f8c2132ae23a23f5177aa8526356051c7510df99f50e012d22152961168c81613247565b600154604080517fc93b3e73d8e8640f06a157324bdbc5b9ff5b832480a4949d26a4ad2a87d4e15c60208201527fbeeacfb82bad45f02bef36f600d9d252a0e99a8a966bd9348652e7328e54901b918101919091527fadbe96ac53cb4ca392e9ee5a7e23c7d7c8450cb015ceaad4d4677fae1c0bb1a46060820152600091829182916001600160a01b031690637b7dfa55906080016040516020818303038152906040526040518263ffffffff1660e01b815260040161174c91906151c4565b60006040518083038186803b15801561176457600080fd5b505afa158015611778573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526117a09190810190615226565b8060200190518101906117b3919061526f565b9250925092506000836001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156117f457600080fd5b505afa158015611808573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061182c919061534c565b6040517fc17af6450000000000000000000000000000000000000000000000000000000081526001600160a01b038a8116600483015291925060009183169063c17af6459060240160206040518083038186803b15801561188c57600080fd5b505afa1580156118a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118c4919061534c565b9050816001600160a01b0316632aa6f9cb6040518163ffffffff1660e01b815260040160206040518083038186803b1580156118ff57600080fd5b505afa158015611913573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611937919061534c565b6040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152602482018a9052919091169063095ea7b390604401602060405180830381600087803b15801561199c57600080fd5b505af11580156119b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d49190615636565b506000846001600160a01b031663fe73212f85856001600160a01b0316632aa6f9cb6040518163ffffffff1660e01b815260040160206040518083038186803b158015611a2057600080fd5b505afa158015611a34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a58919061534c565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b03928316600482015291166024820152604481018b905260640160206040518083038186803b158015611abd57600080fd5b505afa158015611ad1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611af591906152b1565b6040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152602482018390529192509085169063095ea7b390604401602060405180830381600087803b158015611b5c57600080fd5b505af1158015611b70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b949190615636565b50846001600160a01b0316632b4e3a1d85856001600160a01b0316632aa6f9cb6040518163ffffffff1660e01b815260040160206040518083038186803b158015611bde57600080fd5b505afa158015611bf2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c16919061534c565b848c60016040518663ffffffff1660e01b8152600401611c3a959493929190615653565b602060405180830381600087803b158015611c5457600080fd5b505af1158015611c68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8c91906152b1565b506040517ffb307e19000000000000000000000000000000000000000000000000000000008152600481018a90526001600160a01b0383169063fb307e1990602401600060405180830381600087803b158015611ce857600080fd5b505af1158015611cfc573d6000803e3d6000fd5b5050505050505050505050505050565b7f70546d1c92f8c2132ae23a23f5177aa8526356051c7510df99f50e012d221529611d3681613247565b6040517fc11d600f0000000000000000000000000000000000000000000000000000000081526001600160a01b0384169063c11d600f90611d7b9085906004016156c0565b600060405180830381600087803b158015611d9557600080fd5b505af1158015611da9573d6000803e3d6000fd5b50508351915060009050611ddc7f34489f383427a9c74d852e5b541c817a2f309e276c92cc7338b94daf451dcc9c61377f565b905060015b82811015611ea657816001600160a01b031663cfc6dc4287878481518110611e0b57611e0b615704565b60209081029190910101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b039092166004830152602482015260006044820152606401600060405180830381600087803b158015611e7b57600080fd5b505af1158015611e8f573d6000803e3d6000fd5b505050508080611e9e90615733565b915050611de1565b506000856001600160a01b031663ad36cd0e6040518163ffffffff1660e01b815260040160206040518083038186803b158015611ee257600080fd5b505afa158015611ef6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1a919061534c565b90506000866001600160a01b031663b60f4ad66040518163ffffffff1660e01b815260040160206040518083038186803b158015611f5757600080fd5b505afa158015611f6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f8f91906152b1565b6040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810182905290915030906001600160a01b03841690636352211e9060240160206040518083038186803b158015611fed57600080fd5b505afa158015612001573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612025919061534c565b6001600160a01b0316141561216657826001600160a01b031663cfc6dc42888860008151811061205757612057615704565b60209081029190910101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b039092166004830152602482015260006044820152606401600060405180830381600087803b1580156120c757600080fd5b505af11580156120db573d6000803e3d6000fd5b50506040517fc75cdaea0000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015260248201859052600160448301528616925063c75cdaea9150606401600060405180830381600087803b15801561214957600080fd5b505af115801561215d573d6000803e3d6000fd5b505050506121f5565b826001600160a01b031663b9f15a39888860008151811061218957612189615704565b60200260200101516040518363ffffffff1660e01b81526004016121c29291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b1580156121dc57600080fd5b505af11580156121f0573d6000803e3d6000fd5b505050505b60006122207ffba7487279c55c9d1ecfd08c78157551f48f89576330d7b02ba67269a9865c9f61377f565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091506000906001600160a01b038316906370a082319060240160206040518083038186803b15801561227e57600080fd5b505afa158015612292573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b691906152b1565b1115612359576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526123579082906001600160a01b038216906370a082319060240160206040518083038186803b15801561231a57600080fd5b505afa15801561232e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061235291906152b1565b613815565b505b5050505050505050565b60607f70546d1c92f8c2132ae23a23f5177aa8526356051c7510df99f50e012d22152961238f81613247565b848067ffffffffffffffff8111156123a9576123a9614d68565b6040519080825280602002602001820160405280156123dc57816020015b60608152602001906001900390816123c75790505b50925060005b818110156124dc576000808989848181106123ff576123ff615704565b90506020020160208101906124149190614bdb565b6001600160a01b031688888581811061242f5761242f615704565b9050602002810190612441919061576c565b60405161244f9291906157d1565b6000604051808303816000865af19150503d806000811461248c576040519150601f19603f3d011682016040523d82523d6000602084013e612491565b606091505b509092509050816124a9576040513d806000833e8082fd5b808684815181106124bc576124bc615704565b6020026020010181905250505080806124d490615733565b9150506123e2565b506124e960646001613bfd565b5050949350505050565b600154604080517fadbe96ac53cb4ca392e9ee5a7e23c7d7c8450cb015ceaad4d4677fae1c0bb1a460208201527fe17af420adc2ecb8bbc8370891481cb5eba8e79cd9efc541de57bf34f6bf4e9f8183015281518082038301815260608201928390527f7b7dfa5500000000000000000000000000000000000000000000000000000000909252859260009283926001600160a01b0390921691637b7dfa559161259f916064016151c4565b60006040518083038186803b1580156125b757600080fd5b505afa1580156125cb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526125f39190810190615226565b80602001905181019061260691906157e1565b91509150816001600160a01b0316836001600160a01b0316148061263b5750806001600160a01b0316836001600160a01b0316145b6126875760405162461bcd60e51b815260206004820152600d60248201527f696e76616c696420746f6b656e000000000000000000000000000000000000006044820152606401610ac9565b600154604080517fd7b5cea1258f7a2acae3ed88fa9155d7a4e8425cafbbe0267f7d8ac75968341a60208201527f8abf076f9a0dc454561c8dc5ab0d193b64f6859d8b5bb48463c1fa0a530ab04b8183015281518082038301815260608201928390527f7b7dfa550000000000000000000000000000000000000000000000000000000090925260009283926001600160a01b0390911691637b7dfa5591612731916064016151c4565b60006040518083038186803b15801561274957600080fd5b505afa15801561275d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526127859190810190615226565b80602001905181019061279891906157e1565b9092509050336001600160a01b03831614806127bc5750336001600160a01b038216145b6128085760405162461bcd60e51b815260206004820152600b60248201527f6e6f7420616c6c6f7765640000000000000000000000000000000000000000006044820152606401610ac9565b6123596001600160a01b0389168789613d4e565b600061282781613247565b50600180547fffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffff1676010000000000000000000000000000000000000000000060ff968716027fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff16177701000000000000000000000000000000000000000000000094861694909402939093177fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff167501000000000000000000000000000000000000000000928516929092027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1691909117740100000000000000000000000000000000000000009190931602919091179055565b600061294781613247565b600154604080517fadbe96ac53cb4ca392e9ee5a7e23c7d7c8450cb015ceaad4d4677fae1c0bb1a460208201527fe17af420adc2ecb8bbc8370891481cb5eba8e79cd9efc541de57bf34f6bf4e9f8183015281518082038301815260608201928390527f7b7dfa550000000000000000000000000000000000000000000000000000000090925260009283926001600160a01b0390911691637b7dfa55916129f1916064016151c4565b60006040518083038186803b158015612a0957600080fd5b505afa158015612a1d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612a459190810190615226565b806020019051810190612a5891906157e1565b91509150806001600160a01b0316846001600160a01b03161480612a8d5750816001600160a01b0316846001600160a01b0316145b15612ae45760055460ff16612ae45760405162461bcd60e51b815260206004820152601760248201527f656d657267656e63792073746f702072657175697265640000000000000000006044820152606401610ac9565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015261165c9033906001600160a01b038716906370a082319060240160206040518083038186803b158015612b4257600080fd5b505afa158015612b56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b7a91906152b1565b6001600160a01b0387169190613d4e565b600154604080517fb99af5f7fc4f544a2e785bf87de65fe8cb07dc637fe8b0abdafa82095b6dd61260208201527fc93b3e73d8e8640f06a157324bdbc5b9ff5b832480a4949d26a4ad2a87d4e15c8183015281518082038301815260608201928390527f7b7dfa550000000000000000000000000000000000000000000000000000000090925260009283926001600160a01b0390911691637b7dfa5591612c35916064016151c4565b60006040518083038186803b158015612c4d57600080fd5b505afa158015612c61573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c899190810190615226565b806020019051810190612c9c91906157e1565b9092509050336001600160a01b03831614612cf95760405162461bcd60e51b815260206004820152601160248201527f6f6e6c79205265504d20616c6c6f7765640000000000000000000000000000006044820152606401610ac9565b6040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301526024820185905288169063095ea7b390604401602060405180830381600087803b158015612d5c57600080fd5b505af1158015612d70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d949190615636565b506040517f45cbcbfa0000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260248201879052604482018690528216906345cbcbfa90606401600060405180830381600087803b158015612dff57600080fd5b505af1158015612e13573d6000803e3d6000fd5b50505050612e97866004546001868b6001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015612e5a57600080fd5b505afa158015612e6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e929190615419565b613dce565b50505050505050565b6000612eab81613247565b60055460ff1615612ee157600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550565b600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555b50565b7fd35fc1ee130ff0f414ed7fa1c28eb137e6e5a7514e5520dcbf996fbe7cba366c612f3a81613247565b61165c848484600080613dce565b600082815260208190526040902060010154612f6381613247565b611596838361330d565b7f70546d1c92f8c2132ae23a23f5177aa8526356051c7510df99f50e012d221529612f9781613247565b6000846001600160a01b031663556e4e686040518163ffffffff1660e01b815260040160206040518083038186803b158015612fd257600080fd5b505afa158015612fe6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061300a919061534c565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091506000906001600160a01b038316906370a082319060240160206040518083038186803b15801561306857600080fd5b505afa15801561307c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130a091906152b1565b6040517f552bb9c30000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152602482018790529192509087169063552bb9c390604401600060405180830381600087803b15801561310757600080fd5b505af115801561311b573d6000803e3d6000fd5b50506040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600092508391506001600160a01b038516906370a082319060240160206040518083038186803b15801561317c57600080fd5b505afa158015613190573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131b491906152b1565b6131be919061561f565b90506131ca8382613815565b600260008282546131db91906152f9565b90915550506040518181526001600160a01b038416907f70d7b7410abe774750abf422fdba0ea57eb08e1de4c2f120ed398156a2a70ad69060200160405180910390a250505050505050565b600061323281613247565b61323f86868686866142ff565b505050505050565b612f0d813361453c565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16611623576000828152602081815260408083206001600160a01b0385168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556132c93390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615611623576000828152602081815260408083206001600160a01b038516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600154604080517f34489f383427a9c74d852e5b541c817a2f309e276c92cc7338b94daf451dcc9c60208201527fdc17c944fa6555801ea40fd8f1e96329b99e57d49e638ff09fa13246c8de84ef8183015281518082038301815260608201928390527f7b7dfa550000000000000000000000000000000000000000000000000000000090925260009283926001600160a01b0390911691637b7dfa5591613454916064016151c4565b60006040518083038186803b15801561346c57600080fd5b505afa158015613480573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526134a89190810190615226565b8060200190518101906134bb91906157e1565b6040517fc75cdaea0000000000000000000000000000000000000000000000000000000081526001600160a01b0388811660048301526024820188905286151560448301529294509092509083169063c75cdaea90606401600060405180830381600087803b15801561352d57600080fd5b505af1158015613541573d6000803e3d6000fd5b50505050600080826001600160a01b0316636f33f3ac88896001600160a01b03166387e2b1fc8a6040518263ffffffff1660e01b815260040161358691815260200190565b60206040518083038186803b15801561359e57600080fd5b505afa1580156135b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135d691906152b1565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b039092166004830152602482015260440160006040518083038186803b15801561363257600080fd5b505afa158015613646573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261366e9190810190615810565b91509150846136f5576040517f8a50db810000000000000000000000000000000000000000000000000000000081526001600160a01b03851690638a50db81906136be908590859060040161586b565b600060405180830381600087803b1580156136d857600080fd5b505af11580156136ec573d6000803e3d6000fd5b50505050612e97565b6040517f4f457ccd0000000000000000000000000000000000000000000000000000000081526001600160a01b03851690634f457ccd906137449085908590600190600090819060040161588d565b600060405180830381600087803b15801561375e57600080fd5b505af1158015613772573d6000803e3d6000fd5b5050505050505050505050565b6001546040517f21f8a721000000000000000000000000000000000000000000000000000000008152600481018390526000916001600160a01b0316906321f8a7219060240160206040518083038186803b1580156137dd57600080fd5b505afa1580156137f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058c919061534c565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009082906001600160a01b038516906370a082319060240160206040518083038186803b15801561387257600080fd5b505afa158015613886573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138aa91906152b1565b11156138f85760405162461bcd60e51b815260206004820152601060248201527f6e6f7420656e6f75676820746f6b656e000000000000000000000000000000006044820152606401610ac9565b600154604080517fbeeacfb82bad45f02bef36f600d9d252a0e99a8a966bd9348652e7328e54901b60208201527fadbe96ac53cb4ca392e9ee5a7e23c7d7c8450cb015ceaad4d4677fae1c0bb1a48183015281518082038301815260608201928390527f7b7dfa550000000000000000000000000000000000000000000000000000000090925260009283926001600160a01b0390911691637b7dfa55916139a2916064016151c4565b60006040518083038186803b1580156139ba57600080fd5b505afa1580156139ce573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526139f69190810190615226565b806020019051810190613a0991906157e1565b6040517fa9eabcbe0000000000000000000000000000000000000000000000000000000081526001600160a01b03888116600483015280831660248301526044820188905292945090925060009184169063a9eabcbe9060640160206040518083038186803b158015613a7b57600080fd5b505afa158015613a8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ab391906152b1565b6040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152602482018890529192509087169063095ea7b390604401602060405180830381600087803b158015613b1a57600080fd5b505af1158015613b2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b529190615636565b506040517f2b4e3a1d0000000000000000000000000000000000000000000000000000000081526001600160a01b03841690632b4e3a1d90613ba190899086908a908790600090600401615653565b602060405180830381600087803b158015613bbb57600080fd5b505af1158015613bcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bf391906152b1565b9695505050505050565b6000613c287f46368cfe9eb4bdc14a0db9efb4fd64daed77c6c7eed07a5ecc8636d750f4116c61377f565b90506000613c34610b43565b90506000826001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015613c7157600080fd5b505afa158015613c85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ca991906152b1565b613cb790633b9aca00615588565b60e083015190915084613ce65760a0830151516060840151613cd9908361561f565b613ce3919061561f565b90505b806064613cf660ff891685615588565b613d009190615311565b111561323f5760405162461bcd60e51b815260206004820152601460248201527f696e73756666696369656e74206261636b696e670000000000000000000000006044820152606401610ac9565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526115969084906145ba565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810191909152600154604080517f34489f383427a9c74d852e5b541c817a2f309e276c92cc7338b94daf451dcc9c60208201527fdc17c944fa6555801ea40fd8f1e96329b99e57d49e638ff09fa13246c8de84ef918101919091527fc93b3e73d8e8640f06a157324bdbc5b9ff5b832480a4949d26a4ad2a87d4e15c60608201526001600160a01b0390911690637b7dfa55906080016040516020818303038152906040526040518263ffffffff1660e01b8152600401613eda91906151c4565b60006040518083038186803b158015613ef257600080fd5b505afa158015613f06573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613f2e9190810190615226565b806020019051810190613f41919061526f565b6001600160a01b03908116610120850152908116835290811661010083018190526040517fcfc6dc4200000000000000000000000000000000000000000000000000000000815291881660048301526024820187905285151560448301529063cfc6dc4290606401600060405180830381600087803b158015613fc357600080fd5b505af1158015613fd7573d6000803e3d6000fd5b5050505060008082600001516001600160a01b031663936e86c8898a6001600160a01b03166378c8436f8b6040518263ffffffff1660e01b815260040161402091815260200190565b60206040518083038186803b15801561403857600080fd5b505afa15801561404c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061407091906152b1565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b039092166004830152602482015260440160006040518083038186803b1580156140cc57600080fd5b505afa1580156140e0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526141089190810190615810565b9150915060008361012001516001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561414c57600080fd5b505afa158015614160573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614184919061534c565b9050866141f5578361010001516001600160a01b0316638a50db8184846040518363ffffffff1660e01b81526004016141be92919061586b565b600060405180830381600087803b1580156141d857600080fd5b505af11580156141ec573d6000803e3d6000fd5b50505050612357565b6101008401516040517f4e873dfb0000000000000000000000000000000000000000000000000000000081526001600160a01b038b8116600483015291821691634f457ccd918691869190861690634e873dfb9060240160606040518083038186803b15801561426457600080fd5b505afa158015614278573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061429c91906158c7565b604001518a8a6040518663ffffffff1660e01b81526004016142c295949392919061588d565b600060405180830381600087803b1580156142dc57600080fd5b505af11580156142f0573d6000803e3d6000fd5b50505050505050505050505050565b60055460ff166143515760405162461bcd60e51b815260206004820152601760248201527f656d657267656e63792073746f702072657175697265640000000000000000006044820152606401610ac9565b8260005b81811015612e97578261441157866001600160a01b03166342842e0e303389898681811061438557614385615704565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152606401600060405180830381600087803b1580156143f457600080fd5b505af1158015614408573d6000803e3d6000fd5b505050506144bc565b866001600160a01b03166342842e0e333089898681811061443457614434615704565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152606401600060405180830381600087803b1580156144a357600080fd5b505af11580156144b7573d6000803e3d6000fd5b505050505b836144f6576144f1878787848181106144d7576144d7615704565b90506020020135856144ea5760006133aa565b60016133aa565b61452a565b61452a8787878481811061450c5761450c615704565b905060200201358561451f576000614522565b60015b600080613dce565b8061453481615733565b915050614355565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1661162357614578816001600160a01b0316601461469f565b61458383602061469f565b604051602001614594929190615930565b60408051601f198184030181529082905262461bcd60e51b8252610ac9916004016151c4565b600061460f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166148cf9092919063ffffffff16565b805190915015611596578080602001905181019061462d9190615636565b6115965760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610ac9565b606060006146ae836002615588565b6146b99060026152f9565b67ffffffffffffffff8111156146d1576146d1614d68565b6040519080825280601f01601f1916602001820160405280156146fb576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061473257614732615704565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061479557614795615704565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006147d1846002615588565b6147dc9060016152f9565b90505b6001811115614879577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061481d5761481d615704565b1a60f81b82828151811061483357614833615704565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93614872816159b1565b90506147df565b5083156148c85760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610ac9565b9392505050565b60606148de84846000856148e6565b949350505050565b60608247101561495e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610ac9565b6001600160a01b0385163b6149b55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610ac9565b600080866001600160a01b031685876040516149d191906159e6565b60006040518083038185875af1925050503d8060008114614a0e576040519150601f19603f3d011682016040523d82523d6000602084013e614a13565b606091505b5091509150614a23828286614a2e565b979650505050505050565b60608315614a3d5750816148c8565b825115614a4d5782518084602001fd5b8160405162461bcd60e51b8152600401610ac991906151c4565b6040518061016001604052806000815260200160008152602001600081526020016000815260200160008152602001614aba60405180606001604052806000815260200160008152602001600081525090565b8152602001600081526020016000815260200160008152602001600081526020016000151581525090565b600060208284031215614af757600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146148c857600080fd5b6001600160a01b0381168114612f0d57600080fd5b600080600080600060808688031215614b5457600080fd5b8535614b5f81614b27565b94506020860135614b6f81614b27565b935060408601359250606086013567ffffffffffffffff80821115614b9357600080fd5b818801915088601f830112614ba757600080fd5b813581811115614bb657600080fd5b896020828501011115614bc857600080fd5b9699959850939650602001949392505050565b600060208284031215614bed57600080fd5b81356148c881614b27565b60006101a082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a0830151614c5360a08401828051825260208082015190830152604090810151910152565b5060c08301516101008381019190915260e0840151610120808501919091529084015161014080850191909152908401516101608401529092015115156101809091015290565b600060208284031215614cac57600080fd5b5035919050565b60008060408385031215614cc657600080fd5b823591506020830135614cd881614b27565b809150509250929050565b8015158114612f0d57600080fd5b600080600060608486031215614d0657600080fd5b8335614d1181614b27565b9250602084013591506040840135614d2881614ce3565b809150509250925092565b600080600060608486031215614d4857600080fd5b8335614d5381614b27565b95602085013595506040909401359392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715614dc057614dc0614d68565b604052919050565b60008060408385031215614ddb57600080fd5b8235614de681614b27565b915060208381013567ffffffffffffffff80821115614e0457600080fd5b818601915086601f830112614e1857600080fd5b813581811115614e2a57614e2a614d68565b8060051b9150614e3b848301614d97565b8181529183018401918481019089841115614e5557600080fd5b938501935b83851015614e7357843582529385019390850190614e5a565b8096505050505050509250929050565b60008083601f840112614e9557600080fd5b50813567ffffffffffffffff811115614ead57600080fd5b6020830191508360208260051b8501011115614ec857600080fd5b9250929050565b60008060008060408587031215614ee557600080fd5b843567ffffffffffffffff80821115614efd57600080fd5b614f0988838901614e83565b90965094506020870135915080821115614f2257600080fd5b50614f2f87828801614e83565b95989497509550505050565b60005b83811015614f56578181015183820152602001614f3e565b8381111561165c5750506000910152565b60008151808452614f7f816020860160208601614f3b565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015615006577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0888603018452614ff4858351614f67565b94509285019290850190600101614fba565b5092979650505050505050565b60008060006060848603121561502857600080fd5b833561503381614b27565b9250602084013591506040840135614d2881614b27565b60ff81168114612f0d57600080fd5b6000806000806080858703121561506f57600080fd5b843561507a8161504a565b9350602085013561508a8161504a565b9250604085013561509a8161504a565b915060608501356150aa8161504a565b939692955090935050565b600080600080600060a086880312156150cd57600080fd5b85356150d881614b27565b945060208601356150e881614b27565b94979496505050506040830135926060810135926080909101359150565b60008060006060848603121561511b57600080fd5b833561512681614b27565b9250602084013561513681614b27565b929592945050506040919091013590565b60008060008060006080868803121561515f57600080fd5b853561516a81614b27565b9450602086013567ffffffffffffffff81111561518657600080fd5b61519288828901614e83565b90955093505060408601356151a681614ce3565b915060608601356151b681614ce3565b809150509295509295909350565b6020815260006148c86020830184614f67565b600067ffffffffffffffff8311156151f1576151f1614d68565b6152046020601f19601f86011601614d97565b905082815283838301111561521857600080fd5b6148c8836020830184614f3b565b60006020828403121561523857600080fd5b815167ffffffffffffffff81111561524f57600080fd5b8201601f8101841361526057600080fd5b6148de848251602084016151d7565b60008060006060848603121561528457600080fd5b835161528f81614b27565b60208501519093506152a081614b27565b6040850151909250614d2881614b27565b6000602082840312156152c357600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561530c5761530c6152ca565b500190565b600082615347577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006020828403121561535e57600080fd5b81516148c881614b27565b600080600080600080600080610100898b03121561538657600080fd5b885161539181614b27565b60208a01519098506153a281614b27565b60408a01519097506153b381614b27565b60608a01519096506153c481614b27565b60808a01519095506153d581614b27565b60a08a01519094506153e681614b27565b60c08a01519093506153f781614b27565b60e08a015190925061540881614b27565b809150509295985092959890939650565b60006020828403121561542b57600080fd5b81516148c88161504a565b600060ff821660ff841680821015615450576154506152ca565b90039392505050565b600181815b808511156154b257817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615498576154986152ca565b808516156154a557918102915b93841c939080029061545e565b509250929050565b6000826154c95750600161058c565b816154d65750600061058c565b81600181146154ec57600281146154f657615512565b600191505061058c565b60ff841115615507576155076152ca565b50506001821b61058c565b5060208310610133831016604e8410600b8410161715615535575081810a61058c565b61553f8383615459565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615571576155716152ca565b029392505050565b60006148c860ff8416836154ba565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156155c0576155c06152ca565b500290565b600080600080608085870312156155db57600080fd5b84519350602085015192506040850151915060608501516150aa81614ce3565b6000806040838503121561560e57600080fd5b505080516020909101519092909150565b600082821015615631576156316152ca565b500390565b60006020828403121561564857600080fd5b81516148c881614ce3565b6001600160a01b03868116825285166020820152604081018490526060810183905260a08101600283106156b0577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8260808301529695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156156f8578351835292840192918401916001016156dc565b50909695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415615765576157656152ca565b5060010190565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126157a157600080fd5b83018035915067ffffffffffffffff8211156157bc57600080fd5b602001915036819003821315614ec857600080fd5b8183823760009101908152919050565b600080604083850312156157f457600080fd5b82516157ff81614b27565b6020840151909250614cd881614b27565b6000806040838503121561582357600080fd5b825167ffffffffffffffff81111561583a57600080fd5b8301601f8101851361584b57600080fd5b61585a858251602084016151d7565b925050602083015190509250929050565b60408152600061587e6040830185614f67565b90508260208301529392505050565b60a0815260006158a060a0830188614f67565b6020830196909652509215156040840152606083019190915260ff16608090910152919050565b6000606082840312156158d957600080fd5b6040516060810181811067ffffffffffffffff821117156158fc576158fc614d68565b604052825161590a81614b27565b815260208381015190820152604083015161592481614ce3565b60408201529392505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615968816017850160208801614f3b565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516159a5816028840160208801614f3b565b01602801949350505050565b6000816159c0576159c06152ca565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b600082516159f8818460208701614f3b565b919091019291505056fea2646970667358221220f3c2dea840265aba07e8b682f373620ed74be45e78fe4b67851e490707a3614064736f6c63430008090033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101da5760003560e01c806363a599a41161010457806393a12825116100a2578063c9b1bb2411610071578063c9b1bb24146104ad578063d547741f146104c0578063d72b3842146104d3578063dd315e70146104e657600080fd5b806393a12825146104815780639a70eef114610494578063a217fddf1461049c578063baee865e146104a457600080fd5b80636f27acb5116100de5780636f27acb5146103fe57806385fbda9b14610411578063894760691461043757806391d148541461044a57600080fd5b806363a599a4146103be57806363fb0b96146103cb57806369328dec146103eb57600080fd5b80632f2ff15d1161017c5780634036656f1161014b5780634036656f1461035e578063417b4dca1461037157806356192124146103845780636324bdbc1461039757600080fd5b80632f2ff15d146102d957806334909aab146102ec57806336568abe1461032357806338ec5a301461033657600080fd5b80631a5fa2e3116101b85780631a5fa2e314610261578063200ae02b14610276578063248a9ca31461028b5780632954018c146102ae57600080fd5b806301ffc9a7146101df5780630c7d393114610207578063150b7a021461021d575b600080fd5b6101f26101ed366004614ae5565b6104f9565b60405190151581526020015b60405180910390f35b61020f610592565b6040519081526020016101fe565b61023061022b366004614b3c565b6109bb565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016101fe565b61027461026f366004614bdb565b610afd565b005b61027e610b43565b6040516101fe9190614bf8565b61020f610299366004614c9a565b60009081526020819052604090206001015490565b6001546102c1906001600160a01b031681565b6040516001600160a01b0390911681526020016101fe565b6102746102e7366004614cb3565b611571565b6001546103119074010000000000000000000000000000000000000000900460ff1681565b60405160ff90911681526020016101fe565b610274610331366004614cb3565b61159b565b6001546103119077010000000000000000000000000000000000000000000000900460ff1681565b61027461036c366004614cf1565b611627565b61027461037f366004614d33565b611662565b610274610392366004614dc8565b611d0c565b60015461031190760100000000000000000000000000000000000000000000900460ff1681565b6005546101f29060ff1681565b6103de6103d9366004614ecf565b612363565b6040516101fe9190614f93565b6102746103f9366004615013565b6124f3565b61027461040c366004615059565b61281c565b600154610311907501000000000000000000000000000000000000000000900460ff1681565b610274610445366004614bdb565b61293c565b6101f2610458366004614cb3565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b61027461048f3660046150b5565b612b8b565b610274612ea0565b61020f600081565b61020f60025481565b6102746104bb366004614cf1565b612f10565b6102746104ce366004614cb3565b612f48565b6102746104e1366004615106565b612f6d565b6102746104f4366004615147565b613227565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061058c57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60007f70546d1c92f8c2132ae23a23f5177aa8526356051c7510df99f50e012d2215296105be81613247565b60006105c8610b43565b600154604080517f8541fe357c2181e26fc7e72af17a53e071d733c15d4819f155d10ed9ef98c92260208201527f46368cfe9eb4bdc14a0db9efb4fd64daed77c6c7eed07a5ecc8636d750f4116c818301527fd7b5cea1258f7a2acae3ed88fa9155d7a4e8425cafbbe0267f7d8ac75968341a6060808301919091528251808303909101815260808201928390527f7b7dfa5500000000000000000000000000000000000000000000000000000000909252929350600092839283926001600160a01b0390911691637b7dfa55916106a2916084016151c4565b60006040518083038186803b1580156106ba57600080fd5b505afa1580156106ce573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106f69190810190615226565b806020019051810190610709919061526f565b925092509250600060025490506000846001600160a01b03166391f7cfb96040518163ffffffff1660e01b815260040160206040518083038186803b15801561075157600080fd5b505afa158015610765573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078991906152b1565b90508015610813576040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290526001600160a01b03861690632e1a7d4d90602401600060405180830381600087803b1580156107ec57600080fd5b505af1158015610800573d6000803e3d6000fd5b50505050808261081091906152f9565b91505b6000821161082057600080fd5b6000836001600160a01b03166327c6b4ba866001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561086a57600080fd5b505afa15801561087e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a291906152b1565b6040518263ffffffff1660e01b81526004016108c091815260200190565b60206040518083038186803b1580156108d857600080fd5b505afa1580156108ec573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091091906152b1565b60e088015190915061092284836152f9565b111561093657610933600284615311565b92505b6040517fbc4f2d6d000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b0386169063bc4f2d6d90602401600060405180830381600087803b15801561099157600080fd5b505af11580156109a5573d6000803e3d6000fd5b5050600060025550929850505050505050505090565b600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000163390811790915560048481556040517f6352211e0000000000000000000000000000000000000000000000000000000081529081018590526000913091636352211e9060240160206040518083038186803b158015610a3f57600080fd5b505afa158015610a53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a77919061534c565b6001600160a01b031614610ad25760405162461bcd60e51b815260206004820152600960248201527f4e6f74206f776e6572000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b507f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6000610b0881613247565b50600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b610b4b614a67565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810191909152600154604080517fdc17c944fa6555801ea40fd8f1e96329b99e57d49e638ff09fa13246c8de84ef60208201527fae439099f665034391cd98cdef153f4746a600e19bb1c12bec8eb425d4440b79918101919091527fe17af420adc2ecb8bbc8370891481cb5eba8e79cd9efc541de57bf34f6bf4e9f60608201527fadbe96ac53cb4ca392e9ee5a7e23c7d7c8450cb015ceaad4d4677fae1c0bb1a460808201527f46368cfe9eb4bdc14a0db9efb4fd64daed77c6c7eed07a5ecc8636d750f4116c60a08201527f6878742ff510854cb02c186504af5267007c4a6d33f490fc28ec83e83e1458e160c08201527f34c2298c7a97dba95967713c1899a52b07fabcdd815495cb99dc62c772bb880f60e08201527f8abf076f9a0dc454561c8dc5ab0d193b64f6859d8b5bb48463c1fa0a530ab04b6101008201526001600160a01b0390911690637b7dfa5590610120016040516020818303038152906040526040518263ffffffff1660e01b8152600401610d1791906151c4565b60006040518083038186803b158015610d2f57600080fd5b505afa158015610d43573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d6b9190810190615226565b806020019051810190610d7e9190615369565b6001600160a01b0390811660e08a015290811660c089015290811660a08801529081166080870152908116606086018190529181166040808701919091529281166020808701919091529316845281517f313ce5670000000000000000000000000000000000000000000000000000000081529151600093919263313ce567926004808301939192829003018186803b158015610e1a57600080fd5b505afa158015610e2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e529190615419565b610e5d906012615436565b610e6890600a615579565b60608301516040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015291925082916001600160a01b03909116906370a082319060240160206040518083038186803b158015610ecb57600080fd5b505afa158015610edf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0391906152b1565b610f0d9190615588565b835260808201516040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b158015610f6d57600080fd5b505afa158015610f81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa591906152b1565b610fb390633b9aca00615588565b6020840152815160608301516040517f50003ca60000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201529116906350003ca69060240160806040518083038186803b15801561101957600080fd5b505afa15801561102d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105191906155c5565b1515610140870152610120860152610100850152604084018181528291611079908390615588565b90525061012083018051829190611091908390615588565b905250610100830180518291906110a9908390615588565b9150818152505050600081604001516001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156110f057600080fd5b505afa158015611104573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111289190615419565b61113390600a615579565b9050600082602001516001600160a01b031663ed1bd76c836040518263ffffffff1660e01b815260040161116991815260200190565b60206040518083038186803b15801561118157600080fd5b505afa158015611195573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b991906152b1565b60408085015190517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919250839183916001600160a01b0316906370a082319060240160206040518083038186803b15801561121c57600080fd5b505afa158015611230573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125491906152b1565b61125e9190615588565b6112689190615311565b8460600181815250506000808460c001516001600160a01b031663d73cc4df6040518163ffffffff1660e01b8152600401604080518083038186803b1580156112b057600080fd5b505afa1580156112c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e891906155fb565b9092509050836112f88484615588565b6113029190615311565b60a08701805191909152805160200182905251516113219082906152f9565b8660a001516040018181525050505050508060a001516001600160a01b0316631a6865026040518163ffffffff1660e01b815260040160206040518083038186803b15801561136f57600080fd5b505afa158015611383573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a791906152b1565b8260800181815250508060e001516001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ed57600080fd5b505afa158015611401573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114259190615419565b611430906012615436565b61143b90600a615579565b8160e001516001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561147857600080fd5b505afa15801561148c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b091906152b1565b6114ba9190615588565b8260c00181815250508161012001518261010001518360a0015160400151846080015185606001518660400151876020015188600001516114fb91906152f9565b61150591906152f9565b61150f91906152f9565b61151991906152f9565b61152391906152f9565b61152d91906152f9565b61153791906152f9565b60e0830181905260c08301511015611566578160c001518260e0015161155d919061561f565b60e08301525090565b600060e08301525090565b60008281526020819052604090206001015461158c81613247565b6115968383613251565b505050565b6001600160a01b03811633146116195760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610ac9565b611623828261330d565b5050565b7fd35fc1ee130ff0f414ed7fa1c28eb137e6e5a7514e5520dcbf996fbe7cba366c61165181613247565b61165c8484846133aa565b50505050565b7f70546d1c92f8c2132ae23a23f5177aa8526356051c7510df99f50e012d22152961168c81613247565b600154604080517fc93b3e73d8e8640f06a157324bdbc5b9ff5b832480a4949d26a4ad2a87d4e15c60208201527fbeeacfb82bad45f02bef36f600d9d252a0e99a8a966bd9348652e7328e54901b918101919091527fadbe96ac53cb4ca392e9ee5a7e23c7d7c8450cb015ceaad4d4677fae1c0bb1a46060820152600091829182916001600160a01b031690637b7dfa55906080016040516020818303038152906040526040518263ffffffff1660e01b815260040161174c91906151c4565b60006040518083038186803b15801561176457600080fd5b505afa158015611778573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526117a09190810190615226565b8060200190518101906117b3919061526f565b9250925092506000836001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156117f457600080fd5b505afa158015611808573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061182c919061534c565b6040517fc17af6450000000000000000000000000000000000000000000000000000000081526001600160a01b038a8116600483015291925060009183169063c17af6459060240160206040518083038186803b15801561188c57600080fd5b505afa1580156118a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118c4919061534c565b9050816001600160a01b0316632aa6f9cb6040518163ffffffff1660e01b815260040160206040518083038186803b1580156118ff57600080fd5b505afa158015611913573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611937919061534c565b6040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152602482018a9052919091169063095ea7b390604401602060405180830381600087803b15801561199c57600080fd5b505af11580156119b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d49190615636565b506000846001600160a01b031663fe73212f85856001600160a01b0316632aa6f9cb6040518163ffffffff1660e01b815260040160206040518083038186803b158015611a2057600080fd5b505afa158015611a34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a58919061534c565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b03928316600482015291166024820152604481018b905260640160206040518083038186803b158015611abd57600080fd5b505afa158015611ad1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611af591906152b1565b6040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152602482018390529192509085169063095ea7b390604401602060405180830381600087803b158015611b5c57600080fd5b505af1158015611b70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b949190615636565b50846001600160a01b0316632b4e3a1d85856001600160a01b0316632aa6f9cb6040518163ffffffff1660e01b815260040160206040518083038186803b158015611bde57600080fd5b505afa158015611bf2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c16919061534c565b848c60016040518663ffffffff1660e01b8152600401611c3a959493929190615653565b602060405180830381600087803b158015611c5457600080fd5b505af1158015611c68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8c91906152b1565b506040517ffb307e19000000000000000000000000000000000000000000000000000000008152600481018a90526001600160a01b0383169063fb307e1990602401600060405180830381600087803b158015611ce857600080fd5b505af1158015611cfc573d6000803e3d6000fd5b5050505050505050505050505050565b7f70546d1c92f8c2132ae23a23f5177aa8526356051c7510df99f50e012d221529611d3681613247565b6040517fc11d600f0000000000000000000000000000000000000000000000000000000081526001600160a01b0384169063c11d600f90611d7b9085906004016156c0565b600060405180830381600087803b158015611d9557600080fd5b505af1158015611da9573d6000803e3d6000fd5b50508351915060009050611ddc7f34489f383427a9c74d852e5b541c817a2f309e276c92cc7338b94daf451dcc9c61377f565b905060015b82811015611ea657816001600160a01b031663cfc6dc4287878481518110611e0b57611e0b615704565b60209081029190910101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b039092166004830152602482015260006044820152606401600060405180830381600087803b158015611e7b57600080fd5b505af1158015611e8f573d6000803e3d6000fd5b505050508080611e9e90615733565b915050611de1565b506000856001600160a01b031663ad36cd0e6040518163ffffffff1660e01b815260040160206040518083038186803b158015611ee257600080fd5b505afa158015611ef6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1a919061534c565b90506000866001600160a01b031663b60f4ad66040518163ffffffff1660e01b815260040160206040518083038186803b158015611f5757600080fd5b505afa158015611f6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f8f91906152b1565b6040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810182905290915030906001600160a01b03841690636352211e9060240160206040518083038186803b158015611fed57600080fd5b505afa158015612001573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612025919061534c565b6001600160a01b0316141561216657826001600160a01b031663cfc6dc42888860008151811061205757612057615704565b60209081029190910101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b039092166004830152602482015260006044820152606401600060405180830381600087803b1580156120c757600080fd5b505af11580156120db573d6000803e3d6000fd5b50506040517fc75cdaea0000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015260248201859052600160448301528616925063c75cdaea9150606401600060405180830381600087803b15801561214957600080fd5b505af115801561215d573d6000803e3d6000fd5b505050506121f5565b826001600160a01b031663b9f15a39888860008151811061218957612189615704565b60200260200101516040518363ffffffff1660e01b81526004016121c29291906001600160a01b03929092168252602082015260400190565b600060405180830381600087803b1580156121dc57600080fd5b505af11580156121f0573d6000803e3d6000fd5b505050505b60006122207ffba7487279c55c9d1ecfd08c78157551f48f89576330d7b02ba67269a9865c9f61377f565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091506000906001600160a01b038316906370a082319060240160206040518083038186803b15801561227e57600080fd5b505afa158015612292573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b691906152b1565b1115612359576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526123579082906001600160a01b038216906370a082319060240160206040518083038186803b15801561231a57600080fd5b505afa15801561232e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061235291906152b1565b613815565b505b5050505050505050565b60607f70546d1c92f8c2132ae23a23f5177aa8526356051c7510df99f50e012d22152961238f81613247565b848067ffffffffffffffff8111156123a9576123a9614d68565b6040519080825280602002602001820160405280156123dc57816020015b60608152602001906001900390816123c75790505b50925060005b818110156124dc576000808989848181106123ff576123ff615704565b90506020020160208101906124149190614bdb565b6001600160a01b031688888581811061242f5761242f615704565b9050602002810190612441919061576c565b60405161244f9291906157d1565b6000604051808303816000865af19150503d806000811461248c576040519150601f19603f3d011682016040523d82523d6000602084013e612491565b606091505b509092509050816124a9576040513d806000833e8082fd5b808684815181106124bc576124bc615704565b6020026020010181905250505080806124d490615733565b9150506123e2565b506124e960646001613bfd565b5050949350505050565b600154604080517fadbe96ac53cb4ca392e9ee5a7e23c7d7c8450cb015ceaad4d4677fae1c0bb1a460208201527fe17af420adc2ecb8bbc8370891481cb5eba8e79cd9efc541de57bf34f6bf4e9f8183015281518082038301815260608201928390527f7b7dfa5500000000000000000000000000000000000000000000000000000000909252859260009283926001600160a01b0390921691637b7dfa559161259f916064016151c4565b60006040518083038186803b1580156125b757600080fd5b505afa1580156125cb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526125f39190810190615226565b80602001905181019061260691906157e1565b91509150816001600160a01b0316836001600160a01b0316148061263b5750806001600160a01b0316836001600160a01b0316145b6126875760405162461bcd60e51b815260206004820152600d60248201527f696e76616c696420746f6b656e000000000000000000000000000000000000006044820152606401610ac9565b600154604080517fd7b5cea1258f7a2acae3ed88fa9155d7a4e8425cafbbe0267f7d8ac75968341a60208201527f8abf076f9a0dc454561c8dc5ab0d193b64f6859d8b5bb48463c1fa0a530ab04b8183015281518082038301815260608201928390527f7b7dfa550000000000000000000000000000000000000000000000000000000090925260009283926001600160a01b0390911691637b7dfa5591612731916064016151c4565b60006040518083038186803b15801561274957600080fd5b505afa15801561275d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526127859190810190615226565b80602001905181019061279891906157e1565b9092509050336001600160a01b03831614806127bc5750336001600160a01b038216145b6128085760405162461bcd60e51b815260206004820152600b60248201527f6e6f7420616c6c6f7765640000000000000000000000000000000000000000006044820152606401610ac9565b6123596001600160a01b0389168789613d4e565b600061282781613247565b50600180547fffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffff1676010000000000000000000000000000000000000000000060ff968716027fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff16177701000000000000000000000000000000000000000000000094861694909402939093177fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff167501000000000000000000000000000000000000000000928516929092027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1691909117740100000000000000000000000000000000000000009190931602919091179055565b600061294781613247565b600154604080517fadbe96ac53cb4ca392e9ee5a7e23c7d7c8450cb015ceaad4d4677fae1c0bb1a460208201527fe17af420adc2ecb8bbc8370891481cb5eba8e79cd9efc541de57bf34f6bf4e9f8183015281518082038301815260608201928390527f7b7dfa550000000000000000000000000000000000000000000000000000000090925260009283926001600160a01b0390911691637b7dfa55916129f1916064016151c4565b60006040518083038186803b158015612a0957600080fd5b505afa158015612a1d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612a459190810190615226565b806020019051810190612a5891906157e1565b91509150806001600160a01b0316846001600160a01b03161480612a8d5750816001600160a01b0316846001600160a01b0316145b15612ae45760055460ff16612ae45760405162461bcd60e51b815260206004820152601760248201527f656d657267656e63792073746f702072657175697265640000000000000000006044820152606401610ac9565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015261165c9033906001600160a01b038716906370a082319060240160206040518083038186803b158015612b4257600080fd5b505afa158015612b56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b7a91906152b1565b6001600160a01b0387169190613d4e565b600154604080517fb99af5f7fc4f544a2e785bf87de65fe8cb07dc637fe8b0abdafa82095b6dd61260208201527fc93b3e73d8e8640f06a157324bdbc5b9ff5b832480a4949d26a4ad2a87d4e15c8183015281518082038301815260608201928390527f7b7dfa550000000000000000000000000000000000000000000000000000000090925260009283926001600160a01b0390911691637b7dfa5591612c35916064016151c4565b60006040518083038186803b158015612c4d57600080fd5b505afa158015612c61573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c899190810190615226565b806020019051810190612c9c91906157e1565b9092509050336001600160a01b03831614612cf95760405162461bcd60e51b815260206004820152601160248201527f6f6e6c79205265504d20616c6c6f7765640000000000000000000000000000006044820152606401610ac9565b6040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301526024820185905288169063095ea7b390604401602060405180830381600087803b158015612d5c57600080fd5b505af1158015612d70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d949190615636565b506040517f45cbcbfa0000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260248201879052604482018690528216906345cbcbfa90606401600060405180830381600087803b158015612dff57600080fd5b505af1158015612e13573d6000803e3d6000fd5b50505050612e97866004546001868b6001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015612e5a57600080fd5b505afa158015612e6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e929190615419565b613dce565b50505050505050565b6000612eab81613247565b60055460ff1615612ee157600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550565b600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555b50565b7fd35fc1ee130ff0f414ed7fa1c28eb137e6e5a7514e5520dcbf996fbe7cba366c612f3a81613247565b61165c848484600080613dce565b600082815260208190526040902060010154612f6381613247565b611596838361330d565b7f70546d1c92f8c2132ae23a23f5177aa8526356051c7510df99f50e012d221529612f9781613247565b6000846001600160a01b031663556e4e686040518163ffffffff1660e01b815260040160206040518083038186803b158015612fd257600080fd5b505afa158015612fe6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061300a919061534c565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091506000906001600160a01b038316906370a082319060240160206040518083038186803b15801561306857600080fd5b505afa15801561307c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130a091906152b1565b6040517f552bb9c30000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152602482018790529192509087169063552bb9c390604401600060405180830381600087803b15801561310757600080fd5b505af115801561311b573d6000803e3d6000fd5b50506040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600092508391506001600160a01b038516906370a082319060240160206040518083038186803b15801561317c57600080fd5b505afa158015613190573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131b491906152b1565b6131be919061561f565b90506131ca8382613815565b600260008282546131db91906152f9565b90915550506040518181526001600160a01b038416907f70d7b7410abe774750abf422fdba0ea57eb08e1de4c2f120ed398156a2a70ad69060200160405180910390a250505050505050565b600061323281613247565b61323f86868686866142ff565b505050505050565b612f0d813361453c565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16611623576000828152602081815260408083206001600160a01b0385168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556132c93390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615611623576000828152602081815260408083206001600160a01b038516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600154604080517f34489f383427a9c74d852e5b541c817a2f309e276c92cc7338b94daf451dcc9c60208201527fdc17c944fa6555801ea40fd8f1e96329b99e57d49e638ff09fa13246c8de84ef8183015281518082038301815260608201928390527f7b7dfa550000000000000000000000000000000000000000000000000000000090925260009283926001600160a01b0390911691637b7dfa5591613454916064016151c4565b60006040518083038186803b15801561346c57600080fd5b505afa158015613480573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526134a89190810190615226565b8060200190518101906134bb91906157e1565b6040517fc75cdaea0000000000000000000000000000000000000000000000000000000081526001600160a01b0388811660048301526024820188905286151560448301529294509092509083169063c75cdaea90606401600060405180830381600087803b15801561352d57600080fd5b505af1158015613541573d6000803e3d6000fd5b50505050600080826001600160a01b0316636f33f3ac88896001600160a01b03166387e2b1fc8a6040518263ffffffff1660e01b815260040161358691815260200190565b60206040518083038186803b15801561359e57600080fd5b505afa1580156135b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135d691906152b1565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b039092166004830152602482015260440160006040518083038186803b15801561363257600080fd5b505afa158015613646573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261366e9190810190615810565b91509150846136f5576040517f8a50db810000000000000000000000000000000000000000000000000000000081526001600160a01b03851690638a50db81906136be908590859060040161586b565b600060405180830381600087803b1580156136d857600080fd5b505af11580156136ec573d6000803e3d6000fd5b50505050612e97565b6040517f4f457ccd0000000000000000000000000000000000000000000000000000000081526001600160a01b03851690634f457ccd906137449085908590600190600090819060040161588d565b600060405180830381600087803b15801561375e57600080fd5b505af1158015613772573d6000803e3d6000fd5b5050505050505050505050565b6001546040517f21f8a721000000000000000000000000000000000000000000000000000000008152600481018390526000916001600160a01b0316906321f8a7219060240160206040518083038186803b1580156137dd57600080fd5b505afa1580156137f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058c919061534c565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009082906001600160a01b038516906370a082319060240160206040518083038186803b15801561387257600080fd5b505afa158015613886573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138aa91906152b1565b11156138f85760405162461bcd60e51b815260206004820152601060248201527f6e6f7420656e6f75676820746f6b656e000000000000000000000000000000006044820152606401610ac9565b600154604080517fbeeacfb82bad45f02bef36f600d9d252a0e99a8a966bd9348652e7328e54901b60208201527fadbe96ac53cb4ca392e9ee5a7e23c7d7c8450cb015ceaad4d4677fae1c0bb1a48183015281518082038301815260608201928390527f7b7dfa550000000000000000000000000000000000000000000000000000000090925260009283926001600160a01b0390911691637b7dfa55916139a2916064016151c4565b60006040518083038186803b1580156139ba57600080fd5b505afa1580156139ce573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526139f69190810190615226565b806020019051810190613a0991906157e1565b6040517fa9eabcbe0000000000000000000000000000000000000000000000000000000081526001600160a01b03888116600483015280831660248301526044820188905292945090925060009184169063a9eabcbe9060640160206040518083038186803b158015613a7b57600080fd5b505afa158015613a8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ab391906152b1565b6040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152602482018890529192509087169063095ea7b390604401602060405180830381600087803b158015613b1a57600080fd5b505af1158015613b2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b529190615636565b506040517f2b4e3a1d0000000000000000000000000000000000000000000000000000000081526001600160a01b03841690632b4e3a1d90613ba190899086908a908790600090600401615653565b602060405180830381600087803b158015613bbb57600080fd5b505af1158015613bcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bf391906152b1565b9695505050505050565b6000613c287f46368cfe9eb4bdc14a0db9efb4fd64daed77c6c7eed07a5ecc8636d750f4116c61377f565b90506000613c34610b43565b90506000826001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015613c7157600080fd5b505afa158015613c85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ca991906152b1565b613cb790633b9aca00615588565b60e083015190915084613ce65760a0830151516060840151613cd9908361561f565b613ce3919061561f565b90505b806064613cf660ff891685615588565b613d009190615311565b111561323f5760405162461bcd60e51b815260206004820152601460248201527f696e73756666696369656e74206261636b696e670000000000000000000000006044820152606401610ac9565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526115969084906145ba565b6040805161014081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810191909152600154604080517f34489f383427a9c74d852e5b541c817a2f309e276c92cc7338b94daf451dcc9c60208201527fdc17c944fa6555801ea40fd8f1e96329b99e57d49e638ff09fa13246c8de84ef918101919091527fc93b3e73d8e8640f06a157324bdbc5b9ff5b832480a4949d26a4ad2a87d4e15c60608201526001600160a01b0390911690637b7dfa55906080016040516020818303038152906040526040518263ffffffff1660e01b8152600401613eda91906151c4565b60006040518083038186803b158015613ef257600080fd5b505afa158015613f06573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613f2e9190810190615226565b806020019051810190613f41919061526f565b6001600160a01b03908116610120850152908116835290811661010083018190526040517fcfc6dc4200000000000000000000000000000000000000000000000000000000815291881660048301526024820187905285151560448301529063cfc6dc4290606401600060405180830381600087803b158015613fc357600080fd5b505af1158015613fd7573d6000803e3d6000fd5b5050505060008082600001516001600160a01b031663936e86c8898a6001600160a01b03166378c8436f8b6040518263ffffffff1660e01b815260040161402091815260200190565b60206040518083038186803b15801561403857600080fd5b505afa15801561404c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061407091906152b1565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b039092166004830152602482015260440160006040518083038186803b1580156140cc57600080fd5b505afa1580156140e0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526141089190810190615810565b9150915060008361012001516001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561414c57600080fd5b505afa158015614160573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614184919061534c565b9050866141f5578361010001516001600160a01b0316638a50db8184846040518363ffffffff1660e01b81526004016141be92919061586b565b600060405180830381600087803b1580156141d857600080fd5b505af11580156141ec573d6000803e3d6000fd5b50505050612357565b6101008401516040517f4e873dfb0000000000000000000000000000000000000000000000000000000081526001600160a01b038b8116600483015291821691634f457ccd918691869190861690634e873dfb9060240160606040518083038186803b15801561426457600080fd5b505afa158015614278573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061429c91906158c7565b604001518a8a6040518663ffffffff1660e01b81526004016142c295949392919061588d565b600060405180830381600087803b1580156142dc57600080fd5b505af11580156142f0573d6000803e3d6000fd5b50505050505050505050505050565b60055460ff166143515760405162461bcd60e51b815260206004820152601760248201527f656d657267656e63792073746f702072657175697265640000000000000000006044820152606401610ac9565b8260005b81811015612e97578261441157866001600160a01b03166342842e0e303389898681811061438557614385615704565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152606401600060405180830381600087803b1580156143f457600080fd5b505af1158015614408573d6000803e3d6000fd5b505050506144bc565b866001600160a01b03166342842e0e333089898681811061443457614434615704565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152606401600060405180830381600087803b1580156144a357600080fd5b505af11580156144b7573d6000803e3d6000fd5b505050505b836144f6576144f1878787848181106144d7576144d7615704565b90506020020135856144ea5760006133aa565b60016133aa565b61452a565b61452a8787878481811061450c5761450c615704565b905060200201358561451f576000614522565b60015b600080613dce565b8061453481615733565b915050614355565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1661162357614578816001600160a01b0316601461469f565b61458383602061469f565b604051602001614594929190615930565b60408051601f198184030181529082905262461bcd60e51b8252610ac9916004016151c4565b600061460f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166148cf9092919063ffffffff16565b805190915015611596578080602001905181019061462d9190615636565b6115965760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610ac9565b606060006146ae836002615588565b6146b99060026152f9565b67ffffffffffffffff8111156146d1576146d1614d68565b6040519080825280601f01601f1916602001820160405280156146fb576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061473257614732615704565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061479557614795615704565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006147d1846002615588565b6147dc9060016152f9565b90505b6001811115614879577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061481d5761481d615704565b1a60f81b82828151811061483357614833615704565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93614872816159b1565b90506147df565b5083156148c85760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610ac9565b9392505050565b60606148de84846000856148e6565b949350505050565b60608247101561495e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610ac9565b6001600160a01b0385163b6149b55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610ac9565b600080866001600160a01b031685876040516149d191906159e6565b60006040518083038185875af1925050503d8060008114614a0e576040519150601f19603f3d011682016040523d82523d6000602084013e614a13565b606091505b5091509150614a23828286614a2e565b979650505050505050565b60608315614a3d5750816148c8565b825115614a4d5782518084602001fd5b8160405162461bcd60e51b8152600401610ac991906151c4565b6040518061016001604052806000815260200160008152602001600081526020016000815260200160008152602001614aba60405180606001604052806000815260200160008152602001600081525090565b8152602001600081526020016000815260200160008152602001600081526020016000151581525090565b600060208284031215614af757600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146148c857600080fd5b6001600160a01b0381168114612f0d57600080fd5b600080600080600060808688031215614b5457600080fd5b8535614b5f81614b27565b94506020860135614b6f81614b27565b935060408601359250606086013567ffffffffffffffff80821115614b9357600080fd5b818801915088601f830112614ba757600080fd5b813581811115614bb657600080fd5b896020828501011115614bc857600080fd5b9699959850939650602001949392505050565b600060208284031215614bed57600080fd5b81356148c881614b27565b60006101a082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a0830151614c5360a08401828051825260208082015190830152604090810151910152565b5060c08301516101008381019190915260e0840151610120808501919091529084015161014080850191909152908401516101608401529092015115156101809091015290565b600060208284031215614cac57600080fd5b5035919050565b60008060408385031215614cc657600080fd5b823591506020830135614cd881614b27565b809150509250929050565b8015158114612f0d57600080fd5b600080600060608486031215614d0657600080fd5b8335614d1181614b27565b9250602084013591506040840135614d2881614ce3565b809150509250925092565b600080600060608486031215614d4857600080fd5b8335614d5381614b27565b95602085013595506040909401359392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715614dc057614dc0614d68565b604052919050565b60008060408385031215614ddb57600080fd5b8235614de681614b27565b915060208381013567ffffffffffffffff80821115614e0457600080fd5b818601915086601f830112614e1857600080fd5b813581811115614e2a57614e2a614d68565b8060051b9150614e3b848301614d97565b8181529183018401918481019089841115614e5557600080fd5b938501935b83851015614e7357843582529385019390850190614e5a565b8096505050505050509250929050565b60008083601f840112614e9557600080fd5b50813567ffffffffffffffff811115614ead57600080fd5b6020830191508360208260051b8501011115614ec857600080fd5b9250929050565b60008060008060408587031215614ee557600080fd5b843567ffffffffffffffff80821115614efd57600080fd5b614f0988838901614e83565b90965094506020870135915080821115614f2257600080fd5b50614f2f87828801614e83565b95989497509550505050565b60005b83811015614f56578181015183820152602001614f3e565b8381111561165c5750506000910152565b60008151808452614f7f816020860160208601614f3b565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015615006577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0888603018452614ff4858351614f67565b94509285019290850190600101614fba565b5092979650505050505050565b60008060006060848603121561502857600080fd5b833561503381614b27565b9250602084013591506040840135614d2881614b27565b60ff81168114612f0d57600080fd5b6000806000806080858703121561506f57600080fd5b843561507a8161504a565b9350602085013561508a8161504a565b9250604085013561509a8161504a565b915060608501356150aa8161504a565b939692955090935050565b600080600080600060a086880312156150cd57600080fd5b85356150d881614b27565b945060208601356150e881614b27565b94979496505050506040830135926060810135926080909101359150565b60008060006060848603121561511b57600080fd5b833561512681614b27565b9250602084013561513681614b27565b929592945050506040919091013590565b60008060008060006080868803121561515f57600080fd5b853561516a81614b27565b9450602086013567ffffffffffffffff81111561518657600080fd5b61519288828901614e83565b90955093505060408601356151a681614ce3565b915060608601356151b681614ce3565b809150509295509295909350565b6020815260006148c86020830184614f67565b600067ffffffffffffffff8311156151f1576151f1614d68565b6152046020601f19601f86011601614d97565b905082815283838301111561521857600080fd5b6148c8836020830184614f3b565b60006020828403121561523857600080fd5b815167ffffffffffffffff81111561524f57600080fd5b8201601f8101841361526057600080fd5b6148de848251602084016151d7565b60008060006060848603121561528457600080fd5b835161528f81614b27565b60208501519093506152a081614b27565b6040850151909250614d2881614b27565b6000602082840312156152c357600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561530c5761530c6152ca565b500190565b600082615347577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006020828403121561535e57600080fd5b81516148c881614b27565b600080600080600080600080610100898b03121561538657600080fd5b885161539181614b27565b60208a01519098506153a281614b27565b60408a01519097506153b381614b27565b60608a01519096506153c481614b27565b60808a01519095506153d581614b27565b60a08a01519094506153e681614b27565b60c08a01519093506153f781614b27565b60e08a015190925061540881614b27565b809150509295985092959890939650565b60006020828403121561542b57600080fd5b81516148c88161504a565b600060ff821660ff841680821015615450576154506152ca565b90039392505050565b600181815b808511156154b257817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615498576154986152ca565b808516156154a557918102915b93841c939080029061545e565b509250929050565b6000826154c95750600161058c565b816154d65750600061058c565b81600181146154ec57600281146154f657615512565b600191505061058c565b60ff841115615507576155076152ca565b50506001821b61058c565b5060208310610133831016604e8410600b8410161715615535575081810a61058c565b61553f8383615459565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115615571576155716152ca565b029392505050565b60006148c860ff8416836154ba565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156155c0576155c06152ca565b500290565b600080600080608085870312156155db57600080fd5b84519350602085015192506040850151915060608501516150aa81614ce3565b6000806040838503121561560e57600080fd5b505080516020909101519092909150565b600082821015615631576156316152ca565b500390565b60006020828403121561564857600080fd5b81516148c881614ce3565b6001600160a01b03868116825285166020820152604081018490526060810183905260a08101600283106156b0577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b8260808301529695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156156f8578351835292840192918401916001016156dc565b50909695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415615765576157656152ca565b5060010190565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126157a157600080fd5b83018035915067ffffffffffffffff8211156157bc57600080fd5b602001915036819003821315614ec857600080fd5b8183823760009101908152919050565b600080604083850312156157f457600080fd5b82516157ff81614b27565b6020840151909250614cd881614b27565b6000806040838503121561582357600080fd5b825167ffffffffffffffff81111561583a57600080fd5b8301601f8101851361584b57600080fd5b61585a858251602084016151d7565b925050602083015190509250929050565b60408152600061587e6040830185614f67565b90508260208301529392505050565b60a0815260006158a060a0830188614f67565b6020830196909652509215156040840152606083019190915260ff16608090910152919050565b6000606082840312156158d957600080fd5b6040516060810181811067ffffffffffffffff821117156158fc576158fc614d68565b604052825161590a81614b27565b815260208381015190820152604083015161592481614ce3565b60408201529392505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615968816017850160208801614f3b565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516159a5816028840160208801614f3b565b01602801949350505050565b6000816159c0576159c06152ca565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b600082516159f8818460208701614f3b565b919091019291505056fea2646970667358221220f3c2dea840265aba07e8b682f373620ed74be45e78fe4b67851e490707a3614064736f6c63430008090033

Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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