ETH Price: $3,429.20 (+4.45%)

Contract

0x9218B27598cDE5449128c27bA2BD924fb74D65F9
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Batch Claim And ...208705922024-10-01 12:17:3553 days ago1727785055IN
0x9218B275...fb74D65F9
0 ETH0.0240861118.04182004
Batch Claim And ...208096922024-09-23 0:25:5961 days ago1727051159IN
0x9218B275...fb74D65F9
0 ETH0.010250087.6
Batch Claim And ...207470702024-09-14 6:29:5970 days ago1726295399IN
0x9218B275...fb74D65F9
0 ETH0.00291391.62808841
Batch Claim And ...207284422024-09-11 16:04:1173 days ago1726070651IN
0x9218B275...fb74D65F9
0 ETH0.001105035.23050013
Batch Claim And ...207253562024-09-11 5:42:5973 days ago1726033379IN
0x9218B275...fb74D65F9
0 ETH0.000782621.85556513
Batch Claim And ...206694732024-09-03 10:32:1181 days ago1725359531IN
0x9218B275...fb74D65F9
0 ETH0.001236622.51624896
Batch Claim And ...206559322024-09-01 13:10:5983 days ago1725196259IN
0x9218B275...fb74D65F9
0 ETH0.002774890.59740291
Batch Claim And ...206559132024-09-01 13:07:1183 days ago1725196031IN
0x9218B275...fb74D65F9
0 ETH0.003183210.6893676
Batch Claim And ...206414852024-08-30 12:46:3585 days ago1725021995IN
0x9218B275...fb74D65F9
0 ETH0.000645031.19473935
Batch Claim And ...206244942024-08-28 3:46:3587 days ago1724816795IN
0x9218B275...fb74D65F9
0 ETH0.00158091.308767
Batch Claim And ...205499832024-08-17 17:58:4798 days ago1723917527IN
0x9218B275...fb74D65F9
0 ETH0.001065341.5
Batch Claim And ...205397632024-08-16 7:41:2399 days ago1723794083IN
0x9218B275...fb74D65F9
0 ETH0.007932521.37519787
Batch Claim And ...205092982024-08-12 1:37:11103 days ago1723426631IN
0x9218B275...fb74D65F9
0 ETH0.001104331.69005195
Batch Claim And ...204992452024-08-10 15:56:11105 days ago1723305371IN
0x9218B275...fb74D65F9
0 ETH0.010180471.78411352
Batch Claim And ...204955282024-08-10 3:29:23105 days ago1723260563IN
0x9218B275...fb74D65F9
0 ETH0.008262191.1054406
Batch Claim And ...204905882024-08-09 10:57:11106 days ago1723201031IN
0x9218B275...fb74D65F9
0 ETH0.002331582.10475113
Batch Claim And ...204151772024-07-29 22:21:23116 days ago1722291683IN
0x9218B275...fb74D65F9
0 ETH0.000800661.2
Batch Claim And ...203535402024-07-21 7:52:47125 days ago1721548367IN
0x9218B275...fb74D65F9
0 ETH0.001920742.51363469
Batch Claim And ...203530762024-07-21 6:19:47125 days ago1721542787IN
0x9218B275...fb74D65F9
0 ETH0.002373852.25863549
Batch Claim And ...203521262024-07-21 3:08:35125 days ago1721531315IN
0x9218B275...fb74D65F9
0 ETH0.01590012.76302989
Batch Claim And ...203331232024-07-18 11:31:35128 days ago1721302295IN
0x9218B275...fb74D65F9
0 ETH0.0280999210.42616753
Batch Claim And ...203160062024-07-16 2:12:59130 days ago1721095979IN
0x9218B275...fb74D65F9
0 ETH0.003745075.73038832
Batch Claim And ...203145092024-07-15 21:11:47130 days ago1721077907IN
0x9218B275...fb74D65F9
0 ETH0.0076392511.68908831
Batch Claim And ...203051872024-07-14 13:57:35132 days ago1720965455IN
0x9218B275...fb74D65F9
0 ETH0.000574232.13007042
Batch Claim And ...202827352024-07-11 10:42:11135 days ago1720694531IN
0x9218B275...fb74D65F9
0 ETH0.006701464.66932975
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
201730882024-06-26 3:11:11150 days ago1719371471
0x9218B275...fb74D65F9
 Contract Creation0 ETH
201559412024-06-23 17:40:23153 days ago1719164423
0x9218B275...fb74D65F9
 Contract Creation0 ETH
201537642024-06-23 10:22:47153 days ago1719138167
0x9218B275...fb74D65F9
 Contract Creation0 ETH
201462472024-06-22 9:07:23154 days ago1719047243
0x9218B275...fb74D65F9
 Contract Creation0 ETH
201459042024-06-22 7:58:35154 days ago1719043115
0x9218B275...fb74D65F9
 Contract Creation0 ETH
201207932024-06-18 19:41:23157 days ago1718739683
0x9218B275...fb74D65F9
 Contract Creation0 ETH
201173322024-06-18 8:02:35158 days ago1718697755
0x9218B275...fb74D65F9
 Contract Creation0 ETH
200535132024-06-09 9:56:35167 days ago1717926995
0x9218B275...fb74D65F9
 Contract Creation0 ETH
200533632024-06-09 9:26:23167 days ago1717925183
0x9218B275...fb74D65F9
 Contract Creation0 ETH
200520352024-06-09 4:58:59167 days ago1717909139
0x9218B275...fb74D65F9
 Contract Creation0 ETH
200515532024-06-09 3:22:35167 days ago1717903355
0x9218B275...fb74D65F9
 Contract Creation0 ETH
200512882024-06-09 2:28:47167 days ago1717900127
0x9218B275...fb74D65F9
 Contract Creation0 ETH
200026592024-06-02 7:31:23174 days ago1717313483
0x9218B275...fb74D65F9
 Contract Creation0 ETH
199957242024-06-01 8:17:59175 days ago1717229879
0x9218B275...fb74D65F9
 Contract Creation0 ETH
199947752024-06-01 5:07:23175 days ago1717218443
0x9218B275...fb74D65F9
 Contract Creation0 ETH
199878142024-05-31 5:45:47176 days ago1717134347
0x9218B275...fb74D65F9
 Contract Creation0 ETH
199523352024-05-26 6:43:23181 days ago1716705803
0x9218B275...fb74D65F9
 Contract Creation0 ETH
199523302024-05-26 6:42:23181 days ago1716705743
0x9218B275...fb74D65F9
 Contract Creation0 ETH
199523252024-05-26 6:41:23181 days ago1716705683
0x9218B275...fb74D65F9
 Contract Creation0 ETH
199523202024-05-26 6:40:23181 days ago1716705623
0x9218B275...fb74D65F9
 Contract Creation0 ETH
199523152024-05-26 6:39:23181 days ago1716705563
0x9218B275...fb74D65F9
 Contract Creation0 ETH
199523102024-05-26 6:38:23181 days ago1716705503
0x9218B275...fb74D65F9
 Contract Creation0 ETH
199523062024-05-26 6:37:35181 days ago1716705455
0x9218B275...fb74D65F9
 Contract Creation0 ETH
199519812024-05-26 5:31:59181 days ago1716701519
0x9218B275...fb74D65F9
 Contract Creation0 ETH
199519652024-05-26 5:28:47181 days ago1716701327
0x9218B275...fb74D65F9
 Contract Creation0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
XENWalletManager

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 14 : XENWalletManager.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/proxy/Clones.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./interfaces/IXENCrypto.sol";
import "./XENWallet.sol";
import "./XELCrypto.sol";

