false
true
0

Contract Address Details

0x76De93c55C45dee2CF777720145424921998FF46

Contract Name
GDXen
Creator
0xb89fa0–c80044 at 0xf1849b–7e2d3c
Balance
8,664,967.510206671047251083 PLS ( )
Tokens
Fetching tokens...
Transactions
1,195 Transactions
Transfers
0 Transfers
Gas Used
0
Last Balance Update
26074645
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
GDXen




Optimization enabled
false
Compiler version
v0.8.17+commit.8df45f5f




EVM Version
default




Verified at
2023-10-30T00:03:45.950956Z

Constructor Arguments

0x0000000000000000000000008a7fdca264e87b6da72d000f22186b4403081a2a0000000000000000000000003d5de5e89d90946324fa8583783cdf1f93b4eb3c000000000000000000000000b724d39b37b6af2bc73d9f73b7fa56e45bb2dedb

Arg [0] (address) : 0x8a7fdca264e87b6da72d000f22186b4403081a2a
Arg [1] (address) : 0x3d5de5e89d90946324fa8583783cdf1f93b4eb3c
Arg [2] (address) : 0xb724d39b37b6af2bc73d9f73b7fa56e45bb2dedb

              

contracts/GDXen.sol

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

import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "abdk-libraries-solidity/ABDKMath64x64.sol";
import "./interfaces/IBurnRedeemable.sol";
import "./GDXenERC20.sol";
import "./XecERC20.sol";
import "./XENCrypto.sol";
import "./Xec.sol";

contract GDXen is Context, ReentrancyGuard, IBurnRedeemable {
    using SafeERC20 for GDXenERC20;
    using SafeERC20 for XecERC20;
    using Math for uint256;
    using ABDKMath64x64 for int128;
    using ABDKMath64x64 for uint256;

    GDXenERC20 public gdxen;

    XecERC20 public xecToken;

    Xec public xec;

    XENCrypto public xen;

    address public teamAddress;

    uint256 public constant MAX_BPS = 100_000;

    uint256 public constant XEN_BATCH_AMOUNT = 2_000_000 ether;
    // 1000000 multiple
    uint256 public constant PROTOCOL_FEE_AMPLIFIER = 1000000;
    // protocol fee base
    uint256 public constant PROTOCOL_FEE_BASE = 1e15;

    uint256 public constant SCALING_FACTOR = 1e40;

    uint256 public constant SCALING_FACTOR_5 = 1e5;

    uint256 public constant HEALTH_E = 102;

    uint256 public constant HEALTH_K = 2;

    uint256 public constant HEALTH_A = 1;

    uint256 public constant HEALTH_INIT = 100;

    uint256 public immutable i_initialTimestamp;

    uint256 public immutable i_periodDuration;

    uint256 public currentCycleReward;

    uint256 public lastCycleReward;

    uint256 public pendingStake;

    uint256 public currentCycle;

    uint256 public lastStartedCycle;

    uint256 public previousStartedCycle;

    uint256 public currentStartedCycle;

    uint256 public pendingStakeWithdrawal;

    uint256 public pendingFees;

    uint256 public totalNumberOfBatchesBurned;

    mapping(address => uint256) public accCycleBatchesBurned;

    mapping(uint256 => uint256) public cycleTotalBatchesBurned;

    mapping(address => mapping(uint256 => uint256)) public accBurnedBatches;

    mapping(address => uint256) public lastActiveCycle;

    mapping(address => uint256) public accRewards;

    mapping(address => uint256) public accAccruedFees;

    mapping(uint256 => uint256) public rewardPerCycle;

    mapping(uint256 => uint256) public summedCycleStakes;

    mapping(address => uint256) public lastFeeUpdateCycle;

    mapping(uint256 => uint256) public cycleAccruedFees;

    mapping(uint256 => uint256) public cycleFeesPerStakeSummed;

    mapping(address => mapping(uint256 => uint256)) public accStakeCycle;

    mapping(address => uint256) public accWithdrawableStake;

    mapping(address => uint256) public accFirstStake;

    mapping(address => uint256) public accSecondStake;

    mapping(address => uint256) public firstBurnCycle;

    mapping(address => bool) public isOldUser;

    event FeesClaimed(
        uint256 indexed cycle,
        address indexed account,
        uint256 fees
    );

    event Staked(
        uint256 indexed cycle,
        address indexed account,
        uint256 amount
    );

    event Unstaked(
        uint256 indexed cycle,
        address indexed account,
        uint256 amount
    );
    event RewardsClaimed(
        uint256 indexed cycle,
        address indexed account,
        uint256 reward
    );

    event NewCycleStarted(
        uint256 indexed cycle,
        uint256 calculatedCycleReward,
        uint256 summedCycleStakes
    );

    event Burn(address indexed userAddress, uint256 batchNumber);

    event RecoverHealth(address indexed userAddress, uint256 health);

    event InviteNewUser(
        address indexed userAddress,
        address indexed referrerAddress
    );

    modifier gasWrapper(uint256 batchNumber) {
        uint256 startGas = gasleft();
        _;

        uint256 discount = (batchNumber * (MAX_BPS - 5 * batchNumber));

        uint256 healthDiscount = (HEALTH_INIT +
            HEALTH_INIT -
            getHealth(_msgSender()));

        uint256 transferXecAmount = (batchNumber * XEN_BATCH_AMOUNT) / 1000;

        uint256 xecAmount = xec.getBurnedXec(address(xen), transferXecAmount);

        uint256 xecProtocolFee = xec.getXecFee(xecAmount);

        uint256 protocolFee = (((PROTOCOL_FEE_BASE * discount) / MAX_BPS) *
            PROTOCOL_FEE_AMPLIFIER *
            healthDiscount) / HEALTH_INIT;
        require(
            msg.value >= protocolFee + xecProtocolFee,
            "GDXen: value less than protocol fee"
        );

        xec.burnXenFromGdxen{value: xecProtocolFee}(
            transferXecAmount,
            msg.sender
        );
        totalNumberOfBatchesBurned += batchNumber;
        cycleTotalBatchesBurned[currentCycle] += batchNumber;
        accBurnedBatches[_msgSender()][currentCycle] += batchNumber;
        accCycleBatchesBurned[_msgSender()] += batchNumber;
        cycleAccruedFees[currentCycle] += protocolFee;
        sendViaCall(
            payable(msg.sender),
            msg.value - protocolFee - xecProtocolFee
        );
    }

    constructor(
        address xenAddress,
        address xecTokenAddress,
        address xecAddress
    ) {
        gdxen = new GDXenERC20();
        xecToken = XecERC20(xecTokenAddress);
        xec = Xec(xecAddress);
        i_initialTimestamp = block.timestamp;
        i_periodDuration = 1 days;
        currentCycleReward = 20000 * 1e18;
        summedCycleStakes[0] = 20000 * 1e18;
        rewardPerCycle[0] = 20000 * 1e18;
        xen = XENCrypto(xenAddress);
        teamAddress = msg.sender;
    }

    function onTokenBurned(address user, uint256 amount) external {
        require(msg.sender == address(xen), "GDXen: illegal callback caller");
        calculateCycle();
        updateCycleFeesPerStakeSummed();
        setUpNewCycle();
        updateStats(user);
        lastActiveCycle[user] = currentCycle;
        emit Burn(user, amount);
    }

    function burnBatch(
        address referrerAddress,
        uint256 batchNumber
    ) external payable nonReentrant gasWrapper(batchNumber) {
        require(batchNumber <= 10000, "GDXen: maxim batch number is 10000");
        require(batchNumber > 0, "GDXen: min batch number is 1");
        require(
            xen.balanceOf(msg.sender) >= batchNumber * XEN_BATCH_AMOUNT,
            "GDXen: not enough tokens for burn"
        );

        require(referrerAddress != msg.sender, "GDXen: referrer is self");

        if (!isOldUser[msg.sender]) {
            if (batchNumber >= 100) {
                xec.awardXec(referrerAddress);
                emit InviteNewUser(msg.sender, referrerAddress);
            }

            isOldUser[msg.sender] = true;

            firstBurnCycle[msg.sender] = getCurrentCycle();
        }

        IBurnableToken(xen).burn(msg.sender, batchNumber * XEN_BATCH_AMOUNT);
    }

    function recoverHealth() public nonReentrant {
        require(
            getHealth(msg.sender) < HEALTH_INIT,
            "GDXen: health greater than 100"
        );
        calculateCycle();

        require(isOldUser[msg.sender], "GDXenViews: not old user");
        uint256 health = getHealth(msg.sender);

        uint256 recoverHealthAmount = HEALTH_INIT - health;

        uint256 burnXec = calculateBurnXec(recoverHealthAmount);

        require(
            xecToken.balanceOf(msg.sender) >= burnXec,
            "GDXen: not enough tokens for burn"
        );

        xecToken.safeTransferFrom(msg.sender, address(this), burnXec);

        firstBurnCycle[msg.sender] = getCurrentCycle();

        xecToken.burn(burnXec);

        emit RecoverHealth(msg.sender, recoverHealthAmount);
    }

    function claimRewards() external nonReentrant {
        calculateCycle();
        updateCycleFeesPerStakeSummed();
        updateStats(_msgSender());
        uint256 reward = accRewards[_msgSender()] -
            accWithdrawableStake[_msgSender()];

        require(reward > 0, "GDXen: account has no rewards");

        require(getHealth(_msgSender()) >= 100, "GDXen: health less than 100");

        accRewards[_msgSender()] -= reward;
        if (lastStartedCycle == currentStartedCycle) {
            pendingStakeWithdrawal += reward;
        } else {
            summedCycleStakes[currentCycle] =
                summedCycleStakes[currentCycle] -
                reward;
        }

        gdxen.mintReward(_msgSender(), reward);
        emit RewardsClaimed(currentCycle, _msgSender(), reward);
    }

    function claimFees() external nonReentrant {
        calculateCycle();
        updateCycleFeesPerStakeSummed();
        updateStats(_msgSender());

        require(getHealth(_msgSender()) >= 100, "GDXen: health less than 100");

        uint256 fees = accAccruedFees[_msgSender()];
        require(fees > 0, "GDXen: amount is zero");
        accAccruedFees[_msgSender()] = 0;
        sendViaCall(payable(_msgSender()), fees);
        emit FeesClaimed(getCurrentCycle(), _msgSender(), fees);
    }

    function stake(uint256 amount) external nonReentrant {
        calculateCycle();
        updateCycleFeesPerStakeSummed();
        updateStats(_msgSender());
        require(amount > 0, "GDXen: amount is zero");
        if (!isOldUser[msg.sender]) {
            isOldUser[msg.sender] = true;
            firstBurnCycle[msg.sender] = getCurrentCycle();
        }
        pendingStake += amount;
        uint256 cycleToSet = currentCycle + 1;

        if (lastStartedCycle == currentStartedCycle) {
            cycleToSet = lastStartedCycle + 1;
        }

        if (
            (cycleToSet != accFirstStake[_msgSender()] &&
                cycleToSet != accSecondStake[_msgSender()])
        ) {
            if (accFirstStake[_msgSender()] == 0) {
                accFirstStake[_msgSender()] = cycleToSet;
            } else if (accSecondStake[_msgSender()] == 0) {
                accSecondStake[_msgSender()] = cycleToSet;
            }
        }

        accStakeCycle[_msgSender()][cycleToSet] += amount;

        gdxen.safeTransferFrom(_msgSender(), address(this), amount);
        emit Staked(cycleToSet, _msgSender(), amount);
    }

    function unstake(uint256 amount) external nonReentrant {
        calculateCycle();
        updateCycleFeesPerStakeSummed();
        updateStats(_msgSender());
        require(amount > 0, "GDXen: amount is zero");
        require(getHealth(_msgSender()) >= 100, "GDXen: health less than 100");
        require(
            amount <= accWithdrawableStake[_msgSender()],
            "GDXen: amount greater than withdrawable stake"
        );

        if (lastStartedCycle == currentStartedCycle) {
            pendingStakeWithdrawal += amount;
        } else {
            summedCycleStakes[currentCycle] -= amount;
        }

        accWithdrawableStake[_msgSender()] -= amount;
        accRewards[_msgSender()] -= amount;

        gdxen.safeTransfer(_msgSender(), amount);
        emit Unstaked(currentCycle, _msgSender(), amount);
    }

    function getCurrentCycle() public view returns (uint256) {
        return (block.timestamp - i_initialTimestamp) / i_periodDuration;
    }

    function calculateBurnXec(
        uint256 _recoverHealth
    ) public view returns (uint256) {
        uint256 T = getCurrentCycle();
        uint256 E = 107;

        uint256 burnXec = ((T + 1)
            .fromUInt()
            .log_2()
            .mul(E.fromUInt())
            .toUInt() *
            10 ** xecToken.decimals() *
            _recoverHealth) / 1e2;
        return burnXec;
    }

    function getHealth(address account) public view returns (uint256) {
        uint256 HEALTH_X = getCurrentCycle() - firstBurnCycle[msg.sender];

        if (HEALTH_X == 0 || !isOldUser[account]) {
            return 100;
        }

        uint256 health = 0;
        if (HEALTH_X > 116) {
            return health;
        }

        uint256 HEALTH_KXA = HEALTH_K * (HEALTH_X ** HEALTH_A);

        uint256 HEALTH_KXA_30_QUOT = HEALTH_KXA / 30;

        uint256 HEALTH_KXA_30_REM = HEALTH_KXA % 30;
        if (HEALTH_KXA_30_QUOT > 0) {
            health =
                HEALTH_INIT *
                ((1 * SCALING_FACTOR_5 ** (2 + HEALTH_KXA_30_QUOT)) /
                    (
                        ((((HEALTH_E ** 30 * SCALING_FACTOR_5) / 1e2 ** 30) **
                            HEALTH_KXA_30_QUOT) *
                            ((HEALTH_E ** HEALTH_KXA_30_REM *
                                SCALING_FACTOR_5) / 1e2 ** HEALTH_KXA_30_REM))
                    ));
        } else {
            health =
                HEALTH_INIT *
                ((1 * SCALING_FACTOR_5 ** 2) /
                    (
                        ((HEALTH_E ** HEALTH_KXA_30_REM * SCALING_FACTOR_5) /
                            1e2 ** HEALTH_KXA_30_REM)
                    ));
        }
        return health / SCALING_FACTOR_5;
    }

    function calculateCycle() internal {
        uint256 calculatedCycle = getCurrentCycle();

        if (calculatedCycle > currentCycle) {
            currentCycle = calculatedCycle;
        }
    }

    function updateCycleFeesPerStakeSummed() internal {
        if (currentCycle != currentStartedCycle) {
            previousStartedCycle = lastStartedCycle + 1;

            lastStartedCycle = currentStartedCycle;
        }

        if (
            currentCycle > lastStartedCycle &&
            cycleFeesPerStakeSummed[lastStartedCycle + 1] == 0
        ) {
            uint256 feePerStake;

            if (summedCycleStakes[lastStartedCycle] != 0) {
                feePerStake =
                    ((cycleAccruedFees[lastStartedCycle] + pendingFees) *
                        SCALING_FACTOR) /
                    summedCycleStakes[lastStartedCycle];
                pendingFees = 0;
            } else {
                pendingFees += cycleAccruedFees[lastStartedCycle];
                feePerStake = 0;
            }

            cycleFeesPerStakeSummed[lastStartedCycle + 1] =
                cycleFeesPerStakeSummed[previousStartedCycle] +
                feePerStake;
        }
    }

    function setUpNewCycle() internal {
        if (rewardPerCycle[currentCycle] == 0) {
            lastCycleReward = currentCycleReward;

            uint256 calculatedCycleReward = (lastCycleReward * 20000) / 20080;

            currentCycleReward = calculatedCycleReward;

            rewardPerCycle[currentCycle] = calculatedCycleReward;

            currentStartedCycle = currentCycle;

            summedCycleStakes[currentStartedCycle] +=
                summedCycleStakes[lastStartedCycle] +
                currentCycleReward;

            if (pendingStake != 0) {
                summedCycleStakes[currentStartedCycle] += pendingStake;

                pendingStake = 0;
            }

            if (pendingStakeWithdrawal != 0) {
                summedCycleStakes[
                    currentStartedCycle
                ] -= pendingStakeWithdrawal;

                pendingStakeWithdrawal = 0;
            }

            emit NewCycleStarted(
                currentCycle,
                calculatedCycleReward,
                summedCycleStakes[currentStartedCycle]
            );
        }
    }

    function updateStats(address account) internal {
        if (
            currentCycle > lastActiveCycle[account] &&
            accCycleBatchesBurned[account] != 0
        ) {
            uint256 lastCycleAccReward = (accCycleBatchesBurned[account] *
                rewardPerCycle[lastActiveCycle[account]]) /
                cycleTotalBatchesBurned[lastActiveCycle[account]];

            accRewards[account] += lastCycleAccReward;

            accCycleBatchesBurned[account] = 0;
        }

        if (
            currentCycle > lastStartedCycle &&
            lastFeeUpdateCycle[account] != lastStartedCycle + 1
        ) {
            accAccruedFees[account] =
                accAccruedFees[account] +
                (
                    (accRewards[account] *
                        (cycleFeesPerStakeSummed[lastStartedCycle + 1] -
                            cycleFeesPerStakeSummed[
                                lastFeeUpdateCycle[account]
                            ]))
                ) /
                SCALING_FACTOR;

            lastFeeUpdateCycle[account] = lastStartedCycle + 1;
        }

        if (
            accFirstStake[account] != 0 && currentCycle > accFirstStake[account]
        ) {
            uint256 unlockedFirstStake = accStakeCycle[account][
                accFirstStake[account]
            ];

            accRewards[account] += unlockedFirstStake;
            accWithdrawableStake[account] += unlockedFirstStake;
            if (lastStartedCycle + 1 > accFirstStake[account]) {
                accAccruedFees[account] =
                    accAccruedFees[account] +
                    (
                        (accStakeCycle[account][accFirstStake[account]] *
                            (cycleFeesPerStakeSummed[lastStartedCycle + 1] -
                                cycleFeesPerStakeSummed[
                                    accFirstStake[account]
                                ]))
                    ) /
                    SCALING_FACTOR;
            }

            accStakeCycle[account][accFirstStake[account]] = 0;
            accFirstStake[account] = 0;

            if (accSecondStake[account] != 0) {
                if (currentCycle > accSecondStake[account]) {
                    uint256 unlockedSecondStake = accStakeCycle[account][
                        accSecondStake[account]
                    ];
                    accRewards[account] += unlockedSecondStake;
                    accWithdrawableStake[account] += unlockedSecondStake;

                    if (lastStartedCycle + 1 > accSecondStake[account]) {
                        accAccruedFees[account] =
                            accAccruedFees[account] +
                            (
                                (accStakeCycle[account][
                                    accSecondStake[account]
                                ] *
                                    (cycleFeesPerStakeSummed[
                                        lastStartedCycle + 1
                                    ] -
                                        cycleFeesPerStakeSummed[
                                            accSecondStake[account]
                                        ]))
                            ) /
                            SCALING_FACTOR;
                    }

                    accStakeCycle[account][accSecondStake[account]] = 0;
                    accSecondStake[account] = 0;
                } else {
                    accFirstStake[account] = accSecondStake[account];
                    accSecondStake[account] = 0;
                }
            }
        }
    }

    function sendViaCall(address payable to, uint256 amount) internal {
        (bool sent, ) = to.call{value: amount}("");
        require(sent, "GDXen: failed to send amount");
    }

    function supportsInterface(bytes4 interfaceId) public pure returns (bool) {
        return interfaceId == type(IBurnRedeemable).interfaceId;
    }
}
        

@openzeppelin/contracts/utils/introspection/IERC165.sol

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

@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol

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

@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/draft-ERC20Permit.sol)

pragma solidity ^0.8.0;

// EIP-2612 is Final as of 2022-11-01. This file is deprecated.

import "./ERC20Permit.sol";
          

@openzeppelin/contracts/utils/Strings.sol

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

@openzeppelin/contracts/utils/Context.sol

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

pragma solidity ^0.8.0;

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

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

contracts/XENCrypto.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

import "./MathX.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/interfaces/IERC165.sol";
import "abdk-libraries-solidity/ABDKMath64x64.sol";
import "./interfaces/IStakingToken.sol";
import "./interfaces/IRankedMintingToken.sol";
import "./interfaces/IBurnableToken.sol";
import "./interfaces/IBurnRedeemable.sol";

contract XENCrypto is
    Context,
    IRankedMintingToken,
    IStakingToken,
    IBurnableToken,
    ERC20("XEN Crypto", "XEN")
{
    using MathX for uint256;
    using ABDKMath64x64 for int128;
    using ABDKMath64x64 for uint256;

    // INTERNAL TYPE TO DESCRIBE A XEN MINT INFO
    struct MintInfo {
        address user;
        uint256 term;
        uint256 maturityTs;
        uint256 rank;
        uint256 amplifier;
        uint256 eaaRate;
    }

    // INTERNAL TYPE TO DESCRIBE A XEN STAKE
    struct StakeInfo {
        uint256 term;
        uint256 maturityTs;
        uint256 amount;
        uint256 apy;
    }

    // PUBLIC CONSTANTS

    uint256 public constant SECONDS_IN_DAY = 3_600 * 24;
    uint256 public constant DAYS_IN_YEAR = 365;

    uint256 public constant GENESIS_RANK = 1;

    uint256 public constant MIN_TERM = 1 * SECONDS_IN_DAY - 1;
    uint256 public constant MAX_TERM_START = 100 * SECONDS_IN_DAY;
    uint256 public constant MAX_TERM_END = 1_000 * SECONDS_IN_DAY;
    uint256 public constant TERM_AMPLIFIER = 15;
    uint256 public constant TERM_AMPLIFIER_THRESHOLD = 5_000;
    uint256 public constant REWARD_AMPLIFIER_START = 3_000;
    uint256 public constant REWARD_AMPLIFIER_END = 1;
    uint256 public constant EAA_PM_START = 100;
    uint256 public constant EAA_PM_STEP = 1;
    uint256 public constant EAA_RANK_STEP = 100_000;
    uint256 public constant WITHDRAWAL_WINDOW_DAYS = 7;
    uint256 public constant MAX_PENALTY_PCT = 99;

    uint256 public constant XEN_MIN_STAKE = 0;

    uint256 public constant XEN_MIN_BURN = 0;

    uint256 public constant XEN_APY_START = 20;
    uint256 public constant XEN_APY_DAYS_STEP = 90;
    uint256 public constant XEN_APY_END = 2;

    string public constant AUTHORS = "@MrJackLevin @lbelyaev faircrypto.org";

    // PUBLIC STATE, READABLE VIA NAMESAKE GETTERS

    uint256 public immutable genesisTs;
    uint256 public globalRank = GENESIS_RANK;
    uint256 public activeMinters;
    uint256 public activeStakes;
    uint256 public totalXenStaked;
    // user address => XEN mint info
    mapping(address => MintInfo) public userMints;
    // user address => XEN stake info
    mapping(address => StakeInfo) public userStakes;
    // user address => XEN burn amount
    mapping(address => uint256) public userBurns;

    // CONSTRUCTOR
    constructor() {
        genesisTs = block.timestamp;
    }

    // PRIVATE METHODS

    /**
     * @dev calculates current MaxTerm based on Global Rank
     *      (if Global Rank crosses over TERM_AMPLIFIER_THRESHOLD)
     */
    function _calculateMaxTerm() private view returns (uint256) {
        if (globalRank > TERM_AMPLIFIER_THRESHOLD) {
            uint256 delta = globalRank
                .fromUInt()
                .log_2()
                .mul(TERM_AMPLIFIER.fromUInt())
                .toUInt();
            uint256 newMax = MAX_TERM_START + delta * SECONDS_IN_DAY;
            return MathX.min(newMax, MAX_TERM_END);
        }
        return MAX_TERM_START;
    }

    /**
     * @dev calculates Withdrawal Penalty depending on lateness
     */
    function _penalty(uint256 secsLate) private pure returns (uint256) {
        // =MIN(2^(daysLate+3)/window-1,99)
        uint256 daysLate = secsLate / SECONDS_IN_DAY;
        if (daysLate > WITHDRAWAL_WINDOW_DAYS - 1) return MAX_PENALTY_PCT;
        uint256 penalty = (uint256(1) << (daysLate + 3)) /
            WITHDRAWAL_WINDOW_DAYS -
            1;
        return MathX.min(penalty, MAX_PENALTY_PCT);
    }

    /**
     * @dev calculates net Mint Reward (adjusted for Penalty)
     */
    function _calculateMintReward(
        uint256 cRank,
        uint256 term,
        uint256 maturityTs,
        uint256 amplifier,
        uint256 eeaRate
    ) private view returns (uint256) {
        uint256 secsLate = block.timestamp - maturityTs;
        uint256 penalty = _penalty(secsLate);
        uint256 rankDelta = MathX.max(globalRank - cRank, 2);
        uint256 EAA = (1_000 + eeaRate);
        uint256 reward = getGrossReward(rankDelta, amplifier, term, EAA);
        return (reward * (100 - penalty)) / 100;
    }

    /**
     * @dev cleans up User Mint storage (gets some Gas credit;))
     */
    function _cleanUpUserMint() private {
        delete userMints[_msgSender()];
        activeMinters--;
    }

    /**
     * @dev calculates XEN Stake Reward
     */
    function _calculateStakeReward(
        uint256 amount,
        uint256 term,
        uint256 maturityTs,
        uint256 apy
    ) private view returns (uint256) {
        if (block.timestamp > maturityTs) {
            uint256 rate = (apy * term * 1_000_000) / DAYS_IN_YEAR;
            return (amount * rate) / 100_000_000;
        }
        return 0;
    }

    /**
     * @dev calculates Reward Amplifier
     */
    function _calculateRewardAmplifier() private view returns (uint256) {
        uint256 amplifierDecrease = (block.timestamp - genesisTs) /
            SECONDS_IN_DAY;
        if (amplifierDecrease < REWARD_AMPLIFIER_START) {
            return
                MathX.max(
                    REWARD_AMPLIFIER_START - amplifierDecrease,
                    REWARD_AMPLIFIER_END
                );
        } else {
            return REWARD_AMPLIFIER_END;
        }
    }

    /**
     * @dev calculates Early Adopter Amplifier Rate (in 1/000ths)
     *      actual EAA is (1_000 + EAAR) / 1_000
     */
    function _calculateEAARate() private view returns (uint256) {
        uint256 decrease = (EAA_PM_STEP * globalRank) / EAA_RANK_STEP;
        if (decrease > EAA_PM_START) return 0;
        return EAA_PM_START - decrease;
    }

    /**
     * @dev calculates APY (in %)
     */
    function _calculateAPY() private view returns (uint256) {
        uint256 decrease = (block.timestamp - genesisTs) /
            (SECONDS_IN_DAY * XEN_APY_DAYS_STEP);
        if (XEN_APY_START - XEN_APY_END < decrease) return XEN_APY_END;
        return XEN_APY_START - decrease;
    }

    /**
     * @dev creates User Stake
     */
    function _createStake(uint256 amount, uint256 term) private {
        userStakes[_msgSender()] = StakeInfo({
            term: term,
            maturityTs: block.timestamp + term * SECONDS_IN_DAY,
            amount: amount,
            apy: _calculateAPY()
        });
        activeStakes++;
        totalXenStaked += amount;
    }

    // PUBLIC CONVENIENCE GETTERS

    /**
     * @dev calculates gross Mint Reward
     */
    function getGrossReward(
        uint256 rankDelta,
        uint256 amplifier,
        uint256 term,
        uint256 eaa
    ) public pure returns (uint256) {
        int128 log128 = rankDelta.fromUInt().log_2();
        int128 reward128 = log128
            .mul(amplifier.fromUInt())
            .mul(term.fromUInt())
            .mul(eaa.fromUInt());
        return reward128.div(uint256(1_000).fromUInt()).toUInt();
    }

    /**
     * @dev returns User Mint object associated with User account address
     */
    function getUserMint() external view returns (MintInfo memory) {
        return userMints[_msgSender()];
    }

    /**
     * @dev returns XEN Stake object associated with User account address
     */
    function getUserStake() external view returns (StakeInfo memory) {
        return userStakes[_msgSender()];
    }

    /**
     * @dev returns current AMP
     */
    function getCurrentAMP() external view returns (uint256) {
        return _calculateRewardAmplifier();
    }

    /**
     * @dev returns current EAA Rate
     */
    function getCurrentEAAR() external view returns (uint256) {
        return _calculateEAARate();
    }

    /**
     * @dev returns current APY
     */
    function getCurrentAPY() external view returns (uint256) {
        return _calculateAPY();
    }

    /**
     * @dev returns current MaxTerm
     */
    function getCurrentMaxTerm() external view returns (uint256) {
        return _calculateMaxTerm();
    }

    // PUBLIC STATE-CHANGING METHODS

    /**
     * @dev accepts User cRank claim provided all checks pass (incl. no current claim exists)
     */
    function claimRank(uint256 term) external {
        uint256 termSec = term * SECONDS_IN_DAY;
        require(termSec > MIN_TERM, "CRank: Term less than min");
        require(
            termSec < _calculateMaxTerm() + 1,
            "CRank: Term more than current max term"
        );
        require(
            userMints[_msgSender()].rank == 0,
            "CRank: Mint already in progress"
        );

        // create and store new MintInfo
        MintInfo memory mintInfo = MintInfo({
            user: _msgSender(),
            term: term,
            maturityTs: block.timestamp + termSec,
            rank: globalRank,
            amplifier: _calculateRewardAmplifier(),
            eaaRate: _calculateEAARate()
        });
        userMints[_msgSender()] = mintInfo;
        activeMinters++;
        emit RankClaimed(_msgSender(), term, globalRank++);
    }

    /**
     * @dev ends minting upon maturity (and within permitted Withdrawal Time Window), gets minted XEN
     */
    function claimMintReward() external {
        MintInfo memory mintInfo = userMints[_msgSender()];
        require(mintInfo.rank > 0, "CRank: No mint exists");
        require(
            block.timestamp > mintInfo.maturityTs,
            "CRank: Mint maturity not reached"
        );

        // calculate reward and mint tokens
        uint256 rewardAmount = _calculateMintReward(
            mintInfo.rank,
            mintInfo.term,
            mintInfo.maturityTs,
            mintInfo.amplifier,
            mintInfo.eaaRate
        ) * 1 ether;
        _mint(_msgSender(), rewardAmount);

        _cleanUpUserMint();
        emit MintClaimed(_msgSender(), rewardAmount);
    }

    /**
     * @dev  ends minting upon maturity (and within permitted Withdrawal time Window)
     *       mints XEN coins and splits them between User and designated other address
     */
    function claimMintRewardAndShare(address other, uint256 pct) external {
        MintInfo memory mintInfo = userMints[_msgSender()];
        require(other != address(0), "CRank: Cannot share with zero address");
        require(pct > 0, "CRank: Cannot share zero percent");
        require(pct < 101, "CRank: Cannot share 100+ percent");
        require(mintInfo.rank > 0, "CRank: No mint exists");
        require(
            block.timestamp > mintInfo.maturityTs,
            "CRank: Mint maturity not reached"
        );

        // calculate reward
        uint256 rewardAmount = _calculateMintReward(
            mintInfo.rank,
            mintInfo.term,
            mintInfo.maturityTs,
            mintInfo.amplifier,
            mintInfo.eaaRate
        ) * 1 ether;
        uint256 sharedReward = (rewardAmount * pct) / 100;
        uint256 ownReward = rewardAmount - sharedReward;

        // mint reward tokens
        _mint(_msgSender(), ownReward);
        _mint(other, sharedReward);

        _cleanUpUserMint();
        emit MintClaimed(_msgSender(), rewardAmount);
    }

    /**
     * @dev  ends minting upon maturity (and within permitted Withdrawal time Window)
     *       mints XEN coins and stakes 'pct' of it for 'term'
     */
    function claimMintRewardAndStake(uint256 pct, uint256 term) external {
        MintInfo memory mintInfo = userMints[_msgSender()];
        // require(pct > 0, "CRank: Cannot share zero percent");
        require(pct < 101, "CRank: Cannot share >100 percent");
        require(mintInfo.rank > 0, "CRank: No mint exists");
        require(
            block.timestamp > mintInfo.maturityTs,
            "CRank: Mint maturity not reached"
        );

        // calculate reward
        uint256 rewardAmount = _calculateMintReward(
            mintInfo.rank,
            mintInfo.term,
            mintInfo.maturityTs,
            mintInfo.amplifier,
            mintInfo.eaaRate
        ) * 1 ether;
        uint256 stakedReward = (rewardAmount * pct) / 100;
        uint256 ownReward = rewardAmount - stakedReward;

        // mint reward tokens part
        _mint(_msgSender(), ownReward);
        _cleanUpUserMint();
        emit MintClaimed(_msgSender(), rewardAmount);

        // nothing to burn since we haven't minted this part yet
        // stake extra tokens part
        require(stakedReward > XEN_MIN_STAKE, "XEN: Below min stake");
        require(term * SECONDS_IN_DAY > MIN_TERM, "XEN: Below min stake term");
        require(
            term * SECONDS_IN_DAY < MAX_TERM_END + 1,
            "XEN: Above max stake term"
        );
        require(userStakes[_msgSender()].amount == 0, "XEN: stake exists");

        _createStake(stakedReward, term);
        emit Staked(_msgSender(), stakedReward, term);
    }

    /**
     * @dev initiates XEN Stake in amount for a term (days)
     */
    function stake(uint256 amount, uint256 term) external {
        require(balanceOf(_msgSender()) >= amount, "XEN: not enough balance");
        require(amount > XEN_MIN_STAKE, "XEN: Below min stake");
        require(term * SECONDS_IN_DAY > MIN_TERM, "XEN: Below min stake term");
        require(
            term * SECONDS_IN_DAY < MAX_TERM_END + 1,
            "XEN: Above max stake term"
        );
        require(userStakes[_msgSender()].amount == 0, "XEN: stake exists");

        // burn staked XEN
        _burn(_msgSender(), amount);
        // create XEN Stake
        _createStake(amount, term);
        emit Staked(_msgSender(), amount, term);
    }

    /**
     * @dev ends XEN Stake and gets reward if the Stake is mature
     */
    function withdraw() external {
        StakeInfo memory userStake = userStakes[_msgSender()];
        require(userStake.amount > 0, "XEN: no stake exists");

        uint256 xenReward = _calculateStakeReward(
            userStake.amount,
            userStake.term,
            userStake.maturityTs,
            userStake.apy
        );
        activeStakes--;
        totalXenStaked -= userStake.amount;

        // mint staked XEN (+ reward)
        _mint(_msgSender(), userStake.amount + xenReward);
        emit Withdrawn(_msgSender(), userStake.amount, xenReward);
        delete userStakes[_msgSender()];
    }

    /**
     * @dev burns XEN tokens and creates Proof-Of-Burn record to be used by connected DeFi services
     */
    function burn(address user, uint256 amount) public {
        require(amount > XEN_MIN_BURN, "Burn: Below min limit");
        require(
            IERC165(_msgSender()).supportsInterface(
                type(IBurnRedeemable).interfaceId
            ),
            "Burn: not a supported contract"
        );

        _spendAllowance(user, _msgSender(), amount);
        _burn(user, amount);
        userBurns[user] += amount;
        IBurnRedeemable(_msgSender()).onTokenBurned(user, amount);
    }
}
          

contracts/interfaces/IBurnableToken.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

interface IBurnableToken {
    function burn(address user, uint256 amount) external;
}
          

contracts/MathX.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

import "abdk-libraries-solidity/ABDKMath64x64.sol";

library MathX {
    function min(uint256 a, uint256 b) external pure returns (uint256) {
        if (a > b) return b;
        return a;
    }

    function max(uint256 a, uint256 b) external pure returns (uint256) {
        if (a > b) return a;
        return b;
    }

    function logX64(uint256 x) external pure returns (int128) {
        return ABDKMath64x64.log_2(ABDKMath64x64.fromUInt(x));
    }
}
          

@openzeppelin/contracts/utils/cryptography/ECDSA.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32")
            mstore(0x1c, hash)
            message := keccak256(0x00, 0x3c)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, "\x19\x01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            data := keccak256(ptr, 0x42)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Data with intended validator, created from a
     * `validator` and `data` according to the version 0 of EIP-191.
     *
     * See {recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x00", validator, data));
    }
}
          

contracts/interfaces/IRankedMintingToken.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

interface IRankedMintingToken {
    event RankClaimed(address indexed user, uint256 term, uint256 rank);

    event MintClaimed(address indexed user, uint256 rewardAmount);

    function claimRank(uint256 term) external;

    function claimMintReward() external;
}
          

@openzeppelin/contracts/utils/StorageSlot.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.0;

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

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

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

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

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

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

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}
          

@openzeppelin/contracts/interfaces/IERC5267.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5267.sol)

pragma solidity ^0.8.0;

interface IERC5267 {
    /**
     * @dev MAY be emitted to signal that the domain could have changed.
     */
    event EIP712DomainChanged();

    /**
     * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
     * signature.
     */
    function eip712Domain()
        external
        view
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        );
}
          

contracts/Xec.sol

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

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "abdk-libraries-solidity/ABDKMath64x64.sol";
import "./interfaces/IBurnRedeemable.sol";
import "./XecERC20.sol";
import "./GDXen.sol";
import "./XENCrypto.sol";

contract Xec is Context, ReentrancyGuard, Ownable {
    using SafeERC20 for XecERC20;
    using Math for uint256;
    using ABDKMath64x64 for int128;
    using ABDKMath64x64 for uint256;
    // 7240 M
    uint256 public constant M = 7240 ether;
    // 223000 T
    uint256 public constant awardThreshold = 223000 ether;

    uint256 public constant xecLockTime = 1 days;

    uint256 public constant xecMaxLockTime = 10 days;

    uint256 public constant A = 106;

    uint256 public constant aDecimal = 1e2;
    XecERC20 public xec;
    GDXen public gdxen;
    XENCrypto public xen;

    uint256 public totalBurnedGarbage;

    address[] public garbageTokens;

    mapping(address => uint256) public accClaimableXec;

    mapping(address => string) public garbageSymbols;

    mapping(address => uint256) public E_0;

    mapping(address => uint256) public lastBurnedTimeToClaim;

    event BurnGarbageToken(
        address indexed userAddress,
        uint256 garbageNumber,
        uint256 xecAmount
    );

    constructor(address xenAddress) {
        xec = new XecERC20();
        xen = XENCrypto(xenAddress);
    }

    function setGdxen(address _gdxen) external onlyOwner {
        require(_gdxen != address(0), "Xec: zero address");
        gdxen = GDXen(_gdxen);
    }

    function createGarbageLists(
        address _garbageAddress,
        uint256 _E_0
    ) external onlyOwner {
        require(_garbageAddress != address(0), "Xec: zero address");
        require(_E_0 > 0, "Xec: E_0 must be greater than 0");

        require(E_0[_garbageAddress] == 0, "Xec: garbage token already exists");

        garbageTokens.push(_garbageAddress);

        garbageSymbols[_garbageAddress] = IERC20Metadata(_garbageAddress)
            .symbol();

        E_0[_garbageAddress] = _E_0;
    }

    function onTokenBurned(address user, uint256 amount) external {
        require(msg.sender == address(xen), "Xec: caller is not XENCrypto");
    }

    function burnGarbage(
        address _garbageAddress,
        uint256 _amount,
        address _to
    ) public payable nonReentrant {
        require(_garbageAddress != address(0), "Xec: zero address");
        require(_amount > 0, "Xec: _amount must be greater than 0");

        require(
            IERC20(_garbageAddress).balanceOf(_msgSender()) >= _amount,
            "Xec: insufficient balance"
        );

        uint256 xecAmount = getBurnedXec(_garbageAddress, _amount);
        if (_garbageAddress == address(xen)) {
            IBurnableToken(xen).burn(_msgSender(), _amount);
        } else {
            IERC20(_garbageAddress).transferFrom(
                _msgSender(),
                address(0x000000000000000000000000000000000000dEaD),
                _amount
            );
        }

        uint256 userFee = getXecFee(xecAmount);

        require(msg.value >= userFee, "Xec: insufficient fee");

        if (msg.value >= awardThreshold) {
            xecAmount += xecAmount / 5;
        }

        totalBurnedGarbage += _amount;

        lastBurnedTimeToClaim[_to] = block.timestamp + getXecLockTime();

        accClaimableXec[_to] += xecAmount;

        emit BurnGarbageToken(_to, _amount, xecAmount);
    }

    function burnXenFromGdxen(uint256 _amount, address _to) external payable {
        require(msg.sender == address(gdxen), "Xec: caller is not GDXen");

        uint256 xecAmount = getBurnedXec(address(xen), _amount);

        totalBurnedGarbage += _amount;

        lastBurnedTimeToClaim[_to] = block.timestamp + getXecLockTime();

        accClaimableXec[_to] += xecAmount;
    }

    function claimXec() external nonReentrant {
        require(accClaimableXec[_msgSender()] > 0, "Xec: no claimable XEC");

        require(
            block.timestamp >= lastBurnedTimeToClaim[_msgSender()],
            "Xec: XEC is locked"
        );

        uint256 claimableXec = accClaimableXec[_msgSender()];

        accClaimableXec[_msgSender()] = 0;

        xec.mintReward(_msgSender(), claimableXec);
    }

    function awardXec(address _to) external nonReentrant {
        require(msg.sender == address(gdxen), "Xec: caller is not GDXen");

        accClaimableXec[_to] += 10 ether;
    }

    function withdraw() external onlyOwner {
        uint256 balance = address(this).balance;

        sendViaCall(payable(owner()), balance);
    }

    function sendViaCall(address payable to, uint256 amount) internal {
        (bool sent, ) = to.call{value: amount}("");
        require(sent, "Xec: failed to send amount");
    }

    function getBurnedXec(
        address _garbageAddress,
        uint256 _amount
    ) public view returns (uint256) {
        require(E_0[_garbageAddress] > 0, "Xec: E_0 must be greater than 0");

        uint256 decimals = IERC20Metadata(_garbageAddress).decimals();

        uint256 xecAmount = (_amount * E_0[_garbageAddress]) / 10 ** decimals;
        return xecAmount;
    }

    function getXecFee(uint256 _xecAmount) public view returns (uint256) {
        uint256 _M = M;
        uint256 _A = A;
        uint256 _aDecimal = aDecimal;

        uint256 currentCycle = Math.min(GDXen(gdxen).getCurrentCycle(), 30);

        uint256 fee = (_M *
            ((1 * _aDecimal ** (2 + currentCycle)) / (_A ** currentCycle))) /
            _aDecimal ** 2;

        uint256 totalFee = (fee * _xecAmount) / 10 ** XecERC20(xec).decimals();
        return totalFee;
    }

    function getXecLockTime() public view returns (uint256) {
        uint256 lockTime = xecLockTime;

        uint256 maxLockTime = xecMaxLockTime;

        uint256 currentCycle = GDXen(gdxen).getCurrentCycle();

        if (currentCycle > 0) {
            lockTime += (currentCycle / 10) * lockTime;
        }

        return Math.min(lockTime, maxLockTime);
    }

    function getAllGarbageTokens() public view returns (address[] memory) {
        return garbageTokens;
    }

    function supportsInterface(bytes4 interfaceId) public pure returns (bool) {
        return interfaceId == type(IBurnRedeemable).interfaceId;
    }
}
          