contract XENWalletManager is Ownable {
    using Clones for address;
    using SafeERC20 for IXENCrypto;

    event WalletsCreated(address indexed owner, uint256 amount, uint256 term);
    event TokensClaimed(
        address indexed owner,
        uint256 totalXEN,
        uint256 totalWallets,
        uint256 weightedTerm,
        uint256 weightedRank,
        uint256 weightedMaturity,
        uint256 totalXEL
    );
    event FeeReceiverChanged(address newReceiver);

    address public feeReceiver;
    address internal immutable implementation;
    address public immutable XENCrypto;
    uint256 public immutable deployTimestamp;
    XELCrypto public immutable xelCrypto;

    uint256 public totalWallets;
    uint256 public activeWallets;
    mapping(address => address[]) internal unmintedWallets;

    uint32[250] internal cumulativeWeeklyRewardMultiplier;

    uint256 internal constant SECONDS_IN_DAY = 3_600 * 24;
    uint256 internal constant SECONDS_IN_WEEK = SECONDS_IN_DAY * 7;
    uint256 internal constant MIN_TOKEN_MINT_TERM = 50;
    uint256 internal constant MIN_REWARD_LIMIT = SECONDS_IN_DAY * 2;
    uint256 internal constant MINT_FEE = 1_000; // 10%

    constructor(
        address xenCrypto,
        address walletImplementation,
        address feeAddress
    ) {
        require(
            xenCrypto != address(0x0) &&
                walletImplementation != address(0x0) &&
                feeAddress != address(0x0),
            "Invalid addresses"
        );
        XENCrypto = xenCrypto;
        implementation = walletImplementation;
        feeReceiver = feeAddress;
        xelCrypto = new XELCrypto(address(this));
        deployTimestamp = block.timestamp;

        populateRates();
    }

    // PUBLIC CONVENIENCE GETTERS

    /**
     * @dev generate a unique salt based on message sender and id value
     */
    function getSalt(uint256 id) public view returns (bytes32) {
        return keccak256(abi.encodePacked(msg.sender, id));
    }

    /**
     * @dev derive a deterministic address based on a salt value
     */
    function getDeterministicAddress(bytes32 salt)
        public
        view
        returns (address)
    {
        return implementation.predictDeterministicAddress(salt);
    }

    /**
     * @dev calculates elapsed number of weeks after contract deployment
     */
    function getElapsedWeeks() public view returns (uint256) {
        return (block.timestamp - deployTimestamp) / SECONDS_IN_WEEK;
    }

    /**
     * @dev returns wallet count associated with wallet owner
     */
    function getWalletCount(address owner) public view returns (uint256) {
        return unmintedWallets[owner].length;
    }

    /**
     * @dev returns wallet addresses based on pagination approach
     */
    function getWallets(
        address owner,
        uint256 startId,
        uint256 endId
    ) external view returns (address[] memory) {
        require(
            endId < unmintedWallets[owner].length,
            "endId exceeds wallet count"
        );
        uint256 size = endId - startId + 1;
        address[] memory wallets = new address[](size);
        for (uint256 id = startId; id <= endId; id++) {
            wallets[id - startId] = unmintedWallets[owner][id];
        }
        return wallets;
    }

    /**
     * @dev returns Mint objects for an array of addresses
     */
    function getUserInfos(address[] calldata owners)
        external
        view
        returns (IXENCrypto.MintInfo[] memory infos)
    {
        infos = new IXENCrypto.MintInfo[](owners.length);
        for (uint256 id = 0; id < owners.length; id++) {
            infos[id] = XENWallet(owners[id]).getUserMint();
        }
    }

    /**
     * @dev returns cumulative weekly reward multiplier at a specific week index
     */
    function getCumulativeWeeklyRewardMultiplier(int256 index)
        public
        view
        returns (uint256)
    {
        if (index < 0) return 0;
        if (index >= int256(cumulativeWeeklyRewardMultiplier.length)) {
            // Return the last multiplier
            return
                cumulativeWeeklyRewardMultiplier[
                    cumulativeWeeklyRewardMultiplier.length - 1
                ];
        }
        return cumulativeWeeklyRewardMultiplier[uint256(index)];
    }

    /**
     * @dev returns weekly reward multiplier
     */
    function getWeeklyRewardMultiplier(int256 index)
        external
        view
        returns (uint256)
    {
        return
            getCumulativeWeeklyRewardMultiplier(index) -
            getCumulativeWeeklyRewardMultiplier(index - 1);
    }

    /**
     * @dev calculates reward multiplier
     * @param finalWeek defines the the number of weeks that has elapsed
     * @param termWeeks defines the term limit in weeks
     */
    function getRewardMultiplier(uint256 finalWeek, uint256 termWeeks)
        public
        view
        returns (uint256)
    {
        return
            getCumulativeWeeklyRewardMultiplier(int256(finalWeek)) -
            getCumulativeWeeklyRewardMultiplier(
                int256(finalWeek) - int256(termWeeks) - 1
            );
    }

    /**
     * @dev calculates adjusted mint amount based on reward multiplier
     * @param originalAmount defines the original amount without adjustment
     * @param termDays defines the term limit in days
     */
    function getAdjustedMintAmount(uint256 originalAmount, uint256 termDays)
        internal
        view
        virtual
        returns (uint256)
    {
        uint256 elapsedWeeks = getElapsedWeeks();
        uint256 termWeeks = termDays / 7;
        return
            (originalAmount * getRewardMultiplier(elapsedWeeks, termWeeks)) /
            1_000_000_000;
    }

    // STATE CHANGING FUNCTIONS

    /**
     * @dev create wallet using a specific index and term
     */
    function createWallet(uint256 id, uint256 term) internal {
        bytes32 salt = getSalt(id);
        XENWallet clone = XENWallet(implementation.cloneDeterministic(salt));

        clone.initialize(XENCrypto, address(this));
        clone.claimRank(term);

        unmintedWallets[msg.sender].push(address(clone));
    }

    /**
     * @dev batch create wallets with a specific term
     * @param amount defines the number of wallets
     * @param term defines the term limit in seconds
     */
    function batchCreateWallets(uint256 amount, uint256 term) external {
        require(amount >= 1, "More than one wallet");
        require(term >= MIN_TOKEN_MINT_TERM, "Too short term");

        uint256 existing = unmintedWallets[msg.sender].length;
        for (uint256 id = 0; id < amount; id++) {
            createWallet(id + existing, term);
        }

        totalWallets += amount;
        activeWallets += amount;

        emit WalletsCreated(msg.sender, amount, term);
    }

    /**
     * @dev claims rewards and sends them to the wallet owner
     */
    function batchClaimAndTransferMintReward(uint256 startId, uint256 endId)
        external
    {
        require(endId >= startId, "Forward ordering");

        uint256 claimedTotal = 0;
        uint256 claimedWallets = 0;

        uint256 weightedTerm = 0;
        uint256 weightedRank = 0;
        uint256 weightedMaturity = 0;

        for (uint256 id = startId; id <= endId; id++) {
            address proxy = unmintedWallets[msg.sender][id];
            IXENCrypto.MintInfo memory info = XENWallet(proxy).getUserMint();
            uint256 claimed = XENWallet(proxy).claimAndTransferMintReward(
                msg.sender
            );

            claimedTotal += claimed;
            claimedWallets += 1;

            weightedTerm += (info.term * claimed);
            weightedRank += (info.rank * claimed);
            weightedMaturity += (info.maturityTs * claimed);

            unmintedWallets[msg.sender][id] = address(0x0);
        }

        if (claimedTotal > 0) {
            activeWallets -= claimedWallets;

            weightedTerm = weightedTerm / claimedTotal;
            weightedRank = weightedRank / claimedTotal;
            weightedMaturity = weightedMaturity / claimedTotal;

            uint256 toBeMinted = getAdjustedMintAmount(
                claimedTotal,
                weightedTerm
            );
            uint256 fee = (toBeMinted * MINT_FEE) / 10_000; // reduce minting fee
            xelCrypto.mint(msg.sender, toBeMinted - fee);
            xelCrypto.mint(feeReceiver, fee);

            emit TokensClaimed(
                msg.sender,
                claimedTotal,
                claimedWallets,
                weightedTerm,
                weightedRank,
                weightedMaturity,
                toBeMinted - fee
            );
        }
    }

    /**
     * @dev change fee receiver address
     */
    function changeFeeReceiver(address newReceiver) external onlyOwner {
        require(newReceiver != address(0x0), "Invalid address");
        feeReceiver = newReceiver;

        emit FeeReceiverChanged(newReceiver);
    }

    function populateRates() internal virtual {
        /*
        Precalculated values for the formula:
        // integrate 0.10000026975 * 0.95^x from 0 to index
        // Calculate 5% weekly decline and compound rewards
        let current = precisionMultiplier * 0.10000026975;
        let cumulative = current;
        for (let i = 0; i < elapsedWeeks; i++) {
            current = (current * 95) / 100;
            cumulative += current;
        }
        return cumulative;
        */
        cumulativeWeeklyRewardMultiplier[0] = 100000269;
        cumulativeWeeklyRewardMultiplier[1] = 195000526;
        cumulativeWeeklyRewardMultiplier[2] = 285250769;
        cumulativeWeeklyRewardMultiplier[3] = 370988500;
        cumulativeWeeklyRewardMultiplier[4] = 452439345;
        cumulativeWeeklyRewardMultiplier[5] = 529817647;
        cumulativeWeeklyRewardMultiplier[6] = 603327035;
        cumulativeWeeklyRewardMultiplier[7] = 673160953;
        cumulativeWeeklyRewardMultiplier[8] = 739503175;
        cumulativeWeeklyRewardMultiplier[9] = 802528286;
        cumulativeWeeklyRewardMultiplier[10] = 862402141;
        cumulativeWeeklyRewardMultiplier[11] = 919282304;
        cumulativeWeeklyRewardMultiplier[12] = 973318458;
        cumulativeWeeklyRewardMultiplier[13] = 1024652805;
        cumulativeWeeklyRewardMultiplier[14] = 1073420435;
        cumulativeWeeklyRewardMultiplier[15] = 1119749683;
        cumulativeWeeklyRewardMultiplier[16] = 1163762468;
        cumulativeWeeklyRewardMultiplier[17] = 1205574615;
        cumulativeWeeklyRewardMultiplier[18] = 1245296154;
        cumulativeWeeklyRewardMultiplier[19] = 1283031616;
        cumulativeWeeklyRewardMultiplier[20] = 1318880305;
        cumulativeWeeklyRewardMultiplier[21] = 1352936559;
        cumulativeWeeklyRewardMultiplier[22] = 1385290001;
        cumulativeWeeklyRewardMultiplier[23] = 1416025771;
        cumulativeWeeklyRewardMultiplier[24] = 1445224752;
        cumulativeWeeklyRewardMultiplier[25] = 1472963784;
        cumulativeWeeklyRewardMultiplier[26] = 1499315864;
        cumulativeWeeklyRewardMultiplier[27] = 1524350341;
        cumulativeWeeklyRewardMultiplier[28] = 1548133094;
        cumulativeWeeklyRewardMultiplier[29] = 1570726709;
        cumulativeWeeklyRewardMultiplier[30] = 1592190643;
        cumulativeWeeklyRewardMultiplier[31] = 1612581381;
        cumulativeWeeklyRewardMultiplier[32] = 1631952581;
        cumulativeWeeklyRewardMultiplier[33] = 1650355222;
        cumulativeWeeklyRewardMultiplier[34] = 1667837731;
        cumulativeWeeklyRewardMultiplier[35] = 1684446114;
        cumulativeWeeklyRewardMultiplier[36] = 1700224078;
        cumulativeWeeklyRewardMultiplier[37] = 1715213144;
        cumulativeWeeklyRewardMultiplier[38] = 1729452756;
        cumulativeWeeklyRewardMultiplier[39] = 1742980388;
        cumulativeWeeklyRewardMultiplier[40] = 1755831638;
        cumulativeWeeklyRewardMultiplier[41] = 1768040326;
        cumulativeWeeklyRewardMultiplier[42] = 1779638580;
        cumulativeWeeklyRewardMultiplier[43] = 1790656920;
        cumulativeWeeklyRewardMultiplier[44] = 1801124344;
        cumulativeWeeklyRewardMultiplier[45] = 1811068397;
        cumulativeWeeklyRewardMultiplier[46] = 1820515246;
        cumulativeWeeklyRewardMultiplier[47] = 1829489754;
        cumulativeWeeklyRewardMultiplier[48] = 1838015536;
        cumulativeWeeklyRewardMultiplier[49] = 1846115029;
        cumulativeWeeklyRewardMultiplier[50] = 1853809547;
        cumulativeWeeklyRewardMultiplier[51] = 1861119339;
        cumulativeWeeklyRewardMultiplier[52] = 1868063642;
        cumulativeWeeklyRewardMultiplier[53] = 1874660730;
        cumulativeWeeklyRewardMultiplier[54] = 1880927963;
        cumulativeWeeklyRewardMultiplier[55] = 1886881835;
        cumulativeWeeklyRewardMultiplier[56] = 1892538013;
        cumulativeWeeklyRewardMultiplier[57] = 1897911382;
        cumulativeWeeklyRewardMultiplier[58] = 1903016082;
        cumulativeWeeklyRewardMultiplier[59] = 1907865548;
        cumulativeWeeklyRewardMultiplier[60] = 1912472540;
        cumulativeWeeklyRewardMultiplier[61] = 1916849183;
        cumulativeWeeklyRewardMultiplier[62] = 1921006994;
        cumulativeWeeklyRewardMultiplier[63] = 1924956914;
        cumulativeWeeklyRewardMultiplier[64] = 1928709338;
        cumulativeWeeklyRewardMultiplier[65] = 1932274141;
        cumulativeWeeklyRewardMultiplier[66] = 1935660703;
        cumulativeWeeklyRewardMultiplier[67] = 1938877938;
        cumulativeWeeklyRewardMultiplier[68] = 1941934311;
        cumulativeWeeklyRewardMultiplier[69] = 1944837865;
        cumulativeWeeklyRewardMultiplier[70] = 1947596241;
        cumulativeWeeklyRewardMultiplier[71] = 1950216699;
        cumulativeWeeklyRewardMultiplier[72] = 1952706134;
        cumulativeWeeklyRewardMultiplier[73] = 1955071097;
        cumulativeWeeklyRewardMultiplier[74] = 1957317812;
        cumulativeWeeklyRewardMultiplier[75] = 1959452191;
        cumulativeWeeklyRewardMultiplier[76] = 1961479851;
        cumulativeWeeklyRewardMultiplier[77] = 1963406128;
        cumulativeWeeklyRewardMultiplier[78] = 1965236091;
        cumulativeWeeklyRewardMultiplier[79] = 1966974557;
        cumulativeWeeklyRewardMultiplier[80] = 1968626099;
        cumulativeWeeklyRewardMultiplier[81] = 1970195063;
        cumulativeWeeklyRewardMultiplier[82] = 1971685580;
        cumulativeWeeklyRewardMultiplier[83] = 1973101571;
        cumulativeWeeklyRewardMultiplier[84] = 1974446762;
        cumulativeWeeklyRewardMultiplier[85] = 1975724693;
        cumulativeWeeklyRewardMultiplier[86] = 1976938728;
        cumulativeWeeklyRewardMultiplier[87] = 1978092062;
        cumulativeWeeklyRewardMultiplier[88] = 1979187728;
        cumulativeWeeklyRewardMultiplier[89] = 1980228612;
        cumulativeWeeklyRewardMultiplier[90] = 1981217451;
        cumulativeWeeklyRewardMultiplier[91] = 1982156848;
        cumulativeWeeklyRewardMultiplier[92] = 1983049275;
        cumulativeWeeklyRewardMultiplier[93] = 1983897081;
        cumulativeWeeklyRewardMultiplier[94] = 1984702497;
        cumulativeWeeklyRewardMultiplier[95] = 1985467642;
        cumulativeWeeklyRewardMultiplier[96] = 1986194529;
        cumulativeWeeklyRewardMultiplier[97] = 1986885073;
        cumulativeWeeklyRewardMultiplier[98] = 1987541089;
        cumulativeWeeklyRewardMultiplier[99] = 1988164304;
        cumulativeWeeklyRewardMultiplier[100] = 1988756359;
        cumulativeWeeklyRewardMultiplier[101] = 1989318810;
        cumulativeWeeklyRewardMultiplier[102] = 1989853140;
        cumulativeWeeklyRewardMultiplier[103] = 1990360752;
        cumulativeWeeklyRewardMultiplier[104] = 1990842984;
        cumulativeWeeklyRewardMultiplier[105] = 1991301105;
        cumulativeWeeklyRewardMultiplier[106] = 1991736319;
        cumulativeWeeklyRewardMultiplier[107] = 1992149773;
        cumulativeWeeklyRewardMultiplier[108] = 1992542554;
        cumulativeWeeklyRewardMultiplier[109] = 1992915696;
        cumulativeWeeklyRewardMultiplier[110] = 1993270181;
        cumulativeWeeklyRewardMultiplier[111] = 1993606942;
        cumulativeWeeklyRewardMultiplier[112] = 1993926864;
        cumulativeWeeklyRewardMultiplier[113] = 1994230791;
        cumulativeWeeklyRewardMultiplier[114] = 1994519521;
        cumulativeWeeklyRewardMultiplier[115] = 1994793815;
        cumulativeWeeklyRewardMultiplier[116] = 1995054394;
        cumulativeWeeklyRewardMultiplier[117] = 1995301944;
        cumulativeWeeklyRewardMultiplier[118] = 1995537116;
        cumulativeWeeklyRewardMultiplier[119] = 1995760530;
        cumulativeWeeklyRewardMultiplier[120] = 1995972774;
        cumulativeWeeklyRewardMultiplier[121] = 1996174405;
        cumulativeWeeklyRewardMultiplier[122] = 1996365954;
        cumulativeWeeklyRewardMultiplier[123] = 1996547926;
        cumulativeWeeklyRewardMultiplier[124] = 1996720799;
        cumulativeWeeklyRewardMultiplier[125] = 1996885029;
        cumulativeWeeklyRewardMultiplier[126] = 1997041048;
        cumulativeWeeklyRewardMultiplier[127] = 1997189265;
        cumulativeWeeklyRewardMultiplier[128] = 1997330071;
        cumulativeWeeklyRewardMultiplier[129] = 1997463837;
        cumulativeWeeklyRewardMultiplier[130] = 1997590915;
        cumulativeWeeklyRewardMultiplier[131] = 1997711639;
        cumulativeWeeklyRewardMultiplier[132] = 1997826327;
        cumulativeWeeklyRewardMultiplier[133] = 1997935280;
        cumulativeWeeklyRewardMultiplier[134] = 1998038786;
        cumulativeWeeklyRewardMultiplier[135] = 1998137117;
        cumulativeWeeklyRewardMultiplier[136] = 1998230530;
        cumulativeWeeklyRewardMultiplier[137] = 1998319274;
        cumulativeWeeklyRewardMultiplier[138] = 1998403580;
        cumulativeWeeklyRewardMultiplier[139] = 1998483670;
        cumulativeWeeklyRewardMultiplier[140] = 1998559757;
        cumulativeWeeklyRewardMultiplier[141] = 1998632039;
        cumulativeWeeklyRewardMultiplier[142] = 1998700706;
        cumulativeWeeklyRewardMultiplier[143] = 1998765941;
        cumulativeWeeklyRewardMultiplier[144] = 1998827913;
        cumulativeWeeklyRewardMultiplier[145] = 1998886787;
        cumulativeWeeklyRewardMultiplier[146] = 1998942718;
        cumulativeWeeklyRewardMultiplier[147] = 1998995852;
        cumulativeWeeklyRewardMultiplier[148] = 1999046329;
        cumulativeWeeklyRewardMultiplier[149] = 1999094282;
        cumulativeWeeklyRewardMultiplier[150] = 1999139838;
        cumulativeWeeklyRewardMultiplier[151] = 1999183116;
        cumulativeWeeklyRewardMultiplier[152] = 1999224230;
        cumulativeWeeklyRewardMultiplier[153] = 1999263288;
        cumulativeWeeklyRewardMultiplier[154] = 1999300393;
        cumulativeWeeklyRewardMultiplier[155] = 1999335643;
        cumulativeWeeklyRewardMultiplier[156] = 1999369131;
        cumulativeWeeklyRewardMultiplier[157] = 1999400944;
        cumulativeWeeklyRewardMultiplier[158] = 1999431166;
        cumulativeWeeklyRewardMultiplier[159] = 1999459878;
        cumulativeWeeklyRewardMultiplier[160] = 1999487154;
        cumulativeWeeklyRewardMultiplier[161] = 1999513066;
        cumulativeWeeklyRewardMultiplier[162] = 1999537682;
        cumulativeWeeklyRewardMultiplier[163] = 1999561068;
        cumulativeWeeklyRewardMultiplier[164] = 1999583284;
        cumulativeWeeklyRewardMultiplier[165] = 1999604390;
        cumulativeWeeklyRewardMultiplier[166] = 1999624440;
        cumulativeWeeklyRewardMultiplier[167] = 1999643488;
        cumulativeWeeklyRewardMultiplier[168] = 1999661583;
        cumulativeWeeklyRewardMultiplier[169] = 1999678774;
        cumulativeWeeklyRewardMultiplier[170] = 1999695105;
        cumulativeWeeklyRewardMultiplier[171] = 1999710619;
        cumulativeWeeklyRewardMultiplier[172] = 1999725358;
        cumulativeWeeklyRewardMultiplier[173] = 1999739360;
        cumulativeWeeklyRewardMultiplier[174] = 1999752661;
        cumulativeWeeklyRewardMultiplier[175] = 1999765298;
        cumulativeWeeklyRewardMultiplier[176] = 1999777303;
        cumulativeWeeklyRewardMultiplier[177] = 1999788707;
        cumulativeWeeklyRewardMultiplier[178] = 1999799542;
        cumulativeWeeklyRewardMultiplier[179] = 1999809834;
        cumulativeWeeklyRewardMultiplier[180] = 1999819612;
        cumulativeWeeklyRewardMultiplier[181] = 1999828902;
        cumulativeWeeklyRewardMultiplier[182] = 1999837726;
        cumulativeWeeklyRewardMultiplier[183] = 1999846110;
        cumulativeWeeklyRewardMultiplier[184] = 1999854074;
        cumulativeWeeklyRewardMultiplier[185] = 1999861640;
        cumulativeWeeklyRewardMultiplier[186] = 1999868828;
        cumulativeWeeklyRewardMultiplier[187] = 1999875656;
        cumulativeWeeklyRewardMultiplier[188] = 1999882143;
        cumulativeWeeklyRewardMultiplier[189] = 1999888305;
        cumulativeWeeklyRewardMultiplier[190] = 1999894160;
        cumulativeWeeklyRewardMultiplier[191] = 1999899722;
        cumulativeWeeklyRewardMultiplier[192] = 1999905005;
        cumulativeWeeklyRewardMultiplier[193] = 1999910025;
        cumulativeWeeklyRewardMultiplier[194] = 1999914793;
        cumulativeWeeklyRewardMultiplier[195] = 1999919323;
        cumulativeWeeklyRewardMultiplier[196] = 1999923627;
        cumulativeWeeklyRewardMultiplier[197] = 1999927715;
        cumulativeWeeklyRewardMultiplier[198] = 1999931599;
        cumulativeWeeklyRewardMultiplier[199] = 1999935289;
        cumulativeWeeklyRewardMultiplier[200] = 1999938794;
        cumulativeWeeklyRewardMultiplier[201] = 1999942124;
        cumulativeWeeklyRewardMultiplier[202] = 1999945288;
        cumulativeWeeklyRewardMultiplier[203] = 1999948293;
        cumulativeWeeklyRewardMultiplier[204] = 1999951148;
        cumulativeWeeklyRewardMultiplier[205] = 1999953860;
        cumulativeWeeklyRewardMultiplier[206] = 1999956437;
        cumulativeWeeklyRewardMultiplier[207] = 1999958885;
        cumulativeWeeklyRewardMultiplier[208] = 1999961211;
        cumulativeWeeklyRewardMultiplier[209] = 1999963420;
        cumulativeWeeklyRewardMultiplier[210] = 1999965518;
        cumulativeWeeklyRewardMultiplier[211] = 1999967512;
        cumulativeWeeklyRewardMultiplier[212] = 1999969406;
        cumulativeWeeklyRewardMultiplier[213] = 1999971206;
        cumulativeWeeklyRewardMultiplier[214] = 1999972915;
        cumulativeWeeklyRewardMultiplier[215] = 1999974539;
        cumulativeWeeklyRewardMultiplier[216] = 1999976082;
        cumulativeWeeklyRewardMultiplier[217] = 1999977548;
        cumulativeWeeklyRewardMultiplier[218] = 1999978940;
        cumulativeWeeklyRewardMultiplier[219] = 1999980263;
        cumulativeWeeklyRewardMultiplier[220] = 1999981519;
        cumulativeWeeklyRewardMultiplier[221] = 1999982713;
        cumulativeWeeklyRewardMultiplier[222] = 1999983847;
        cumulativeWeeklyRewardMultiplier[223] = 1999984924;
        cumulativeWeeklyRewardMultiplier[224] = 1999985948;
        cumulativeWeeklyRewardMultiplier[225] = 1999986920;
        cumulativeWeeklyRewardMultiplier[226] = 1999987844;
        cumulativeWeeklyRewardMultiplier[227] = 1999988722;
        cumulativeWeeklyRewardMultiplier[228] = 1999989555;
        cumulativeWeeklyRewardMultiplier[229] = 1999990347;
        cumulativeWeeklyRewardMultiplier[230] = 1999991100;
        cumulativeWeeklyRewardMultiplier[231] = 1999991814;
        cumulativeWeeklyRewardMultiplier[232] = 1999992493;
        cumulativeWeeklyRewardMultiplier[233] = 1999993138;
        cumulativeWeeklyRewardMultiplier[234] = 1999993751;
        cumulativeWeeklyRewardMultiplier[235] = 1999994333;
        cumulativeWeeklyRewardMultiplier[236] = 1999994886;
        cumulativeWeeklyRewardMultiplier[237] = 1999995412;
        cumulativeWeeklyRewardMultiplier[238] = 1999995911;
        cumulativeWeeklyRewardMultiplier[239] = 1999996385;
        cumulativeWeeklyRewardMultiplier[240] = 1999996836;
        cumulativeWeeklyRewardMultiplier[241] = 1999997264;
        cumulativeWeeklyRewardMultiplier[242] = 1999997670;
        cumulativeWeeklyRewardMultiplier[243] = 1999998056;
        cumulativeWeeklyRewardMultiplier[244] = 1999998423;
        cumulativeWeeklyRewardMultiplier[245] = 1999998772;
        cumulativeWeeklyRewardMultiplier[246] = 1999999103;
        cumulativeWeeklyRewardMultiplier[247] = 1999999417;
        cumulativeWeeklyRewardMultiplier[248] = 1999999716;
        cumulativeWeeklyRewardMultiplier[249] = 2000000000;
    }
}

File 2 of 14 : XENWallet.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

import "@openzeppelin/contracts/proxy/Clones.sol";
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./interfaces/IXENCrypto.sol";

contract XENWallet is Initializable {
    IXENCrypto public XENCrypto;
    address public manager;

    function initialize(address xenAddress, address managerAddress)
        public
        initializer
    {
        XENCrypto = IXENCrypto(xenAddress);
        manager = managerAddress;
    }

    function getUserMint() external view returns (IXENCrypto.MintInfo memory) {
        return XENCrypto.getUserMint();
    }

    // Claim ranks
    function claimRank(uint256 _term) public {
        require(msg.sender == manager, "No access");

        XENCrypto.claimRank(_term);
    }

    // Claim mint reward
    function claimAndTransferMintReward(address target)
        external
        returns (uint256 reward)
    {
        require(msg.sender == manager, "No access");

        uint256 balanceBefore = XENCrypto.balanceOf(target);
        XENCrypto.claimMintRewardAndShare(target, 100);
        reward = XENCrypto.balanceOf(target) - balanceBefore;
    }
}

File 3 of 14 : XELCrypto.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

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

contract XELCrypto is ERC20 {
    address public minter;

    constructor(address _minter) ERC20("XEL Crypto", "XEL") {
        minter = _minter;
    }

    function mint(address account, uint256 amount) external {
        require(msg.sender == minter, "No access");
        _mint(account, amount);
    }
}