@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/ERC20Permit.sol)

pragma solidity ^0.8.0;

import "./IERC20Permit.sol";
import "../ERC20.sol";
import "../../../utils/cryptography/ECDSA.sol";
import "../../../utils/cryptography/EIP712.sol";
import "../../../utils/Counters.sol";

/**
 * @dev Implementation 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.
 *
 * _Available since v3.4._
 */
abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {
    using Counters for Counters.Counter;

    mapping(address => Counters.Counter) private _nonces;

    // solhint-disable-next-line var-name-mixedcase
    bytes32 private constant _PERMIT_TYPEHASH =
        keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
    /**
     * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.
     * However, to ensure consistency with the upgradeable transpiler, we will continue
     * to reserve a slot.
     * @custom:oz-renamed-from _PERMIT_TYPEHASH
     */
    // solhint-disable-next-line var-name-mixedcase
    bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;

    /**
     * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`.
     *
     * It's a good idea to use the same `name` that is defined as the ERC20 token name.
     */
    constructor(string memory name) EIP712(name, "1") {}

    /**
     * @dev See {IERC20Permit-permit}.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual override {
        require(block.timestamp <= deadline, "ERC20Permit: expired deadline");

        bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));

        bytes32 hash = _hashTypedDataV4(structHash);

        address signer = ECDSA.recover(hash, v, r, s);
        require(signer == owner, "ERC20Permit: invalid signature");

        _approve(owner, spender, value);
    }

    /**
     * @dev See {IERC20Permit-nonces}.
     */
    function nonces(address owner) public view virtual override returns (uint256) {
        return _nonces[owner].current();
    }

    /**
     * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view override returns (bytes32) {
        return _domainSeparatorV4();
    }

    /**
     * @dev "Consume a nonce": return the current value and increment.
     *
     * _Available since v4.1._
     */
    function _useNonce(address owner) internal virtual returns (uint256 current) {
        Counters.Counter storage nonce = _nonces[owner];
        current = nonce.current();
        nonce.increment();
    }
}
          

contracts/XecERC20.sol

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

import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";

contract XecERC20 is ERC20Permit {
    /**
     * The address of the Xec.sol contract instance.
     */
    address public immutable owner;

    /**
     * Sets the owner address.
     * Called from within the Xec.sol constructor.
     */
    constructor() ERC20("Xec Token", "Xec") ERC20Permit("Xec Token") {
        owner = msg.sender;
    }

    /**
     * The total supply is naturally capped by the distribution algorithm
     * implemented by the main gdxen contract, however an additional check
     * that will never be triggered is added to reassure the reader.
     *
     * @param account the address of the reward token reciever
     * @param amount wei to be minted
     */
    function mintReward(address account, uint256 amount) external {
        require(msg.sender == owner, "Xec: caller is not Xec contract.");
        _mint(account, amount);
    }

    function burn(uint256 amount) external {
        _burn(msg.sender, amount);
    }
}
          

@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

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

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

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

@openzeppelin/contracts/utils/ShortStrings.sol

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

pragma solidity ^0.8.8;

import "./StorageSlot.sol";

// | string  | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA   |
// | length  | 0x                                                              BB |
type ShortString is bytes32;

/**
 * @dev This library provides functions to convert short memory strings
 * into a `ShortString` type that can be used as an immutable variable.
 *
 * Strings of arbitrary length can be optimized using this library if
 * they are short enough (up to 31 bytes) by packing them with their
 * length (1 byte) in a single EVM word (32 bytes). Additionally, a
 * fallback mechanism can be used for every other case.
 *
 * Usage example:
 *
 * ```solidity
 * contract Named {
 *     using ShortStrings for *;
 *
 *     ShortString private immutable _name;
 *     string private _nameFallback;
 *
 *     constructor(string memory contractName) {
 *         _name = contractName.toShortStringWithFallback(_nameFallback);
 *     }
 *
 *     function name() external view returns (string memory) {
 *         return _name.toStringWithFallback(_nameFallback);
 *     }
 * }
 * ```
 */
library ShortStrings {
    // Used as an identifier for strings longer than 31 bytes.
    bytes32 private constant _FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;

    error StringTooLong(string str);
    error InvalidShortString();

    /**
     * @dev Encode a string of at most 31 chars into a `ShortString`.
     *
     * This will trigger a `StringTooLong` error is the input string is too long.
     */
    function toShortString(string memory str) internal pure returns (ShortString) {
        bytes memory bstr = bytes(str);
        if (bstr.length > 31) {
            revert StringTooLong(str);
        }
        return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));
    }

    /**
     * @dev Decode a `ShortString` back to a "normal" string.
     */
    function toString(ShortString sstr) internal pure returns (string memory) {
        uint256 len = byteLength(sstr);
        // using `new string(len)` would work locally but is not memory safe.
        string memory str = new string(32);
        /// @solidity memory-safe-assembly
        assembly {
            mstore(str, len)
            mstore(add(str, 0x20), sstr)
        }
        return str;
    }

    /**
     * @dev Return the length of a `ShortString`.
     */
    function byteLength(ShortString sstr) internal pure returns (uint256) {
        uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;
        if (result > 31) {
            revert InvalidShortString();
        }
        return result;
    }

    /**
     * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.
     */
    function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {
        if (bytes(value).length < 32) {
            return toShortString(value);
        } else {
            StorageSlot.getStringSlot(store).value = value;
            return ShortString.wrap(_FALLBACK_SENTINEL);
        }
    }

    /**
     * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
     */
    function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
        if (ShortString.unwrap(value) != _FALLBACK_SENTINEL) {
            return toString(value);
        } else {
            return store;
        }
    }

    /**
     * @dev Return the length of a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
     *
     * WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
     * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
     */
    function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {
        if (ShortString.unwrap(value) != _FALLBACK_SENTINEL) {
            return byteLength(value);
        } else {
            return bytes(store).length;
        }
    }
}
          

@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol

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

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

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

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

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

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

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

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

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

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

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

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

@openzeppelin/contracts/interfaces/IERC165.sol

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

pragma solidity ^0.8.0;

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

contracts/interfaces/IStakingToken.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

interface IStakingToken {
    event Staked(address indexed user, uint256 amount, uint256 term);

    event Withdrawn(address indexed user, uint256 amount, uint256 reward);

    function stake(uint256 amount, uint256 term) external;

    function withdraw() external;
}
          

@openzeppelin/contracts/utils/math/Math.sol

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

contracts/GDXenERC20.sol

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

import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";

/**
 * Reward token contract to be used by the gdxen protocol.
 * The entire amount is minted by the main gdxen contract
 * (GDXen.sol - which is the owner of this contract)
 * directly to an account when it claims rewards.
 */
contract GDXenERC20 is ERC20Permit {
    /**
     * The address of the GDXen.sol contract instance.
     */
    address public immutable owner;

    /**
     * Sets the owner address.
     * Called from within the GDXen.sol constructor.
     */
    constructor() ERC20("GDXen Token", "GDXen") ERC20Permit("GDXen Token") {
        owner = msg.sender;
    }

    /**
     * The total supply is naturally capped by the distribution algorithm
     * implemented by the main gdxen contract, however an additional check
     * that will never be triggered is added to reassure the reader.
     *
     * @param account the address of the reward token reciever
     * @param amount wei to be minted
     */
    function mintReward(address account, uint256 amount) external {
        require(msg.sender == owner, "GDXen: caller is not GDXen contract.");
        require(
            super.totalSupply() < 5010000000000000000000000,
            "GDXen: max supply already minted"
        );
        _mint(account, amount);
    }
}
          

@openzeppelin/contracts/utils/math/SignedMath.sol

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

pragma solidity ^0.8.0;

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

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

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

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

@openzeppelin/contracts/utils/Address.sol

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}
          

@openzeppelin/contracts/utils/Counters.sol

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

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}
          

@openzeppelin/contracts/token/ERC20/ERC20.sol

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

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the default value returned by this function, unless
     * it's overridden.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(address from, address to, uint256 amount) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _balances[account] += amount;
        }
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _totalSupply -= amount;
        }

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
}
          

contracts/interfaces/IBurnRedeemable.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

interface IBurnRedeemable {
    event Redeemed(
        address indexed user,
        address indexed xenContract,
        address indexed tokenContract,
        uint256 xenAmount,
        uint256 tokenAmount
    );

    function onTokenBurned(address user, uint256 amount) external;
}
          

@openzeppelin/contracts/access/Ownable.sol

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

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

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

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

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

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

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

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

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

abdk-libraries-solidity/ABDKMath64x64.sol

// SPDX-License-Identifier: BSD-4-Clause
/*
 * ABDK Math 64.64 Smart Contract Library.  Copyright © 2019 by ABDK Consulting.
 * Author: Mikhail Vladimirov <mikhail.vladimirov@gmail.com>
 */
pragma solidity ^0.8.0;

/**
 * Smart contract library of mathematical functions operating with signed
 * 64.64-bit fixed point numbers.  Signed 64.64-bit fixed point number is
 * basically a simple fraction whose numerator is signed 128-bit integer and
 * denominator is 2^64.  As long as denominator is always the same, there is no
 * need to store it, thus in Solidity signed 64.64-bit fixed point numbers are
 * represented by int128 type holding only the numerator.
 */