File 4 of 14 : IXENCrypto.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

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

abstract contract IXENCrypto is IERC20 {
    struct MintInfo {
        address user;
        uint256 term;
        uint256 maturityTs;
        uint256 rank;
        uint256 amplifier;
        uint256 eaaRate;
    }

    mapping(address => MintInfo) public userMints;

    function claimRank(uint256 term) external virtual;

    function claimMintReward() external virtual;

    function claimMintRewardAndShare(address other, uint256 pct)
        external
        virtual;

    function getUserMint() external view virtual returns (MintInfo memory);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

File 6 of 14 : Clones.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/Clones.sol)

pragma solidity ^0.8.0;

/**
 * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for
 * deploying minimal proxy contracts, also known as "clones".
 *
 * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies
 * > a minimal bytecode implementation that delegates all calls to a known, fixed address.
 *
 * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
 * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
 * deterministic method.
 *
 * _Available since v3.4._
 */
library Clones {
    /**
     * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
     *
     * This function uses the create opcode, which should never revert.
     */
    function clone(address implementation) internal returns (address instance) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            mstore(add(ptr, 0x14), shl(0x60, implementation))
            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
            instance := create(0, ptr, 0x37)
        }
        require(instance != address(0), "ERC1167: create failed");
    }

    /**
     * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
     *
     * This function uses the create2 opcode and a `salt` to deterministically deploy
     * the clone. Using the same `implementation` and `salt` multiple time will revert, since
     * the clones cannot be deployed twice at the same address.
     */
    function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            mstore(add(ptr, 0x14), shl(0x60, implementation))
            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
            instance := create2(0, ptr, 0x37, salt)
        }
        require(instance != address(0), "ERC1167: create2 failed");
    }

    /**
     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
     */
    function predictDeterministicAddress(
        address implementation,
        bytes32 salt,
        address deployer
    ) internal pure returns (address predicted) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            mstore(add(ptr, 0x14), shl(0x60, implementation))
            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000)
            mstore(add(ptr, 0x38), shl(0x60, deployer))
            mstore(add(ptr, 0x4c), salt)
            mstore(add(ptr, 0x6c), keccak256(ptr, 0x37))
            predicted := keccak256(add(ptr, 0x37), 0x55)
        }
    }

    /**
     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
     */
    function predictDeterministicAddress(address implementation, bytes32 salt)
        internal
        view
        returns (address predicted)
    {
        return predictDeterministicAddress(implementation, salt, address(this));
    }
}