library ABDKMath64x64 {
  /*
   * Minimum value signed 64.64-bit fixed point number may have. 
   */
  int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;

  /*
   * Maximum value signed 64.64-bit fixed point number may have. 
   */
  int128 private constant MAX_64x64 = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;

  /**
   * Convert signed 256-bit integer number into signed 64.64-bit fixed point
   * number.  Revert on overflow.
   *
   * @param x signed 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function fromInt (int256 x) internal pure returns (int128) {
    unchecked {
      require (x >= -0x8000000000000000 && x <= 0x7FFFFFFFFFFFFFFF);
      return int128 (x << 64);
    }
  }

  /**
   * Convert signed 64.64 fixed point number into signed 64-bit integer number
   * rounding down.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64-bit integer number
   */
  function toInt (int128 x) internal pure returns (int64) {
    unchecked {
      return int64 (x >> 64);
    }
  }

  /**
   * Convert unsigned 256-bit integer number into signed 64.64-bit fixed point
   * number.  Revert on overflow.
   *
   * @param x unsigned 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function fromUInt (uint256 x) internal pure returns (int128) {
    unchecked {
      require (x <= 0x7FFFFFFFFFFFFFFF);
      return int128 (int256 (x << 64));
    }
  }

  /**
   * Convert signed 64.64 fixed point number into unsigned 64-bit integer
   * number rounding down.  Revert on underflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return unsigned 64-bit integer number
   */
  function toUInt (int128 x) internal pure returns (uint64) {
    unchecked {
      require (x >= 0);
      return uint64 (uint128 (x >> 64));
    }
  }

  /**
   * Convert signed 128.128 fixed point number into signed 64.64-bit fixed point
   * number rounding down.  Revert on overflow.
   *
   * @param x signed 128.128-bin fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function from128x128 (int256 x) internal pure returns (int128) {
    unchecked {
      int256 result = x >> 64;
      require (result >= MIN_64x64 && result <= MAX_64x64);
      return int128 (result);
    }
  }

  /**
   * Convert signed 64.64 fixed point number into signed 128.128 fixed point
   * number.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 128.128 fixed point number
   */
  function to128x128 (int128 x) internal pure returns (int256) {
    unchecked {
      return int256 (x) << 64;
    }
  }

  /**
   * Calculate x + y.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function add (int128 x, int128 y) internal pure returns (int128) {
    unchecked {
      int256 result = int256(x) + y;
      require (result >= MIN_64x64 && result <= MAX_64x64);
      return int128 (result);
    }
  }

  /**
   * Calculate x - y.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function sub (int128 x, int128 y) internal pure returns (int128) {
    unchecked {
      int256 result = int256(x) - y;
      require (result >= MIN_64x64 && result <= MAX_64x64);
      return int128 (result);
    }
  }

  /**
   * Calculate x * y rounding down.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function mul (int128 x, int128 y) internal pure returns (int128) {
    unchecked {
      int256 result = int256(x) * y >> 64;
      require (result >= MIN_64x64 && result <= MAX_64x64);
      return int128 (result);
    }
  }

  /**
   * Calculate x * y rounding towards zero, where x is signed 64.64 fixed point
   * number and y is signed 256-bit integer number.  Revert on overflow.
   *
   * @param x signed 64.64 fixed point number
   * @param y signed 256-bit integer number
   * @return signed 256-bit integer number
   */
  function muli (int128 x, int256 y) internal pure returns (int256) {
    unchecked {
      if (x == MIN_64x64) {
        require (y >= -0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF &&
          y <= 0x1000000000000000000000000000000000000000000000000);
        return -y << 63;
      } else {
        bool negativeResult = false;
        if (x < 0) {
          x = -x;
          negativeResult = true;
        }
        if (y < 0) {
          y = -y; // We rely on overflow behavior here
          negativeResult = !negativeResult;
        }
        uint256 absoluteResult = mulu (x, uint256 (y));
        if (negativeResult) {
          require (absoluteResult <=
            0x8000000000000000000000000000000000000000000000000000000000000000);
          return -int256 (absoluteResult); // We rely on overflow behavior here
        } else {
          require (absoluteResult <=
            0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
          return int256 (absoluteResult);
        }
      }
    }
  }

  /**
   * Calculate x * y rounding down, where x is signed 64.64 fixed point number
   * and y is unsigned 256-bit integer number.  Revert on overflow.
   *
   * @param x signed 64.64 fixed point number
   * @param y unsigned 256-bit integer number
   * @return unsigned 256-bit integer number
   */
  function mulu (int128 x, uint256 y) internal pure returns (uint256) {
    unchecked {
      if (y == 0) return 0;

      require (x >= 0);

      uint256 lo = (uint256 (int256 (x)) * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) >> 64;
      uint256 hi = uint256 (int256 (x)) * (y >> 128);

      require (hi <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
      hi <<= 64;

      require (hi <=
        0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF - lo);
      return hi + lo;
    }
  }

  /**
   * Calculate x / y rounding towards zero.  Revert on overflow or when y is
   * zero.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function div (int128 x, int128 y) internal pure returns (int128) {
    unchecked {
      require (y != 0);
      int256 result = (int256 (x) << 64) / y;
      require (result >= MIN_64x64 && result <= MAX_64x64);
      return int128 (result);
    }
  }

  /**
   * Calculate x / y rounding towards zero, where x and y are signed 256-bit
   * integer numbers.  Revert on overflow or when y is zero.
   *
   * @param x signed 256-bit integer number
   * @param y signed 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function divi (int256 x, int256 y) internal pure returns (int128) {
    unchecked {
      require (y != 0);

      bool negativeResult = false;
      if (x < 0) {
        x = -x; // We rely on overflow behavior here
        negativeResult = true;
      }
      if (y < 0) {
        y = -y; // We rely on overflow behavior here
        negativeResult = !negativeResult;
      }
      uint128 absoluteResult = divuu (uint256 (x), uint256 (y));
      if (negativeResult) {
        require (absoluteResult <= 0x80000000000000000000000000000000);
        return -int128 (absoluteResult); // We rely on overflow behavior here
      } else {
        require (absoluteResult <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
        return int128 (absoluteResult); // We rely on overflow behavior here
      }
    }
  }

  /**
   * Calculate x / y rounding towards zero, where x and y are unsigned 256-bit
   * integer numbers.  Revert on overflow or when y is zero.
   *
   * @param x unsigned 256-bit integer number
   * @param y unsigned 256-bit integer number
   * @return signed 64.64-bit fixed point number
   */
  function divu (uint256 x, uint256 y) internal pure returns (int128) {
    unchecked {
      require (y != 0);
      uint128 result = divuu (x, y);
      require (result <= uint128 (MAX_64x64));
      return int128 (result);
    }
  }

  /**
   * Calculate -x.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function neg (int128 x) internal pure returns (int128) {
    unchecked {
      require (x != MIN_64x64);
      return -x;
    }
  }

  /**
   * Calculate |x|.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function abs (int128 x) internal pure returns (int128) {
    unchecked {
      require (x != MIN_64x64);
      return x < 0 ? -x : x;
    }
  }

  /**
   * Calculate 1 / x rounding towards zero.  Revert on overflow or when x is
   * zero.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function inv (int128 x) internal pure returns (int128) {
    unchecked {
      require (x != 0);
      int256 result = int256 (0x100000000000000000000000000000000) / x;
      require (result >= MIN_64x64 && result <= MAX_64x64);
      return int128 (result);
    }
  }

  /**
   * Calculate arithmetics average of x and y, i.e. (x + y) / 2 rounding down.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function avg (int128 x, int128 y) internal pure returns (int128) {
    unchecked {
      return int128 ((int256 (x) + int256 (y)) >> 1);
    }
  }

  /**
   * Calculate geometric average of x and y, i.e. sqrt (x * y) rounding down.
   * Revert on overflow or in case x * y is negative.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function gavg (int128 x, int128 y) internal pure returns (int128) {
    unchecked {
      int256 m = int256 (x) * int256 (y);
      require (m >= 0);
      require (m <
          0x4000000000000000000000000000000000000000000000000000000000000000);
      return int128 (sqrtu (uint256 (m)));
    }
  }

  /**
   * Calculate x^y assuming 0^0 is 1, where x is signed 64.64 fixed point number
   * and y is unsigned 256-bit integer number.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y uint256 value
   * @return signed 64.64-bit fixed point number
   */
  function pow (int128 x, uint256 y) internal pure returns (int128) {
    unchecked {
      bool negative = x < 0 && y & 1 == 1;

      uint256 absX = uint128 (x < 0 ? -x : x);
      uint256 absResult;
      absResult = 0x100000000000000000000000000000000;

      if (absX <= 0x10000000000000000) {
        absX <<= 63;
        while (y != 0) {
          if (y & 0x1 != 0) {
            absResult = absResult * absX >> 127;
          }
          absX = absX * absX >> 127;

          if (y & 0x2 != 0) {
            absResult = absResult * absX >> 127;
          }
          absX = absX * absX >> 127;

          if (y & 0x4 != 0) {
            absResult = absResult * absX >> 127;
          }
          absX = absX * absX >> 127;

          if (y & 0x8 != 0) {
            absResult = absResult * absX >> 127;
          }
          absX = absX * absX >> 127;

          y >>= 4;
        }

        absResult >>= 64;
      } else {
        uint256 absXShift = 63;
        if (absX < 0x1000000000000000000000000) { absX <<= 32; absXShift -= 32; }
        if (absX < 0x10000000000000000000000000000) { absX <<= 16; absXShift -= 16; }
        if (absX < 0x1000000000000000000000000000000) { absX <<= 8; absXShift -= 8; }
        if (absX < 0x10000000000000000000000000000000) { absX <<= 4; absXShift -= 4; }
        if (absX < 0x40000000000000000000000000000000) { absX <<= 2; absXShift -= 2; }
        if (absX < 0x80000000000000000000000000000000) { absX <<= 1; absXShift -= 1; }

        uint256 resultShift = 0;
        while (y != 0) {
          require (absXShift < 64);

          if (y & 0x1 != 0) {
            absResult = absResult * absX >> 127;
            resultShift += absXShift;
            if (absResult > 0x100000000000000000000000000000000) {
              absResult >>= 1;
              resultShift += 1;
            }
          }
          absX = absX * absX >> 127;
          absXShift <<= 1;
          if (absX >= 0x100000000000000000000000000000000) {
              absX >>= 1;
              absXShift += 1;
          }

          y >>= 1;
        }

        require (resultShift < 64);
        absResult >>= 64 - resultShift;
      }
      int256 result = negative ? -int256 (absResult) : int256 (absResult);
      require (result >= MIN_64x64 && result <= MAX_64x64);
      return int128 (result);
    }
  }

  /**
   * Calculate sqrt (x) rounding down.  Revert if x < 0.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function sqrt (int128 x) internal pure returns (int128) {
    unchecked {
      require (x >= 0);
      return int128 (sqrtu (uint256 (int256 (x)) << 64));
    }
  }

  /**
   * Calculate binary logarithm of x.  Revert if x <= 0.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function log_2 (int128 x) internal pure returns (int128) {
    unchecked {
      require (x > 0);

      int256 msb = 0;
      int256 xc = x;
      if (xc >= 0x10000000000000000) { xc >>= 64; msb += 64; }
      if (xc >= 0x100000000) { xc >>= 32; msb += 32; }
      if (xc >= 0x10000) { xc >>= 16; msb += 16; }
      if (xc >= 0x100) { xc >>= 8; msb += 8; }
      if (xc >= 0x10) { xc >>= 4; msb += 4; }
      if (xc >= 0x4) { xc >>= 2; msb += 2; }
      if (xc >= 0x2) msb += 1;  // No need to shift xc anymore

      int256 result = msb - 64 << 64;
      uint256 ux = uint256 (int256 (x)) << uint256 (127 - msb);
      for (int256 bit = 0x8000000000000000; bit > 0; bit >>= 1) {
        ux *= ux;
        uint256 b = ux >> 255;
        ux >>= 127 + b;
        result += bit * int256 (b);
      }

      return int128 (result);
    }
  }

  /**
   * Calculate natural logarithm of x.  Revert if x <= 0.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function ln (int128 x) internal pure returns (int128) {
    unchecked {
      require (x > 0);

      return int128 (int256 (
          uint256 (int256 (log_2 (x))) * 0xB17217F7D1CF79ABC9E3B39803F2F6AF >> 128));
    }
  }

  /**
   * Calculate binary exponent of x.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function exp_2 (int128 x) internal pure returns (int128) {
    unchecked {
      require (x < 0x400000000000000000); // Overflow

      if (x < -0x400000000000000000) return 0; // Underflow

      uint256 result = 0x80000000000000000000000000000000;

      if (x & 0x8000000000000000 > 0)
        result = result * 0x16A09E667F3BCC908B2FB1366EA957D3E >> 128;
      if (x & 0x4000000000000000 > 0)
        result = result * 0x1306FE0A31B7152DE8D5A46305C85EDEC >> 128;
      if (x & 0x2000000000000000 > 0)
        result = result * 0x1172B83C7D517ADCDF7C8C50EB14A791F >> 128;
      if (x & 0x1000000000000000 > 0)
        result = result * 0x10B5586CF9890F6298B92B71842A98363 >> 128;
      if (x & 0x800000000000000 > 0)
        result = result * 0x1059B0D31585743AE7C548EB68CA417FD >> 128;
      if (x & 0x400000000000000 > 0)
        result = result * 0x102C9A3E778060EE6F7CACA4F7A29BDE8 >> 128;
      if (x & 0x200000000000000 > 0)
        result = result * 0x10163DA9FB33356D84A66AE336DCDFA3F >> 128;
      if (x & 0x100000000000000 > 0)
        result = result * 0x100B1AFA5ABCBED6129AB13EC11DC9543 >> 128;
      if (x & 0x80000000000000 > 0)
        result = result * 0x10058C86DA1C09EA1FF19D294CF2F679B >> 128;
      if (x & 0x40000000000000 > 0)
        result = result * 0x1002C605E2E8CEC506D21BFC89A23A00F >> 128;
      if (x & 0x20000000000000 > 0)
        result = result * 0x100162F3904051FA128BCA9C55C31E5DF >> 128;
      if (x & 0x10000000000000 > 0)
        result = result * 0x1000B175EFFDC76BA38E31671CA939725 >> 128;
      if (x & 0x8000000000000 > 0)
        result = result * 0x100058BA01FB9F96D6CACD4B180917C3D >> 128;
      if (x & 0x4000000000000 > 0)
        result = result * 0x10002C5CC37DA9491D0985C348C68E7B3 >> 128;
      if (x & 0x2000000000000 > 0)
        result = result * 0x1000162E525EE054754457D5995292026 >> 128;
      if (x & 0x1000000000000 > 0)
        result = result * 0x10000B17255775C040618BF4A4ADE83FC >> 128;
      if (x & 0x800000000000 > 0)
        result = result * 0x1000058B91B5BC9AE2EED81E9B7D4CFAB >> 128;
      if (x & 0x400000000000 > 0)
        result = result * 0x100002C5C89D5EC6CA4D7C8ACC017B7C9 >> 128;
      if (x & 0x200000000000 > 0)
        result = result * 0x10000162E43F4F831060E02D839A9D16D >> 128;
      if (x & 0x100000000000 > 0)
        result = result * 0x100000B1721BCFC99D9F890EA06911763 >> 128;
      if (x & 0x80000000000 > 0)
        result = result * 0x10000058B90CF1E6D97F9CA14DBCC1628 >> 128;
      if (x & 0x40000000000 > 0)
        result = result * 0x1000002C5C863B73F016468F6BAC5CA2B >> 128;
      if (x & 0x20000000000 > 0)
        result = result * 0x100000162E430E5A18F6119E3C02282A5 >> 128;
      if (x & 0x10000000000 > 0)
        result = result * 0x1000000B1721835514B86E6D96EFD1BFE >> 128;
      if (x & 0x8000000000 > 0)
        result = result * 0x100000058B90C0B48C6BE5DF846C5B2EF >> 128;
      if (x & 0x4000000000 > 0)
        result = result * 0x10000002C5C8601CC6B9E94213C72737A >> 128;
      if (x & 0x2000000000 > 0)
        result = result * 0x1000000162E42FFF037DF38AA2B219F06 >> 128;
      if (x & 0x1000000000 > 0)
        result = result * 0x10000000B17217FBA9C739AA5819F44F9 >> 128;
      if (x & 0x800000000 > 0)
        result = result * 0x1000000058B90BFCDEE5ACD3C1CEDC823 >> 128;
      if (x & 0x400000000 > 0)
        result = result * 0x100000002C5C85FE31F35A6A30DA1BE50 >> 128;
      if (x & 0x200000000 > 0)
        result = result * 0x10000000162E42FF0999CE3541B9FFFCF >> 128;
      if (x & 0x100000000 > 0)
        result = result * 0x100000000B17217F80F4EF5AADDA45554 >> 128;
      if (x & 0x80000000 > 0)
        result = result * 0x10000000058B90BFBF8479BD5A81B51AD >> 128;
      if (x & 0x40000000 > 0)
        result = result * 0x1000000002C5C85FDF84BD62AE30A74CC >> 128;
      if (x & 0x20000000 > 0)
        result = result * 0x100000000162E42FEFB2FED257559BDAA >> 128;
      if (x & 0x10000000 > 0)
        result = result * 0x1000000000B17217F7D5A7716BBA4A9AE >> 128;
      if (x & 0x8000000 > 0)
        result = result * 0x100000000058B90BFBE9DDBAC5E109CCE >> 128;
      if (x & 0x4000000 > 0)
        result = result * 0x10000000002C5C85FDF4B15DE6F17EB0D >> 128;
      if (x & 0x2000000 > 0)
        result = result * 0x1000000000162E42FEFA494F1478FDE05 >> 128;
      if (x & 0x1000000 > 0)
        result = result * 0x10000000000B17217F7D20CF927C8E94C >> 128;
      if (x & 0x800000 > 0)
        result = result * 0x1000000000058B90BFBE8F71CB4E4B33D >> 128;
      if (x & 0x400000 > 0)
        result = result * 0x100000000002C5C85FDF477B662B26945 >> 128;
      if (x & 0x200000 > 0)
        result = result * 0x10000000000162E42FEFA3AE53369388C >> 128;
      if (x & 0x100000 > 0)
        result = result * 0x100000000000B17217F7D1D351A389D40 >> 128;
      if (x & 0x80000 > 0)
        result = result * 0x10000000000058B90BFBE8E8B2D3D4EDE >> 128;
      if (x & 0x40000 > 0)
        result = result * 0x1000000000002C5C85FDF4741BEA6E77E >> 128;
      if (x & 0x20000 > 0)
        result = result * 0x100000000000162E42FEFA39FE95583C2 >> 128;
      if (x & 0x10000 > 0)
        result = result * 0x1000000000000B17217F7D1CFB72B45E1 >> 128;
      if (x & 0x8000 > 0)
        result = result * 0x100000000000058B90BFBE8E7CC35C3F0 >> 128;
      if (x & 0x4000 > 0)
        result = result * 0x10000000000002C5C85FDF473E242EA38 >> 128;
      if (x & 0x2000 > 0)
        result = result * 0x1000000000000162E42FEFA39F02B772C >> 128;
      if (x & 0x1000 > 0)
        result = result * 0x10000000000000B17217F7D1CF7D83C1A >> 128;
      if (x & 0x800 > 0)
        result = result * 0x1000000000000058B90BFBE8E7BDCBE2E >> 128;
      if (x & 0x400 > 0)
        result = result * 0x100000000000002C5C85FDF473DEA871F >> 128;
      if (x & 0x200 > 0)
        result = result * 0x10000000000000162E42FEFA39EF44D91 >> 128;
      if (x & 0x100 > 0)
        result = result * 0x100000000000000B17217F7D1CF79E949 >> 128;
      if (x & 0x80 > 0)
        result = result * 0x10000000000000058B90BFBE8E7BCE544 >> 128;
      if (x & 0x40 > 0)
        result = result * 0x1000000000000002C5C85FDF473DE6ECA >> 128;
      if (x & 0x20 > 0)
        result = result * 0x100000000000000162E42FEFA39EF366F >> 128;
      if (x & 0x10 > 0)
        result = result * 0x1000000000000000B17217F7D1CF79AFA >> 128;
      if (x & 0x8 > 0)
        result = result * 0x100000000000000058B90BFBE8E7BCD6D >> 128;
      if (x & 0x4 > 0)
        result = result * 0x10000000000000002C5C85FDF473DE6B2 >> 128;
      if (x & 0x2 > 0)
        result = result * 0x1000000000000000162E42FEFA39EF358 >> 128;
      if (x & 0x1 > 0)
        result = result * 0x10000000000000000B17217F7D1CF79AB >> 128;

      result >>= uint256 (int256 (63 - (x >> 64)));
      require (result <= uint256 (int256 (MAX_64x64)));

      return int128 (int256 (result));
    }
  }

  /**
   * Calculate natural exponent of x.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function exp (int128 x) internal pure returns (int128) {
    unchecked {
      require (x < 0x400000000000000000); // Overflow

      if (x < -0x400000000000000000) return 0; // Underflow

      return exp_2 (
          int128 (int256 (x) * 0x171547652B82FE1777D0FFDA0D23A7D12 >> 128));
    }
  }

  /**
   * Calculate x / y rounding towards zero, where x and y are unsigned 256-bit
   * integer numbers.  Revert on overflow or when y is zero.
   *
   * @param x unsigned 256-bit integer number
   * @param y unsigned 256-bit integer number
   * @return unsigned 64.64-bit fixed point number
   */
  function divuu (uint256 x, uint256 y) private pure returns (uint128) {
    unchecked {
      require (y != 0);

      uint256 result;

      if (x <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
        result = (x << 64) / y;
      else {
        uint256 msb = 192;
        uint256 xc = x >> 192;
        if (xc >= 0x100000000) { xc >>= 32; msb += 32; }
        if (xc >= 0x10000) { xc >>= 16; msb += 16; }
        if (xc >= 0x100) { xc >>= 8; msb += 8; }
        if (xc >= 0x10) { xc >>= 4; msb += 4; }
        if (xc >= 0x4) { xc >>= 2; msb += 2; }
        if (xc >= 0x2) msb += 1;  // No need to shift xc anymore

        result = (x << 255 - msb) / ((y - 1 >> msb - 191) + 1);
        require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);

        uint256 hi = result * (y >> 128);
        uint256 lo = result * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);

        uint256 xh = x >> 192;
        uint256 xl = x << 64;

        if (xl < lo) xh -= 1;
        xl -= lo; // We rely on overflow behavior here
        lo = hi << 128;
        if (xl < lo) xh -= 1;
        xl -= lo; // We rely on overflow behavior here

        assert (xh == hi >> 128);

        result += xl / y;
      }

      require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
      return uint128 (result);
    }
  }

  /**
   * Calculate sqrt (x) rounding down, where x is unsigned 256-bit integer
   * number.
   *
   * @param x unsigned 256-bit integer number
   * @return unsigned 128-bit integer number
   */
  function sqrtu (uint256 x) private pure returns (uint128) {
    unchecked {
      if (x == 0) return 0;
      else {
        uint256 xx = x;
        uint256 r = 1;
        if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; }
        if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; }
        if (xx >= 0x100000000) { xx >>= 32; r <<= 16; }
        if (xx >= 0x10000) { xx >>= 16; r <<= 8; }
        if (xx >= 0x100) { xx >>= 8; r <<= 4; }
        if (xx >= 0x10) { xx >>= 4; r <<= 2; }
        if (xx >= 0x4) { r <<= 1; }
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1; // Seven iterations should be enough
        uint256 r1 = x / r;
        return uint128 (r < r1 ? r : r1);
      }
    }
  }
}
          

@openzeppelin/contracts/security/ReentrancyGuard.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}
          

@openzeppelin/contracts/utils/cryptography/EIP712.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/EIP712.sol)

pragma solidity ^0.8.8;

import "./ECDSA.sol";
import "../ShortStrings.sol";
import "../../interfaces/IERC5267.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
 * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
 * they need in their contracts using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
 * separator of the implementation contract. This will cause the `_domainSeparatorV4` function to always rebuild the
 * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
 *
 * _Available since v3.4._
 *
 * @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
 */
abstract contract EIP712 is IERC5267 {
    using ShortStrings for *;

    bytes32 private constant _TYPE_HASH =
        keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");

    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _cachedDomainSeparator;
    uint256 private immutable _cachedChainId;
    address private immutable _cachedThis;

    bytes32 private immutable _hashedName;
    bytes32 private immutable _hashedVersion;

    ShortString private immutable _name;
    ShortString private immutable _version;
    string private _nameFallback;
    string private _versionFallback;

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory name, string memory version) {
        _name = name.toShortStringWithFallback(_nameFallback);
        _version = version.toShortStringWithFallback(_versionFallback);
        _hashedName = keccak256(bytes(name));
        _hashedVersion = keccak256(bytes(version));

        _cachedChainId = block.chainid;
        _cachedDomainSeparator = _buildDomainSeparator();
        _cachedThis = address(this);
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _cachedThis && block.chainid == _cachedChainId) {
            return _cachedDomainSeparator;
        } else {
            return _buildDomainSeparator();
        }
    }

    function _buildDomainSeparator() private view returns (bytes32) {
        return keccak256(abi.encode(_TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
    }

    /**
     * @dev See {EIP-5267}.
     *
     * _Available since v4.9._
     */
    function eip712Domain()
        public
        view
        virtual
        override
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        )
    {
        return (
            hex"0f", // 01111
            _name.toStringWithFallback(_nameFallback),
            _version.toStringWithFallback(_versionFallback),
            block.chainid,
            address(this),
            bytes32(0),
            new uint256[](0)
        );
    }
}
          

@openzeppelin/contracts/token/ERC20/IERC20.sol

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

Compiler Settings

{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers"]}},"optimizer":{"runs":200,"enabled":false},"libraries":{}}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"xenAddress","internalType":"address"},{"type":"address","name":"xecTokenAddress","internalType":"address"},{"type":"address","name":"xecAddress","internalType":"address"}]},{"type":"event","name":"Burn","inputs":[{"type":"address","name":"userAddress","internalType":"address","indexed":true},{"type":"uint256","name":"batchNumber","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"FeesClaimed","inputs":[{"type":"uint256","name":"cycle","internalType":"uint256","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"uint256","name":"fees","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"InviteNewUser","inputs":[{"type":"address","name":"userAddress","internalType":"address","indexed":true},{"type":"address","name":"referrerAddress","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"NewCycleStarted","inputs":[{"type":"uint256","name":"cycle","internalType":"uint256","indexed":true},{"type":"uint256","name":"calculatedCycleReward","internalType":"uint256","indexed":false},{"type":"uint256","name":"summedCycleStakes","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RecoverHealth","inputs":[{"type":"address","name":"userAddress","internalType":"address","indexed":true},{"type":"uint256","name":"health","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Redeemed","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"address","name":"xenContract","internalType":"address","indexed":true},{"type":"address","name":"tokenContract","internalType":"address","indexed":true},{"type":"uint256","name":"xenAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"tokenAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RewardsClaimed","inputs":[{"type":"uint256","name":"cycle","internalType":"uint256","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"uint256","name":"reward","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Staked","inputs":[{"type":"uint256","name":"cycle","internalType":"uint256","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Unstaked","inputs":[{"type":"uint256","name":"cycle","internalType":"uint256","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"HEALTH_A","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"HEALTH_E","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"HEALTH_INIT","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"HEALTH_K","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_BPS","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"PROTOCOL_FEE_AMPLIFIER","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"PROTOCOL_FEE_BASE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"SCALING_FACTOR","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"SCALING_FACTOR_5","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"XEN_BATCH_AMOUNT","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"accAccruedFees","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"accBurnedBatches","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"accCycleBatchesBurned","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"accFirstStake","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"accRewards","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"accSecondStake","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"accStakeCycle","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"accWithdrawableStake","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"burnBatch","inputs":[{"type":"address","name":"referrerAddress","internalType":"address"},{"type":"uint256","name":"batchNumber","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"calculateBurnXec","inputs":[{"type":"uint256","name":"_recoverHealth","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"claimFees","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"claimRewards","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"currentCycle","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"currentCycleReward","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"currentStartedCycle","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"cycleAccruedFees","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"cycleFeesPerStakeSummed","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"cycleTotalBatchesBurned","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"firstBurnCycle","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract GDXenERC20"}],"name":"gdxen","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getCurrentCycle","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getHealth","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"i_initialTimestamp","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"i_periodDuration","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isOldUser","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastActiveCycle","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastCycleReward","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastFeeUpdateCycle","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastStartedCycle","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"onTokenBurned","inputs":[{"type":"address","name":"user","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingFees","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingStake","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingStakeWithdrawal","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"previousStartedCycle","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"recoverHealth","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardPerCycle","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"stake","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"summedCycleStakes","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"teamAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalNumberOfBatchesBurned","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unstake","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract Xec"}],"name":"xec","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract XecERC20"}],"name":"xecToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract XENCrypto"}],"name":"xen","inputs":[]}]
              

Contract Creation Code

0x60c06040523480156200001157600080fd5b506040516200906938038062009069833981810160405281019062000037919062000298565b60016000819055506040516200004d9062000220565b604051809103906000f0801580156200006a573d6000803e3d6000fd5b50600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555042608081815250506201518060a0818152505069043c33c193756480000060068190555069043c33c1937564800000601760008081526020019081526020016000208190555069043c33c1937564800000601660008081526020019081526020016000208190555082600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050620002f4565b6133448062005d2583390190565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620002608262000233565b9050919050565b620002728162000253565b81146200027e57600080fd5b50565b600081519050620002928162000267565b92915050565b600080600060608486031215620002b457620002b36200022e565b5b6000620002c48682870162000281565b9350506020620002d78682870162000281565b9250506040620002ea8682870162000281565b9150509250925092565b60805160a0516159fd6200032860003960008181611adc0152612c8a0152600081816126b70152612cab01526159fd6000f3fe6080604052600436106103505760003560e01c806391b30020116101c6578063bef51052116100f7578063db80a28c11610095578063ef4cadc51161006f578063ef4cadc514610ceb578063f1b371e214610d16578063fa845ca914610d41578063fd967f4714610d7e57610350565b8063db80a28c14610c34578063e60c90c414610c71578063ed725e8314610cae57610350565b8063c67c742d116100d1578063c67c742d14610b8a578063c8727c8114610bb5578063d294f09314610bf2578063d4432e4e14610c0957610350565b8063bef5105214610ae5578063c40af1ee14610b22578063c4235ae914610b4d57610350565b8063bab2f55211610164578063bd1654bd1161013e578063bd1654bd14610a27578063bd21c4b014610a52578063be26ed7f14610a7d578063bebc9dfc14610aa857610350565b8063bab2f55214610994578063bc3dc8af146109bf578063bc713290146109ea57610350565b8063a95f1dac116101a0578063a95f1dac146108c4578063aabbb1bd146108ef578063ad5ed4791461092c578063adc0f6861461095757610350565b806391b3002014610833578063a694fc3a1461085e578063a707140b1461088757610350565b8063304d3fae116102a0578063616b08af1161023e578063857f098111610218578063857f098114610763578063872e3b26146107a05780638bd95563146107dd5780639055c5151461080857610350565b8063616b08af146106d057806368f057691461070d57806369ef02641461073857610350565b8063436091c11161027a578063436091c114610626578063543746b11461065157806356b96bf51461067a5780635f5080b4146106a557610350565b8063304d3fae146105cd5780633119c400146105e4578063372500ab1461060f57610350565b8063138031581161030d5780631ed6380f116102e75780631ed6380f14610511578063224438d11461054e5780632e17de78146105795780632f7cdab0146105a257610350565b8063138031581461048d57806317d9c47a146104a95780631c75f085146104e657610350565b806301b0210a1461035557806301ffc9a71461038057806306ab411c146103bd5780630ad75292146103e85780630ece21541461041357806312cb22ac14610450575b600080fd5b34801561036157600080fd5b5061036a610da9565b604051610377919061482f565b60405180910390f35b34801561038c57600080fd5b506103a760048036038101906103a291906148a7565b610dae565b6040516103b491906148ef565b60405180910390f35b3480156103c957600080fd5b506103d2610e18565b6040516103df919061482f565b60405180910390f35b3480156103f457600080fd5b506103fd610e1d565b60405161040a9190614989565b60405180910390f35b34801561041f57600080fd5b5061043a600480360381019061043591906149d0565b610e43565b604051610447919061482f565b60405180910390f35b34801561045c57600080fd5b5061047760048036038101906104729190614a3b565b610e5b565b604051610484919061482f565b60405180910390f35b6104a760048036038101906104a29190614a68565b610e73565b005b3480156104b557600080fd5b506104d060048036038101906104cb91906149d0565b611770565b6040516104dd919061482f565b60405180910390f35b3480156104f257600080fd5b506104fb611788565b6040516105089190614ab7565b60405180910390f35b34801561051d57600080fd5b5061053860048036038101906105339190614a3b565b6117ae565b604051610545919061482f565b60405180910390f35b34801561055a57600080fd5b506105636117c6565b604051610570919061482f565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b91906149d0565b6117cc565b005b3480156105ae57600080fd5b506105b7611ada565b6040516105c4919061482f565b60405180910390f35b3480156105d957600080fd5b506105e2611afe565b005b3480156105f057600080fd5b506105f9611e70565b604051610606919061482f565b60405180910390f35b34801561061b57600080fd5b50610624611e75565b005b34801561063257600080fd5b5061063b612189565b604051610648919061482f565b60405180910390f35b34801561065d57600080fd5b5061067860048036038101906106739190614a68565b61218f565b005b34801561068657600080fd5b5061068f6122d8565b60405161069c919061482f565b60405180910390f35b3480156106b157600080fd5b506106ba6122e7565b6040516106c7919061482f565b60405180910390f35b3480156106dc57600080fd5b506106f760048036038101906106f29190614a3b565b6122ed565b604051610704919061482f565b60405180910390f35b34801561071957600080fd5b50610722612557565b60405161072f919061482f565b60405180910390f35b34801561074457600080fd5b5061074d61255d565b60405161075a919061482f565b60405180910390f35b34801561076f57600080fd5b5061078a60048036038101906107859190614a3b565b612564565b60405161079791906148ef565b60405180910390f35b3480156107ac57600080fd5b506107c760048036038101906107c291906149d0565b612583565b6040516107d4919061482f565b60405180910390f35b3480156107e957600080fd5b506107f26126b5565b6040516107ff919061482f565b60405180910390f35b34801561081457600080fd5b5061081d6126d9565b60405161082a9190614af3565b60405180910390f35b34801561083f57600080fd5b506108486126ff565b604051610855919061482f565b60405180910390f35b34801561086a57600080fd5b50610885600480360381019061088091906149d0565b612705565b005b34801561089357600080fd5b506108ae60048036038101906108a99190614a3b565b612baf565b6040516108bb919061482f565b60405180910390f35b3480156108d057600080fd5b506108d9612bc7565b6040516108e6919061482f565b60405180910390f35b3480156108fb57600080fd5b5061091660048036038101906109119190614a68565b612bcd565b604051610923919061482f565b60405180910390f35b34801561093857600080fd5b50610941612bf2565b60405161094e9190614b2f565b60405180910390f35b34801561096357600080fd5b5061097e600480360381019061097991906149d0565b612c18565b60405161098b919061482f565b60405180910390f35b3480156109a057600080fd5b506109a9612c30565b6040516109b6919061482f565b60405180910390f35b3480156109cb57600080fd5b506109d4612c36565b6040516109e19190614b6b565b60405180910390f35b3480156109f657600080fd5b50610a116004803603810190610a0c9190614a3b565b612c5c565b604051610a1e919061482f565b60405180910390f35b348015610a3357600080fd5b50610a3c612c74565b604051610a49919061482f565b60405180910390f35b348015610a5e57600080fd5b50610a67612c7b565b604051610a74919061482f565b60405180910390f35b348015610a8957600080fd5b50610a92612c86565b604051610a9f919061482f565b60405180910390f35b348015610ab457600080fd5b50610acf6004803603810190610aca91906149d0565b612ce4565b604051610adc919061482f565b60405180910390f35b348015610af157600080fd5b50610b0c6004803603810190610b079190614a3b565b612cfc565b604051610b19919061482f565b60405180910390f35b348015610b2e57600080fd5b50610b37612d14565b604051610b44919061482f565b60405180910390f35b348015610b5957600080fd5b50610b746004803603810190610b6f91906149d0565b612d1a565b604051610b81919061482f565b60405180910390f35b348015610b9657600080fd5b50610b9f612d32565b604051610bac919061482f565b60405180910390f35b348015610bc157600080fd5b50610bdc6004803603810190610bd79190614a68565b612d37565b604051610be9919061482f565b60405180910390f35b348015610bfe57600080fd5b50610c07612d5c565b005b348015610c1557600080fd5b50610c1e612f2a565b604051610c2b919061482f565b60405180910390f35b348015610c4057600080fd5b50610c5b6004803603810190610c569190614a3b565b612f30565b604051610c68919061482f565b60405180910390f35b348015610c7d57600080fd5b50610c986004803603810190610c939190614a3b565b612f48565b604051610ca5919061482f565b60405180910390f35b348015610cba57600080fd5b50610cd56004803603810190610cd09190614a3b565b612f60565b604051610ce2919061482f565b60405180910390f35b348015610cf757600080fd5b50610d00612f78565b604051610d0d919061482f565b60405180910390f35b348015610d2257600080fd5b50610d2b612f8d565b604051610d38919061482f565b60405180910390f35b348015610d4d57600080fd5b50610d686004803603810190610d639190614a3b565b612f93565b604051610d75919061482f565b60405180910390f35b348015610d8a57600080fd5b50610d93612fab565b604051610da0919061482f565b60405180910390f35b606481565b60007f543746b1000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b606681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60196020528060005260406000206000915090505481565b60106020528060005260406000206000915090505481565b610e7b612fb2565b8060005a9050612710831115610ec6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ebd90614c09565b60405180910390fd5b60008311610f09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0090614c75565b60405180910390fd5b6a01a784379d99db4200000083610f209190614cc4565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401610f7b9190614ab7565b602060405180830381865afa158015610f98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fbc9190614d1b565b1015610ffd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff490614dba565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361106b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106290614e26565b60405180910390fd5b602060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661125057606483106111ac57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dc8f2d69856040518263ffffffff1660e01b815260040161111f9190614ab7565b600060405180830381600087803b15801561113957600080fd5b505af115801561114d573d6000803e3d6000fd5b505050508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fdca4f0ed9b7f82ec9b5c9c7f339e58882a8d9015768b67ed73134406fd92d09760405160405180910390a35b6001602060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061120c612c86565b601f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac336a01a784379d99db42000000866112a69190614cc4565b6040518363ffffffff1660e01b81526004016112c3929190614e46565b600060405180830381600087803b1580156112dd57600080fd5b505af11580156112f1573d6000803e3d6000fd5b5050505060008260056113049190614cc4565b620186a06113129190614e6f565b8361131d9190614cc4565b9050600061133161132c613001565b6122ed565b60648061133e9190614ea3565b6113489190614e6f565b905060006103e86a01a784379d99db42000000866113669190614cc4565b6113709190614f06565b90506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166329c7f805600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b81526004016113f3929190614e46565b602060405180830381865afa158015611410573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114349190614d1b565b90506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663819c3f3b836040518263ffffffff1660e01b8152600401611493919061482f565b602060405180830381865afa1580156114b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d49190614d1b565b90506000606485620f4240620186a08966038d7ea4c680006114f69190614cc4565b6115009190614f06565b61150a9190614cc4565b6115149190614cc4565b61151e9190614f06565b9050818161152c9190614ea3565b34101561156e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156590614fa9565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663280e63098386336040518463ffffffff1660e01b81526004016115cc929190614fc9565b6000604051808303818588803b1580156115e557600080fd5b505af11580156115f9573d6000803e3d6000fd5b505050505087600f60008282546116109190614ea3565b9250508190555087601160006009548152602001908152602001600020600082825461163c9190614ea3565b925050819055508760126000611650613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600954815260200190815260200160002060008282546116ac9190614ea3565b9250508190555087601060006116c0613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546117099190614ea3565b925050819055508060196000600954815260200190815260200160002060008282546117359190614ea3565b9250508190555061175c3383833461174d9190614e6f565b6117579190614e6f565b613009565b505050505050505061176c6130ba565b5050565b60116020528060005260406000206000915090505481565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601c6020528060005260406000206000915090505481565b600e5481565b6117d4612fb2565b6117dc6130c4565b6117e46130e5565b6117f46117ef613001565b613251565b60008111611837576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182e9061503e565b60405180910390fd5b6064611849611844613001565b6122ed565b101561188a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611881906150aa565b60405180910390fd5b601c6000611896613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115611913576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190a9061513c565b60405180910390fd5b600c54600a540361193c5780600d60008282546119309190614ea3565b92505081905550611969565b8060176000600954815260200190815260200160002060008282546119619190614e6f565b925050819055505b80601c6000611976613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546119bf9190614e6f565b9250508190555080601460006119d3613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611a1c9190614e6f565b92505081905550611a77611a2e613001565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166141099092919063ffffffff16565b611a7f613001565b73ffffffffffffffffffffffffffffffffffffffff166009547f37375b03d8924bd8f076f11f8411b9962aa5c02fb489021507bc6bb6f850e36583604051611ac7919061482f565b60405180910390a3611ad76130ba565b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b611b06612fb2565b6064611b11336122ed565b10611b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b48906151a8565b60405180910390fd5b611b596130c4565b602060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611be5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bdc90615214565b60405180910390fd5b6000611bf0336122ed565b90506000816064611c019190614e6f565b90506000611c0e82612583565b905080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401611c6c9190614ab7565b602060405180830381865afa158015611c89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cad9190614d1b565b1015611cee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce590614dba565b60405180910390fd5b611d3d333083600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661418f909392919063ffffffff16565b611d45612c86565b601f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166342966c68826040518263ffffffff1660e01b8152600401611de3919061482f565b600060405180830381600087803b158015611dfd57600080fd5b505af1158015611e11573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167ff8fc6e6bea4fbbdb2e72c44b7a05758fb4d348f9cac00a8960855dc5068ab65e83604051611e5b919061482f565b60405180910390a2505050611e6e6130ba565b565b600281565b611e7d612fb2565b611e856130c4565b611e8d6130e5565b611e9d611e98613001565b613251565b6000601c6000611eab613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460146000611ef2613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f379190614e6f565b905060008111611f7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7390615280565b60405180910390fd5b6064611f8e611f89613001565b6122ed565b1015611fcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc6906150aa565b60405180910390fd5b8060146000611fdc613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546120259190614e6f565b92505081905550600c54600a54036120555780600d60008282546120499190614ea3565b92505081905550612090565b80601760006009548152602001908152602001600020546120769190614e6f565b601760006009548152602001908152602001600020819055505b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639a49090e6120d6613001565b836040518363ffffffff1660e01b81526004016120f4929190614e46565b600060405180830381600087803b15801561210e57600080fd5b505af1158015612122573d6000803e3d6000fd5b5050505061212e613001565b73ffffffffffffffffffffffffffffffffffffffff166009547f3300bdb359cfb956935bca32e9db727413eab1ca84341f2e36caea85bb79696883604051612176919061482f565b60405180910390a3506121876130ba565b565b600a5481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461221f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612216906152ec565b60405180910390fd5b6122276130c4565b61222f6130e5565b612237614218565b61224082613251565b600954601360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040516122cc919061482f565b60405180910390a25050565b6a01a784379d99db4200000081565b600b5481565b600080601f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612338612c86565b6123429190614e6f565b9050600081148061239d5750602060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156123ac576064915050612552565b600060748211156123c1578092505050612552565b60006001836123d0919061543f565b60026123dc9190614cc4565b90506000601e826123ed9190614f06565b90506000601e836123fe919061548a565b905060008211156124d457806064612416919061543f565b620186a0826066612427919061543f565b6124319190614cc4565b61243b9190614f06565b82789f4f2726179a224501d762422c946590d91000000000000000620186a0601e606661246891906154c8565b6124729190614cc4565b61247c9190614f06565b612486919061543f565b6124909190614cc4565b82600261249d9190614ea3565b620186a06124ab919061543f565b60016124b79190614cc4565b6124c19190614f06565b60646124cd9190614cc4565b935061253b565b8060646124e1919061543f565b620186a08260666124f2919061543f565b6124fc9190614cc4565b6125069190614f06565b6002620186a061251691906154c8565b60016125229190614cc4565b61252c9190614f06565b60646125389190614cc4565b93505b620186a08461254a9190614f06565b955050505050505b919050565b600d5481565b620186a081565b602080528060005260406000206000915054906101000a900460ff1681565b60008061258e612c86565b90506000606b90506000606485600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015612608573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061262c919061553f565b600a61263891906154c8565b612680612678612647876143ae565b61266761265f60018b61265a9190614ea3565b6143ae565b600f0b6143d1565b600f0b6144f590919063ffffffff16565b600f0b614560565b67ffffffffffffffff166126949190614cc4565b61269e9190614cc4565b6126a89190614f06565b9050809350505050919050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b61270d612fb2565b6127156130c4565b61271d6130e5565b61272d612728613001565b613251565b60008111612770576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127679061503e565b60405180910390fd5b602060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612865576001602060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612821612c86565b601f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b80600860008282546128779190614ea3565b925050819055506000600160095461288f9190614ea3565b9050600c54600a54036128ae576001600a546128ab9190614ea3565b90505b601d60006128ba613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811415801561294a5750601e600061290b613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548114155b15612a89576000601d600061295d613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054036129ed5780601d60006129aa613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a88565b6000601e60006129fb613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403612a875780601e6000612a48613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b81601b6000612a96613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000828254612af09190614ea3565b92505081905550612b4d612b02613001565b3084600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661418f909392919063ffffffff16565b612b55613001565b73ffffffffffffffffffffffffffffffffffffffff16817f18dcd430020e4d4899772fd94a8b40451dc5044dfb70bc46b532eeae431c864f84604051612b9b919061482f565b60405180910390a350612bac6130ba565b50565b60186020528060005260406000206000915090505481565b60075481565b601b602052816000526040600020602052806000526040600020600091509150505481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60166020528060005260406000206000915090505481565b60095481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60156020528060005260406000206000915090505481565b620f424081565b66038d7ea4c6800081565b60007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000042612cd59190614e6f565b612cdf9190614f06565b905090565b601a6020528060005260406000206000915090505481565b601f6020528060005260406000206000915090505481565b600f5481565b60176020528060005260406000206000915090505481565b600181565b6012602052816000526040600020602052806000526040600020600091509150505481565b612d64612fb2565b612d6c6130c4565b612d746130e5565b612d84612d7f613001565b613251565b6064612d96612d91613001565b6122ed565b1015612dd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dce906150aa565b60405180910390fd5b600060156000612de5613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008111612e65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e5c9061503e565b60405180910390fd5b600060156000612e73613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ec2612ebc613001565b82613009565b612eca613001565b73ffffffffffffffffffffffffffffffffffffffff16612ee8612c86565b7f2227733fc4c8a9034cb58087dcf6995128b9c0233b038b03366aaf30c92b92d683604051612f17919061482f565b60405180910390a350612f286130ba565b565b60085481565b601e6020528060005260406000206000915090505481565b601d6020528060005260406000206000915090505481565b60146020528060005260406000206000915090505481565b701d6329f1c35ca4bfabb9f561000000000081565b600c5481565b60136020528060005260406000206000915090505481565b620186a081565b600260005403612ff7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fee906155b8565b60405180910390fd5b6002600081905550565b600033905090565b60008273ffffffffffffffffffffffffffffffffffffffff168260405161302f90615609565b60006040518083038185875af1925050503d806000811461306c576040519150601f19603f3d011682016040523d82523d6000602084013e613071565b606091505b50509050806130b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130ac9061566a565b60405180910390fd5b505050565b6001600081905550565b60006130ce612c86565b90506009548111156130e257806009819055505b50565b600c546009541461310f576001600a546130ff9190614ea3565b600b81905550600c54600a819055505b600a5460095411801561314357506000601a60006001600a546131329190614ea3565b815260200190815260200160002054145b1561324f5760008060176000600a54815260200190815260200160002054146131d45760176000600a54815260200190815260200160002054701d6329f1c35ca4bfabb9f5610000000000600e5460196000600a548152602001908152602001600020546131b19190614ea3565b6131bb9190614cc4565b6131c59190614f06565b90506000600e81905550613207565b60196000600a54815260200190815260200160002054600e60008282546131fb9190614ea3565b92505081905550600090505b80601a6000600b548152602001908152602001600020546132289190614ea3565b601a60006001600a5461323b9190614ea3565b815260200190815260200160002081905550505b565b601360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546009541180156132e157506000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1561348157600060116000601360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481526020019081526020016000205460166000601360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133d89190614cc4565b6133e29190614f06565b905080601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546134339190614ea3565b925050819055506000601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600a546009541180156134e157506001600a5461349e9190614ea3565b601860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b156136ab57701d6329f1c35ca4bfabb9f5610000000000601a6000601860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054601a60006001600a5461355e9190614ea3565b8152602001908152602001600020546135779190614e6f565b601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546135c19190614cc4565b6135cb9190614f06565b601560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136159190614ea3565b601560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001600a546136679190614ea3565b601860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000601d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415801561373b5750601d60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600954115b15614106576000601b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000601d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054905080601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546138239190614ea3565b9250508190555080601c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546138799190614ea3565b92505081905550601d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546001600a546138cf9190614ea3565b1115613a9857701d6329f1c35ca4bfabb9f5610000000000601a6000601d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054601a60006001600a5461394d9190614ea3565b8152602001908152602001600020546139669190614e6f565b601b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000601d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054613a009190614cc4565b613a0a9190614f06565b601560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a549190614ea3565b601560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000601b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000601d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020819055506000601d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000601e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461410457601e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600954111561403a576000601b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000601e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054905080601460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613ce59190614ea3565b9250508190555080601c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613d3b9190614ea3565b92505081905550601e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546001600a54613d919190614ea3565b1115613f5a57701d6329f1c35ca4bfabb9f5610000000000601a6000601e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054601a60006001600a54613e0f9190614ea3565b815260200190815260200160002054613e289190614e6f565b601b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000601e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054613ec29190614cc4565b613ecc9190614f06565b601560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613f169190614ea3565b601560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000601b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000601e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020819055506000601e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050614103565b601e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054601d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000601e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b505b50565b61418a8363a9059cbb60e01b8484604051602401614128929190614e46565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050614581565b505050565b614212846323b872dd60e01b8585856040516024016141b09392919061568a565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050614581565b50505050565b600060166000600954815260200190815260200160002054036143ac576006546007819055506000614e70614e206007546142539190614cc4565b61425d9190614f06565b9050806006819055508060166000600954815260200190815260200160002081905550600954600c8190555060065460176000600a548152602001908152602001600020546142ac9190614ea3565b60176000600c54815260200190815260200160002060008282546142d09190614ea3565b925050819055506000600854146143185760085460176000600c54815260200190815260200160002060008282546143089190614ea3565b9250508190555060006008819055505b6000600d541461435957600d5460176000600c54815260200190815260200160002060008282546143499190614e6f565b925050819055506000600d819055505b6009547f0666a61c1092f5b86c2cfe6ea1ad0d9a36032c4fb92d285b4e43f662d48f19b48260176000600c548152602001908152602001600020546040516143a29291906156c1565b60405180910390a2505b565b6000677fffffffffffffff8211156143c557600080fd5b604082901b9050919050565b60008082600f0b136143e257600080fd5b60008083600f0b905068010000000000000000811261440957604081901d90506040820191505b640100000000811261442357602081901d90506020820191505b62010000811261443b57601081901d90506010820191505b610100811261445257600881901d90506008820191505b6010811261446857600481901d90506004820191505b6004811261447e57600281901d90506002820191505b6002811261448d576001820191505b60006040808403901b9050600083607f0386600f0b901b9050600067800000000000000090505b60008113156144e8578182029150600060ff83901c905080607f0183901c92508082028401935050600181901d90506144b4565b5081945050505050919050565b600080604083600f0b85600f0b02901d90507fffffffffffffffffffffffffffffffff80000000000000000000000000000000600f0b811215801561454d57506f7fffffffffffffffffffffffffffffff600f0b8113155b61455657600080fd5b8091505092915050565b60008082600f0b121561457257600080fd5b604082600f0b901d9050919050565b60006145e3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166146499092919063ffffffff16565b90506000815114806146055750808060200190518101906146049190615716565b5b614644576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161463b906157b5565b60405180910390fd5b505050565b60606146588484600085614661565b90509392505050565b6060824710156146a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161469d90615847565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516146cf91906158cd565b60006040518083038185875af1925050503d806000811461470c576040519150601f19603f3d011682016040523d82523d6000602084013e614711565b606091505b50915091506147228783838761472e565b92505050949350505050565b6060831561479057600083510361478857614748856147a3565b614787576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161477e90615930565b60405180910390fd5b5b82905061479b565b61479a83836147c6565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000825111156147d95781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161480d91906159a5565b60405180910390fd5b6000819050919050565b61482981614816565b82525050565b60006020820190506148446000830184614820565b92915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6148848161484f565b811461488f57600080fd5b50565b6000813590506148a18161487b565b92915050565b6000602082840312156148bd576148bc61484a565b5b60006148cb84828501614892565b91505092915050565b60008115159050919050565b6148e9816148d4565b82525050565b600060208201905061490460008301846148e0565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061494f61494a6149458461490a565b61492a565b61490a565b9050919050565b600061496182614934565b9050919050565b600061497382614956565b9050919050565b61498381614968565b82525050565b600060208201905061499e600083018461497a565b92915050565b6149ad81614816565b81146149b857600080fd5b50565b6000813590506149ca816149a4565b92915050565b6000602082840312156149e6576149e561484a565b5b60006149f4848285016149bb565b91505092915050565b6000614a088261490a565b9050919050565b614a18816149fd565b8114614a2357600080fd5b50565b600081359050614a3581614a0f565b92915050565b600060208284031215614a5157614a5061484a565b5b6000614a5f84828501614a26565b91505092915050565b60008060408385031215614a7f57614a7e61484a565b5b6000614a8d85828601614a26565b9250506020614a9e858286016149bb565b9150509250929050565b614ab1816149fd565b82525050565b6000602082019050614acc6000830184614aa8565b92915050565b6000614add82614956565b9050919050565b614aed81614ad2565b82525050565b6000602082019050614b086000830184614ae4565b92915050565b6000614b1982614956565b9050919050565b614b2981614b0e565b82525050565b6000602082019050614b446000830184614b20565b92915050565b6000614b5582614956565b9050919050565b614b6581614b4a565b82525050565b6000602082019050614b806000830184614b5c565b92915050565b600082825260208201905092915050565b7f474458656e3a206d6178696d206261746368206e756d6265722069732031303060008201527f3030000000000000000000000000000000000000000000000000000000000000602082015250565b6000614bf3602283614b86565b9150614bfe82614b97565b604082019050919050565b60006020820190508181036000830152614c2281614be6565b9050919050565b7f474458656e3a206d696e206261746368206e756d626572206973203100000000600082015250565b6000614c5f601c83614b86565b9150614c6a82614c29565b602082019050919050565b60006020820190508181036000830152614c8e81614c52565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614ccf82614816565b9150614cda83614816565b9250828202614ce881614816565b91508282048414831517614cff57614cfe614c95565b5b5092915050565b600081519050614d15816149a4565b92915050565b600060208284031215614d3157614d3061484a565b5b6000614d3f84828501614d06565b91505092915050565b7f474458656e3a206e6f7420656e6f75676820746f6b656e7320666f722062757260008201527f6e00000000000000000000000000000000000000000000000000000000000000602082015250565b6000614da4602183614b86565b9150614daf82614d48565b604082019050919050565b60006020820190508181036000830152614dd381614d97565b9050919050565b7f474458656e3a2072656665727265722069732073656c66000000000000000000600082015250565b6000614e10601783614b86565b9150614e1b82614dda565b602082019050919050565b60006020820190508181036000830152614e3f81614e03565b9050919050565b6000604082019050614e5b6000830185614aa8565b614e686020830184614820565b9392505050565b6000614e7a82614816565b9150614e8583614816565b9250828203905081811115614e9d57614e9c614c95565b5b92915050565b6000614eae82614816565b9150614eb983614816565b9250828201905080821115614ed157614ed0614c95565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000614f1182614816565b9150614f1c83614816565b925082614f2c57614f2b614ed7565b5b828204905092915050565b7f474458656e3a2076616c7565206c657373207468616e2070726f746f636f6c2060008201527f6665650000000000000000000000000000000000000000000000000000000000602082015250565b6000614f93602383614b86565b9150614f9e82614f37565b604082019050919050565b60006020820190508181036000830152614fc281614f86565b9050919050565b6000604082019050614fde6000830185614820565b614feb6020830184614aa8565b9392505050565b7f474458656e3a20616d6f756e74206973207a65726f0000000000000000000000600082015250565b6000615028601583614b86565b915061503382614ff2565b602082019050919050565b600060208201905081810360008301526150578161501b565b9050919050565b7f474458656e3a206865616c7468206c657373207468616e203130300000000000600082015250565b6000615094601b83614b86565b915061509f8261505e565b602082019050919050565b600060208201905081810360008301526150c381615087565b9050919050565b7f474458656e3a20616d6f756e742067726561746572207468616e20776974686460008201527f72617761626c65207374616b6500000000000000000000000000000000000000602082015250565b6000615126602d83614b86565b9150615131826150ca565b604082019050919050565b6000602082019050818103600083015261515581615119565b9050919050565b7f474458656e3a206865616c74682067726561746572207468616e203130300000600082015250565b6000615192601e83614b86565b915061519d8261515c565b602082019050919050565b600060208201905081810360008301526151c181615185565b9050919050565b7f474458656e56696577733a206e6f74206f6c6420757365720000000000000000600082015250565b60006151fe601883614b86565b9150615209826151c8565b602082019050919050565b6000602082019050818103600083015261522d816151f1565b9050919050565b7f474458656e3a206163636f756e7420686173206e6f2072657761726473000000600082015250565b600061526a601d83614b86565b915061527582615234565b602082019050919050565b600060208201905081810360008301526152998161525d565b9050919050565b7f474458656e3a20696c6c6567616c2063616c6c6261636b2063616c6c65720000600082015250565b60006152d6601e83614b86565b91506152e1826152a0565b602082019050919050565b60006020820190508181036000830152615305816152c9565b9050919050565b60008160011c9050919050565b6000808291508390505b60018511156153635780860481111561533f5761533e614c95565b5b600185161561534e5780820291505b808102905061535c8561530c565b9450615323565b94509492505050565b60008261537c5760019050615438565b8161538a5760009050615438565b81600181146153a057600281146153aa576153d9565b6001915050615438565b60ff8411156153bc576153bb614c95565b5b8360020a9150848211156153d3576153d2614c95565b5b50615438565b5060208310610133831016604e8410600b841016171561540e5782820a90508381111561540957615408614c95565b5b615438565b61541b8484846001615319565b9250905081840481111561543257615431614c95565b5b81810290505b9392505050565b600061544a82614816565b915061545583614816565b92506154827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848461536c565b905092915050565b600061549582614816565b91506154a083614816565b9250826154b0576154af614ed7565b5b828206905092915050565b600060ff82169050919050565b60006154d382614816565b91506154de836154bb565b925061550b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848461536c565b905092915050565b61551c816154bb565b811461552757600080fd5b50565b60008151905061553981615513565b92915050565b6000602082840312156155555761555461484a565b5b60006155638482850161552a565b91505092915050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b60006155a2601f83614b86565b91506155ad8261556c565b602082019050919050565b600060208201905081810360008301526155d181615595565b9050919050565b600081905092915050565b50565b60006155f36000836155d8565b91506155fe826155e3565b600082019050919050565b6000615614826155e6565b9150819050919050565b7f474458656e3a206661696c656420746f2073656e6420616d6f756e7400000000600082015250565b6000615654601c83614b86565b915061565f8261561e565b602082019050919050565b6000602082019050818103600083015261568381615647565b9050919050565b600060608201905061569f6000830186614aa8565b6156ac6020830185614aa8565b6156b96040830184614820565b949350505050565b60006040820190506156d66000830185614820565b6156e36020830184614820565b9392505050565b6156f3816148d4565b81146156fe57600080fd5b50565b600081519050615710816156ea565b92915050565b60006020828403121561572c5761572b61484a565b5b600061573a84828501615701565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b600061579f602a83614b86565b91506157aa82615743565b604082019050919050565b600060208201905081810360008301526157ce81615792565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000615831602683614b86565b915061583c826157d5565b604082019050919050565b6000602082019050818103600083015261586081615824565b9050919050565b600081519050919050565b60005b83811015615890578082015181840152602081019050615875565b60008484015250505050565b60006158a782615867565b6158b181856155d8565b93506158c1818560208601615872565b80840191505092915050565b60006158d9828461589c565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b600061591a601d83614b86565b9150615925826158e4565b602082019050919050565b600060208201905081810360008301526159498161590d565b9050919050565b600081519050919050565b6000601f19601f8301169050919050565b600061597782615950565b6159818185614b86565b9350615991818560208601615872565b61599a8161595b565b840191505092915050565b600060208201905081810360008301526159bf818461596c565b90509291505056fea26469706673582212207f3f9045d6ba6ae54f9390eda5bc1334d873680aecd1252f1639cc4f436ad24164736f6c634300081100336101806040523480156200001257600080fd5b506040518060400160405280600b81526020017f474458656e20546f6b656e000000000000000000000000000000000000000000815250806040518060400160405280600181526020017f31000000000000000000000000000000000000000000000000000000000000008152506040518060400160405280600b81526020017f474458656e20546f6b656e0000000000000000000000000000000000000000008152506040518060400160405280600581526020017f474458656e0000000000000000000000000000000000000000000000000000008152508160039081620000fd9190620005b3565b5080600490816200010f9190620005b3565b5050506200012d6005836200020860201b62000a801790919060201c565b6101208181525050620001506006826200020860201b62000a801790919060201c565b6101408181525050818051906020012060e08181525050808051906020012061010081815250504660a081815250506200018f6200026560201b60201c565b608081815250503073ffffffffffffffffffffffffffffffffffffffff1660c08173ffffffffffffffffffffffffffffffffffffffff16815250505050503373ffffffffffffffffffffffffffffffffffffffff166101608173ffffffffffffffffffffffffffffffffffffffff1681525050620008bd565b60006020835110156200022e576200022683620002c260201b60201c565b90506200025f565b8262000245836200032f60201b62000ac41760201c565b6000019081620002569190620005b3565b5060ff60001b90505b92915050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60e051610100514630604051602001620002a79594939291906200070b565b60405160208183030381529060405280519060200120905090565b600080829050601f815111156200031257826040517f305a27a9000000000000000000000000000000000000000000000000000000008152600401620003099190620007f7565b60405180910390fd5b80518162000320906200084d565b60001c1760001b915050919050565b6000819050919050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620003bb57607f821691505b602082108103620003d157620003d062000373565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026200043b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620003fc565b620004478683620003fc565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620004946200048e62000488846200045f565b62000469565b6200045f565b9050919050565b6000819050919050565b620004b08362000473565b620004c8620004bf826200049b565b84845462000409565b825550505050565b600090565b620004df620004d0565b620004ec818484620004a5565b505050565b5b81811015620005145762000508600082620004d5565b600181019050620004f2565b5050565b601f82111562000563576200052d81620003d7565b6200053884620003ec565b8101602085101562000548578190505b620005606200055785620003ec565b830182620004f1565b50505b505050565b600082821c905092915050565b6000620005886000198460080262000568565b1980831691505092915050565b6000620005a3838362000575565b9150826002028217905092915050565b620005be8262000339565b67ffffffffffffffff811115620005da57620005d962000344565b5b620005e68254620003a2565b620005f382828562000518565b600060209050601f8311600181146200062b576000841562000616578287015190505b62000622858262000595565b86555062000692565b601f1984166200063b86620003d7565b60005b8281101562000665578489015182556001820191506020850194506020810190506200063e565b8683101562000685578489015162000681601f89168262000575565b8355505b6001600288020188555050505b505050505050565b6000819050919050565b620006af816200069a565b82525050565b620006c0816200045f565b82525050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620006f382620006c6565b9050919050565b6200070581620006e6565b82525050565b600060a082019050620007226000830188620006a4565b620007316020830187620006a4565b620007406040830186620006a4565b6200074f6060830185620006b5565b6200075e6080830184620006fa565b9695505050505050565b600082825260208201905092915050565b60005b83811015620007995780820151818401526020810190506200077c565b60008484015250505050565b6000601f19601f8301169050919050565b6000620007c38262000339565b620007cf818562000768565b9350620007e181856020860162000779565b620007ec81620007a5565b840191505092915050565b60006020820190508181036000830152620008138184620007b6565b905092915050565b600081519050919050565b6000819050602082019050919050565b60006200084482516200069a565b80915050919050565b60006200085a826200081b565b82620008668462000826565b9050620008738162000836565b92506020821015620008b657620008b17fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83602003600802620003fc565b831692505b5050919050565b60805160a05160c05160e05161010051610120516101405161016051612a1a6200092a60003960008181610679015261072f015260006105bc01526000610588015260006113c7015260006113a601526000610fa501526000610ffb015260006110240152612a1a6000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c80637ecebe00116100a25780639a49090e116100715780639a49090e146102d8578063a457c2d7146102f4578063a9059cbb14610324578063d505accf14610354578063dd62ed3e146103705761010b565b80637ecebe001461024857806384b0196e146102785780638da5cb5b1461029c57806395d89b41146102ba5761010b565b8063313ce567116100de578063313ce567146101ac5780633644e515146101ca57806339509351146101e857806370a08231146102185761010b565b806306fdde0314610110578063095ea7b31461012e57806318160ddd1461015e57806323b872dd1461017c575b600080fd5b6101186103a0565b604051610125919061180a565b60405180910390f35b610148600480360381019061014391906118c5565b610432565b6040516101559190611920565b60405180910390f35b610166610455565b604051610173919061194a565b60405180910390f35b61019660048036038101906101919190611965565b61045f565b6040516101a39190611920565b60405180910390f35b6101b461048e565b6040516101c191906119d4565b60405180910390f35b6101d2610497565b6040516101df9190611a08565b60405180910390f35b61020260048036038101906101fd91906118c5565b6104a6565b60405161020f9190611920565b60405180910390f35b610232600480360381019061022d9190611a23565b6104dd565b60405161023f919061194a565b60405180910390f35b610262600480360381019061025d9190611a23565b610525565b60405161026f919061194a565b60405180910390f35b610280610575565b6040516102939796959493929190611b58565b60405180910390f35b6102a4610677565b6040516102b19190611bdc565b60405180910390f35b6102c261069b565b6040516102cf919061180a565b60405180910390f35b6102f260048036038101906102ed91906118c5565b61072d565b005b61030e600480360381019061030991906118c5565b61081d565b60405161031b9190611920565b60405180910390f35b61033e600480360381019061033991906118c5565b610894565b60405161034b9190611920565b60405180910390f35b61036e60048036038101906103699190611c4f565b6108b7565b005b61038a60048036038101906103859190611cf1565b6109f9565b604051610397919061194a565b60405180910390f35b6060600380546103af90611d60565b80601f01602080910402602001604051908101604052809291908181526020018280546103db90611d60565b80156104285780601f106103fd57610100808354040283529160200191610428565b820191906000526020600020905b81548152906001019060200180831161040b57829003601f168201915b5050505050905090565b60008061043d610ace565b905061044a818585610ad6565b600191505092915050565b6000600254905090565b60008061046a610ace565b9050610477858285610c9f565b610482858585610d2b565b60019150509392505050565b60006012905090565b60006104a1610fa1565b905090565b6000806104b1610ace565b90506104d28185856104c385896109f9565b6104cd9190611dc0565b610ad6565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600061056e600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611058565b9050919050565b6000606080600080600060606105b560057f000000000000000000000000000000000000000000000000000000000000000061106690919063ffffffff16565b6105e960067f000000000000000000000000000000000000000000000000000000000000000061106690919063ffffffff16565b46306000801b600067ffffffffffffffff81111561060a57610609611df4565b5b6040519080825280602002602001820160405280156106385781602001602082028036833780820191505090505b507f0f00000000000000000000000000000000000000000000000000000000000000959493929190965096509650965096509650965090919293949596565b7f000000000000000000000000000000000000000000000000000000000000000081565b6060600480546106aa90611d60565b80601f01602080910402602001604051908101604052809291908181526020018280546106d690611d60565b80156107235780601f106106f857610100808354040283529160200191610723565b820191906000526020600020905b81548152906001019060200180831161070657829003601f168201915b5050505050905090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b290611e95565b60405180910390fd5b6a0424e8a4eaca5ed74000006107cf610455565b1061080f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080690611f01565b60405180910390fd5b6108198282611116565b5050565b600080610828610ace565b9050600061083682866109f9565b90508381101561087b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087290611f93565b60405180910390fd5b6108888286868403610ad6565b60019250505092915050565b60008061089f610ace565b90506108ac818585610d2b565b600191505092915050565b834211156108fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f190611fff565b60405180910390fd5b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886109298c61126c565b8960405160200161093f9695949392919061201f565b6040516020818303038152906040528051906020012090506000610962826112ca565b90506000610972828787876112e4565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146109e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109d9906120cc565b60405180910390fd5b6109ed8a8a8a610ad6565b50505050505050505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000602083511015610a9c57610a958361130f565b9050610abe565b82610aa683610ac4565b6000019081610ab59190612298565b5060ff60001b90505b92915050565b6000819050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610b45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3c906123dc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610bb4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bab9061246e565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610c92919061194a565b60405180910390a3505050565b6000610cab84846109f9565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610d255781811015610d17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0e906124da565b60405180910390fd5b610d248484848403610ad6565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610d9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d919061256c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610e09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e00906125fe565b60405180910390fd5b610e14838383611377565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610e9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9190612690565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610f88919061194a565b60405180910390a3610f9b84848461137c565b50505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614801561101d57507f000000000000000000000000000000000000000000000000000000000000000046145b1561104a577f00000000000000000000000000000000000000000000000000000000000000009050611055565b611052611381565b90505b90565b600081600001549050919050565b606060ff60001b83146110835761107c83611417565b9050611110565b81805461108f90611d60565b80601f01602080910402602001604051908101604052809291908181526020018280546110bb90611d60565b80156111085780601f106110dd57610100808354040283529160200191611108565b820191906000526020600020905b8154815290600101906020018083116110eb57829003601f168201915b505050505090505b92915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611185576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117c906126fc565b60405180910390fd5b61119160008383611377565b80600260008282546111a39190611dc0565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611254919061194a565b60405180910390a36112686000838361137c565b5050565b600080600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506112b981611058565b91506112c48161148b565b50919050565b60006112dd6112d7610fa1565b836114a1565b9050919050565b60008060006112f5878787876114e2565b91509150611302816115c4565b8192505050949350505050565b600080829050601f8151111561135c57826040517f305a27a9000000000000000000000000000000000000000000000000000000008152600401611353919061180a565b60405180910390fd5b8051816113689061274c565b60001c1760001b915050919050565b505050565b505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000046306040516020016113fc9594939291906127b3565b60405160208183030381529060405280519060200120905090565b606060006114248361172a565b90506000602067ffffffffffffffff81111561144357611442611df4565b5b6040519080825280601f01601f1916602001820160405280156114755781602001600182028036833780820191505090505b5090508181528360208201528092505050919050565b6001816000016000828254019250508190555050565b60006040517f190100000000000000000000000000000000000000000000000000000000000081528360028201528260228201526042812091505092915050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08360001c111561151d5760006003915091506115bb565b6000600187878787604051600081526020016040526040516115429493929190612806565b6020604051602081039080840390855afa158015611564573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036115b2576000600192509250506115bb565b80600092509250505b94509492505050565b600060048111156115d8576115d761284b565b5b8160048111156115eb576115ea61284b565b5b031561172757600160048111156116055761160461284b565b5b8160048111156116185761161761284b565b5b03611658576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161164f906128c6565b60405180910390fd5b6002600481111561166c5761166b61284b565b5b81600481111561167f5761167e61284b565b5b036116bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b690612932565b60405180910390fd5b600360048111156116d3576116d261284b565b5b8160048111156116e6576116e561284b565b5b03611726576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171d906129c4565b60405180910390fd5b5b50565b60008060ff8360001c169050601f811115611771576040517fb3512b0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80915050919050565b600081519050919050565b600082825260208201905092915050565b60005b838110156117b4578082015181840152602081019050611799565b60008484015250505050565b6000601f19601f8301169050919050565b60006117dc8261177a565b6117e68185611785565b93506117f6818560208601611796565b6117ff816117c0565b840191505092915050565b6000602082019050818103600083015261182481846117d1565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061185c82611831565b9050919050565b61186c81611851565b811461187757600080fd5b50565b60008135905061188981611863565b92915050565b6000819050919050565b6118a28161188f565b81146118ad57600080fd5b50565b6000813590506118bf81611899565b92915050565b600080604083850312156118dc576118db61182c565b5b60006118ea8582860161187a565b92505060206118fb858286016118b0565b9150509250929050565b60008115159050919050565b61191a81611905565b82525050565b60006020820190506119356000830184611911565b92915050565b6119448161188f565b82525050565b600060208201905061195f600083018461193b565b92915050565b60008060006060848603121561197e5761197d61182c565b5b600061198c8682870161187a565b935050602061199d8682870161187a565b92505060406119ae868287016118b0565b9150509250925092565b600060ff82169050919050565b6119ce816119b8565b82525050565b60006020820190506119e960008301846119c5565b92915050565b6000819050919050565b611a02816119ef565b82525050565b6000602082019050611a1d60008301846119f9565b92915050565b600060208284031215611a3957611a3861182c565b5b6000611a478482850161187a565b91505092915050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b611a8581611a50565b82525050565b611a9481611851565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611acf8161188f565b82525050565b6000611ae18383611ac6565b60208301905092915050565b6000602082019050919050565b6000611b0582611a9a565b611b0f8185611aa5565b9350611b1a83611ab6565b8060005b83811015611b4b578151611b328882611ad5565b9750611b3d83611aed565b925050600181019050611b1e565b5085935050505092915050565b600060e082019050611b6d600083018a611a7c565b8181036020830152611b7f81896117d1565b90508181036040830152611b9381886117d1565b9050611ba2606083018761193b565b611baf6080830186611a8b565b611bbc60a08301856119f9565b81810360c0830152611bce8184611afa565b905098975050505050505050565b6000602082019050611bf16000830184611a8b565b92915050565b611c00816119b8565b8114611c0b57600080fd5b50565b600081359050611c1d81611bf7565b92915050565b611c2c816119ef565b8114611c3757600080fd5b50565b600081359050611c4981611c23565b92915050565b600080600080600080600060e0888a031215611c6e57611c6d61182c565b5b6000611c7c8a828b0161187a565b9750506020611c8d8a828b0161187a565b9650506040611c9e8a828b016118b0565b9550506060611caf8a828b016118b0565b9450506080611cc08a828b01611c0e565b93505060a0611cd18a828b01611c3a565b92505060c0611ce28a828b01611c3a565b91505092959891949750929550565b60008060408385031215611d0857611d0761182c565b5b6000611d168582860161187a565b9250506020611d278582860161187a565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611d7857607f821691505b602082108103611d8b57611d8a611d31565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611dcb8261188f565b9150611dd68361188f565b9250828201905080821115611dee57611ded611d91565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f474458656e3a2063616c6c6572206973206e6f7420474458656e20636f6e747260008201527f6163742e00000000000000000000000000000000000000000000000000000000602082015250565b6000611e7f602483611785565b9150611e8a82611e23565b604082019050919050565b60006020820190508181036000830152611eae81611e72565b9050919050565b7f474458656e3a206d617820737570706c7920616c7265616479206d696e746564600082015250565b6000611eeb602083611785565b9150611ef682611eb5565b602082019050919050565b60006020820190508181036000830152611f1a81611ede565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000611f7d602583611785565b9150611f8882611f21565b604082019050919050565b60006020820190508181036000830152611fac81611f70565b9050919050565b7f45524332305065726d69743a206578706972656420646561646c696e65000000600082015250565b6000611fe9601d83611785565b9150611ff482611fb3565b602082019050919050565b6000602082019050818103600083015261201881611fdc565b9050919050565b600060c08201905061203460008301896119f9565b6120416020830188611a8b565b61204e6040830187611a8b565b61205b606083018661193b565b612068608083018561193b565b61207560a083018461193b565b979650505050505050565b7f45524332305065726d69743a20696e76616c6964207369676e61747572650000600082015250565b60006120b6601e83611785565b91506120c182612080565b602082019050919050565b600060208201905081810360008301526120e5816120a9565b9050919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b60006008830261214e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82612111565b6121588683612111565b95508019841693508086168417925050509392505050565b6000819050919050565b600061219561219061218b8461188f565b612170565b61188f565b9050919050565b6000819050919050565b6121af8361217a565b6121c36121bb8261219c565b84845461211e565b825550505050565b600090565b6121d86121cb565b6121e38184846121a6565b505050565b5b81811015612207576121fc6000826121d0565b6001810190506121e9565b5050565b601f82111561224c5761221d816120ec565b61222684612101565b81016020851015612235578190505b61224961224185612101565b8301826121e8565b50505b505050565b600082821c905092915050565b600061226f60001984600802612251565b1980831691505092915050565b6000612288838361225e565b9150826002028217905092915050565b6122a18261177a565b67ffffffffffffffff8111156122ba576122b9611df4565b5b6122c48254611d60565b6122cf82828561220b565b600060209050601f83116001811461230257600084156122f0578287015190505b6122fa858261227c565b865550612362565b601f198416612310866120ec565b60005b8281101561233857848901518255600182019150602085019450602081019050612313565b868310156123555784890151612351601f89168261225e565b8355505b6001600288020188555050505b505050505050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006123c6602483611785565b91506123d18261236a565b604082019050919050565b600060208201905081810360008301526123f5816123b9565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612458602283611785565b9150612463826123fc565b604082019050919050565b600060208201905081810360008301526124878161244b565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b60006124c4601d83611785565b91506124cf8261248e565b602082019050919050565b600060208201905081810360008301526124f3816124b7565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612556602583611785565b9150612561826124fa565b604082019050919050565b6000602082019050818103600083015261258581612549565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006125e8602383611785565b91506125f38261258c565b604082019050919050565b60006020820190508181036000830152612617816125db565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b600061267a602683611785565b91506126858261261e565b604082019050919050565b600060208201905081810360008301526126a98161266d565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b60006126e6601f83611785565b91506126f1826126b0565b602082019050919050565b60006020820190508181036000830152612715816126d9565b9050919050565b600081519050919050565b6000819050602082019050919050565b600061274382516119ef565b80915050919050565b60006127578261271c565b8261276184612727565b905061276c81612737565b925060208210156127ac576127a77fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83602003600802612111565b831692505b5050919050565b600060a0820190506127c860008301886119f9565b6127d560208301876119f9565b6127e260408301866119f9565b6127ef606083018561193b565b6127fc6080830184611a8b565b9695505050505050565b600060808201905061281b60008301876119f9565b61282860208301866119c5565b61283560408301856119f9565b61284260608301846119f9565b95945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f45434453413a20696e76616c6964207369676e61747572650000000000000000600082015250565b60006128b0601883611785565b91506128bb8261287a565b602082019050919050565b600060208201905081810360008301526128df816128a3565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e67746800600082015250565b600061291c601f83611785565b9150612927826128e6565b602082019050919050565b6000602082019050818103600083015261294b8161290f565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b60006129ae602283611785565b91506129b982612952565b604082019050919050565b600060208201905081810360008301526129dd816129a1565b905091905056fea2646970667358221220adca7dc33fbaa1eee9f6f2f9e6d70b6e2d58b1f60d777acfcc8851c62508754864736f6c634300081100330000000000000000000000008a7fdca264e87b6da72d000f22186b4403081a2a0000000000000000000000003d5de5e89d90946324fa8583783cdf1f93b4eb3c000000000000000000000000b724d39b37b6af2bc73d9f73b7fa56e45bb2dedb

Deployed ByteCode

0x6080604052600436106103505760003560e01c806391b30020116101c6578063bef51052116100f7578063db80a28c11610095578063ef4cadc51161006f578063ef4cadc514610ceb578063f1b371e214610d16578063fa845ca914610d41578063fd967f4714610d7e57610350565b8063db80a28c14610c34578063e60c90c414610c71578063ed725e8314610cae57610350565b8063c67c742d116100d1578063c67c742d14610b8a578063c8727c8114610bb5578063d294f09314610bf2578063d4432e4e14610c0957610350565b8063bef5105214610ae5578063c40af1ee14610b22578063c4235ae914610b4d57610350565b8063bab2f55211610164578063bd1654bd1161013e578063bd1654bd14610a27578063bd21c4b014610a52578063be26ed7f14610a7d578063bebc9dfc14610aa857610350565b8063bab2f55214610994578063bc3dc8af146109bf578063bc713290146109ea57610350565b8063a95f1dac116101a0578063a95f1dac146108c4578063aabbb1bd146108ef578063ad5ed4791461092c578063adc0f6861461095757610350565b806391b3002014610833578063a694fc3a1461085e578063a707140b1461088757610350565b8063304d3fae116102a0578063616b08af1161023e578063857f098111610218578063857f098114610763578063872e3b26146107a05780638bd95563146107dd5780639055c5151461080857610350565b8063616b08af146106d057806368f057691461070d57806369ef02641461073857610350565b8063436091c11161027a578063436091c114610626578063543746b11461065157806356b96bf51461067a5780635f5080b4146106a557610350565b8063304d3fae146105cd5780633119c400146105e4578063372500ab1461060f57610350565b8063138031581161030d5780631ed6380f116102e75780631ed6380f14610511578063224438d11461054e5780632e17de78146105795780632f7cdab0146105a257610350565b8063138031581461048d57806317d9c47a146104a95780631c75f085146104e657610350565b806301b0210a1461035557806301ffc9a71461038057806306ab411c146103bd5780630ad75292146103e85780630ece21541461041357806312cb22ac14610450575b600080fd5b34801561036157600080fd5b5061036a610da9565b604051610377919061482f565b60405180910390f35b34801561038c57600080fd5b506103a760048036038101906103a291906148a7565b610dae565b6040516103b491906148ef565b60405180910390f35b3480156103c957600080fd5b506103d2610e18565b6040516103df919061482f565b60405180910390f35b3480156103f457600080fd5b506103fd610e1d565b60405161040a9190614989565b60405180910390f35b34801561041f57600080fd5b5061043a600480360381019061043591906149d0565b610e43565b604051610447919061482f565b60405180910390f35b34801561045c57600080fd5b5061047760048036038101906104729190614a3b565b610e5b565b604051610484919061482f565b60405180910390f35b6104a760048036038101906104a29190614a68565b610e73565b005b3480156104b557600080fd5b506104d060048036038101906104cb91906149d0565b611770565b6040516104dd919061482f565b60405180910390f35b3480156104f257600080fd5b506104fb611788565b6040516105089190614ab7565b60405180910390f35b34801561051d57600080fd5b5061053860048036038101906105339190614a3b565b6117ae565b604051610545919061482f565b60405180910390f35b34801561055a57600080fd5b506105636117c6565b604051610570919061482f565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b91906149d0565b6117cc565b005b3480156105ae57600080fd5b506105b7611ada565b6040516105c4919061482f565b60405180910390f35b3480156105d957600080fd5b506105e2611afe565b005b3480156105f057600080fd5b506105f9611e70565b604051610606919061482f565b60405180910390f35b34801561061b57600080fd5b50610624611e75565b005b34801561063257600080fd5b5061063b612189565b604051610648919061482f565b60405180910390f35b34801561065d57600080fd5b5061067860048036038101906106739190614a68565b61218f565b005b34801561068657600080fd5b5061068f6122d8565b60405161069c919061482f565b60405180910390f35b3480156106b157600080fd5b506106ba6122e7565b6040516106c7919061482f565b60405180910390f35b3480156106dc57600080fd5b506106f760048036038101906106f29190614a3b565b6122ed565b604051610704919061482f565b60405180910390f35b34801561071957600080fd5b50610722612557565b60405161072f919061482f565b60405180910390f35b34801561074457600080fd5b5061074d61255d565b60405161075a919061482f565b60405180910390f35b34801561076f57600080fd5b5061078a60048036038101906107859190614a3b565b612564565b60405161079791906148ef565b60405180910390f35b3480156107ac57600080fd5b506107c760048036038101906107c291906149d0565b612583565b6040516107d4919061482f565b60405180910390f35b3480156107e957600080fd5b506107f26126b5565b6040516107ff919061482f565b60405180910390f35b34801561081457600080fd5b5061081d6126d9565b60405161082a9190614af3565b60405180910390f35b34801561083f57600080fd5b506108486126ff565b604051610855919061482f565b60405180910390f35b34801561086a57600080fd5b50610885600480360381019061088091906149d0565b612705565b005b34801561089357600080fd5b506108ae60048036038101906108a99190614a3b565b612baf565b6040516108bb919061482f565b60405180910390f35b3480156108d057600080fd5b506108d9612bc7565b6040516108e6919061482f565b60405180910390f35b3480156108fb57600080fd5b5061091660048036038101906109119190614a68565b612bcd565b604051610923919061482f565b60405180910390f35b34801561093857600080fd5b50610941612bf2565b60405161094e9190614b2f565b60405180910390f35b34801561096357600080fd5b5061097e600480360381019061097991906149d0565b612c18565b60405161098b919061482f565b60405180910390f35b3480156109a057600080fd5b506109a9612c30565b6040516109b6919061482f565b60405180910390f35b3480156109cb57600080fd5b506109d4612c36565b6040516109e19190614b6b565b60405180910390f35b3480156109f657600080fd5b50610a116004803603810190610a0c9190614a3b565b612c5c565b604051610a1e919061482f565b60405180910390f35b348015610a3357600080fd5b50610a3c612c74565b604051610a49919061482f565b60405180910390f35b348015610a5e57600080fd5b50610a67612c7b565b604051610a74919061482f565b60405180910390f35b348015610a8957600080fd5b50610a92612c86565b604051610a9f919061482f565b60405180910390f35b348015610ab457600080fd5b50610acf6004803603810190610aca91906149d0565b612ce4565b604051610adc919061482f565b60405180910390f35b348015610af157600080fd5b50610b0c6004803603810190610b079190614a3b565b612cfc565b604051610b19919061482f565b60405180910390f35b348015610b2e57600080fd5b50610b37612d14565b604051610b44919061482f565b60405180910390f35b348015610b5957600080fd5b50610b746004803603810190610b6f91906149d0565b612d1a565b604051610b81919061482f565b60405180910390f35b348015610b9657600080fd5b50610b9f612d32565b604051610bac919061482f565b60405180910390f35b348015610bc157600080fd5b50610bdc6004803603810190610bd79190614a68565b612d37565b604051610be9919061482f565b60405180910390f35b348015610bfe57600080fd5b50610c07612d5c565b005b348015610c1557600080fd5b50610c1e612f2a565b604051610c2b919061482f565b60405180910390f35b348015610c4057600080fd5b50610c5b6004803603810190610c569190614a3b565b612f30565b604051610c68919061482f565b60405180910390f35b348015610c7d57600080fd5b50610c986004803603810190610c939190614a3b565b612f48565b604051610ca5919061482f565b60405180910390f35b348015610cba57600080fd5b50610cd56004803603810190610cd09190614a3b565b612f60565b604051610ce2919061482f565b60405180910390f35b348015610cf757600080fd5b50610d00612f78565b604051610d0d919061482f565b60405180910390f35b348015610d2257600080fd5b50610d2b612f8d565b604051610d38919061482f565b60405180910390f35b348015610d4d57600080fd5b50610d686004803603810190610d639190614a3b565b612f93565b604051610d75919061482f565b60405180910390f35b348015610d8a57600080fd5b50610d93612fab565b604051610da0919061482f565b60405180910390f35b606481565b60007f543746b1000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b606681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60196020528060005260406000206000915090505481565b60106020528060005260406000206000915090505481565b610e7b612fb2565b8060005a9050612710831115610ec6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ebd90614c09565b60405180910390fd5b60008311610f09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0090614c75565b60405180910390fd5b6a01a784379d99db4200000083610f209190614cc4565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401610f7b9190614ab7565b602060405180830381865afa158015610f98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fbc9190614d1b565b1015610ffd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff490614dba565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361106b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106290614e26565b60405180910390fd5b602060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661125057606483106111ac57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dc8f2d69856040518263ffffffff1660e01b815260040161111f9190614ab7565b600060405180830381600087803b15801561113957600080fd5b505af115801561114d573d6000803e3d6000fd5b505050508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fdca4f0ed9b7f82ec9b5c9c7f339e58882a8d9015768b67ed73134406fd92d09760405160405180910390a35b6001602060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061120c612c86565b601f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac336a01a784379d99db42000000866112a69190614cc4565b6040518363ffffffff1660e01b81526004016112c3929190614e46565b600060405180830381600087803b1580156112dd57600080fd5b505af11580156112f1573d6000803e3d6000fd5b5050505060008260056113049190614cc4565b620186a06113129190614e6f565b8361131d9190614cc4565b9050600061133161132c613001565b6122ed565b60648061133e9190614ea3565b6113489190614e6f565b905060006103e86a01a784379d99db42000000866113669190614cc4565b6113709190614f06565b90506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166329c7f805600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b81526004016113f3929190614e46565b602060405180830381865afa158015611410573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114349190614d1b565b90506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663819c3f3b836040518263ffffffff1660e01b8152600401611493919061482f565b602060405180830381865afa1580156114b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d49190614d1b565b90506000606485620f4240620186a08966038d7ea4c680006114f69190614cc4565b6115009190614f06565b61150a9190614cc4565b6115149190614cc4565b61151e9190614f06565b9050818161152c9190614ea3565b34101561156e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156590614fa9565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663280e63098386336040518463ffffffff1660e01b81526004016115cc929190614fc9565b6000604051808303818588803b1580156115e557600080fd5b505af11580156115f9573d6000803e3d6000fd5b505050505087600f60008282546116109190614ea3565b9250508190555087601160006009548152602001908152602001600020600082825461163c9190614ea3565b925050819055508760126000611650613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600954815260200190815260200160002060008282546116ac9190614ea3565b9250508190555087601060006116c0613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546117099190614ea3565b925050819055508060196000600954815260200190815260200160002060008282546117359190614ea3565b9250508190555061175c3383833461174d9190614e6f565b6117579190614e6f565b613009565b505050505050505061176c6130ba565b5050565b60116020528060005260406000206000915090505481565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601c6020528060005260406000206000915090505481565b600e5481565b6117d4612fb2565b6117dc6130c4565b6117e46130e5565b6117f46117ef613001565b613251565b60008111611837576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182e9061503e565b60405180910390fd5b6064611849611844613001565b6122ed565b101561188a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611881906150aa565b60405180910390fd5b601c6000611896613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115611913576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190a9061513c565b60405180910390fd5b600c54600a540361193c5780600d60008282546119309190614ea3565b92505081905550611969565b8060176000600954815260200190815260200160002060008282546119619190614e6f565b925050819055505b80601c6000611976613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546119bf9190614e6f565b9250508190555080601460006119d3613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611a1c9190614e6f565b92505081905550611a77611a2e613001565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166141099092919063ffffffff16565b611a7f613001565b73ffffffffffffffffffffffffffffffffffffffff166009547f37375b03d8924bd8f076f11f8411b9962aa5c02fb489021507bc6bb6f850e36583604051611ac7919061482f565b60405180910390a3611ad76130ba565b50565b7f000000000000000000000000000000000000000000000000000000000001518081565b611b06612fb2565b6064611b11336122ed565b10611b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b48906151a8565b60405180910390fd5b611b596130c4565b602060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611be5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bdc90615214565b60405180910390fd5b6000611bf0336122ed565b90506000816064611c019190614e6f565b90506000611c0e82612583565b905080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401611c6c9190614ab7565b602060405180830381865afa158015611c89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cad9190614d1b565b1015611cee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce590614dba565b60405180910390fd5b611d3d333083600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661418f909392919063ffffffff16565b611d45612c86565b601f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166342966c68826040518263ffffffff1660e01b8152600401611de3919061482f565b600060405180830381600087803b158015611dfd57600080fd5b505af1158015611e11573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167ff8fc6e6bea4fbbdb2e72c44b7a05758fb4d348f9cac00a8960855dc5068ab65e83604051611e5b919061482f565b60405180910390a2505050611e6e6130ba565b565b600281565b611e7d612fb2565b611e856130c4565b611e8d6130e5565b611e9d611e98613001565b613251565b6000601c6000611eab613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460146000611ef2613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f379190614e6f565b905060008111611f7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7390615280565b60405180910390fd5b6064611f8e611f89613001565b6122ed565b1015611fcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc6906150aa565b60405180910390fd5b8060146000611fdc613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546120259190614e6f565b92505081905550600c54600a54036120555780600d60008282546120499190614ea3565b92505081905550612090565b80601760006009548152602001908152602001600020546120769190614e6f565b601760006009548152602001908152602001600020819055505b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639a49090e6120d6613001565b836040518363ffffffff1660e01b81526004016120f4929190614e46565b600060405180830381600087803b15801561210e57600080fd5b505af1158015612122573d6000803e3d6000fd5b5050505061212e613001565b73ffffffffffffffffffffffffffffffffffffffff166009547f3300bdb359cfb956935bca32e9db727413eab1ca84341f2e36caea85bb79696883604051612176919061482f565b60405180910390a3506121876130ba565b565b600a5481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461221f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612216906152ec565b60405180910390fd5b6122276130c4565b61222f6130e5565b612237614218565b61224082613251565b600954601360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040516122cc919061482f565b60405180910390a25050565b6a01a784379d99db4200000081565b600b5481565b600080601f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612338612c86565b6123429190614e6f565b9050600081148061239d5750602060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156123ac576064915050612552565b600060748211156123c1578092505050612552565b60006001836123d0919061543f565b60026123dc9190614cc4565b90506000601e826123ed9190614f06565b90506000601e836123fe919061548a565b905060008211156124d457806064612416919061543f565b620186a0826066612427919061543f565b6124319190614cc4565b61243b9190614f06565b82789f4f2726179a224501d762422c946590d91000000000000000620186a0601e606661246891906154c8565b6124729190614cc4565b61247c9190614f06565b612486919061543f565b6124909190614cc4565b82600261249d9190614ea3565b620186a06124ab919061543f565b60016124b79190614cc4565b6124c19190614f06565b60646124cd9190614cc4565b935061253b565b8060646124e1919061543f565b620186a08260666124f2919061543f565b6124fc9190614cc4565b6125069190614f06565b6002620186a061251691906154c8565b60016125229190614cc4565b61252c9190614f06565b60646125389190614cc4565b93505b620186a08461254a9190614f06565b955050505050505b919050565b600d5481565b620186a081565b602080528060005260406000206000915054906101000a900460ff1681565b60008061258e612c86565b90506000606b90506000606485600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015612608573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061262c919061553f565b600a61263891906154c8565b612680612678612647876143ae565b61266761265f60018b61265a9190614ea3565b6143ae565b600f0b6143d1565b600f0b6144f590919063ffffffff16565b600f0b614560565b67ffffffffffffffff166126949190614cc4565b61269e9190614cc4565b6126a89190614f06565b9050809350505050919050565b7f00000000000000000000000000000000000000000000000000000000653e57cd81565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b61270d612fb2565b6127156130c4565b61271d6130e5565b61272d612728613001565b613251565b60008111612770576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127679061503e565b60405180910390fd5b602060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612865576001602060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612821612c86565b601f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b80600860008282546128779190614ea3565b925050819055506000600160095461288f9190614ea3565b9050600c54600a54036128ae576001600a546128ab9190614ea3565b90505b601d60006128ba613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811415801561294a5750601e600061290b613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548114155b15612a89576000601d600061295d613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054036129ed5780601d60006129aa613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a88565b6000601e60006129fb613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403612a875780601e6000612a48613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b81601b6000612a96613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000828254612af09190614ea3565b92505081905550612b4d612b02613001565b3084600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661418f909392919063ffffffff16565b612b55613001565b73ffffffffffffffffffffffffffffffffffffffff16817f18dcd430020e4d4899772fd94a8b40451dc5044dfb70bc46b532eeae431c864f84604051612b9b919061482f565b60405180910390a350612bac6130ba565b50565b60186020528060005260406000206000915090505481565b60075481565b601b602052816000526040600020602052806000526040600020600091509150505481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60166020528060005260406000206000915090505481565b60095481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60156020528060005260406000206000915090505481565b620f424081565b66038d7ea4c6800081565b60007f00000000000000000000000000000000000000000000000000000000000151807f00000000000000000000000000000000000000000000000000000000653e57cd42612cd59190614e6f565b612cdf9190614f06565b905090565b601a6020528060005260406000206000915090505481565b601f6020528060005260406000206000915090505481565b600f5481565b60176020528060005260406000206000915090505481565b600181565b6012602052816000526040600020602052806000526040600020600091509150505481565b612d64612fb2565b612d6c6130c4565b612d746130e5565b612d84612d7f613001565b613251565b6064612d96612d91613001565b6122ed565b1015612dd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dce906150aa565b60405180910390fd5b600060156000612de5613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008111612e65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e5c9061503e565b60405180910390fd5b600060156000612e73613001565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ec2612ebc613001565b82613009565b612eca613001565b73ffffffffffffffffffffffffffffffffffffffff16612ee8612c86565b7f2227733fc4c8a9034cb58087dcf6995128b9c0233b038b03366aaf30c92b92d683604051612f17919061482f565b60405180910390a350612f286130ba565b565b60085481565b601e6020528060005260406000206000915090505481565b601d6020528060005260406000206000915090505481565b60146020528060005260406000206000915090505481565b701d6329f1c35ca4bfabb9f561000000000081565b600c5481565b60136020528060005260406000206000915090505481565b620186a081565b600260005403612ff7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fee906155b8565b60405180910390fd5b6002600081905550565b600033905090565b60008273ffffffffffffffffffffffffffffffffffffffff168260405161302f90615609565b60006040518083038185875af1925050503d806000811461306c576040519150601f19603f3d011682016040523d82523d6000602084013e613071565b606091505b50509050806130b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130ac9061566a565b60405180910390fd5b505050565b6001600081905550565b60006130ce612c86565b90506009548111156130e257806009819055505b50565b600c546009541461310f576001600a546130ff9190614ea3565b600b81905550600c54600a819055505b600a5460095411801561314357506000601a60006001600a546131329190614ea3565b815260200190815260200160002054145b1561324f5760008060176000600a54815260200190815260200160002054146131d45760176000600a54815260200190815260200160002054701d6329f1c35ca4bfabb9f5610000000000600e5460196000600a548152602001908152602001600020546131b19190614ea3565b6131bb9190614cc4565b6131c59190614f06565b90506000600e81905550613207565b60196000600a54815260200190815260200160002054600e60008282546131fb9190614ea3565b92505081905550600090505b80601a6000600b548152602001908152602001600020546132289190614ea3565b601a60006001600a5461323b9190614ea3565b815260200190815260200160002081905550505b565b601360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546009541180156132e157506000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1561348157600060116000601360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481526020019081526020016000205460166000601360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133d89190614cc4565b6133e29190614f06565b905080601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546134339190614ea3565b925050819055506000601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600a546009541180156134e157506001600a5461349e9190614ea3565b601860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b156136ab57701d6329f1c35ca4bfabb9f5610000000000601a6000601860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054601a60006001600a5461355e9190614ea3565b8152602001908152602001600020546135779190614e6f565b601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546135c19190614cc4565b6135cb9190614f06565b601560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136159190614ea3565b601560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001600a546136679190614ea3565b601860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000601d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415801561373b5750601d60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600954115b15614106576000601b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000601d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054905080601460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546138239190614ea3565b9250508190555080601c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546138799190614ea3565b92505081905550601d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546001600a546138cf9190614ea3565b1115613a9857701d6329f1c35ca4bfabb9f5610000000000601a6000601d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054601a60006001600a5461394d9190614ea3565b8152602001908152602001600020546139669190614e6f565b601b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000601d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054613a009190614cc4565b613a0a9190614f06565b601560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a549190614ea3565b601560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000601b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000601d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020819055506000601d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000601e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461410457601e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600954111561403a576000601b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000601e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054905080601460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613ce59190614ea3565b9250508190555080601c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613d3b9190614ea3565b92505081905550601e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546001600a54613d919190614ea3565b1115613f5a57701d6329f1c35ca4bfabb9f5610000000000601a6000601e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054601a60006001600a54613e0f9190614ea3565b815260200190815260200160002054613e289190614e6f565b601b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000601e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054613ec29190614cc4565b613ecc9190614f06565b601560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613f169190614ea3565b601560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000601b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000601e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020819055506000601e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050614103565b601e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054601d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000601e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b505b50565b61418a8363a9059cbb60e01b8484604051602401614128929190614e46565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050614581565b505050565b614212846323b872dd60e01b8585856040516024016141b09392919061568a565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050614581565b50505050565b600060166000600954815260200190815260200160002054036143ac576006546007819055506000614e70614e206007546142539190614cc4565b61425d9190614f06565b9050806006819055508060166000600954815260200190815260200160002081905550600954600c8190555060065460176000600a548152602001908152602001600020546142ac9190614ea3565b60176000600c54815260200190815260200160002060008282546142d09190614ea3565b925050819055506000600854146143185760085460176000600c54815260200190815260200160002060008282546143089190614ea3565b9250508190555060006008819055505b6000600d541461435957600d5460176000600c54815260200190815260200160002060008282546143499190614e6f565b925050819055506000600d819055505b6009547f0666a61c1092f5b86c2cfe6ea1ad0d9a36032c4fb92d285b4e43f662d48f19b48260176000600c548152602001908152602001600020546040516143a29291906156c1565b60405180910390a2505b565b6000677fffffffffffffff8211156143c557600080fd5b604082901b9050919050565b60008082600f0b136143e257600080fd5b60008083600f0b905068010000000000000000811261440957604081901d90506040820191505b640100000000811261442357602081901d90506020820191505b62010000811261443b57601081901d90506010820191505b610100811261445257600881901d90506008820191505b6010811261446857600481901d90506004820191505b6004811261447e57600281901d90506002820191505b6002811261448d576001820191505b60006040808403901b9050600083607f0386600f0b901b9050600067800000000000000090505b60008113156144e8578182029150600060ff83901c905080607f0183901c92508082028401935050600181901d90506144b4565b5081945050505050919050565b600080604083600f0b85600f0b02901d90507fffffffffffffffffffffffffffffffff80000000000000000000000000000000600f0b811215801561454d57506f7fffffffffffffffffffffffffffffff600f0b8113155b61455657600080fd5b8091505092915050565b60008082600f0b121561457257600080fd5b604082600f0b901d9050919050565b60006145e3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166146499092919063ffffffff16565b90506000815114806146055750808060200190518101906146049190615716565b5b614644576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161463b906157b5565b60405180910390fd5b505050565b60606146588484600085614661565b90509392505050565b6060824710156146a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161469d90615847565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516146cf91906158cd565b60006040518083038185875af1925050503d806000811461470c576040519150601f19603f3d011682016040523d82523d6000602084013e614711565b606091505b50915091506147228783838761472e565b92505050949350505050565b6060831561479057600083510361478857614748856147a3565b614787576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161477e90615930565b60405180910390fd5b5b82905061479b565b61479a83836147c6565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000825111156147d95781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161480d91906159a5565b60405180910390fd5b6000819050919050565b61482981614816565b82525050565b60006020820190506148446000830184614820565b92915050565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6148848161484f565b811461488f57600080fd5b50565b6000813590506148a18161487b565b92915050565b6000602082840312156148bd576148bc61484a565b5b60006148cb84828501614892565b91505092915050565b60008115159050919050565b6148e9816148d4565b82525050565b600060208201905061490460008301846148e0565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061494f61494a6149458461490a565b61492a565b61490a565b9050919050565b600061496182614934565b9050919050565b600061497382614956565b9050919050565b61498381614968565b82525050565b600060208201905061499e600083018461497a565b92915050565b6149ad81614816565b81146149b857600080fd5b50565b6000813590506149ca816149a4565b92915050565b6000602082840312156149e6576149e561484a565b5b60006149f4848285016149bb565b91505092915050565b6000614a088261490a565b9050919050565b614a18816149fd565b8114614a2357600080fd5b50565b600081359050614a3581614a0f565b92915050565b600060208284031215614a5157614a5061484a565b5b6000614a5f84828501614a26565b91505092915050565b60008060408385031215614a7f57614a7e61484a565b5b6000614a8d85828601614a26565b9250506020614a9e858286016149bb565b9150509250929050565b614ab1816149fd565b82525050565b6000602082019050614acc6000830184614aa8565b92915050565b6000614add82614956565b9050919050565b614aed81614ad2565b82525050565b6000602082019050614b086000830184614ae4565b92915050565b6000614b1982614956565b9050919050565b614b2981614b0e565b82525050565b6000602082019050614b446000830184614b20565b92915050565b6000614b5582614956565b9050919050565b614b6581614b4a565b82525050565b6000602082019050614b806000830184614b5c565b92915050565b600082825260208201905092915050565b7f474458656e3a206d6178696d206261746368206e756d6265722069732031303060008201527f3030000000000000000000000000000000000000000000000000000000000000602082015250565b6000614bf3602283614b86565b9150614bfe82614b97565b604082019050919050565b60006020820190508181036000830152614c2281614be6565b9050919050565b7f474458656e3a206d696e206261746368206e756d626572206973203100000000600082015250565b6000614c5f601c83614b86565b9150614c6a82614c29565b602082019050919050565b60006020820190508181036000830152614c8e81614c52565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614ccf82614816565b9150614cda83614816565b9250828202614ce881614816565b91508282048414831517614cff57614cfe614c95565b5b5092915050565b600081519050614d15816149a4565b92915050565b600060208284031215614d3157614d3061484a565b5b6000614d3f84828501614d06565b91505092915050565b7f474458656e3a206e6f7420656e6f75676820746f6b656e7320666f722062757260008201527f6e00000000000000000000000000000000000000000000000000000000000000602082015250565b6000614da4602183614b86565b9150614daf82614d48565b604082019050919050565b60006020820190508181036000830152614dd381614d97565b9050919050565b7f474458656e3a2072656665727265722069732073656c66000000000000000000600082015250565b6000614e10601783614b86565b9150614e1b82614dda565b602082019050919050565b60006020820190508181036000830152614e3f81614e03565b9050919050565b6000604082019050614e5b6000830185614aa8565b614e686020830184614820565b9392505050565b6000614e7a82614816565b9150614e8583614816565b9250828203905081811115614e9d57614e9c614c95565b5b92915050565b6000614eae82614816565b9150614eb983614816565b9250828201905080821115614ed157614ed0614c95565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000614f1182614816565b9150614f1c83614816565b925082614f2c57614f2b614ed7565b5b828204905092915050565b7f474458656e3a2076616c7565206c657373207468616e2070726f746f636f6c2060008201527f6665650000000000000000000000000000000000000000000000000000000000602082015250565b6000614f93602383614b86565b9150614f9e82614f37565b604082019050919050565b60006020820190508181036000830152614fc281614f86565b9050919050565b6000604082019050614fde6000830185614820565b614feb6020830184614aa8565b9392505050565b7f474458656e3a20616d6f756e74206973207a65726f0000000000000000000000600082015250565b6000615028601583614b86565b915061503382614ff2565b602082019050919050565b600060208201905081810360008301526150578161501b565b9050919050565b7f474458656e3a206865616c7468206c657373207468616e203130300000000000600082015250565b6000615094601b83614b86565b915061509f8261505e565b602082019050919050565b600060208201905081810360008301526150c381615087565b9050919050565b7f474458656e3a20616d6f756e742067726561746572207468616e20776974686460008201527f72617761626c65207374616b6500000000000000000000000000000000000000602082015250565b6000615126602d83614b86565b9150615131826150ca565b604082019050919050565b6000602082019050818103600083015261515581615119565b9050919050565b7f474458656e3a206865616c74682067726561746572207468616e203130300000600082015250565b6000615192601e83614b86565b915061519d8261515c565b602082019050919050565b600060208201905081810360008301526151c181615185565b9050919050565b7f474458656e56696577733a206e6f74206f6c6420757365720000000000000000600082015250565b60006151fe601883614b86565b9150615209826151c8565b602082019050919050565b6000602082019050818103600083015261522d816151f1565b9050919050565b7f474458656e3a206163636f756e7420686173206e6f2072657761726473000000600082015250565b600061526a601d83614b86565b915061527582615234565b602082019050919050565b600060208201905081810360008301526152998161525d565b9050919050565b7f474458656e3a20696c6c6567616c2063616c6c6261636b2063616c6c65720000600082015250565b60006152d6601e83614b86565b91506152e1826152a0565b602082019050919050565b60006020820190508181036000830152615305816152c9565b9050919050565b60008160011c9050919050565b6000808291508390505b60018511156153635780860481111561533f5761533e614c95565b5b600185161561534e5780820291505b808102905061535c8561530c565b9450615323565b94509492505050565b60008261537c5760019050615438565b8161538a5760009050615438565b81600181146153a057600281146153aa576153d9565b6001915050615438565b60ff8411156153bc576153bb614c95565b5b8360020a9150848211156153d3576153d2614c95565b5b50615438565b5060208310610133831016604e8410600b841016171561540e5782820a90508381111561540957615408614c95565b5b615438565b61541b8484846001615319565b9250905081840481111561543257615431614c95565b5b81810290505b9392505050565b600061544a82614816565b915061545583614816565b92506154827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848461536c565b905092915050565b600061549582614816565b91506154a083614816565b9250826154b0576154af614ed7565b5b828206905092915050565b600060ff82169050919050565b60006154d382614816565b91506154de836154bb565b925061550b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848461536c565b905092915050565b61551c816154bb565b811461552757600080fd5b50565b60008151905061553981615513565b92915050565b6000602082840312156155555761555461484a565b5b60006155638482850161552a565b91505092915050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b60006155a2601f83614b86565b91506155ad8261556c565b602082019050919050565b600060208201905081810360008301526155d181615595565b9050919050565b600081905092915050565b50565b60006155f36000836155d8565b91506155fe826155e3565b600082019050919050565b6000615614826155e6565b9150819050919050565b7f474458656e3a206661696c656420746f2073656e6420616d6f756e7400000000600082015250565b6000615654601c83614b86565b915061565f8261561e565b602082019050919050565b6000602082019050818103600083015261568381615647565b9050919050565b600060608201905061569f6000830186614aa8565b6156ac6020830185614aa8565b6156b96040830184614820565b949350505050565b60006040820190506156d66000830185614820565b6156e36020830184614820565b9392505050565b6156f3816148d4565b81146156fe57600080fd5b50565b600081519050615710816156ea565b92915050565b60006020828403121561572c5761572b61484a565b5b600061573a84828501615701565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b600061579f602a83614b86565b91506157aa82615743565b604082019050919050565b600060208201905081810360008301526157ce81615792565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000615831602683614b86565b915061583c826157d5565b604082019050919050565b6000602082019050818103600083015261586081615824565b9050919050565b600081519050919050565b60005b83811015615890578082015181840152602081019050615875565b60008484015250505050565b60006158a782615867565b6158b181856155d8565b93506158c1818560208601615872565b80840191505092915050565b60006158d9828461589c565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b600061591a601d83614b86565b9150615925826158e4565b602082019050919050565b600060208201905081810360008301526159498161590d565b9050919050565b600081519050919050565b6000601f19601f8301169050919050565b600061597782615950565b6159818185614b86565b9350615991818560208601615872565b61599a8161595b565b840191505092915050565b600060208201905081810360008301526159bf818461596c565b90509291505056fea26469706673582212207f3f9045d6ba6ae54f9390eda5bc1334d873680aecd1252f1639cc4f436ad24164736f6c63430008110033