File 7 of 14 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * 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}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * 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 value {ERC20} uses, unless this function is
     * 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;
        }
        _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;
        _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;
        }
        _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 {}
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.2;

import "../../utils/Address.sol";

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

File 13 of 14 : 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);
}

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

pragma solidity ^0.8.0;

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"xenCrypto","type":"address"},{"internalType":"address","name":"walletImplementation","type":"address"},{"internalType":"address","name":"feeAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newReceiver","type":"address"}],"name":"FeeReceiverChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalXEN","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalWallets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"weightedTerm","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"weightedRank","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"weightedMaturity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalXEL","type":"uint256"}],"name":"TokensClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"term","type":"uint256"}],"name":"WalletsCreated","type":"event"},{"inputs":[],"name":"XENCrypto","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"activeWallets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"startId","type":"uint256"},{"internalType":"uint256","name":"endId","type":"uint256"}],"name":"batchClaimAndTransferMintReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"term","type":"uint256"}],"name":"batchCreateWallets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newReceiver","type":"address"}],"name":"changeFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deployTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256","name":"index","type":"int256"}],"name":"getCumulativeWeeklyRewardMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"salt","type":"bytes32"}],"name":"getDeterministicAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getElapsedWeeks","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"finalWeek","type":"uint256"},{"internalType":"uint256","name":"termWeeks","type":"uint256"}],"name":"getRewardMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getSalt","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"owners","type":"address[]"}],"name":"getUserInfos","outputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"term","type":"uint256"},{"internalType":"uint256","name":"maturityTs","type":"uint256"},{"internalType":"uint256","name":"rank","type":"uint256"},{"internalType":"uint256","name":"amplifier","type":"uint256"},{"internalType":"uint256","name":"eaaRate","type":"uint256"}],"internalType":"struct IXENCrypto.MintInfo[]","name":"infos","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"getWalletCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"startId","type":"uint256"},{"internalType":"uint256","name":"endId","type":"uint256"}],"name":"getWallets","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256","name":"index","type":"int256"}],"name":"getWeeklyRewardMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalWallets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"xelCrypto","outputs":[{"internalType":"contract XELCrypto","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

6101006040523480156200001257600080fd5b506040516200284f3803806200284f83398101604081905262000035916200062e565b6200004033620005b3565b6001600160a01b038316158015906200006157506001600160a01b03821615155b80156200007657506001600160a01b03811615155b620000bb5760405162461bcd60e51b8152602060048201526011602482015270496e76616c69642061646472657373657360781b604482015260640160405180910390fd5b6001600160a01b0383811660a052828116608052600180546001600160a01b0319169183169190911790556040513090620000f69062000603565b6001600160a01b039091168152602001604051809103906000f08015801562000123573d6000803e3d6000fd5b506001600160a01b031660e0524260c0527f281f9ef923f60a3b1f94602f1af7ad31161cd5d4110094d10b9f78ce05f5e20d6005557f42be06333ffb18933d12f6053a03a93a36cb22803367365d2fd59c1e2c13ec476006557f5466d6ab5291d91150a42c6f4e9c84314c7982404a39b61a47db9bd7455d9b246007557f601e0a055ee6e6b35d9f63355c46a2e65adbbd85595dbe9857cba4c8562461306008557f67e3c52467155ad4663c135865575c4e64669ba263692f23625e6c1661459ec56009557f6d0bcc5a6c82dbae6bf2b5ed6b5af9f86abb41986a1321346962278668a7dd56600a557f7077882b701caedb6fbd0d7a6f58639a6eee6d6b6e7ee38b6e097ad56d8de430600b557f72bc82f272803d927240cc1f71fe03dc71b7b7cc716db892711fd45670cdd69d600c557f743df1fb7415f5d173ebdee973bf90e77390edf2735fd69f732c29dd72f5c4da600d557f753da65d75231f7b7507333074e9ceab74cade1f74aa4cb4748804797463ee56600e557f75e74a1e75d5b0e875c32a9575afaaaa759b2403758588cc756eca777556d9b3600f557f7657d4fa764c2821763fddf97632ee3b762550307616faab7607e40475f802106010557f76a27eb0769abfd47692989a768a03877680fad076777861766d75d17662ec616011557f76d4071e76cee3a576c97af076c3c95a76bdcb0d76b77bff76b0d7f176a9da686012557f76f4e39276f17adc76ede43876ea1d3a76e6235776e1f3e176dd8c0776d8e8d06013557f770ab09177086d9877060c2577038a9f7700e75676fe208276fb344576f820a66014557f7719271d7717a702771612b0771469177712a9177710d183770ee11d770cd6976015557f7722bf757721c0a27720b467771f9a0d771e70d6771d37fc771beeaa771a94026016557f77291d0c772873fe7727c20a772706b97726418c772571fe772497837723b1896017557f772d5626772ce5fe772c6ff0772bf3ab772b70db772ae729772a56387729bda66018557f77302360772fd8f8772f8aa6772f3834772ee16c772e8612772e25ea772dc0b26019557f7731ff327731cdd5773199e07731632e7731299b7730ed017730ad3677306a0f601a557f77333ade77331a1e7732f7a67732d35c7732ad2a773284f677325aa377322e17601b557f77340c4a7733f6907733dfb17733c79f7733ae487733939c77337788773359fa601c557f77349739773488cf773479a3773469ab773458db7734472977343489773420ed601d557f7734f3657734e9d57734dfc47734d52c7734ca057734be487734b1ec7734a4ea601e557f7735308b77352a337735238677351c7e7735151877350d4e7735051c7734fc7b601f557f7735591c773554e77735507977354bcf773546e7773541bc77353c4c773536926020557f773574067735713c77356e4b77356b33773567f277356484773560e877355d1c6021557f773585e177358407773582147735800677357ddd77357b9777357932773576ad6022557f773591b97735907f77358f3477358dd777358c6877358ae677358950773587a4602355602480546001600160401b0319166777359400773592e417905550505062000678565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610c108062001c3f83390190565b80516001600160a01b03811681146200062957600080fd5b919050565b6000806000606084860312156200064457600080fd5b6200064f8462000611565b92506200065f6020850162000611565b91506200066f6040850162000611565b90509250925092565b60805160a05160c05160e05161156a620006d5600039600081816101ce01528181610ca50152610d5a0152600081816101f501526104df0152600081816101670152610f2d01526000818161075e0152610ef0015261156a6000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c80638da5cb5b116100b8578063b3f006741161007c578063b3f00674146102b9578063dcf53f5d146102cc578063e971ea46146102ec578063ef5c7271146102ff578063f2fde38b14610312578063f3b611f01461032557600080fd5b80638da5cb5b1461026657806390ad85ce14610277578063977d2c451461028a578063a1add21d14610293578063a58dcc95146102a657600080fd5b8063607ad0d7116100ff578063607ad0d7146101f0578063715018a6146102175780637536721e146102215780637c08b9641461022a578063878023d41461023d57600080fd5b80632afbefd61461013c5780632d3af11214610162578063363ec22c146101a15780634ac2d63b146101c15780634c3f31a2146101c9575b600080fd5b61014f61014a366004611186565b610338565b6040519081526020015b60405180910390f35b6101897f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610159565b6101b46101af3660046111a8565b61036f565b604051610159919061121d565b61014f6104ca565b6101897f000000000000000000000000000000000000000000000000000000000000000081565b61014f7f000000000000000000000000000000000000000000000000000000000000000081565b61021f610513565b005b61014f60035481565b61021f6102383660046112b3565b610527565b61014f61024b3660046112b3565b6001600160a01b031660009081526004602052604090205490565b6000546001600160a01b0316610189565b61014f6102853660046112d7565b6105d0565b61014f60025481565b61021f6102a1366004611186565b610615565b6101896102b43660046112d7565b61074f565b600154610189906001600160a01b031681565b6102df6102da3660046112f0565b610784565b6040516101599190611325565b61014f6102fa3660046112d7565b6108e5565b61014f61030d3660046112d7565b610953565b61021f6103203660046112b3565b610976565b61021f610333366004611186565b6109ef565b600061035360016103498486611388565b6102fa9190611388565b61035c846108e5565b61036691906113c7565b90505b92915050565b60608167ffffffffffffffff81111561038a5761038a6113de565b6040519080825280602002602001820160405280156103fd57816020015b6103ea6040518060c0016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001906001900390816103a85790505b50905060005b828110156104c35783838281811061041d5761041d6113f4565b905060200201602081019061043291906112b3565b6001600160a01b0316637010d7a16040518163ffffffff1660e01b815260040160c060405180830381865afa15801561046f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610493919061141a565b8282815181106104a5576104a56113f4565b602002602001018190525080806104bb906114a7565b915050610403565b5092915050565b60006104da6201518060076114c2565b6105047f0000000000000000000000000000000000000000000000000000000000000000426113c7565b61050e91906114e1565b905090565b61051b610e2a565b6105256000610e84565b565b61052f610e2a565b6001600160a01b03811661057c5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b60448201526064015b60405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f647672599d3468abcfa241a13c9e3d34383caadb5cc80fb67c3cdfcd5f7860599060200160405180910390a150565b6040516bffffffffffffffffffffffff193360601b16602082015260348101829052600090605401604051602081830303815290604052805190602001209050919050565b600182101561065d5760405162461bcd60e51b8152602060048201526014602482015273135bdc99481d1a185b881bdb99481dd85b1b195d60621b6044820152606401610573565b603281101561069f5760405162461bcd60e51b815260206004820152600e60248201526d546f6f2073686f7274207465726d60901b6044820152606401610573565b33600090815260046020526040812054905b838110156106de576106cc6106c68383611503565b84610ed4565b806106d6816114a7565b9150506106b1565b5082600260008282546106f19190611503565b92505081905550826003600082825461070a9190611503565b9091555050604080518481526020810184905233917f4781cf9bea301b9e21ed2b088e9daf13add2ee71b38076211ffacf60e82d4f1c910160405180910390a2505050565b60006103696001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001683611038565b6001600160a01b03831660009081526004602052604090205460609082106107ee5760405162461bcd60e51b815260206004820152601a60248201527f656e64496420657863656564732077616c6c657420636f756e740000000000006044820152606401610573565b60006107fa84846113c7565b610805906001611503565b905060008167ffffffffffffffff811115610822576108226113de565b60405190808252806020026020018201604052801561084b578160200160208202803683370190505b509050845b8481116108db576001600160a01b0387166000908152600460205260409020805482908110610881576108816113f4565b6000918252602090912001546001600160a01b0316826108a188846113c7565b815181106108b1576108b16113f4565b6001600160a01b0390921660209283029190910190910152806108d3816114a7565b915050610850565b5095945050505050565b6000808212156108f757506000919050565b60fa821261094057600561090d600160fa6113c7565b60fa811061091d5761091d6113f4565b60088104919091015460079091166004026101000a900463ffffffff1692915050565b60058260fa811061091d5761091d6113f4565b60006109636102fa600184611388565b61096c836108e5565b61036991906113c7565b61097e610e2a565b6001600160a01b0381166109e35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610573565b6109ec81610e84565b50565b81811015610a325760405162461bcd60e51b815260206004820152601060248201526f466f7277617264206f72646572696e6760801b6044820152606401610573565b600080808080865b868111610c2d57336000908152600460205260408120805483908110610a6257610a626113f4565b9060005260206000200160009054906101000a90046001600160a01b031690506000816001600160a01b0316637010d7a16040518163ffffffff1660e01b815260040160c060405180830381865afa158015610ac2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae6919061141a565b604051630327e6bd60e61b81523360048201529091506000906001600160a01b0384169063c9f9af40906024016020604051808303816000875af1158015610b32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b56919061151b565b9050610b62818a611503565b9850610b6f600189611503565b9750808260200151610b8191906114c2565b610b8b9088611503565b9650808260600151610b9d91906114c2565b610ba79087611503565b9550808260400151610bb991906114c2565b610bc39086611503565b3360009081526004602052604081208054929750909186908110610be957610be96113f4565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505050508080610c25906114a7565b915050610a3a565b508415610e21578360036000828254610c4691906113c7565b90915550610c56905085846114e1565b9250610c6285836114e1565b9150610c6e85826114e1565b90506000610c7c868561109e565b90506000612710610c8f6103e8846114c2565b610c9991906114e1565b90506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166340c10f1933610cd584866113c7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015610d1b57600080fd5b505af1158015610d2f573d6000803e3d6000fd5b50506001546040516340c10f1960e01b81526001600160a01b039182166004820152602481018590527f000000000000000000000000000000000000000000000000000000000000000090911692506340c10f199150604401600060405180830381600087803b158015610da257600080fd5b505af1158015610db6573d6000803e3d6000fd5b503392507f80b1cac76c7e17d29cd11219b6f3edc4a2aee9f78544405894e53ebc86e90284915089905088888888610dee888a6113c7565b604080519687526020870195909552938501929092526060840152608083015260a082015260c00160405180910390a250505b50505050505050565b6000546001600160a01b031633146105255760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610573565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610edf836105d0565b90506000610f166001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016836110e6565b60405163485cc95560e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301523060248301529192509082169063485cc95590604401600060405180830381600087803b158015610f8357600080fd5b505af1158015610f97573d6000803e3d6000fd5b5050604051639ff054df60e01b8152600481018690526001600160a01b0384169250639ff054df9150602401600060405180830381600087803b158015610fdd57600080fd5b505af1158015610ff1573d6000803e3d6000fd5b50503360009081526004602090815260408220805460018101825590835291200180546001600160a01b0319166001600160a01b0394909416939093179092555050505050565b6000610366838330604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b8152606093841b60148201526f5af43d82803e903d91602b57fd5bf3ff60801b6028820152921b6038830152604c8201526037808220606c830152605591012090565b6000806110a96104ca565b905060006110b86007856114e1565b9050633b9aca006110c98383610338565b6110d390876114c2565b6110dd91906114e1565b95945050505050565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528360601b60148201526e5af43d82803e903d91602b57fd5bf360881b6028820152826037826000f59150506001600160a01b0381166103695760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c65640000000000000000006044820152606401610573565b6000806040838503121561119957600080fd5b50508035926020909101359150565b600080602083850312156111bb57600080fd5b823567ffffffffffffffff808211156111d357600080fd5b818501915085601f8301126111e757600080fd5b8135818111156111f657600080fd5b8660208260051b850101111561120b57600080fd5b60209290920196919550909350505050565b602080825282518282018190526000919060409081850190868401855b8281101561129157815180516001600160a01b0316855286810151878601528581015186860152606080820151908601526080808201519086015260a0908101519085015260c0909301929085019060010161123a565b5091979650505050505050565b6001600160a01b03811681146109ec57600080fd5b6000602082840312156112c557600080fd5b81356112d08161129e565b9392505050565b6000602082840312156112e957600080fd5b5035919050565b60008060006060848603121561130557600080fd5b83356113108161129e565b95602085013595506040909401359392505050565b6020808252825182820181905260009190848201906040850190845b818110156113665783516001600160a01b031683529284019291840191600101611341565b50909695505050505050565b634e487b7160e01b600052601160045260246000fd5b60008083128015600160ff1b8501841216156113a6576113a6611372565b6001600160ff1b03840183138116156113c1576113c1611372565b50500390565b6000828210156113d9576113d9611372565b500390565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b80516114158161129e565b919050565b600060c0828403121561142c57600080fd5b60405160c0810181811067ffffffffffffffff8211171561145d57634e487b7160e01b600052604160045260246000fd5b6040526114698361140a565b81526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a08201528091505092915050565b60006000198214156114bb576114bb611372565b5060010190565b60008160001904831182151516156114dc576114dc611372565b500290565b6000826114fe57634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561151657611516611372565b500190565b60006020828403121561152d57600080fd5b505191905056fea2646970667358221220c90c63ece3b4fe35cd935101eb48ece9dc7d5f98c16cf9f93448855d59f94c8a64736f6c634300080a003360806040523480156200001157600080fd5b5060405162000c1038038062000c10833981016040819052620000349162000171565b6040518060400160405280600a81526020016958454c2043727970746f60b01b8152506040518060400160405280600381526020016216115360ea1b81525081600390805190602001906200008b929190620000cb565b508051620000a1906004906020840190620000cb565b5050600580546001600160a01b0319166001600160a01b03939093169290921790915550620001e0565b828054620000d990620001a3565b90600052602060002090601f016020900481019282620000fd576000855562000148565b82601f106200011857805160ff191683800117855562000148565b8280016001018555821562000148579182015b82811115620001485782518255916020019190600101906200012b565b50620001569291506200015a565b5090565b5b808211156200015657600081556001016200015b565b6000602082840312156200018457600080fd5b81516001600160a01b03811681146200019c57600080fd5b9392505050565b600181811c90821680620001b857607f821691505b60208210811415620001da57634e487b7160e01b600052602260045260246000fd5b50919050565b610a2080620001f06000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063395093511161008c57806395d89b411161006657806395d89b41146101c5578063a457c2d7146101cd578063a9059cbb146101e0578063dd62ed3e146101f357600080fd5b8063395093511461017457806340c10f191461018757806370a082311461019c57600080fd5b806306fdde03146100d457806307546172146100f2578063095ea7b31461011d57806318160ddd1461014057806323b872dd14610152578063313ce56714610165575b600080fd5b6100dc610206565b6040516100e9919061085d565b60405180910390f35b600554610105906001600160a01b031681565b6040516001600160a01b0390911681526020016100e9565b61013061012b3660046108ce565b610298565b60405190151581526020016100e9565b6002545b6040519081526020016100e9565b6101306101603660046108f8565b6102b0565b604051601281526020016100e9565b6101306101823660046108ce565b6102d4565b61019a6101953660046108ce565b6102f6565b005b6101446101aa366004610934565b6001600160a01b031660009081526020819052604090205490565b6100dc61034f565b6101306101db3660046108ce565b61035e565b6101306101ee3660046108ce565b6103d9565b610144610201366004610956565b6103e7565b60606003805461021590610989565b80601f016020809104026020016040519081016040528092919081815260200182805461024190610989565b801561028e5780601f106102635761010080835404028352916020019161028e565b820191906000526020600020905b81548152906001019060200180831161027157829003601f168201915b5050505050905090565b6000336102a6818585610412565b5060019392505050565b6000336102be858285610536565b6102c98585856105b0565b506001949350505050565b6000336102a68185856102e783836103e7565b6102f191906109c4565b610412565b6005546001600160a01b031633146103415760405162461bcd60e51b81526020600482015260096024820152684e6f2061636365737360b81b60448201526064015b60405180910390fd5b61034b828261077e565b5050565b60606004805461021590610989565b6000338161036c82866103e7565b9050838110156103cc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610338565b6102c98286868403610412565b6000336102a68185856105b0565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166104745760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610338565b6001600160a01b0382166104d55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610338565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600061054284846103e7565b905060001981146105aa578181101561059d5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610338565b6105aa8484848403610412565b50505050565b6001600160a01b0383166106145760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610338565b6001600160a01b0382166106765760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610338565b6001600160a01b038316600090815260208190526040902054818110156106ee5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610338565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906107259084906109c4565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161077191815260200190565b60405180910390a36105aa565b6001600160a01b0382166107d45760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610338565b80600260008282546107e691906109c4565b90915550506001600160a01b038216600090815260208190526040812080548392906108139084906109c4565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600060208083528351808285015260005b8181101561088a5785810183015185820160400152820161086e565b8181111561089c576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146108c957600080fd5b919050565b600080604083850312156108e157600080fd5b6108ea836108b2565b946020939093013593505050565b60008060006060848603121561090d57600080fd5b610916846108b2565b9250610924602085016108b2565b9150604084013590509250925092565b60006020828403121561094657600080fd5b61094f826108b2565b9392505050565b6000806040838503121561096957600080fd5b610972836108b2565b9150610980602084016108b2565b90509250929050565b600181811c9082168061099d57607f821691505b602082108114156109be57634e487b7160e01b600052602260045260246000fd5b50919050565b600082198211156109e557634e487b7160e01b600052601160045260246000fd5b50019056fea2646970667358221220a82418f7d7668ff6558067bb0307b7fe640ed092e6a2cebf5a9c75af6f711e6064736f6c634300080a003300000000000000000000000006450dee7fd2fb8e39061434babcfc05599a6fb8000000000000000000000000f561f8b1ff40980650f5a7f11851c32ba6e4d303000000000000000000000000903eb4d298795b2f7bdfac6838b45dacd68ddc98

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101375760003560e01c80638da5cb5b116100b8578063b3f006741161007c578063b3f00674146102b9578063dcf53f5d146102cc578063e971ea46146102ec578063ef5c7271146102ff578063f2fde38b14610312578063f3b611f01461032557600080fd5b80638da5cb5b1461026657806390ad85ce14610277578063977d2c451461028a578063a1add21d14610293578063a58dcc95146102a657600080fd5b8063607ad0d7116100ff578063607ad0d7146101f0578063715018a6146102175780637536721e146102215780637c08b9641461022a578063878023d41461023d57600080fd5b80632afbefd61461013c5780632d3af11214610162578063363ec22c146101a15780634ac2d63b146101c15780634c3f31a2146101c9575b600080fd5b61014f61014a366004611186565b610338565b6040519081526020015b60405180910390f35b6101897f00000000000000000000000006450dee7fd2fb8e39061434babcfc05599a6fb881565b6040516001600160a01b039091168152602001610159565b6101b46101af3660046111a8565b61036f565b604051610159919061121d565b61014f6104ca565b6101897f000000000000000000000000fe610be6d169e53b99d014547022a9a3f9295d6e81565b61014f7f00000000000000000000000000000000000000000000000000000000642c23db81565b61021f610513565b005b61014f60035481565b61021f6102383660046112b3565b610527565b61014f61024b3660046112b3565b6001600160a01b031660009081526004602052604090205490565b6000546001600160a01b0316610189565b61014f6102853660046112d7565b6105d0565b61014f60025481565b61021f6102a1366004611186565b610615565b6101896102b43660046112d7565b61074f565b600154610189906001600160a01b031681565b6102df6102da3660046112f0565b610784565b6040516101599190611325565b61014f6102fa3660046112d7565b6108e5565b61014f61030d3660046112d7565b610953565b61021f6103203660046112b3565b610976565b61021f610333366004611186565b6109ef565b600061035360016103498486611388565b6102fa9190611388565b61035c846108e5565b61036691906113c7565b90505b92915050565b60608167ffffffffffffffff81111561038a5761038a6113de565b6040519080825280602002602001820160405280156103fd57816020015b6103ea6040518060c0016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081525090565b8152602001906001900390816103a85790505b50905060005b828110156104c35783838281811061041d5761041d6113f4565b905060200201602081019061043291906112b3565b6001600160a01b0316637010d7a16040518163ffffffff1660e01b815260040160c060405180830381865afa15801561046f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610493919061141a565b8282815181106104a5576104a56113f4565b602002602001018190525080806104bb906114a7565b915050610403565b5092915050565b60006104da6201518060076114c2565b6105047f00000000000000000000000000000000000000000000000000000000642c23db426113c7565b61050e91906114e1565b905090565b61051b610e2a565b6105256000610e84565b565b61052f610e2a565b6001600160a01b03811661057c5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b60448201526064015b60405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f647672599d3468abcfa241a13c9e3d34383caadb5cc80fb67c3cdfcd5f7860599060200160405180910390a150565b6040516bffffffffffffffffffffffff193360601b16602082015260348101829052600090605401604051602081830303815290604052805190602001209050919050565b600182101561065d5760405162461bcd60e51b8152602060048201526014602482015273135bdc99481d1a185b881bdb99481dd85b1b195d60621b6044820152606401610573565b603281101561069f5760405162461bcd60e51b815260206004820152600e60248201526d546f6f2073686f7274207465726d60901b6044820152606401610573565b33600090815260046020526040812054905b838110156106de576106cc6106c68383611503565b84610ed4565b806106d6816114a7565b9150506106b1565b5082600260008282546106f19190611503565b92505081905550826003600082825461070a9190611503565b9091555050604080518481526020810184905233917f4781cf9bea301b9e21ed2b088e9daf13add2ee71b38076211ffacf60e82d4f1c910160405180910390a2505050565b60006103696001600160a01b037f000000000000000000000000f561f8b1ff40980650f5a7f11851c32ba6e4d3031683611038565b6001600160a01b03831660009081526004602052604090205460609082106107ee5760405162461bcd60e51b815260206004820152601a60248201527f656e64496420657863656564732077616c6c657420636f756e740000000000006044820152606401610573565b60006107fa84846113c7565b610805906001611503565b905060008167ffffffffffffffff811115610822576108226113de565b60405190808252806020026020018201604052801561084b578160200160208202803683370190505b509050845b8481116108db576001600160a01b0387166000908152600460205260409020805482908110610881576108816113f4565b6000918252602090912001546001600160a01b0316826108a188846113c7565b815181106108b1576108b16113f4565b6001600160a01b0390921660209283029190910190910152806108d3816114a7565b915050610850565b5095945050505050565b6000808212156108f757506000919050565b60fa821261094057600561090d600160fa6113c7565b60fa811061091d5761091d6113f4565b60088104919091015460079091166004026101000a900463ffffffff1692915050565b60058260fa811061091d5761091d6113f4565b60006109636102fa600184611388565b61096c836108e5565b61036991906113c7565b61097e610e2a565b6001600160a01b0381166109e35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610573565b6109ec81610e84565b50565b81811015610a325760405162461bcd60e51b815260206004820152601060248201526f466f7277617264206f72646572696e6760801b6044820152606401610573565b600080808080865b868111610c2d57336000908152600460205260408120805483908110610a6257610a626113f4565b9060005260206000200160009054906101000a90046001600160a01b031690506000816001600160a01b0316637010d7a16040518163ffffffff1660e01b815260040160c060405180830381865afa158015610ac2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae6919061141a565b604051630327e6bd60e61b81523360048201529091506000906001600160a01b0384169063c9f9af40906024016020604051808303816000875af1158015610b32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b56919061151b565b9050610b62818a611503565b9850610b6f600189611503565b9750808260200151610b8191906114c2565b610b8b9088611503565b9650808260600151610b9d91906114c2565b610ba79087611503565b9550808260400151610bb991906114c2565b610bc39086611503565b3360009081526004602052604081208054929750909186908110610be957610be96113f4565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505050508080610c25906114a7565b915050610a3a565b508415610e21578360036000828254610c4691906113c7565b90915550610c56905085846114e1565b9250610c6285836114e1565b9150610c6e85826114e1565b90506000610c7c868561109e565b90506000612710610c8f6103e8846114c2565b610c9991906114e1565b90506001600160a01b037f000000000000000000000000fe610be6d169e53b99d014547022a9a3f9295d6e166340c10f1933610cd584866113c7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015610d1b57600080fd5b505af1158015610d2f573d6000803e3d6000fd5b50506001546040516340c10f1960e01b81526001600160a01b039182166004820152602481018590527f000000000000000000000000fe610be6d169e53b99d014547022a9a3f9295d6e90911692506340c10f199150604401600060405180830381600087803b158015610da257600080fd5b505af1158015610db6573d6000803e3d6000fd5b503392507f80b1cac76c7e17d29cd11219b6f3edc4a2aee9f78544405894e53ebc86e90284915089905088888888610dee888a6113c7565b604080519687526020870195909552938501929092526060840152608083015260a082015260c00160405180910390a250505b50505050505050565b6000546001600160a01b031633146105255760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610573565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610edf836105d0565b90506000610f166001600160a01b037f000000000000000000000000f561f8b1ff40980650f5a7f11851c32ba6e4d30316836110e6565b60405163485cc95560e01b81526001600160a01b037f00000000000000000000000006450dee7fd2fb8e39061434babcfc05599a6fb8811660048301523060248301529192509082169063485cc95590604401600060405180830381600087803b158015610f8357600080fd5b505af1158015610f97573d6000803e3d6000fd5b5050604051639ff054df60e01b8152600481018690526001600160a01b0384169250639ff054df9150602401600060405180830381600087803b158015610fdd57600080fd5b505af1158015610ff1573d6000803e3d6000fd5b50503360009081526004602090815260408220805460018101825590835291200180546001600160a01b0319166001600160a01b0394909416939093179092555050505050565b6000610366838330604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b8152606093841b60148201526f5af43d82803e903d91602b57fd5bf3ff60801b6028820152921b6038830152604c8201526037808220606c830152605591012090565b6000806110a96104ca565b905060006110b86007856114e1565b9050633b9aca006110c98383610338565b6110d390876114c2565b6110dd91906114e1565b95945050505050565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528360601b60148201526e5af43d82803e903d91602b57fd5bf360881b6028820152826037826000f59150506001600160a01b0381166103695760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c65640000000000000000006044820152606401610573565b6000806040838503121561119957600080fd5b50508035926020909101359150565b600080602083850312156111bb57600080fd5b823567ffffffffffffffff808211156111d357600080fd5b818501915085601f8301126111e757600080fd5b8135818111156111f657600080fd5b8660208260051b850101111561120b57600080fd5b60209290920196919550909350505050565b602080825282518282018190526000919060409081850190868401855b8281101561129157815180516001600160a01b0316855286810151878601528581015186860152606080820151908601526080808201519086015260a0908101519085015260c0909301929085019060010161123a565b5091979650505050505050565b6001600160a01b03811681146109ec57600080fd5b6000602082840312156112c557600080fd5b81356112d08161129e565b9392505050565b6000602082840312156112e957600080fd5b5035919050565b60008060006060848603121561130557600080fd5b83356113108161129e565b95602085013595506040909401359392505050565b6020808252825182820181905260009190848201906040850190845b818110156113665783516001600160a01b031683529284019291840191600101611341565b50909695505050505050565b634e487b7160e01b600052601160045260246000fd5b60008083128015600160ff1b8501841216156113a6576113a6611372565b6001600160ff1b03840183138116156113c1576113c1611372565b50500390565b6000828210156113d9576113d9611372565b500390565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b80516114158161129e565b919050565b600060c0828403121561142c57600080fd5b60405160c0810181811067ffffffffffffffff8211171561145d57634e487b7160e01b600052604160045260246000fd5b6040526114698361140a565b81526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a08201528091505092915050565b60006000198214156114bb576114bb611372565b5060010190565b60008160001904831182151516156114dc576114dc611372565b500290565b6000826114fe57634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561151657611516611372565b500190565b60006020828403121561152d57600080fd5b505191905056fea2646970667358221220c90c63ece3b4fe35cd935101eb48ece9dc7d5f98c16cf9f93448855d59f94c8a64736f6c634300080a0033

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

00000000000000000000000006450dee7fd2fb8e39061434babcfc05599a6fb8000000000000000000000000f561f8b1ff40980650f5a7f11851c32ba6e4d303000000000000000000000000903eb4d298795b2f7bdfac6838b45dacd68ddc98

-----Decoded View---------------
Arg [0] : xenCrypto (address): 0x06450dEe7FD2Fb8E39061434BAbCFC05599a6Fb8
Arg [1] : walletImplementation (address): 0xf561f8B1ff40980650f5a7f11851c32ba6e4D303
Arg [2] : feeAddress (address): 0x903eb4d298795b2F7bDfAc6838B45DAcD68DDc98

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000006450dee7fd2fb8e39061434babcfc05599a6fb8
Arg [1] : 000000000000000000000000f561f8b1ff40980650f5a7f11851c32ba6e4d303
Arg [2] : 000000000000000000000000903eb4d298795b2f7bdfac6838b45dacd68ddc98


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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