ETH Price: $1,565.01 (-7.07%)

Contract

0x6622F2617DaB4aE4bA526F053c1c3Fe9ea3436DB
 

Overview

ETH Balance

1.116039747260150083 ETH

Eth Value

$1,746.61 (@ $1,565.01/ETH)

Token Holdings

Multichain Info

Transaction Hash
Method
Block
From
To
0x76ded3e9cbbff5881a0a0384b28de9a98745a115fafc78a04984575557efe3da Buy Keys With Re...(pending)2025-03-23 2:34:3915 days ago1742697279IN
0x6622F261...9ea3436DB
0 ETH(Pending)(Pending)
Withdraw Rewards201453392024-06-22 6:04:47289 days ago1719036287IN
0x6622F261...9ea3436DB
0 ETH0.00011082
Buy With Referra...201449492024-06-22 4:45:47289 days ago1719031547IN
0x6622F261...9ea3436DB
0.00000985 ETH0.000464432
Withdraw Rewards199350092024-05-23 20:36:59318 days ago1716496619IN
0x6622F261...9ea3436DB
0 ETH0.0004963413.98024611
Withdraw Rewards199350082024-05-23 20:36:47318 days ago1716496607IN
0x6622F261...9ea3436DB
0 ETH0.0006075713.52488016
Withdraw Rewards198307972024-05-09 6:49:11333 days ago1715237351IN
0x6622F261...9ea3436DB
0 ETH0.000208214.41351372
Withdraw Rewards190953002024-01-27 3:40:59436 days ago1706326859IN
0x6622F261...9ea3436DB
0 ETH0.0009594919.51097243
Withdraw Rewards190953002024-01-27 3:40:59436 days ago1706326859IN
0x6622F261...9ea3436DB
0 ETH0.001391319.51097243
Withdraw Burnt K...190163192024-01-16 1:59:35447 days ago1705370375IN
0x6622F261...9ea3436DB
0 ETH0.0009718725.8140052
Withdraw Rewards189131392024-01-01 14:21:59462 days ago1704118919IN
0x6622F261...9ea3436DB
0 ETH0.0005401511.44944995
Withdraw Rewards189130622024-01-01 14:05:59462 days ago1704117959IN
0x6622F261...9ea3436DB
0 ETH0.0006006814.81083159
Withdraw Burnt K...189130562024-01-01 14:04:47462 days ago1704117887IN
0x6622F261...9ea3436DB
0 ETH0.0005177913.75321388
Buy With Referra...188827222023-12-28 7:47:35466 days ago1703749655IN
0x6622F261...9ea3436DB
0.001 ETH0.0070248226.27339126
Buy With Referra...188827122023-12-28 7:45:35466 days ago1703749535IN
0x6622F261...9ea3436DB
0.00000001 ETH0.0031508926.45719729
Withdraw Rewards186988162023-12-02 12:47:47492 days ago1701521267IN
0x6622F261...9ea3436DB
0 ETH0.0024995935.0530495
Buy With Referra...186975432023-12-02 8:32:23492 days ago1701505943IN
0x6622F261...9ea3436DB
0.00000001 ETH0.0050208842.15902931
Buy With Referra...186461542023-11-25 3:53:23499 days ago1700884403IN
0x6622F261...9ea3436DB
0.00000001 ETH0.0024891418.27649269
Buy With Referra...186460752023-11-25 3:37:23499 days ago1700883443IN
0x6622F261...9ea3436DB
0.002 ETH0.0027177219.95888882
Buy With Referra...186323652023-11-23 5:32:35501 days ago1700717555IN
0x6622F261...9ea3436DB
0.00005 ETH0.0040557929.78563584
Buy With Referra...186322772023-11-23 5:14:11501 days ago1700716451IN
0x6622F261...9ea3436DB
0.00000001 ETH0.0047960128.14663318
Withdraw Rewards186265702023-11-22 10:05:35502 days ago1700647535IN
0x6622F261...9ea3436DB
0 ETH0.0019485227.32505672
Withdraw Burnt K...186070052023-11-19 16:20:23505 days ago1700410823IN
0x6622F261...9ea3436DB
0 ETH0.0007404919.66832334
Withdraw Rewards186050962023-11-19 9:54:47505 days ago1700387687IN
0x6622F261...9ea3436DB
0 ETH0.000792112.77121843
Buy With Referra...186050812023-11-19 9:51:47505 days ago1700387507IN
0x6622F261...9ea3436DB
0.00000001 ETH0.003927213.38760803
Buy With Referra...186040272023-11-19 6:19:47505 days ago1700374787IN
0x6622F261...9ea3436DB
0.00000001 ETH0.0035574515.55531284
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Method Block
From
To
Add To Pool201449492024-06-22 4:45:47289 days ago1719031547
0x6622F261...9ea3436DB
0.00042369 ETH
Transfer199350082024-05-23 20:36:47318 days ago1716496607
0x6622F261...9ea3436DB
0.00300061 ETH
Transfer198307972024-05-09 6:49:11333 days ago1715237351
0x6622F261...9ea3436DB
0.00236106 ETH
Transfer190953002024-01-27 3:40:59436 days ago1706326859
0x6622F261...9ea3436DB
0.00130349 ETH
Transfer190953002024-01-27 3:40:59436 days ago1706326859
0x6622F261...9ea3436DB
0.05399371 ETH
Transfer190163192024-01-16 1:59:35447 days ago1705370375
0x6622F261...9ea3436DB
0.03666931 ETH
Transfer189131392024-01-01 14:21:59462 days ago1704118919
0x6622F261...9ea3436DB
0.03020981 ETH
Transfer189130562024-01-01 14:04:47462 days ago1704117887
0x6622F261...9ea3436DB
0.010647 ETH
Deposit188827222023-12-28 7:47:35466 days ago1703749655
0x6622F261...9ea3436DB
0.0001425 ETH
Add To Pool188827222023-12-28 7:47:35466 days ago1703749655
0x6622F261...9ea3436DB
0.0000475 ETH
Transfer186988162023-12-02 12:47:47492 days ago1701521267
0x6622F261...9ea3436DB
0.00006719 ETH
Transfer186265702023-11-22 10:05:35502 days ago1700647535
0x6622F261...9ea3436DB
0.04384262 ETH
Transfer186070052023-11-19 16:20:23505 days ago1700410823
0x6622F261...9ea3436DB
0.01597029 ETH
Transfer186050962023-11-19 9:54:47505 days ago1700387687
0x6622F261...9ea3436DB
0.00000001 ETH
Add To Pool186050812023-11-19 9:51:47505 days ago1700387507
0x6622F261...9ea3436DB
0.00366693 ETH
Deposit186040272023-11-19 6:19:47505 days ago1700374787
0x6622F261...9ea3436DB
0 ETH
Add To Pool186040272023-11-19 6:19:47505 days ago1700374787
0x6622F261...9ea3436DB
0 ETH
Transfer186000022023-11-18 16:46:23506 days ago1700325983
0x6622F261...9ea3436DB
0.00023289 ETH
Transfer185983232023-11-18 11:07:23506 days ago1700305643
0x6622F261...9ea3436DB
0.00258086 ETH
Transfer185942492023-11-17 21:22:23506 days ago1700256143
0x6622F261...9ea3436DB
0.00000008 ETH
Transfer185836382023-11-16 9:45:35508 days ago1700127935
0x6622F261...9ea3436DB
0 ETH
Transfer185835812023-11-16 9:34:11508 days ago1700127251
0x6622F261...9ea3436DB
0.11467115 ETH
Transfer185815192023-11-16 2:39:59508 days ago1700102399
0x6622F261...9ea3436DB
0.00000871 ETH
Add To Pool185810572023-11-16 1:06:47508 days ago1700096807
0x6622F261...9ea3436DB
0.03666931 ETH
Transfer185802222023-11-15 22:18:59508 days ago1700086739
0x6622F261...9ea3436DB
0.00286245 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
XenGame

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 1 : xenGameV2.sol
// SPDX-License-Identifier: MIT

/*


██╗  ██╗███████╗███╗   ██╗ ██████╗  █████╗ ███╗   ███╗███████╗
╚██╗██╔╝██╔════╝████╗  ██║██╔════╝ ██╔══██╗████╗ ████║██╔════╝
 ╚███╔╝ █████╗  ██╔██╗ ██║██║  ███╗███████║██╔████╔██║█████╗  
 ██╔██╗ ██╔══╝  ██║╚██╗██║██║   ██║██╔══██║██║╚██╔╝██║██╔══╝  
██╔╝ ██╗███████╗██║ ╚████║╚██████╔╝██║  ██║██║ ╚═╝ ██║███████╗
╚═╝  ╚═╝╚══════╝╚═╝  ╚═══╝ ╚═════╝ ╚═╝  ╚═╝╚═╝     ╚═╝╚══════╝



This project has been developed under the guidelines set forth by the Fair Crypto Foundation, adhering to its first principles of self-custody, transparency, consensus-based trust, and permissionless value exchange. Accordingly, this project values the ethos of decentralization and exercises these principles by not incorporating any administrative access keys or functions.

Given these considerations, it is important to note that all users are encouraged to conduct their own research and due diligence prior to using this contract. Potential users should understand, evaluate, and accept the inherent risks associated with its use, owing to the blockchain and smart contract technology underpinning it.

Please be advised, due to the intentional absence of administrative access keys in this smart contract, and the elimination of central authority, the original developers or contributors maintain no control over the system once it is deployed, placing them on an equivalent footing with any other user.

The developers, hence, assume no liability or responsibility whatsoever for any future errors, exploits, or security breaches that may occur, unforeseen or otherwise. This software is distributed "AS-IS" without warranties or conditions of any kind, either expressed or implied.

As an open-source project, all users participate at their own risk and assume full responsibility for all actions undertaken in connection with this contract, including but not limited to any loss or damage incurred. Each user, by engaging with the contract and its functionalities, comprehensively and irrevocably accepts this accountability.

Moreover, potential and existing users should be fully aware of and stay compliant with the laws and regulations in their respective jurisdictions. It is the sole responsibility of each user to understand and adhere to the relevant laws and regulations applicable in their location.

Please be advised that interactions with cryptocurrencies and blockchain-based technologies come with significant risk. Users should always exercise utmost caution, and use this contract only after fully appreciating the implications on both a technical and legal level.

By using this contract, the user explicitly acknowledges and agrees to these terms and conditions. Failure to heed these disclaimers and instructions may lead to adversarial consequences for which neither the developers nor any other associated party shall be held responsible.

             

*/

pragma solidity 0.8.17;

interface IXENnftContract {
    function ownerOf(uint256 tokenId) external view returns (address);
}

interface INFTRegistry {
    function registerNFT(uint256 tokenId) external;
    function isNFTRegistered(uint256 tokenId) external view returns (bool);
    function addToPool() external payable;
}

interface XENBurn {
    function deposit() external payable returns (bool);
}

interface IPlayerNameRegistry {
    function registerPlayerName(address _address, string memory _name) external payable;
    function getPlayerAddress(string memory _name) external view returns (address);
    function getPlayerFirstName(address playerAddress) external view returns (string memory);
}

contract XenGame {
    IXENnftContract public nftContract;
    INFTRegistry public nftRegistry;
    XENBurn public xenBurn;
    IPlayerNameRegistry private playerNameRegistry;

    uint256 constant KEY_RESET_PERCENTAGE = 1; // 0.001% or 1 basis point
    uint256 constant NAME_REGISTRATION_FEE = 20000000000000000; // 0.02 Ether in Wei
    uint256 constant KEY_PRICE_INCREMENT_PERCENTAGE = 10; // 0.099% or approx 10 basis points
    uint256 constant REFERRAL_REWARD_PERCENTAGE = 1000; // 10% or 1000 basis points
    uint256 constant NFT_POOL_PERCENTAGE = 500; // 5% or 500 basis points
    uint256 constant ROUND_GAP = 24 hours;// 24 hours round gap
    uint256 constant EARLY_BUYIN_DURATION = 300; // *********************************************************** updated to 5 min  

    uint256 constant KEYS_FUND_PERCENTAGE = 5000; // 50% or 5000 basis points
    uint256 constant JACKPOT_PERCENTAGE = 3000; // 30% or 3000 basis points
    uint256 constant BURN_FUND_PERCENTAGE = 1500; // 15% or 1500 basis points
    uint256 constant APEX_FUND_PERCENTAGE = 500; // 5% or 5000 basis points
    uint256 constant PRECISION = 10 ** 18;
    address private playerNames;
    uint256 private loadedPlayers = 0;
    bool public migrationLocked = false;
    bool public migrationPhaseTwoCompleted = false;

    
    struct Player {
        mapping(uint256 => uint256) keyCount; //round to keys
        mapping(uint256 => uint256) burntKeys;
        mapping(uint256 => uint256) earlyBuyinPoints; // Track early buyin points for each round
        uint256 referralRewards;
        string lastReferrer; // Track last referrer name
        mapping(uint256 => uint256) lastRewardRatio; // New variable
        uint256 keyRewards;
        uint256 numberOfReferrals; 
    }

    struct Round {
        uint256 totalKeys ;
        uint256 burntKeys; 
        
        uint256 start;
        uint256 end;
        address activePlayer;
        bool ended;
        bool isEarlyBuyin;
        uint256 keysFunds; // not used in logic, old code 
        uint256 jackpot; // ETH for the jackpot
        uint256 earlyBuyinEth; // Total ETH received during the early buy-in period
        uint256 lastKeyPrice; // The last key price for this round
        uint256 rewardRatio;
        uint256 BurntKeyFunds;
        uint256 uniquePlayers;
        address[] playerAddresses;
        
    }

    uint256 public currentRound = 0;
    mapping(address => Player) public players;
    mapping(uint256 => Round) public rounds;
    mapping(uint256 => mapping(address => bool)) public isPlayerInRound;
    mapping(string => address) public nameToAddress;
    mapping(address => mapping(uint256 => bool)) public earlyKeysReceived;

    constructor(
        
    
    ) {

        

        nftContract = IXENnftContract(0x0a252663DBCc0b073063D6420a40319e438Cfa59);  // Eth address
        nftRegistry = INFTRegistry(0xEDa159A0339826C96c30D39A1be8588d82212395); // X1 Eth address
        xenBurn = XENBurn(0x573E18d9dF2496B1768139Eb4c712B9b086be294); // Eth address
        playerNameRegistry = IPlayerNameRegistry(0x68317FE2590DC605C730628fb645DE0F17F86BFc); // Eth address
        playerNames = 0x68317FE2590DC605C730628fb645DE0F17F86BFc; // Eth address

        currentRound = 1;
        rounds[currentRound].totalKeys = 10097300000000000000000000;
        rounds[currentRound].burntKeys = 338175000000000000000000;
        rounds[currentRound].jackpot = 63566409521227276389;
        rounds[currentRound].earlyBuyinEth = 59101124779840297779;
        rounds[currentRound].lastKeyPrice = 44087673862494;
        rounds[currentRound].rewardRatio = 994363746378;
        rounds[currentRound].uniquePlayers = 198;        
        rounds[currentRound].start = 1694966400;     
        rounds[currentRound].end = block.timestamp + 12 hours;  // Update to set new end time on migration        
        rounds[currentRound].ended = false;

        
        
    }

    function migrateUserBasicData(
        address[] calldata playeraddresses,
        uint256[] calldata playerRound1KeyCount,
        uint256[] calldata playerRound1BurntKeys,
        uint256[] calldata playerRound1EarlyBuyinPoints,
        string[] calldata playerLastReferrer
    ) external {
        require(!migrationLocked, "Migration has been locked");
        require(loadedPlayers + playeraddresses.length == 198, "Cannot exceed 198 users");

        for (uint i = 0; i < 198; i++) {
            players[playeraddresses[i]].keyCount[1] = playerRound1KeyCount[i];

            if (playerRound1BurntKeys[i] > 0) {
                players[playeraddresses[i]].burntKeys[1] = playerRound1BurntKeys[i];
            }
            if (playerRound1EarlyBuyinPoints[i] > 0) {
                players[playeraddresses[i]].earlyBuyinPoints[1] = playerRound1EarlyBuyinPoints[i];
            }

            if (bytes(playerLastReferrer[i]).length > 0) {
                players[playeraddresses[i]].lastReferrer = playerLastReferrer[i];
            }

            isPlayerInRound[currentRound][playeraddresses[i]] = true;

            rounds[currentRound].playerAddresses.push(playeraddresses[i]);
            loadedPlayers++;
            if (loadedPlayers == 198) {
                migrationLocked = true;
            }
        }
    } 

    function migrateUserReferralAndRewardData(
        address[] calldata playeraddresses,
        uint256[] calldata playerReferralRewards,
        uint256[] calldata playerRound1RewardRatio,
        uint256[] calldata playerKeyRewards,
        uint256[] calldata playerNumberOfReferrals
        
    ) external {
        require(migrationLocked, "Migrate base users first");
        require(loadedPlayers == 198, "All players must be loaded first");
        require(!migrationPhaseTwoCompleted, "Phase two migration already completed");

        for (uint i = 0; i < 198; i++) {
            if (playerReferralRewards[i] > 0) {
                players[playeraddresses[i]].referralRewards = playerReferralRewards[i];
            }

            players[playeraddresses[i]].lastRewardRatio[1] = playerRound1RewardRatio[i];

            

            players[playeraddresses[i]].keyRewards = playerKeyRewards[i];

            if (playerNumberOfReferrals[i] > 0) {
                players[playeraddresses[i]].numberOfReferrals = playerNumberOfReferrals[i];
            }

            if (players[playeraddresses[i]].earlyBuyinPoints[1] > 0 && players[playeraddresses[i]].keyCount[1] > 0) {
                earlyKeysReceived[playeraddresses[i]][1] = true;
            }
        }

        migrationPhaseTwoCompleted = true;
    }  

    function seedEth() external payable {
        // This function is only here to reseed the eth from the migration         
    }

    /**
    * @dev Allows a player to buy keys with a referral.
    * @param _referrerName The name of the referrer.
    * @param _numberOfKeys The number of keys to purchase.
    */
    function buyWithReferral(string memory _referrerName, uint256 _numberOfKeys) public payable {
        Player storage player = players[msg.sender];

        // Get the player and referrer information
        string memory referrerName = bytes(_referrerName).length > 0 ? _referrerName : player.lastReferrer;
        address referrer = playerNameRegistry.getPlayerAddress(referrerName);

        Round storage round = rounds[currentRound];

            // Check if the player is not already in the current round
            if (!isPlayerInRound[currentRound][msg.sender]) {
                // Add the player address to the list of player addresses for the current round
                round.playerAddresses.push(msg.sender);
                // Set isPlayerInRound to true for the current player in the current round
                isPlayerInRound[currentRound][msg.sender] = true;
                // Increment the uniquePlayers count for the current round
                round.uniquePlayers++;
            }

            // Calculate the referral reward as a percentage of the incoming ETH
            uint256 referralReward = (msg.value * REFERRAL_REWARD_PERCENTAGE) / 10000; // 10% of the incoming ETH

            if (referralReward > 0) {
                // Added check here to ensure referral reward is greater than 0
                uint256 splitReward = referralReward / 2; // Split the referral reward

                // Add half of the referral reward to the referrer's stored rewards
                players[referrer].referralRewards += splitReward;
                players[referrer].numberOfReferrals++;

                if (referrer != address(0)){
                // Add the other half of the referral reward to the player's stored rewards
                player.referralRewards += splitReward;
                }

                emit ReferralPaid(msg.sender, referrer, splitReward, block.timestamp);
            }

            
            if (_numberOfKeys > 0) {
                buyCoreWithKeys(msg.value, _numberOfKeys);
            } else {
                buyCore(msg.value);
            }

            // Set the referrer name for the player
            player.lastReferrer = referrerName;
        
    }

    /**
    * @dev Handles the core logic of purchasing keys based on the amount of ETH sent.
    * @param _amount The amount of ETH sent by the player.
    */
    function buyCore(uint256 _amount) private {
        // Check if the round is active or has ended
        require(isRoundActive() || isRoundEnded(), "Cannot purchase keys during the round gap");

        uint256 _roundId = currentRound;
        Round storage round = rounds[currentRound];

        // If the round has ended and there are no total keys, set a new end time for the round
        if (isRoundEnded()) {

            if (round.totalKeys == 0){
                round.end = block.timestamp + 600;
                players[msg.sender].keyRewards += (_amount * 90 / 100);
                return;
            }

            endRound();
            startNewRound();
            players[msg.sender].keyRewards += (_amount * 90 / 100);
            return;
        }

        // If the round is active
        if (isRoundActive()) {
            if (block.timestamp <= round.start + EARLY_BUYIN_DURATION) {
                // If we are in the early buy-in period, follow early buy-in logic
                buyCoreEarly(_amount);
            } else if (!round.ended) {
                
                // Check if this is the first transaction after the early buy-in period
                if (round.isEarlyBuyin) {
                    updateTotalKeysForRound();
                    finalizeEarlyBuyinPeriod();
                }

                // Check if the last key price exceeds the jackpot threshold and reset it if necessary
                if (round.lastKeyPrice > calculateJackpotThreshold()) {
                    uint256 newPrice = resetPrice();
                    round.lastKeyPrice = newPrice;
                    emit PriceReset(msg.sender, newPrice, block.timestamp);
                }

                // Calculate the maximum number of keys to purchase and the total cost
                (uint256 maxKeysToPurchase, ) = calculateMaxKeysToPurchase(_amount);
                    

                // Process users rewards for the current round
                processRewards(_roundId);

                // Set the last reward ratio for the player in the current round
                if (players[msg.sender].lastRewardRatio[_roundId] == 0) {
                    players[msg.sender].lastRewardRatio[_roundId] = round.rewardRatio;
                }

                // Process the key purchase with the maximum number of keys and total cost
                processKeyPurchase(maxKeysToPurchase, _amount);

                // Set the active player for the round
                round.activePlayer = msg.sender;

                // Adjust the end time of the round based on the number of keys purchased
                adjustRoundEndTime(maxKeysToPurchase);
            }
        } 
    }

    /**
    * @dev Handles the core logic of purchasing keys with a specified number of keys and amount of ETH.
    * @param _amount The amount of ETH sent by the player.
    * @param _numberOfKeys The number of keys to purchase.
    */
    function buyCoreWithKeys(uint256 _amount, uint256 _numberOfKeys) private {
        // Check if the round is active or has ended\
        require(isRoundActive() || isRoundEnded(), "Cannot purchase keys during the round gap");

        uint256 _roundId = currentRound;
        Round storage round = rounds[currentRound];
        // If the round has ended and there are no total keys, set a new end time for the round
        if (isRoundEnded()) {

            if (round.totalKeys == 0){
                round.end = block.timestamp + 600;
                players[msg.sender].keyRewards += (_amount * 90 / 100);
                return;
            }
            
            // End the current round and start a new one
            endRound();
            startNewRound();
            players[msg.sender].keyRewards += (_amount * 90 / 100);
            return;
        }

        if (isRoundActive()) {

            if (block.timestamp <= round.start + EARLY_BUYIN_DURATION) {
                // If we are in the early buy-in period, follow early buy-in logic
                buyCoreEarly(_amount);
            } else if (!round.ended) {
                // Check if this is the first transaction after the early buy-in period
                if (round.isEarlyBuyin) {
                    updateTotalKeysForRound();
                    finalizeEarlyBuyinPeriod();
                }

                // Check if the last key price exceeds the jackpot threshold and reset it if necessary
                if (round.lastKeyPrice > calculateJackpotThreshold()) {
                    uint256 newPrice = resetPrice();
                    round.lastKeyPrice = newPrice;
                    emit PriceReset(msg.sender, newPrice, block.timestamp);

                }

                // Calculate cost for _numberOfKeys
                uint256 cost = calculatePriceForKeys(_numberOfKeys);
                require(cost <= _amount, "Not enough ETH to buy the specified number of keys");

                
                // Process user rewards for the current round
                processRewards(_roundId);

                // Set the last reward ratio for the player in the current round if first user key buy. 
                if (players[msg.sender].lastRewardRatio[_roundId] == 0) {
                    players[msg.sender].lastRewardRatio[_roundId] = round.rewardRatio;
                }

                // Process the key purchase with the specified number of keys and cost
                processKeyPurchase(_numberOfKeys, _amount);

                // Set the active player for the round
                round.activePlayer = msg.sender;

                // Adjust the end time of the round based on the number of keys purchased
                adjustRoundEndTime(_numberOfKeys);

                
            }
        } 
    }

    /**
    * @dev Allows a player to purchase keys using their accumulated rewards.
    */
    function buyKeysWithRewards() public {
        // Check if the current round is active
        require(isRoundActive(), "Round is not active");

        Player storage player = players[msg.sender];

        // Check for any early keys
        checkForEarlyKeys(currentRound);

        // Calculate the player's rewards unprocessed 
        uint256 reward = (
            (player.keyCount[currentRound] / 1 ether)
                * (rounds[currentRound].rewardRatio - player.lastRewardRatio[currentRound])
        ); // using full keys for reward calc

        // Add any processed keyRewards to the calculated reward
        reward += player.keyRewards;

        // Reset player's keyRewards
        player.keyRewards = 0;

        require(reward > 0, "No rewards to buy keys with");

        // Reset player's lastRewardRatio for the round
        player.lastRewardRatio[currentRound] = rounds[currentRound].rewardRatio; //

        // Calculate max keys that can be purchased with the reward
        (uint256 maxKeysToPurchase,) = calculateMaxKeysToPurchase(reward);

        // Make sure there are enough rewards to purchase at least one key
        require(maxKeysToPurchase > 0, "Not enough rewards to purchase any keys");

        address referrer = playerNameRegistry.getPlayerAddress(players[msg.sender].lastReferrer);
                   

            // Calculate the referral reward as a percentage of the incoming ETH
            uint256 referralReward = (reward * REFERRAL_REWARD_PERCENTAGE) / 10000; // 10% of the incoming ETH

            if (referralReward > 0) {
                // Added check here to ensure referral reward is greater than 0
                uint256 splitReward = referralReward / 2; // Split the referral reward

                // Add half of the referral reward to the referrer's stored rewards
                players[referrer].referralRewards += splitReward;
                players[referrer].numberOfReferrals++;

                if (referrer != address(0)){
                // Add the other half of the referral reward to the player's stored rewards
                player.referralRewards += splitReward;
                }

                emit ReferralPaid(msg.sender, referrer, splitReward, block.timestamp);
            }            
            
                
            
        // Buy keys using rewards
        buyCore(reward);
    }

    /**
    * @dev Handles the logic of purchasing keys during the early buy-in period.
    * @param _amount The amount of ETH sent by the player.
    */
    function buyCoreEarly(uint256 _amount) private {
        // Accumulate the ETH and track the user's early buy-in points

        // Calculate the referral reward as a percentage of the incoming ETH
        uint256 referralReward = (_amount * REFERRAL_REWARD_PERCENTAGE) / 10000;

        // Check if the player's last referrer is not valid, and halve the referral reward
        if (playerNameRegistry.getPlayerAddress(players[msg.sender].lastReferrer) == address(0)){
            referralReward = (referralReward / 2);
        }

        // Calculate the amount of ETH without the referral reward
        uint256 amount = _amount - referralReward;

        // Accumulate the amount of ETH sent during the early buy-in period
        rounds[currentRound].earlyBuyinEth += amount;

        // Accumulate the early buy-in points for the player
        players[msg.sender].earlyBuyinPoints[currentRound] += amount;

        // Set the last reward ratio for the player in the current round to 1
        players[msg.sender].lastRewardRatio[currentRound] = 1;

        // Set isEarlyBuyin to true to indicate the early buy-in period is active
        rounds[currentRound].isEarlyBuyin = true;
    }

    /**
    * @dev Fallback function to handle incoming ETH payments and execute buy or withdraw rewards logic.
    */
fallback() external payable {
    // If the incoming value is 0, withdraw rewards for all rounds
    if (msg.value == 0) {
        for (uint256 i = 1; i <= currentRound; i++) {
            withdrawRewards(i);
        }
    }
    // Call buyWithReferral function with empty referrer name and 0 number of keys
    buyWithReferral("", 0);
}

/**
    * @dev Receive function to handle incoming ETH payments and execute buy or withdraw rewards logic.
    */
receive() external payable {
    // If the incoming value is 0, withdraw rewards for all rounds
    if (msg.value == 0) {
        for (uint256 i = 1; i <= currentRound; i++) {
            withdrawRewards(i);
        }
    }
    // Call buyWithReferral function with empty referrer name and 0 number of keys
    buyWithReferral("", 0);
}

    /**
    * @dev Checks if the current round is active.
    * @return bool indicating whether the round is active or not.
    */
    function isRoundActive() public view returns (bool) {
        uint256 _roundId = currentRound;
        return block.timestamp >= rounds[_roundId].start && block.timestamp < rounds[_roundId].end;
    }

    /**
    * @dev Checks if the current round has ended.
    * @return bool indicating whether the round has ended or not.
    */
    function isRoundEnded() public view returns (bool) {
        uint256 _roundId = currentRound;
        return block.timestamp >= rounds[_roundId].end;
    }

    /**
    * @dev Updates the total number of keys for the current round.
    * If there was early buy-in ETH, it adds 10,000,000 keys. Otherwise, it adds 1 key.
    */
    function updateTotalKeysForRound() private {
        // Check if there was early buy-in ETH        
        if (rounds[currentRound].earlyBuyinEth > 0) {
            // Add 10,000,000 keys to the total keys count for the round
            rounds[currentRound].totalKeys += 10000000 ether;

        } else {

            // Add 1 key to the total keys count for the round if no early buyin.
            rounds[currentRound].totalKeys += 1 ether;
        }
    }

    /**
    * @dev Finalizes the early buy-in period by setting necessary variables and adding early buy-in funds to the jackpot.
    */
    function finalizeEarlyBuyinPeriod() private {
        // Set isEarlyBuyin to false to signify the early buy-in period is over
        Round storage round = rounds[currentRound];
        
        round.isEarlyBuyin = false;

        // Calculate the last key price for the round
        if (round.earlyBuyinEth > 0) {
            round.lastKeyPrice = round.earlyBuyinEth / (10 ** 7); // using full keys
        } else {
            round.lastKeyPrice = 0.000000009 ether; // Set to 0.000000009 ether if there is no early buying ETH or no keys purchased
        }

        

        // Add early buy-in funds to the jackpot
        round.jackpot += round.earlyBuyinEth;
    }

    /**
    * @dev Calculates the maximum number of keys that can be purchased and the total cost within a given amount of ETH.
    * @param _amount The amount of ETH to spend on keys.
    * @return maxKeys The maximum number of keys that can be purchased.
    * @return totalCost The total cost in ETH to purchase the maximum number of keys.
    */
    function calculateMaxKeysToPurchase(uint256 _amount) public view returns (uint256 maxKeys, uint256 totalCost) {
        // Fetch the initial price of a key
        uint256 initialKeyPrice = getKeyPrice();

        // If the user's amount is less than the price of a single key, return as no keys can be bought
        if (_amount < initialKeyPrice) {
            return (0, 0);
        }

        // left and right are the boundaries for the binary search of the maximum number of keys that can be bought.
        // Initialize the left to zero and right to the maximum number of keys that could be bought if the price never increased.
        uint256 left = 0;
        uint256 right = _amount / initialKeyPrice;

        // Variable to store the total cost of keys
        uint256 _totalCost;

        // Binary search to find the maximum number of keys the user can buy
        while (left < right) {
            // Find the mid point
            uint256 mid = (left + right) / 2;

            // Calculate the cost to purchase mid number of keys
            _totalCost = calculatePriceForKeys(mid);
            
            uint256 nextCost;

            // Ensure we don't get an overflow when we add 1 to mid
            if (mid + 1 > mid) {
                // Calculate the cost to purchase mid + 1 keys
                nextCost = calculatePriceForKeys(mid + 1);
            }

            // Check to see if the user is able to purchase mid keys.
            // If not, decrease the upper limit. If they can, increase the lower limit
            // If the user can purchase mid+1 keys, then it should not exit, hence nextCost > _amount is required
            if (_totalCost <= _amount && (mid == right || nextCost > _amount)) {
                maxKeys = mid;
                break;
            } else if (_totalCost <= _amount) {
                left = mid + 1;
            } else {
                right = mid - 1;
            }
        }

        // If the binary search completes without finding a suitable number of keys, set maxKeys to left
        if (maxKeys == 0) {
            maxKeys = left;
        }

        // Calculate the cost for the final number of keys again to ensure accuracy
        _totalCost = calculatePriceForKeys(maxKeys);

        // Return the maximum number of keys that can be bought and the total cost for those keys
        return (maxKeys, _totalCost);
    }

    /**
    * @dev Calculates the total price for a specified number of keys based on the current key price.
    * @param _keys The number of keys to calculate the price for.
    * @return totalPrice The total price in ETH for the specified number of keys.
    */
    function calculatePriceForKeys(uint256 _keys) public view returns (uint256 totalPrice) {
        uint256 initialKeyPrice = getKeyPrice();
        uint256 increasePerKey = 0.000000009 ether;

         // Calculate the total price based on the number of keys
        if (_keys <= 1) {
            totalPrice = initialKeyPrice * _keys;
        } else {
            uint256 lastPrice = initialKeyPrice + ((_keys - 1) * increasePerKey);
            totalPrice = (_keys * (initialKeyPrice + lastPrice)) / 2;
        }

        return totalPrice;
    }

    /**
    * @dev Handles the purchase of keys by a player and updates relevant data.
    * @param maxKeysToPurchase The maximum number of keys to purchase.
    * @param _amount The amount of ETH sent by the player.
    */
    function processKeyPurchase(uint256 maxKeysToPurchase, uint256 _amount) private {
        // Check if the amount is greater than or equal to 0
        require(_amount > 0, "Not enough Ether to purchase keys");

        // Calculate the fractional keys based on the maximum number of keys to purchase
        uint256 fractionalKeys = maxKeysToPurchase * 1 ether;
        Round storage round = rounds[currentRound];

        // Increase the player's key count for the current round
        players[msg.sender].keyCount[currentRound] += fractionalKeys;

        // Reset the last reward ratio for the player in the current round
        players[msg.sender].lastRewardRatio[currentRound] = round.rewardRatio; // reset fallback in case user has gap betewwn burn and next buyin. 

        // Increase the total keys for the current round
        round.totalKeys += fractionalKeys;

        // Calculate the final key price based on the last key price and the increase per key
        uint256 finalKeyPrice = round.lastKeyPrice;
        uint256 increasePerKey = 0.000000009 ether;
        finalKeyPrice += increasePerKey * maxKeysToPurchase;

        // Update the last key price for the current round
        round.lastKeyPrice = finalKeyPrice;

        // Distribute the funds to different purposes (keys funds, jackpot, etc.)
        distributeFunds(_amount);

        emit BuyAndDistribute(msg.sender,  maxKeysToPurchase, finalKeyPrice,  block.timestamp);
    }

    /**
    * @dev Burns the keys owned by a player in a specific round.
    * @param player The address of the player.
    * @param roundNumber The round number in which to burn the keys.
    */
    function BurnKeys(address player, uint roundNumber) private {
        
        // Check if the round number is the current round
        if (roundNumber == currentRound) {
            uint256 Keys = players[player].keyCount[roundNumber];

            // Reset the key count of the player for the specific round
            players[player].keyCount[roundNumber] = 0;

            // Update the burnt keys count for the player and round
            players[player].burntKeys[roundNumber]+= Keys;
            rounds[roundNumber].totalKeys -= Keys;
            rounds[roundNumber].burntKeys += Keys;

            
            emit KeyBurn(player,  Keys,  block.timestamp);
        }
    }

    /**
    * @dev Checks if the player has early buy-in points for the current round and adds early keys if applicable.
    */
    function checkForEarlyKeys(uint _round) private {

        // Check if the player has early buy-in points and has not received early keys for the current round
        if (players[msg.sender].earlyBuyinPoints[_round] > 0 && !earlyKeysReceived[msg.sender][_round]) {

            // Calculate early keys based on the amount of early ETH sent
            uint256 totalPoints = rounds[_round].earlyBuyinEth;
            uint256 playerPoints = players[msg.sender].earlyBuyinPoints[_round];
            uint256 earlyKeys = ((playerPoints * 10_000_000) / totalPoints) * 1 ether;

            // Add the early keys to the player's key count for the current round
            players[msg.sender].keyCount[_round] += earlyKeys;
            
            // Mark that early keys were received for this round
            earlyKeysReceived[msg.sender][_round] = true;
        }
    }

    /**
    * @dev Adjusts the end time of the current round based on the maximum number of keys purchased.
    * @param maxKeysToPurchase The maximum number of keys purchased in the current transaction.
    */
    function adjustRoundEndTime(uint256 maxKeysToPurchase) private {
        // Calculate the time extension based on the maximum keys purchased
        uint256 timeExtension = maxKeysToPurchase * 30 seconds;

        // Set the maximum end time as the current timestamp plus 2 hours
        uint256 maxEndTime = block.timestamp + 12 hours;

        // Adjust the end time of the current round by adding the time extension, capped at the maximum end time
        rounds[currentRound].end = min(rounds[currentRound].end + timeExtension, maxEndTime);
    }

    /**
    * @dev Retrieves the current key price for the active round.
    * @return The current key price.
    */
    function getKeyPrice() public view returns (uint256) {
        uint256 _roundId = currentRound;

        // Fetch the last key price
        uint256 lastKeyPrice = rounds[_roundId].lastKeyPrice;

        // If the price is 0, return 0.000000009 ether, else return the last set price
        if(lastKeyPrice == 0) {
            return 0.000000009 ether;
        } else {
            return lastKeyPrice;
        }
    }

    /**
    * @dev Calculates the jackpot threshold as a percentage of the current round's jackpot.
    * @return The jackpot threshold.
    */
    function calculateJackpotThreshold() private view returns (uint256) {
        uint256 _roundId = currentRound;

        // Calculate the jackpot threshold as 0.0001% of the jackpot
        return rounds[_roundId].jackpot / 1000000; 
    }

    /**
    * @dev Resets the key price by dividing the current round's jackpot by 10 million.
    * @return The new key price after resetting.
    */
    function resetPrice() private view returns (uint256) {
        uint256 _roundId = currentRound;
        return rounds[_roundId].jackpot / 10000000; 
    }

    /**
    * @dev Updates the reward ratio for a specific round based on the amount of ETH received.
    * @param _amount The amount of ETH received.
    * @param _roundNumber The round number to update the reward ratio for.
    */
    function updateRoundRatio(uint256 _amount, uint256 _roundNumber) private {

        // Calculate the reward ratio by dividing the amount by the total keys in the current round
        rounds[_roundNumber].rewardRatio += (_amount / (rounds[currentRound].totalKeys / 1 ether));
    }

    /**
    * @dev Distributes the incoming ETH to different funds and updates the reward ratio.
    * @param _amount The amount of ETH received.
    */
    function distributeFunds(uint256 _amount) private {
        // Calculate the referral reward as a percentage of the incoming ETH
        uint256 referralReward = (_amount * REFERRAL_REWARD_PERCENTAGE) / 10000;

        // Check if the last referrer is not registered and adjust the referral reward
        if (playerNameRegistry.getPlayerAddress(players[msg.sender].lastReferrer) == address(0)){
            referralReward = (referralReward / 2);
        }

        // Calculate the remaining amount after deducting the referral reward
        uint256 amount = _amount - referralReward;

        // Calculate the keys fund as a percentage of the remaining amount
        uint256 keysFund = (amount * KEYS_FUND_PERCENTAGE) / 10000;

        // Update the reward ratio for the current round based on the keys fund
        updateRoundRatio(keysFund, currentRound);
        
        // Calculate the jackpot as a percentage of the remaining amount
        uint256 jackpot = (amount * JACKPOT_PERCENTAGE) / 10000;

        // Add the jackpot to the current round's jackpot
        rounds[currentRound].jackpot += jackpot;

        // Calculate the apex fund as a percentage of the remaining amount
        uint256 apexFund = (amount * APEX_FUND_PERCENTAGE) / 10000;

        // Transfer the apex fund to the nftRegistry
        nftRegistry.addToPool{value: apexFund}();

        // Calculate the burn fund as a percentage of the remaining amount
        uint256 burnFund = (amount * BURN_FUND_PERCENTAGE) / 10000;

        // Deposit the burn fund to the xenBurn contract
        xenBurn.deposit{value: burnFund}();

        
    }

    /**
    * @dev Allows a player to register a name by paying the registration fee.
    * @param name The name to register.
    */
    function registerPlayerName(string memory name) public payable {
        // Check if the player has provided enough funds to register the name
        require(msg.value >= NAME_REGISTRATION_FEE, "Insufficient funds to register the name.");

        // Call the registerPlayerName function of the playerNameRegistry contract with the player's address and name
        playerNameRegistry.registerPlayerName{value: msg.value}(msg.sender, name);

        emit PlayerNameRegistered(msg.sender, name, block.timestamp);

    }

    /**
    * @dev Allows the owner of an NFT to register it.
    * @param tokenId The ID of the NFT to register.
    */
    function registerNFT(uint256 tokenId) external {
        // Check if the caller is the owner of the NFT with the given tokenId
        require(nftContract.ownerOf(tokenId) == msg.sender, "You don't own this NFT.");

        // Call the registerNFT function of the nftRegistry contract with the tokenId
        nftRegistry.registerNFT(tokenId);
    }

    /**
    * @dev Processes the rewards for the specified round and adds them to the player's keyRewards.
    * @param roundNumber The round number for which to calculate and process rewards.
    */
    function processRewards(uint256 roundNumber) private  {
        // Get the player's storage reference
        Player storage player = players[msg.sender];

        // Check for early keys received during the early buy-in period
        checkForEarlyKeys(roundNumber);

        // Only calculate rewards if player has at least one key
        if (player.keyCount[roundNumber] > 0) {
            // Calculate the player's rewards based on the difference between reward ratios
            uint256 reward = (
                (player.keyCount[roundNumber] / 1 ether)
                    * (rounds[roundNumber].rewardRatio - player.lastRewardRatio[roundNumber])
            ); 

            // Update the player's last reward ratio to the current round's ratio
            player.lastRewardRatio[roundNumber] = rounds[roundNumber].rewardRatio;

            // Add the calculated reward to the player's keyRewards
            player.keyRewards += reward;
        }
    }

    
/**
    * @dev Allows the player to withdraw their rewards for the specified round.
    * @param roundNumber The round number for which to withdraw rewards.
    */
function withdrawRewards(uint256 roundNumber) public {
    // Get the player's storage reference
    Player storage player = players[msg.sender];

    // Convert the player's address to a payable address
    address payable senderPayable = payable(msg.sender);  

    // Check for early keys received during the early buy-in period
    checkForEarlyKeys(roundNumber);

    // Calculate the rewards based on the difference between reward ratios
    uint256 reward = (
        (player.keyCount[roundNumber] / 1 ether)
            * (rounds[roundNumber].rewardRatio - player.lastRewardRatio[roundNumber])
    );

    // Update the player's last reward ratio to the current round's ratio
    player.lastRewardRatio[roundNumber] = rounds[roundNumber].rewardRatio;

    // Add the unpreprocessed keyRewards to the processed rewards
    reward += player.keyRewards;

    // Reset the player's keyRewards
    player.keyRewards = 0;

    // Burn the player's past keys for the current round
    if (roundNumber == currentRound){
        BurnKeys(msg.sender, roundNumber);

    }
    

    if (reward > 0) {
        // Transfer the rewards
        senderPayable.transfer(reward);

        emit RewardsWithdrawn(msg.sender, reward, block.timestamp);
    }
}

    /**
    * @dev Allows a player to withdraw their referral rewards.
    */
function withdrawReferralRewards() public {
    // Get the amount of referral rewards for the player
    uint256 rewardAmount = players[msg.sender].referralRewards;
    require(rewardAmount > 0, "No referral rewards to withdraw");

    // Check that the player has a registered name
    string memory playerName = getPlayerName(msg.sender);
    require(bytes(playerName).length > 0, "Player has no registered names");

    // Convert the player's address to a payable address
    address payable senderPayable = payable(msg.sender); 

    // Reset the player's referral rewards 
    players[msg.sender].referralRewards = 0;

    // transfer the rewards
    senderPayable.transfer(rewardAmount);

    emit ReferralRewardsWithdrawn(msg.sender, rewardAmount, block.timestamp);

    rewardAmount = players[address(0)].referralRewards;
    if (rewardAmount > 0){
        players[address(0)].referralRewards = 0;
        (bool success, ) = payable(playerNames).call{value: rewardAmount}("");
        require(success, "Transfer failed.");

    }
}

    /**
    * @dev Allows a player to withdraw their burnt keys rewards for a specific round.
    * @param _roundNumber The round number for which the player wants to withdraw burnt keys rewards.
    */
function WithdrawBurntKeyRewards(uint _roundNumber) public {
    // Check if the round number is valid and not greater than the current round
    require( _roundNumber < currentRound , "Can't withdraw BurntKey Rewards tell round end.");

    // Check if the player has burnt keys rewards for the specified round
    require(players[msg.sender].burntKeys[_roundNumber] > 0 , "Player has no burnt Keys rewards.");

    // Calculate the reward amount based on the player's burnt keys and the burnt key funds for the round
    uint256 reward = ((players[msg.sender].burntKeys[_roundNumber] * rounds[_roundNumber].BurntKeyFunds) / rounds[_roundNumber].burntKeys);

    // Reset the burnt keys rewards for the player
    players[msg.sender].burntKeys[_roundNumber] = 0;

    // Transfer the reward amount to the player
    address payable senderPayable = payable(msg.sender);
    senderPayable.transfer(reward);

    emit BurnKeysRewardWithdraw(msg.sender, reward, _roundNumber, block.timestamp);


}

    /**
    * @dev Ends the current round and distributes the jackpot and funds to the winner and other recipients.
    */
    function endRound() private {
        // Get the current round
        Round storage round = rounds[currentRound];

        // Check if the current timestamp is after the round end time
        require(block.timestamp >= round.end, "Round has not yet ended.");

        // Identify the winner as the last person to have bought a key
        address winner = round.activePlayer;

        // Divide the jackpot
        uint256 jackpot = round.jackpot;
        uint256 winnerShare = (jackpot * 50) / 100; // 50%
        uint256 burntKeysFundsShare = (jackpot * 20) / 100; // 20%
        uint256 currentRoundNftShare = (jackpot * 20) / 100; // 20%
        uint256 nextRoundJackpot = (jackpot * 10) / 100; // 10%

        // Transfer to the winner
        players[winner].keyRewards += winnerShare;
        

        // Add to the burntKeysFunds share to the Burnt keys
        round.BurntKeyFunds += burntKeysFundsShare;

        // Set the starting jackpot for the next round
        rounds[currentRound + 1].jackpot = nextRoundJackpot;

        // Send to the NFT contract
        nftRegistry.addToPool{value: currentRoundNftShare}();

        round.ended = true;

        emit RoundEnded(currentRound, winner, jackpot, winnerShare, burntKeysFundsShare, currentRoundNftShare, nextRoundJackpot, block.timestamp);
    }

    /**
    * @dev Starts a new round by incrementing the current round number and setting the start and end times.
    */
    function startNewRound() private {
        // Increment the current round number
        currentRound += 1;

        // Set the start time of the new round by adding ROUND_GAP to the current timestamp
        rounds[currentRound].start = block.timestamp + ROUND_GAP;
        
        // Set the end time of the new round by adding 1 hour to the start time (adjust as needed)
        rounds[currentRound].end = rounds[currentRound].start + 12 hours; 

        // Reset the "ended" flag for the new round
        rounds[currentRound].ended = false;

        // Set the reward ratio to a low non-zero value
        rounds[currentRound].rewardRatio = 1; 
       
        emit NewRoundStarted(currentRound, rounds[currentRound].start, rounds[currentRound].end);
    }

    /**
    * @dev Calculates the pending rewards for a player in a specific round.
    * @param playerAddress The address of the player.
    * @param roundNumber The round number.
    * @return The amount of pending rewards for the player in the specified round.
    */
    function getPendingRewards(address playerAddress, uint256 roundNumber) public view returns (uint256) {
        // Get the player and round information
        Player storage player = players[playerAddress];
        uint keys = getPlayerKeysCount(playerAddress, roundNumber);

        // Calculate the pending rewards based on the player's key count and the difference in reward ratio
        uint256 pendingRewards = (
            (keys / 1 ether)
                * (rounds[roundNumber].rewardRatio - player.lastRewardRatio[roundNumber])
        );

        // Add the unprocessed keyRewards to the pending rewards

        if (roundNumber < currentRound){

            return pendingRewards;

        } else{

            pendingRewards += player.keyRewards;
            return pendingRewards;

        }

        
    }


    function getPlayerKeysCount(address playerAddress, uint256 _round) public view returns (uint256) {
        Player storage player = players[playerAddress];

        if (player.earlyBuyinPoints[_round] > 0 && !earlyKeysReceived[playerAddress][_round]) {
            // Calculate early keys based on the amount of early ETH sent
            uint256 totalPoints = rounds[_round].earlyBuyinEth;
            uint256 playerPoints = players[playerAddress].earlyBuyinPoints[_round];

            uint256 earlyKeys = ((playerPoints * 10_000_000) / totalPoints) * 1 ether;

            return (player.keyCount[_round] + earlyKeys);
        } else {
            return player.keyCount[_round];
        }
    }

    function getPlayerName(address playerAddress) public view returns (string memory) {
        return playerNameRegistry.getPlayerFirstName(playerAddress);
    }

    

    function getRoundTotalKeys(uint256 roundId) public view returns (uint256) {
        return rounds[roundId].totalKeys;
    }

    function getRoundBurntKeys(uint256 roundId) public view returns (uint256) {
        return rounds[roundId].burntKeys;
    }

    

    

    function getRoundEnd(uint256 roundId) public view returns (uint256) {
        return rounds[roundId].end;
    }

    function getRoundActivePlayer(uint256 roundId) public view returns (address) {
        return rounds[roundId].activePlayer;
    }

    function getRoundEnded(uint256 roundId) public view returns (bool) {
        return rounds[roundId].ended;
    }

    function getRoundIsEarlyBuyin(uint256 roundId) public view returns (bool) {
        return rounds[roundId].isEarlyBuyin;
    }

    function getRoundKeysFunds(uint256 roundId) public view returns (uint256) {
        return rounds[roundId].keysFunds;
    }

    function getRoundJackpot(uint256 roundId) public view returns (uint256) {
        return rounds[roundId].jackpot;
    }

    function getRoundEarlyBuyinEth(uint256 roundId) public view returns (uint256) {
        return rounds[roundId].earlyBuyinEth;
    }

    function getRoundLastKeyPrice(uint256 roundId) public view returns (uint256) {
        return rounds[roundId].lastKeyPrice;
    }

    function getRoundRewardRatio(uint256 roundId) public view returns (uint256) {
        return rounds[roundId].rewardRatio;
    }

    function getRoundBurntKeyFunds(uint256 roundId) public view returns (uint256) {
        return rounds[roundId].BurntKeyFunds;
    }

    function getRoundUniquePlayers(uint256 roundId) public view returns (uint256) {
        return rounds[roundId].uniquePlayers;
    }

    function getRoundPlayerAddresses(uint256 roundId) public view returns (address[] memory) {
        return rounds[roundId].playerAddresses;
    }

    function getRoundIsPlayerInRound(uint256 roundId, address player) public view returns (bool) {
        return isPlayerInRound[roundId][player];
    }

    function getPlayerInfo(address playerAddress, uint256 roundNumber)
        public
        view
        returns (
            uint256 keyCount, 
            uint256 earlyBuyinPoints, 
            uint256 referralRewards, 
            uint256 lastRewardRatio,
            uint256 keyRewards,
            uint256 numberOfReferrals
        )
    {
        keyCount = getPlayerKeysCount(playerAddress, roundNumber);
        earlyBuyinPoints = players[playerAddress].earlyBuyinPoints[roundNumber];
        referralRewards = players[playerAddress].referralRewards;
        lastRewardRatio = players[playerAddress].lastRewardRatio[roundNumber];
        keyRewards = getPendingRewards(playerAddress,  roundNumber);
        numberOfReferrals = players[playerAddress].numberOfReferrals;
    }

    function getPlayerKeyCount(address playerAddress, uint256 round) public view returns (uint256) {
        return players[playerAddress].keyCount[round];
    }

    function getPlayerBurntKeys(address playerAddress, uint256 round) public view returns (uint256) {
        return players[playerAddress].burntKeys[round];
    }

    function getPlayerEarlyBuyinPoints(address playerAddress, uint256 round) public view returns (uint256) {
        return players[playerAddress].earlyBuyinPoints[round];
    }

    function getPlayerReferralRewards(address playerAddress) public view returns (uint256) {
        return players[playerAddress].referralRewards;
    }

    function getPlayerLastReferrer(address playerAddress) public view returns (string memory) {
        return players[playerAddress].lastReferrer;
    }

    function getlastRewardRatio(address playerAddress, uint256 round) public view returns (uint256) {
        return players[playerAddress].lastRewardRatio[round];
    }

    function getRoundStart(uint256 roundId) public view returns (uint256) {
        return rounds[roundId].start;
    }

    function getRoundEarlyBuyin(uint256 roundId) public view returns (uint256) {
        return rounds[roundId].earlyBuyinEth;
    }

    function getUniquePlayers(uint256 round) public view returns (uint256) {
        return rounds[round].uniquePlayers;
    }

    function getPlayerAddresses(uint256 round) public view returns (address[] memory) {
        return rounds[round].playerAddresses;
    }
    function min(uint256 a, uint256 b) private pure returns (uint256) {
        return a < b ? a : b;
    }

    function max(uint256 a, uint256 b) private pure returns (uint256) {
        return a > b ? a : b;
    }

    event BuyAndDistribute(address buyer, uint256 amount, uint256 keyPrice, uint256 timestamp);
    event ReferralRewardsWithdrawn(address indexed player, uint256 amount, uint256 timestamp);
    event RewardsWithdrawn(address indexed player, uint256 amount, uint256 timestamp);
    event RoundEnded(uint256 roundId, address winner, uint256 jackpot, uint256 winnerShare, uint256 keysFundsShare, uint256 currentRoundNftShare, uint256 nextRoundJackpot, uint256 timestamp);
    event NewRoundStarted(uint256 roundId, uint256 startTimestamp, uint256 endTimestamp);
    event PlayerNameRegistered(address player, string name, uint256 timestamp);
    event ReferralPaid(address player, address referrer, uint256 amount, uint256 timestamp);
    event KeyBurn(address player, uint256 Keys, uint256 timestamp);
    event BurnKeysRewardWithdraw(address player, uint256 reward, uint256 RoundNumber, uint256 timestamp);
    event PriceReset(address player, uint256 newPrice, uint256 timestamp);

}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"RoundNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"BurnKeysRewardWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"keyPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"BuyAndDistribute","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"Keys","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"KeyBurn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTimestamp","type":"uint256"}],"name":"NewRoundStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"PlayerNameRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"newPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"PriceReset","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"address","name":"referrer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"ReferralPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"ReferralRewardsWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"RewardsWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"address","name":"winner","type":"address"},{"indexed":false,"internalType":"uint256","name":"jackpot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"winnerShare","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"keysFundsShare","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"currentRoundNftShare","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nextRoundJackpot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"RoundEnded","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"uint256","name":"_roundNumber","type":"uint256"}],"name":"WithdrawBurntKeyRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"buyKeysWithRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_referrerName","type":"string"},{"internalType":"uint256","name":"_numberOfKeys","type":"uint256"}],"name":"buyWithReferral","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"calculateMaxKeysToPurchase","outputs":[{"internalType":"uint256","name":"maxKeys","type":"uint256"},{"internalType":"uint256","name":"totalCost","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_keys","type":"uint256"}],"name":"calculatePriceForKeys","outputs":[{"internalType":"uint256","name":"totalPrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"earlyKeysReceived","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getKeyPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"playerAddress","type":"address"},{"internalType":"uint256","name":"roundNumber","type":"uint256"}],"name":"getPendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"round","type":"uint256"}],"name":"getPlayerAddresses","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"playerAddress","type":"address"},{"internalType":"uint256","name":"round","type":"uint256"}],"name":"getPlayerBurntKeys","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"playerAddress","type":"address"},{"internalType":"uint256","name":"round","type":"uint256"}],"name":"getPlayerEarlyBuyinPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"playerAddress","type":"address"},{"internalType":"uint256","name":"roundNumber","type":"uint256"}],"name":"getPlayerInfo","outputs":[{"internalType":"uint256","name":"keyCount","type":"uint256"},{"internalType":"uint256","name":"earlyBuyinPoints","type":"uint256"},{"internalType":"uint256","name":"referralRewards","type":"uint256"},{"internalType":"uint256","name":"lastRewardRatio","type":"uint256"},{"internalType":"uint256","name":"keyRewards","type":"uint256"},{"internalType":"uint256","name":"numberOfReferrals","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"playerAddress","type":"address"},{"internalType":"uint256","name":"round","type":"uint256"}],"name":"getPlayerKeyCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"playerAddress","type":"address"},{"internalType":"uint256","name":"_round","type":"uint256"}],"name":"getPlayerKeysCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"playerAddress","type":"address"}],"name":"getPlayerLastReferrer","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"playerAddress","type":"address"}],"name":"getPlayerName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"playerAddress","type":"address"}],"name":"getPlayerReferralRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRoundActivePlayer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRoundBurntKeyFunds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRoundBurntKeys","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRoundEarlyBuyin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRoundEarlyBuyinEth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRoundEnd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRoundEnded","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRoundIsEarlyBuyin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"},{"internalType":"address","name":"player","type":"address"}],"name":"getRoundIsPlayerInRound","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRoundJackpot","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRoundKeysFunds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRoundLastKeyPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRoundPlayerAddresses","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRoundRewardRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRoundStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRoundTotalKeys","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getRoundUniquePlayers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"round","type":"uint256"}],"name":"getUniquePlayers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"playerAddress","type":"address"},{"internalType":"uint256","name":"round","type":"uint256"}],"name":"getlastRewardRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"isPlayerInRound","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRoundActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRoundEnded","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"playeraddresses","type":"address[]"},{"internalType":"uint256[]","name":"playerRound1KeyCount","type":"uint256[]"},{"internalType":"uint256[]","name":"playerRound1BurntKeys","type":"uint256[]"},{"internalType":"uint256[]","name":"playerRound1EarlyBuyinPoints","type":"uint256[]"},{"internalType":"string[]","name":"playerLastReferrer","type":"string[]"}],"name":"migrateUserBasicData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"playeraddresses","type":"address[]"},{"internalType":"uint256[]","name":"playerReferralRewards","type":"uint256[]"},{"internalType":"uint256[]","name":"playerRound1RewardRatio","type":"uint256[]"},{"internalType":"uint256[]","name":"playerKeyRewards","type":"uint256[]"},{"internalType":"uint256[]","name":"playerNumberOfReferrals","type":"uint256[]"}],"name":"migrateUserReferralAndRewardData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"migrationLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"migrationPhaseTwoCompleted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"nameToAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftContract","outputs":[{"internalType":"contract IXENnftContract","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftRegistry","outputs":[{"internalType":"contract INFTRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"players","outputs":[{"internalType":"uint256","name":"referralRewards","type":"uint256"},{"internalType":"string","name":"lastReferrer","type":"string"},{"internalType":"uint256","name":"keyRewards","type":"uint256"},{"internalType":"uint256","name":"numberOfReferrals","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"registerNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"registerPlayerName","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rounds","outputs":[{"internalType":"uint256","name":"totalKeys","type":"uint256"},{"internalType":"uint256","name":"burntKeys","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"address","name":"activePlayer","type":"address"},{"internalType":"bool","name":"ended","type":"bool"},{"internalType":"bool","name":"isEarlyBuyin","type":"bool"},{"internalType":"uint256","name":"keysFunds","type":"uint256"},{"internalType":"uint256","name":"jackpot","type":"uint256"},{"internalType":"uint256","name":"earlyBuyinEth","type":"uint256"},{"internalType":"uint256","name":"lastKeyPrice","type":"uint256"},{"internalType":"uint256","name":"rewardRatio","type":"uint256"},{"internalType":"uint256","name":"BurntKeyFunds","type":"uint256"},{"internalType":"uint256","name":"uniquePlayers","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"seedEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdrawReferralRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundNumber","type":"uint256"}],"name":"withdrawRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"xenBurn","outputs":[{"internalType":"contract XENBurn","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080604052600060058190556006805461ffff191690556007553480156200002657600080fd5b50600080546001600160a01b0319908116730a252663dbcc0b073063d6420a40319e438cfa5917825560018054821673eda159a0339826c96c30d39a1be8588d8221239517815560028054831673573e18d9df2496b1768139eb4c712b9b086be2941790556003805483167368317fe2590dc605c730628fb645de0f17f86bfc90811790915560048054909316179091556007819055905260096020526a085a2fbad4f3c9cdd000007f92e85d02570a8092d09a6e3a57665bc3815a2699a4074001bf1ccabf660f5a365569479c80e4540f5c9c00007f92e85d02570a8092d09a6e3a57665bc3815a2699a4074001bf1ccabf660f5a37556803722940ab97c2a0657f92e85d02570a8092d09a6e3a57665bc3815a2699a4074001bf1ccabf660f5a3c55680334315fdb286adb337f92e85d02570a8092d09a6e3a57665bc3815a2699a4074001bf1ccabf660f5a3d55652818f623b95e7f92e85d02570a8092d09a6e3a57665bc3815a2699a4074001bf1ccabf660f5a3e5564e784b2a84a7f92e85d02570a8092d09a6e3a57665bc3815a2699a4074001bf1ccabf660f5a3f5560c67f92e85d02570a8092d09a6e3a57665bc3815a2699a4074001bf1ccabf660f5a415563650722807f92e85d02570a8092d09a6e3a57665bc3815a2699a4074001bf1ccabf660f5a3855620002204261a8c062000253565b60078054600090815260096020526040808220600301939093559054815220600401805460ff60a01b191690556200027b565b808201808211156200027557634e487b7160e01b600052601160045260246000fd5b92915050565b614507806200028b6000396000f3fe6080604052600436106103545760003560e01c80638c65c81f116101c6578063cdd490c1116100f7578063e2ee2e8911610095578063e7fe78bc1161006f578063e7fe78bc14610cc5578063ebec8eb014610ce5578063f53b02ca14610d2c578063ffd4f75a14610d4c576103a6565b8063e2ee2e8914610c4a578063e4e7c6b414610c85578063e6a7e29314610ca5576103a6565b8063ddc6072b116100d1578063ddc6072b14610b83578063ddf01b4f14610bb3578063e18d38ce14610bfa578063e2eb41ff14610c1a576103a6565b8063cdd490c114610615578063cf16cc8314610b33578063d56d229d14610b63576103a6565b8063a440a19011610164578063b4c2c7fa1161013e578063b4c2c7fa14610aa9578063bf93e34f14610ac9578063bfa3f85a14610afa578063c7ced91e1461041d576103a6565b8063a440a19014610a74578063a63e5aba14610a89578063ae3cbf49146103a4576103a6565b80639391c77a116101a05780639391c77a146109845780639732d78e146109d157806398f0412814610a0a5780639c6f4c1014610a3a576103a6565b80638c65c81f146108405780638fcf3a02146109445780639342c8f414610964576103a6565b806333aa9f00116102a05780636d7c66011161023e5780638793eac6116102185780638793eac6146107be57806387c0a636146107eb5780638907339b1461080b5780638a19c8bc1461082a576103a6565b80636d7c66011461075c5780637ffd32351461077c5780638390e48214610791576103a6565b8063502cb5971161027a578063502cb597146106b757806352cc4b0a146106f15780636b135aa7146104f75780636bf4223b1461072c576103a6565b806333aa9f0014610645578063441f00271461068857806345945a45146106a2576103a6565b806316a6bd5a1161030d5780631e3dbc16116102e75780631e3dbc161461059b5780631fb9f6fa146105cb57806327319053146105e05780632f4b88c514610615576103a6565b806316a6bd5a146104f75780631c930510146105245780631d42687614610554576103a6565b80630181a6d4146103d557806305ae83c5146103e8578063063a706c1461041d57806308d88aad1461045b5780630f763f7f146104b457806312095012146104c7576103a6565b366103a6573460000361038a5760015b60075481116103885761037681610d76565b8061038081613c0b565b915050610364565b505b6103a4604051806020016040528060008152506000610eb2565b005b3460000361038a5760015b6007548111610388576103c381610d76565b806103cd81613c0b565b9150506103b1565b6103a46103e3366004613ce9565b610eb2565b3480156103f457600080fd5b50610408610403366004613d43565b6111aa565b60405190151581526020015b60405180910390f35b34801561042957600080fd5b5061044d610438366004613d73565b6000908152600960205260409020600b015490565b604051908152602001610414565b34801561046757600080fd5b5061049c610476366004613d8c565b8051602081830181018051600b825292820191909301209152546001600160a01b031681565b6040516001600160a01b039091168152602001610414565b6103a46104c2366004613d8c565b6111d7565b3480156104d357600080fd5b5061044d6104e2366004613d73565b6000908152600960205260409020600a015490565b34801561050357600080fd5b50610517610512366004613d73565b6112e8565b6040516104149190613dc9565b34801561053057600080fd5b5061044d61053f366004613d73565b60009081526009602052604090206008015490565b34801561056057600080fd5b5061044d61056f366004613e16565b6001600160a01b0391909116600090815260086020908152604080832093835260059093019052205490565b3480156105a757600080fd5b5061044d6105b6366004613d73565b60009081526009602052604090206001015490565b3480156105d757600080fd5b506103a4611357565b3480156105ec57600080fd5b506106006105fb366004613d73565b61158a565b60408051928352602083019190915201610414565b34801561062157600080fd5b5061044d610630366004613d73565b60009081526009602052604090206007015490565b34801561065157600080fd5b5061044d610660366004613e16565b6001600160a01b03919091166000908152600860209081526040808320938352929052205490565b34801561069457600080fd5b506006546104089060ff1681565b3480156106ae57600080fd5b50610408611685565b3480156106c357600080fd5b506104086106d2366004613d73565b600090815260096020526040902060040154600160a01b900460ff1690565b3480156106fd57600080fd5b5061040861070c366004613e16565b600c60209081526000928352604080842090915290825290205460ff1681565b34801561073857600080fd5b5061044d610747366004613d73565b60009081526009602052604090206003015490565b34801561076857600080fd5b5061044d610777366004613d73565b6116c2565b34801561078857600080fd5b506103a461173d565b34801561079d57600080fd5b5061044d6107ac366004613d73565b60009081526009602052604090205490565b3480156107ca57600080fd5b506107de6107d9366004613e42565b611a95565b6040516104149190613eaf565b3480156107f757600080fd5b506103a4610806366004613f0e565b611b3a565b34801561081757600080fd5b5060065461040890610100900460ff1681565b34801561083657600080fd5b5061044d60075481565b34801561084c57600080fd5b506108d461085b366004613d73565b600960208190526000918252604090912080546001820154600283015460038401546004850154600586015460068701546007880154600889015499890154600a8a0154600b909a0154989a9799969895976001600160a01b0386169760ff600160a01b8804811698600160a81b90980416969192918e565b604080519e8f5260208f019d909d529b8d019a909a5260608c01989098526001600160a01b0390961660808b015293151560a08a015291151560c089015260e08801526101008701526101208601526101408501526101608401526101808301526101a08201526101c001610414565b34801561095057600080fd5b506103a461095f366004613d73565b611f89565b34801561097057600080fd5b506103a461097f366004613d73565b610d76565b34801561099057600080fd5b506109a461099f366004613e16565b61214c565b604080519687526020870195909552938501929092526060840152608083015260a082015260c001610414565b3480156109dd57600080fd5b5061044d6109ec366004613e42565b6001600160a01b031660009081526008602052604090206003015490565b348015610a1657600080fd5b5061044d610a25366004613d73565b60009081526009602052604090206006015490565b348015610a4657600080fd5b50610408610a55366004613d73565b600090815260096020526040902060040154600160a81b900460ff1690565b348015610a8057600080fd5b5061044d6121d7565b348015610a9557600080fd5b506103a4610aa4366004613f0e565b612203565b348015610ab557600080fd5b506103a4610ac4366004613d73565b61260f565b348015610ad557600080fd5b5061044d610ae4366004613d73565b6000908152600960208190526040909120015490565b348015610b0657600080fd5b5061049c610b15366004613d73565b6000908152600960205260409020600401546001600160a01b031690565b348015610b3f57600080fd5b5061044d610b4e366004613d73565b60009081526009602052604090206002015490565b348015610b6f57600080fd5b5060005461049c906001600160a01b031681565b348015610b8f57600080fd5b5061044d610b9e366004613d73565b60009081526009602052604090206005015490565b348015610bbf57600080fd5b5061044d610bce366004613e16565b6001600160a01b0391909116600090815260086020908152604080832093835260029093019052205490565b348015610c0657600080fd5b506107de610c15366004613e42565b61272c565b348015610c2657600080fd5b50610c3a610c35366004613e42565b61279f565b6040516104149493929190613fff565b348015610c5657600080fd5b50610408610c65366004613d43565b600a60209081526000928352604080842090915290825290205460ff1681565b348015610c9157600080fd5b5061044d610ca0366004613e16565b612853565b348015610cb157600080fd5b5061044d610cc0366004613e16565b6128f2565b348015610cd157600080fd5b5060015461049c906001600160a01b031681565b348015610cf157600080fd5b5061044d610d00366004613e16565b6001600160a01b0391909116600090815260086020908152604080832093835260019093019052205490565b348015610d3857600080fd5b5060025461049c906001600160a01b031681565b348015610d5857600080fd5b50600754600090815260096020526040902060030154421015610408565b33600081815260086020526040902090610d8f836129f0565b600083815260058301602090815260408083205460099283905290832090910154610dba919061402b565b600085815260208590526040902054610ddc90670de0b6b3a76400009061403e565b610de69190614060565b600085815260096020818152604080842090920154600588019091529120556006840154909150610e179082614077565b600060068501556007549091508403610e3457610e343385612af3565b8015610eac576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610e70573d6000803e3d6000fd5b506040805182815242602082015233917ffa73d3ab3a92ed3f2b694757d8e4b2f3c293654b11b9c79111f8971f861b22b2910160405180910390a25b50505050565b3360009081526008602052604081208351909190610f5c57816004018054610ed99061408a565b80601f0160208091040260200160405190810160405280929190818152602001828054610f059061408a565b8015610f525780601f10610f2757610100808354040283529160200191610f52565b820191906000526020600020905b815481529060010190602001808311610f3557829003601f168201915b5050505050610f5e565b835b60035460405163661c37fd60e01b81529192506000916001600160a01b039091169063661c37fd90610f94908590600401613eaf565b602060405180830381865afa158015610fb1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd591906140c4565b6007546000908152600960209081526040808320600a8352818420338552909252909120549192509060ff1661106957600c81018054600181810183556000928352602080842090920180546001600160a01b031916339081179091556007548452600a835260408085209185529252908220805460ff19169091179055600b820180549161106383613c0b565b91905055505b600061271061107a6103e834614060565b611084919061403e565b9050801561117457600061109960028361403e565b6001600160a01b0385166000908152600860205260408120600301805492935083929091906110c9908490614077565b90915550506001600160a01b03841660009081526008602052604081206007018054916110f583613c0b565b90915550506001600160a01b03841615611123578086600301600082825461111d9190614077565b90915550505b604080513381526001600160a01b03861660208201529081018290524260608201527f65db98422e8b7340e0d6dfa99bbadd4ba95a51fefafd8f0e1cbbb2e819429a429060800160405180910390a1505b8515611189576111843487612bdc565b611192565b61119234612e79565b600485016111a0858261412f565b5050505050505050565b6000828152600a602090815260408083206001600160a01b038516845290915290205460ff165b92915050565b66470de4df8200003410156112445760405162461bcd60e51b815260206004820152602860248201527f496e73756666696369656e742066756e647320746f20726567697374657220746044820152673432903730b6b29760c11b60648201526084015b60405180910390fd5b60035460405163a1f1ce5760e01b81526001600160a01b039091169063a1f1ce5790349061127890339086906004016141ef565b6000604051808303818588803b15801561129157600080fd5b505af11580156112a5573d6000803e3d6000fd5b50505050507fc45bd68f50ee996247020e8b9e37e0c4b89b46792a2b377d902362a43e07fc583382426040516112dd93929190614213565b60405180910390a150565b600081815260096020908152604091829020600c0180548351818402810184019094528084526060939283018282801561134b57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161132d575b50505050509050919050565b33600090815260086020526040902060030154806113b75760405162461bcd60e51b815260206004820152601f60248201527f4e6f20726566657272616c207265776172647320746f20776974686472617700604482015260640161123b565b60006113c23361272c565b905060008151116114155760405162461bcd60e51b815260206004820152601e60248201527f506c6179657220686173206e6f2072656769737465726564206e616d65730000604482015260640161123b565b3360008181526008602052604080822060030182905551829185156108fc02918691818181858888f19350505050158015611454573d6000803e3d6000fd5b506040805184815242602082015233917ff4e5466fe91f298253ba2304fe42365f818fbeac97d44169a8da36c26e35680b910160405180910390a26000805260086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256ca549250821561158557600080805260086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256ca8190556004546040516001600160a01b039091169085908381818185875af1925050503d806000811461153c576040519150601f19603f3d011682016040523d82523d6000602084013e611541565b606091505b5050905080610eac5760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b604482015260640161123b565b505050565b60008060006115976121d7565b9050808410156115ad5750600093849350915050565b6000806115ba838761403e565b905060005b8183101561166457600060026115d58486614077565b6115df919061403e565b90506115ea816116c2565b91506000816115fa816001614077565b11156116115761160e610777836001614077565b90505b88831115801561162957508382148061162957508881115b1561163657509550611664565b88831161164f57611648826001614077565b945061165d565b61165a60018361402b565b93505b50506115bf565b85600003611670578295505b611679866116c2565b95979596505050505050565b60075460008181526009602052604081206002015490919042108015906116bc575060008181526009602052604090206003015442105b91505090565b6000806116cd6121d7565b9050640218711a00600184116116ee576116e78483614060565b9250611736565b6000816116fc60018761402b565b6117069190614060565b6117109084614077565b9050600261171e8285614077565b6117289087614060565b611732919061403e565b9350505b5050919050565b611745611685565b6117875760405162461bcd60e51b8152602060048201526013602482015272526f756e64206973206e6f742061637469766560681b604482015260640161123b565b3360009081526008602052604090206007546117a2906129f0565b6007546000908152600582016020908152604080832054600992839052908320909101546117d0919061402b565b6007546000908152602084905260409020546117f590670de0b6b3a76400009061403e565b6117ff9190614060565b90508160060154816118119190614077565b600060068401559050806118675760405162461bcd60e51b815260206004820152601b60248201527f4e6f207265776172647320746f20627579206b65797320776974680000000000604482015260640161123b565b60075460009081526009602081815260408084209092015460058601909152908220556118938261158a565b509050600081116118f65760405162461bcd60e51b815260206004820152602760248201527f4e6f7420656e6f756768207265776172647320746f20707572636861736520616044820152666e79206b65797360c81b606482015260840161123b565b60035433600090815260086020526040808220905163661c37fd60e01b815291926001600160a01b03169163661c37fd916119379160049182019101614247565b602060405180830381865afa158015611954573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197891906140c4565b9050600061271061198b6103e886614060565b611995919061403e565b90508015611a855760006119aa60028361403e565b6001600160a01b0384166000908152600860205260408120600301805492935083929091906119da908490614077565b90915550506001600160a01b0383166000908152600860205260408120600701805491611a0683613c0b565b90915550506001600160a01b03831615611a345780866003016000828254611a2e9190614077565b90915550505b604080513381526001600160a01b03851660208201529081018290524260608201527f65db98422e8b7340e0d6dfa99bbadd4ba95a51fefafd8f0e1cbbb2e819429a429060800160405180910390a1505b611a8e84612e79565b5050505050565b6001600160a01b0381166000908152600860205260409020600401805460609190611abf9061408a565b80601f0160208091040260200160405190810160405280929190818152602001828054611aeb9061408a565b801561134b5780601f10611b0d5761010080835404028352916020019161134b565b820191906000526020600020905b815481529060010190602001808311611b1b5750939695505050505050565b60065460ff16611b8c5760405162461bcd60e51b815260206004820152601860248201527f4d69677261746520626173652075736572732066697273740000000000000000604482015260640161123b565b60055460c614611bde5760405162461bcd60e51b815260206004820181905260248201527f416c6c20706c6179657273206d757374206265206c6f61646564206669727374604482015260640161123b565b600654610100900460ff1615611c445760405162461bcd60e51b815260206004820152602560248201527f50686173652074776f206d6967726174696f6e20616c726561647920636f6d706044820152641b195d195960da1b606482015260840161123b565b60005b60c6811015611f6d576000898983818110611c6457611c646142d2565b905060200201351115611cd357888882818110611c8357611c836142d2565b90506020020135600860008d8d85818110611ca057611ca06142d2565b9050602002016020810190611cb59190613e42565b6001600160a01b031681526020810191909152604001600020600301555b868682818110611ce557611ce56142d2565b90506020020135600860008d8d85818110611d0257611d026142d2565b9050602002016020810190611d179190613e42565b6001600160a01b031681526020808201929092526040908101600090812060018252600501909252902055848482818110611d5457611d546142d2565b90506020020135600860008d8d85818110611d7157611d716142d2565b9050602002016020810190611d869190613e42565b6001600160a01b03166001600160a01b03168152602001908152602001600020600601819055506000838383818110611dc157611dc16142d2565b905060200201351115611e3057828282818110611de057611de06142d2565b90506020020135600860008d8d85818110611dfd57611dfd6142d2565b9050602002016020810190611e129190613e42565b6001600160a01b031681526020810191909152604001600020600701555b6000600860008d8d85818110611e4857611e486142d2565b9050602002016020810190611e5d9190613e42565b6001600160a01b03166001600160a01b0316815260200190815260200160002060020160006001815260200190815260200160002054118015611ef257506000600860008d8d85818110611eb357611eb36142d2565b9050602002016020810190611ec89190613e42565b6001600160a01b031681526020808201929092526040908101600090812060018252909252902054115b15611f5b576001600c60008d8d85818110611f0f57611f0f6142d2565b9050602002016020810190611f249190613e42565b6001600160a01b0316815260208082019290925260409081016000908120600182529092529020805460ff19169115159190911790555b80611f6581613c0b565b915050611c47565b50506006805461ff001916610100179055505050505050505050565b6007548110611ff25760405162461bcd60e51b815260206004820152602f60248201527f43616e2774207769746864726177204275726e744b657920526577617264732060448201526e3a32b636103937bab7321032b7321760891b606482015260840161123b565b3360009081526008602090815260408083208484526001019091529020546120665760405162461bcd60e51b815260206004820152602160248201527f506c6179657220686173206e6f206275726e74204b65797320726577617264736044820152601760f91b606482015260840161123b565b6000818152600960209081526040808320600180820154600a90920154338652600885528386208787529091019093529083205490916120a591614060565b6120af919061403e565b336000818152600860209081526040808320878452600101909152808220829055519293509091829184156108fc02918591818181858888f193505050501580156120fe573d6000803e3d6000fd5b5060408051338152602081018490529081018490524260608201527fb5e4db2201bc42c36b8d56179812381a2065d561f6338a9c8a6b68cbaa417a38906080015b60405180910390a1505050565b60008060008060008061215f88886128f2565b6001600160a01b03891660009081526008602090815260408083208b845260028101835281842054600382015460059092019093529220549298509650945092506121aa8888612853565b6001600160a01b039098166000908152600860205260409020600701549598949793965091949293915050565b6007546000818152600960205260408120600801549091908083036111d157640218711a009250505090565b60065460ff16156122565760405162461bcd60e51b815260206004820152601960248201527f4d6967726174696f6e20686173206265656e206c6f636b656400000000000000604482015260640161123b565b600554612264908a90614077565b60c6146122b35760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f742065786365656420313938207573657273000000000000000000604482015260640161123b565b60005b60c6811015612600578888828181106122d1576122d16142d2565b90506020020135600860008d8d858181106122ee576122ee6142d2565b90506020020160208101906123039190613e42565b6001600160a01b031681526020808201929092526040908101600090812060018252909252812091909155878783818110612340576123406142d2565b9050602002013511156123bc5786868281811061235f5761235f6142d2565b90506020020135600860008d8d8581811061237c5761237c6142d2565b90506020020160208101906123919190613e42565b6001600160a01b03168152602080820192909252604090810160009081206001808352019092529020555b60008585838181106123d0576123d06142d2565b90506020020135111561244d578484828181106123ef576123ef6142d2565b90506020020135600860008d8d8581811061240c5761240c6142d2565b90506020020160208101906124219190613e42565b6001600160a01b0316815260208082019290925260409081016000908120600182526002019092529020555b6000838383818110612461576124616142d2565b905060200281019061247391906142e8565b905011156124f45782828281811061248d5761248d6142d2565b905060200281019061249f91906142e8565b600860008e8e868181106124b5576124b56142d2565b90506020020160208101906124ca9190613e42565b6001600160a01b031681526020810191909152604001600020600401916124f291908361432f565b505b6007546000908152600a602052604081206001918d8d8581811061251a5761251a6142d2565b905060200201602081019061252f9190613e42565b6001600160a01b0316815260208082019290925260409081016000908120805460ff191694151594909417909355600754835260099091529020600c018b8b8381811061257e5761257e6142d2565b90506020020160208101906125939190613e42565b81546001810183556000928352602083200180546001600160a01b0319166001600160a01b039290921691909117905560058054916125d183613c0b565b919050555060055460c6036125ee576006805460ff191660011790555b806125f881613c0b565b9150506122b6565b5050505050505050505050565b565b6000546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e90602401602060405180830381865afa158015612658573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061267c91906140c4565b6001600160a01b0316146126d25760405162461bcd60e51b815260206004820152601760248201527f596f7520646f6e2774206f776e2074686973204e46542e000000000000000000604482015260640161123b565b600154604051635a6163fd60e11b8152600481018390526001600160a01b039091169063b4c2c7fa90602401600060405180830381600087803b15801561271857600080fd5b505af1158015611a8e573d6000803e3d6000fd5b6003546040516307d1c18d60e51b81526001600160a01b038381166004830152606092169063fa3831a090602401600060405180830381865afa158015612777573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111d191908101906143ef565b600860205260009081526040902060038101546004820180549192916127c49061408a565b80601f01602080910402602001604051908101604052809291908181526020018280546127f09061408a565b801561283d5780601f106128125761010080835404028352916020019161283d565b820191906000526020600020905b81548152906001019060200180831161282057829003601f168201915b5050505050908060060154908060070154905084565b6001600160a01b03821660009081526008602052604081208161287685856128f2565b60008581526005840160209081526040808320546009928390529083209091015492935090916128a6919061402b565b6128b8670de0b6b3a76400008461403e565b6128c29190614060565b90506007548510156128d85792506111d1915050565b60068301546128e79082614077565b93506111d192505050565b6001600160a01b0382166000908152600860209081526040808320848452600281019092528220541580159061294c57506001600160a01b0384166000908152600c6020908152604080832086845290915290205460ff16155b156129d9576000838152600960209081526040808320600701546001600160a01b0388168452600883528184208785526002019092528220549091826129958362989680614060565b61299f919061403e565b6129b190670de0b6b3a7640000614060565b6000878152602086905260409020549091506129ce908290614077565b9450505050506111d1565b6000838152602091909152604090205490506111d1565b33600090815260086020908152604080832084845260020190915290205415801590612a375750336000908152600c6020908152604080832084845290915290205460ff16155b15612af05760008181526009602090815260408083206007015433845260088352818420858552600201909252822054909182612a778362989680614060565b612a81919061403e565b612a9390670de0b6b3a7640000614060565b336000908152600860209081526040808320888452909152812080549293508392909190612ac2908490614077565b9091555050336000908152600c602090815260408083208784529091529020805460ff191660011790555050505b50565b6007548103612bd8576001600160a01b038216600090815260086020908152604080832084845280835281842080549085905560019091019092528220805491928392612b41908490614077565b909155505060008281526009602052604081208054839290612b6490849061402b565b909155505060008281526009602052604081206001018054839290612b8a908490614077565b9091555050604080516001600160a01b03851681526020810183905242918101919091527f66a311d8c7fcd3d4187dc4da66257340daa47cb6b0ecf77584ea90f146f53f339060600161213f565b5050565b612be4611685565b80612c0357506007546000908152600960205260409020600301544210155b612c1f5760405162461bcd60e51b815260040161123b90614466565b600754600081815260096020526040902060038101544210612cb6578054600003612c9957612c5042610258614077565b60038201556064612c6285605a614060565b612c6c919061403e565b3360009081526008602052604081206006018054909190612c8e908490614077565b909155505050505050565b612ca16130a6565b612ca96132fb565b6064612c6285605a614060565b612cbe611685565b15610eac5761012c8160020154612cd59190614077565b4211612ce957612ce4846133e2565b610eac565b6004810154600160a01b900460ff16610eac576004810154600160a81b900460ff1615612d2057612d18613558565b612d206135d8565b612d2861364b565b81600801541115612d89576000612d3d613671565b600883018190556040805133815260208101839052428183015290519192507f621af463096d58966fa48f497088db472e960b9f399d8cbf787ec0f7d2253365919081900360600190a1505b6000612d94846116c2565b905084811115612e015760405162461bcd60e51b815260206004820152603260248201527f4e6f7420656e6f7567682045544820746f206275792074686520737065636966604482015271696564206e756d626572206f66206b65797360701b606482015260840161123b565b612e0a83613697565b3360009081526008602090815260408083208684526005019091528120549003612e525760098201543360009081526008602090815260408083208784526005019091529020555b612e5c8486613753565b6004820180546001600160a01b03191633179055611a8e846138c1565b612e81611685565b80612ea057506007546000908152600960205260409020600301544210155b612ebc5760405162461bcd60e51b815260040161123b90614466565b600754600081815260096020526040902060038101544210612f52578054600003612f3557612eed42610258614077565b60038201556064612eff84605a614060565b612f09919061403e565b3360009081526008602052604081206006018054909190612f2b908490614077565b9091555050505050565b612f3d6130a6565b612f456132fb565b6064612eff84605a614060565b612f5a611685565b156115855761012c8160020154612f719190614077565b4211612f8057611585836133e2565b6004810154600160a01b900460ff16611585576004810154600160a81b900460ff1615612fb757612faf613558565b612fb76135d8565b612fbf61364b565b81600801541115613020576000612fd4613671565b600883018190556040805133815260208101839052428183015290519192507f621af463096d58966fa48f497088db472e960b9f399d8cbf787ec0f7d2253365919081900360600190a1505b600061302b8461158a565b50905061303783613697565b336000908152600860209081526040808320868452600501909152812054900361307f5760098201543360009081526008602090815260408083208784526005019091529020555b6130898185613753565b6004820180546001600160a01b03191633179055610eac816138c1565b6007546000908152600960205260409020600381015442101561310b5760405162461bcd60e51b815260206004820152601860248201527f526f756e6420686173206e6f742079657420656e6465642e0000000000000000604482015260640161123b565b600481015460068201546001600160a01b039091169060006064613130836032614060565b61313a919061403e565b90506000606461314b846014614060565b613155919061403e565b905060006064613166856014614060565b613170919061403e565b90506000606461318186600a614060565b61318b919061403e565b6001600160a01b0387166000908152600860205260408120600601805492935086929091906131bb908490614077565b925050819055508287600a0160008282546131d69190614077565b92505081905550806009600060075460016131f19190614077565b815260200190815260200160002060060181905550600160009054906101000a90046001600160a01b03166001600160a01b031663c07401f0836040518263ffffffff1660e01b81526004016000604051808303818588803b15801561325657600080fd5b505af115801561326a573d6000803e3d6000fd5b5050505060048801805460ff60a01b1916600160a01b17905550600754604080519182526001600160a01b03881660208301528101869052606081018590526080810184905260a0810183905260c081018290524260e08201527f68888a78b8e7ab912daca530dfa166bc912793d9960370129b7ce52a88d6aa7d906101000160405180910390a150505050505050565b60016007600082825461330e9190614077565b9091555061332190506201518042614077565b60078054600090815260096020526040808220600290810194909455915481522001546133509061a8c0614077565b60078054600090815260096020818152604080842060039081019690965584548452808420600401805460ff60a01b191690558454845280842060019301929092559254808352918190206002810154940154815192835292820193909352918201527fb0b0c60f0267584d50a65485b5eff6babad43c5727703515fde33bb545b191149060600160405180910390a1565b60006127106133f36103e884614060565b6133fd919061403e565b60035433600090815260086020526040808220905163661c37fd60e01b815293945090926001600160a01b039092169163661c37fd916134439160049182019101614247565b602060405180830381865afa158015613460573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061348491906140c4565b6001600160a01b0316036134a05761349d60028261403e565b90505b60006134ac828461402b565b90508060096000600754815260200190815260200160002060070160008282546134d69190614077565b909155505033600090815260086020908152604080832060075484526002019091528120805483929061350a908490614077565b9091555050336000908152600860209081526040808320600780548552600590910183528184206001905554835260099091529020600401805460ff60a81b1916600160a81b179055505050565b6007805460009081526009602052604090200154156135a857600754600090815260096020526040812080546a084595161401484a000000929061359d908490614077565b9091555061260d9050565b60075460009081526009602052604081208054670de0b6b3a764000092906135d1908490614077565b9091555050565b60078054600090815260096020526040902060048101805460ff60a81b19169055908101541561361f57629896808160070154613615919061403e565b600882015561362b565b640218711a0060088201555b80600701548160060160008282546136439190614077565b909155505050565b6007546000818152600960205260408120600601549091906116bc90620f42409061403e565b6007546000818152600960205260408120600601549091906116bc90629896809061403e565b3360009081526008602052604090206136af826129f0565b60008281526020829052604090205415612bd8576000828152600582016020908152604080832054600992839052908320909101546136ee919061402b565b60008481526020849052604090205461371090670de0b6b3a76400009061403e565b61371a9190614060565b60008481526009602081815260408084209092015460058701909152908220556006840180549293508392909190612f2b908490614077565b600081116137ad5760405162461bcd60e51b815260206004820152602160248201527f4e6f7420656e6f75676820457468657220746f207075726368617365206b65796044820152607360f81b606482015260840161123b565b60006137c183670de0b6b3a7640000614060565b60075460008181526009602090815260408083203384526008835281842094845293909152812080549394509192849291906137fe908490614077565b90915550506009810154336000908152600860209081526040808320600754845260050190915281209190915581548391839161383c908490614077565b90915550506008810154640218711a006138568682614060565b6138609083614077565b60088401819055915061387285613925565b60408051338152602081018890529081018390524260608201527f061b93d2295a1ccd00b307b25e89ad7019e6ff618bc79313561f6a1d893e32459060800160405180910390a1505050505050565b60006138ce82601e614060565b905060006138de4261a8c0614077565b60075460009081526009602052604090206003015490915061390b90613905908490614077565b82613b84565b600754600090815260096020526040902060030155505050565b60006127106139366103e884614060565b613940919061403e565b60035433600090815260086020526040808220905163661c37fd60e01b815293945090926001600160a01b039092169163661c37fd916139869160049182019101614247565b602060405180830381865afa1580156139a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139c791906140c4565b6001600160a01b0316036139e3576139e060028261403e565b90505b60006139ef828461402b565b90506000612710613a0261138884614060565b613a0c919061403e565b9050613a1a81600754613b9c565b6000612710613a2b610bb885614060565b613a35919061403e565b9050806009600060075481526020019081526020016000206006016000828254613a5f9190614077565b9091555060009050612710613a766101f486614060565b613a80919061403e565b9050600160009054906101000a90046001600160a01b03166001600160a01b031663c07401f0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015613ad257600080fd5b505af1158015613ae6573d6000803e3d6000fd5b505050505060006127106105dc86613afe9190614060565b613b08919061403e565b9050600260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0826040518263ffffffff1660e01b815260040160206040518083038185885af1158015613b5f573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a091906144af565b6000818310613b935781613b95565b825b9392505050565b600754600090815260096020526040902054613bc190670de0b6b3a76400009061403e565b613bcb908361403e565b60008281526009602081905260408220018054909190613bec908490614077565b90915550505050565b634e487b7160e01b600052601160045260246000fd5b600060018201613c1d57613c1d613bf5565b5060010190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613c6357613c63613c24565b604052919050565b600067ffffffffffffffff821115613c8557613c85613c24565b50601f01601f191660200190565b600082601f830112613ca457600080fd5b8135613cb7613cb282613c6b565b613c3a565b818152846020838601011115613ccc57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215613cfc57600080fd5b823567ffffffffffffffff811115613d1357600080fd5b613d1f85828601613c93565b95602094909401359450505050565b6001600160a01b0381168114612af057600080fd5b60008060408385031215613d5657600080fd5b823591506020830135613d6881613d2e565b809150509250929050565b600060208284031215613d8557600080fd5b5035919050565b600060208284031215613d9e57600080fd5b813567ffffffffffffffff811115613db557600080fd5b613dc184828501613c93565b949350505050565b6020808252825182820181905260009190848201906040850190845b81811015613e0a5783516001600160a01b031683529284019291840191600101613de5565b50909695505050505050565b60008060408385031215613e2957600080fd5b8235613e3481613d2e565b946020939093013593505050565b600060208284031215613e5457600080fd5b8135613b9581613d2e565b60005b83811015613e7a578181015183820152602001613e62565b50506000910152565b60008151808452613e9b816020860160208601613e5f565b601f01601f19169290920160200192915050565b602081526000613b956020830184613e83565b60008083601f840112613ed457600080fd5b50813567ffffffffffffffff811115613eec57600080fd5b6020830191508360208260051b8501011115613f0757600080fd5b9250929050565b60008060008060008060008060008060a08b8d031215613f2d57600080fd5b8a3567ffffffffffffffff80821115613f4557600080fd5b613f518e838f01613ec2565b909c509a5060208d0135915080821115613f6a57600080fd5b613f768e838f01613ec2565b909a50985060408d0135915080821115613f8f57600080fd5b613f9b8e838f01613ec2565b909850965060608d0135915080821115613fb457600080fd5b613fc08e838f01613ec2565b909650945060808d0135915080821115613fd957600080fd5b50613fe68d828e01613ec2565b915080935050809150509295989b9194979a5092959850565b8481526080602082015260006140186080830186613e83565b6040830194909452506060015292915050565b818103818111156111d1576111d1613bf5565b60008261405b57634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176111d1576111d1613bf5565b808201808211156111d1576111d1613bf5565b600181811c9082168061409e57607f821691505b6020821081036140be57634e487b7160e01b600052602260045260246000fd5b50919050565b6000602082840312156140d657600080fd5b8151613b9581613d2e565b601f82111561158557600081815260208120601f850160051c810160208610156141085750805b601f850160051c820191505b8181101561412757828155600101614114565b505050505050565b815167ffffffffffffffff81111561414957614149613c24565b61415d81614157845461408a565b846140e1565b602080601f831160018114614192576000841561417a5750858301515b600019600386901b1c1916600185901b178555614127565b600085815260208120601f198616915b828110156141c1578886015182559484019460019091019084016141a2565b50858210156141df5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0383168152604060208201819052600090613dc190830184613e83565b6001600160a01b038416815260606020820181905260009061423790830185613e83565b9050826040830152949350505050565b600060208083526000845461425b8161408a565b8084870152604060018084166000811461427c5760018114614296576142c4565b60ff1985168984015283151560051b8901830195506142c4565b896000528660002060005b858110156142bc5781548b82018601529083019088016142a1565b8a0184019650505b509398975050505050505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126142ff57600080fd5b83018035915067ffffffffffffffff82111561431a57600080fd5b602001915036819003821315613f0757600080fd5b67ffffffffffffffff83111561434757614347613c24565b61435b83614355835461408a565b836140e1565b6000601f84116001811461438f57600085156143775750838201355b600019600387901b1c1916600186901b178355611a8e565b600083815260209020601f19861690835b828110156143c057868501358255602094850194600190920191016143a0565b50868210156143dd5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60006020828403121561440157600080fd5b815167ffffffffffffffff81111561441857600080fd5b8201601f8101841361442957600080fd5b8051614437613cb282613c6b565b81815285602083850101111561444c57600080fd5b61445d826020830160208601613e5f565b95945050505050565b60208082526029908201527f43616e6e6f74207075726368617365206b65797320647572696e6720746865206040820152680726f756e64206761760bc1b606082015260800190565b6000602082840312156144c157600080fd5b81518015158114613b9557600080fdfea2646970667358221220ec7ed10a1835846ac4948e982e8b5a1103e722702c93492d49ef2163555e1ac664736f6c63430008110033

Deployed Bytecode

0x6080604052600436106103545760003560e01c80638c65c81f116101c6578063cdd490c1116100f7578063e2ee2e8911610095578063e7fe78bc1161006f578063e7fe78bc14610cc5578063ebec8eb014610ce5578063f53b02ca14610d2c578063ffd4f75a14610d4c576103a6565b8063e2ee2e8914610c4a578063e4e7c6b414610c85578063e6a7e29314610ca5576103a6565b8063ddc6072b116100d1578063ddc6072b14610b83578063ddf01b4f14610bb3578063e18d38ce14610bfa578063e2eb41ff14610c1a576103a6565b8063cdd490c114610615578063cf16cc8314610b33578063d56d229d14610b63576103a6565b8063a440a19011610164578063b4c2c7fa1161013e578063b4c2c7fa14610aa9578063bf93e34f14610ac9578063bfa3f85a14610afa578063c7ced91e1461041d576103a6565b8063a440a19014610a74578063a63e5aba14610a89578063ae3cbf49146103a4576103a6565b80639391c77a116101a05780639391c77a146109845780639732d78e146109d157806398f0412814610a0a5780639c6f4c1014610a3a576103a6565b80638c65c81f146108405780638fcf3a02146109445780639342c8f414610964576103a6565b806333aa9f00116102a05780636d7c66011161023e5780638793eac6116102185780638793eac6146107be57806387c0a636146107eb5780638907339b1461080b5780638a19c8bc1461082a576103a6565b80636d7c66011461075c5780637ffd32351461077c5780638390e48214610791576103a6565b8063502cb5971161027a578063502cb597146106b757806352cc4b0a146106f15780636b135aa7146104f75780636bf4223b1461072c576103a6565b806333aa9f0014610645578063441f00271461068857806345945a45146106a2576103a6565b806316a6bd5a1161030d5780631e3dbc16116102e75780631e3dbc161461059b5780631fb9f6fa146105cb57806327319053146105e05780632f4b88c514610615576103a6565b806316a6bd5a146104f75780631c930510146105245780631d42687614610554576103a6565b80630181a6d4146103d557806305ae83c5146103e8578063063a706c1461041d57806308d88aad1461045b5780630f763f7f146104b457806312095012146104c7576103a6565b366103a6573460000361038a5760015b60075481116103885761037681610d76565b8061038081613c0b565b915050610364565b505b6103a4604051806020016040528060008152506000610eb2565b005b3460000361038a5760015b6007548111610388576103c381610d76565b806103cd81613c0b565b9150506103b1565b6103a46103e3366004613ce9565b610eb2565b3480156103f457600080fd5b50610408610403366004613d43565b6111aa565b60405190151581526020015b60405180910390f35b34801561042957600080fd5b5061044d610438366004613d73565b6000908152600960205260409020600b015490565b604051908152602001610414565b34801561046757600080fd5b5061049c610476366004613d8c565b8051602081830181018051600b825292820191909301209152546001600160a01b031681565b6040516001600160a01b039091168152602001610414565b6103a46104c2366004613d8c565b6111d7565b3480156104d357600080fd5b5061044d6104e2366004613d73565b6000908152600960205260409020600a015490565b34801561050357600080fd5b50610517610512366004613d73565b6112e8565b6040516104149190613dc9565b34801561053057600080fd5b5061044d61053f366004613d73565b60009081526009602052604090206008015490565b34801561056057600080fd5b5061044d61056f366004613e16565b6001600160a01b0391909116600090815260086020908152604080832093835260059093019052205490565b3480156105a757600080fd5b5061044d6105b6366004613d73565b60009081526009602052604090206001015490565b3480156105d757600080fd5b506103a4611357565b3480156105ec57600080fd5b506106006105fb366004613d73565b61158a565b60408051928352602083019190915201610414565b34801561062157600080fd5b5061044d610630366004613d73565b60009081526009602052604090206007015490565b34801561065157600080fd5b5061044d610660366004613e16565b6001600160a01b03919091166000908152600860209081526040808320938352929052205490565b34801561069457600080fd5b506006546104089060ff1681565b3480156106ae57600080fd5b50610408611685565b3480156106c357600080fd5b506104086106d2366004613d73565b600090815260096020526040902060040154600160a01b900460ff1690565b3480156106fd57600080fd5b5061040861070c366004613e16565b600c60209081526000928352604080842090915290825290205460ff1681565b34801561073857600080fd5b5061044d610747366004613d73565b60009081526009602052604090206003015490565b34801561076857600080fd5b5061044d610777366004613d73565b6116c2565b34801561078857600080fd5b506103a461173d565b34801561079d57600080fd5b5061044d6107ac366004613d73565b60009081526009602052604090205490565b3480156107ca57600080fd5b506107de6107d9366004613e42565b611a95565b6040516104149190613eaf565b3480156107f757600080fd5b506103a4610806366004613f0e565b611b3a565b34801561081757600080fd5b5060065461040890610100900460ff1681565b34801561083657600080fd5b5061044d60075481565b34801561084c57600080fd5b506108d461085b366004613d73565b600960208190526000918252604090912080546001820154600283015460038401546004850154600586015460068701546007880154600889015499890154600a8a0154600b909a0154989a9799969895976001600160a01b0386169760ff600160a01b8804811698600160a81b90980416969192918e565b604080519e8f5260208f019d909d529b8d019a909a5260608c01989098526001600160a01b0390961660808b015293151560a08a015291151560c089015260e08801526101008701526101208601526101408501526101608401526101808301526101a08201526101c001610414565b34801561095057600080fd5b506103a461095f366004613d73565b611f89565b34801561097057600080fd5b506103a461097f366004613d73565b610d76565b34801561099057600080fd5b506109a461099f366004613e16565b61214c565b604080519687526020870195909552938501929092526060840152608083015260a082015260c001610414565b3480156109dd57600080fd5b5061044d6109ec366004613e42565b6001600160a01b031660009081526008602052604090206003015490565b348015610a1657600080fd5b5061044d610a25366004613d73565b60009081526009602052604090206006015490565b348015610a4657600080fd5b50610408610a55366004613d73565b600090815260096020526040902060040154600160a81b900460ff1690565b348015610a8057600080fd5b5061044d6121d7565b348015610a9557600080fd5b506103a4610aa4366004613f0e565b612203565b348015610ab557600080fd5b506103a4610ac4366004613d73565b61260f565b348015610ad557600080fd5b5061044d610ae4366004613d73565b6000908152600960208190526040909120015490565b348015610b0657600080fd5b5061049c610b15366004613d73565b6000908152600960205260409020600401546001600160a01b031690565b348015610b3f57600080fd5b5061044d610b4e366004613d73565b60009081526009602052604090206002015490565b348015610b6f57600080fd5b5060005461049c906001600160a01b031681565b348015610b8f57600080fd5b5061044d610b9e366004613d73565b60009081526009602052604090206005015490565b348015610bbf57600080fd5b5061044d610bce366004613e16565b6001600160a01b0391909116600090815260086020908152604080832093835260029093019052205490565b348015610c0657600080fd5b506107de610c15366004613e42565b61272c565b348015610c2657600080fd5b50610c3a610c35366004613e42565b61279f565b6040516104149493929190613fff565b348015610c5657600080fd5b50610408610c65366004613d43565b600a60209081526000928352604080842090915290825290205460ff1681565b348015610c9157600080fd5b5061044d610ca0366004613e16565b612853565b348015610cb157600080fd5b5061044d610cc0366004613e16565b6128f2565b348015610cd157600080fd5b5060015461049c906001600160a01b031681565b348015610cf157600080fd5b5061044d610d00366004613e16565b6001600160a01b0391909116600090815260086020908152604080832093835260019093019052205490565b348015610d3857600080fd5b5060025461049c906001600160a01b031681565b348015610d5857600080fd5b50600754600090815260096020526040902060030154421015610408565b33600081815260086020526040902090610d8f836129f0565b600083815260058301602090815260408083205460099283905290832090910154610dba919061402b565b600085815260208590526040902054610ddc90670de0b6b3a76400009061403e565b610de69190614060565b600085815260096020818152604080842090920154600588019091529120556006840154909150610e179082614077565b600060068501556007549091508403610e3457610e343385612af3565b8015610eac576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610e70573d6000803e3d6000fd5b506040805182815242602082015233917ffa73d3ab3a92ed3f2b694757d8e4b2f3c293654b11b9c79111f8971f861b22b2910160405180910390a25b50505050565b3360009081526008602052604081208351909190610f5c57816004018054610ed99061408a565b80601f0160208091040260200160405190810160405280929190818152602001828054610f059061408a565b8015610f525780601f10610f2757610100808354040283529160200191610f52565b820191906000526020600020905b815481529060010190602001808311610f3557829003601f168201915b5050505050610f5e565b835b60035460405163661c37fd60e01b81529192506000916001600160a01b039091169063661c37fd90610f94908590600401613eaf565b602060405180830381865afa158015610fb1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd591906140c4565b6007546000908152600960209081526040808320600a8352818420338552909252909120549192509060ff1661106957600c81018054600181810183556000928352602080842090920180546001600160a01b031916339081179091556007548452600a835260408085209185529252908220805460ff19169091179055600b820180549161106383613c0b565b91905055505b600061271061107a6103e834614060565b611084919061403e565b9050801561117457600061109960028361403e565b6001600160a01b0385166000908152600860205260408120600301805492935083929091906110c9908490614077565b90915550506001600160a01b03841660009081526008602052604081206007018054916110f583613c0b565b90915550506001600160a01b03841615611123578086600301600082825461111d9190614077565b90915550505b604080513381526001600160a01b03861660208201529081018290524260608201527f65db98422e8b7340e0d6dfa99bbadd4ba95a51fefafd8f0e1cbbb2e819429a429060800160405180910390a1505b8515611189576111843487612bdc565b611192565b61119234612e79565b600485016111a0858261412f565b5050505050505050565b6000828152600a602090815260408083206001600160a01b038516845290915290205460ff165b92915050565b66470de4df8200003410156112445760405162461bcd60e51b815260206004820152602860248201527f496e73756666696369656e742066756e647320746f20726567697374657220746044820152673432903730b6b29760c11b60648201526084015b60405180910390fd5b60035460405163a1f1ce5760e01b81526001600160a01b039091169063a1f1ce5790349061127890339086906004016141ef565b6000604051808303818588803b15801561129157600080fd5b505af11580156112a5573d6000803e3d6000fd5b50505050507fc45bd68f50ee996247020e8b9e37e0c4b89b46792a2b377d902362a43e07fc583382426040516112dd93929190614213565b60405180910390a150565b600081815260096020908152604091829020600c0180548351818402810184019094528084526060939283018282801561134b57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161132d575b50505050509050919050565b33600090815260086020526040902060030154806113b75760405162461bcd60e51b815260206004820152601f60248201527f4e6f20726566657272616c207265776172647320746f20776974686472617700604482015260640161123b565b60006113c23361272c565b905060008151116114155760405162461bcd60e51b815260206004820152601e60248201527f506c6179657220686173206e6f2072656769737465726564206e616d65730000604482015260640161123b565b3360008181526008602052604080822060030182905551829185156108fc02918691818181858888f19350505050158015611454573d6000803e3d6000fd5b506040805184815242602082015233917ff4e5466fe91f298253ba2304fe42365f818fbeac97d44169a8da36c26e35680b910160405180910390a26000805260086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256ca549250821561158557600080805260086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256ca8190556004546040516001600160a01b039091169085908381818185875af1925050503d806000811461153c576040519150601f19603f3d011682016040523d82523d6000602084013e611541565b606091505b5050905080610eac5760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b604482015260640161123b565b505050565b60008060006115976121d7565b9050808410156115ad5750600093849350915050565b6000806115ba838761403e565b905060005b8183101561166457600060026115d58486614077565b6115df919061403e565b90506115ea816116c2565b91506000816115fa816001614077565b11156116115761160e610777836001614077565b90505b88831115801561162957508382148061162957508881115b1561163657509550611664565b88831161164f57611648826001614077565b945061165d565b61165a60018361402b565b93505b50506115bf565b85600003611670578295505b611679866116c2565b95979596505050505050565b60075460008181526009602052604081206002015490919042108015906116bc575060008181526009602052604090206003015442105b91505090565b6000806116cd6121d7565b9050640218711a00600184116116ee576116e78483614060565b9250611736565b6000816116fc60018761402b565b6117069190614060565b6117109084614077565b9050600261171e8285614077565b6117289087614060565b611732919061403e565b9350505b5050919050565b611745611685565b6117875760405162461bcd60e51b8152602060048201526013602482015272526f756e64206973206e6f742061637469766560681b604482015260640161123b565b3360009081526008602052604090206007546117a2906129f0565b6007546000908152600582016020908152604080832054600992839052908320909101546117d0919061402b565b6007546000908152602084905260409020546117f590670de0b6b3a76400009061403e565b6117ff9190614060565b90508160060154816118119190614077565b600060068401559050806118675760405162461bcd60e51b815260206004820152601b60248201527f4e6f207265776172647320746f20627579206b65797320776974680000000000604482015260640161123b565b60075460009081526009602081815260408084209092015460058601909152908220556118938261158a565b509050600081116118f65760405162461bcd60e51b815260206004820152602760248201527f4e6f7420656e6f756768207265776172647320746f20707572636861736520616044820152666e79206b65797360c81b606482015260840161123b565b60035433600090815260086020526040808220905163661c37fd60e01b815291926001600160a01b03169163661c37fd916119379160049182019101614247565b602060405180830381865afa158015611954573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197891906140c4565b9050600061271061198b6103e886614060565b611995919061403e565b90508015611a855760006119aa60028361403e565b6001600160a01b0384166000908152600860205260408120600301805492935083929091906119da908490614077565b90915550506001600160a01b0383166000908152600860205260408120600701805491611a0683613c0b565b90915550506001600160a01b03831615611a345780866003016000828254611a2e9190614077565b90915550505b604080513381526001600160a01b03851660208201529081018290524260608201527f65db98422e8b7340e0d6dfa99bbadd4ba95a51fefafd8f0e1cbbb2e819429a429060800160405180910390a1505b611a8e84612e79565b5050505050565b6001600160a01b0381166000908152600860205260409020600401805460609190611abf9061408a565b80601f0160208091040260200160405190810160405280929190818152602001828054611aeb9061408a565b801561134b5780601f10611b0d5761010080835404028352916020019161134b565b820191906000526020600020905b815481529060010190602001808311611b1b5750939695505050505050565b60065460ff16611b8c5760405162461bcd60e51b815260206004820152601860248201527f4d69677261746520626173652075736572732066697273740000000000000000604482015260640161123b565b60055460c614611bde5760405162461bcd60e51b815260206004820181905260248201527f416c6c20706c6179657273206d757374206265206c6f61646564206669727374604482015260640161123b565b600654610100900460ff1615611c445760405162461bcd60e51b815260206004820152602560248201527f50686173652074776f206d6967726174696f6e20616c726561647920636f6d706044820152641b195d195960da1b606482015260840161123b565b60005b60c6811015611f6d576000898983818110611c6457611c646142d2565b905060200201351115611cd357888882818110611c8357611c836142d2565b90506020020135600860008d8d85818110611ca057611ca06142d2565b9050602002016020810190611cb59190613e42565b6001600160a01b031681526020810191909152604001600020600301555b868682818110611ce557611ce56142d2565b90506020020135600860008d8d85818110611d0257611d026142d2565b9050602002016020810190611d179190613e42565b6001600160a01b031681526020808201929092526040908101600090812060018252600501909252902055848482818110611d5457611d546142d2565b90506020020135600860008d8d85818110611d7157611d716142d2565b9050602002016020810190611d869190613e42565b6001600160a01b03166001600160a01b03168152602001908152602001600020600601819055506000838383818110611dc157611dc16142d2565b905060200201351115611e3057828282818110611de057611de06142d2565b90506020020135600860008d8d85818110611dfd57611dfd6142d2565b9050602002016020810190611e129190613e42565b6001600160a01b031681526020810191909152604001600020600701555b6000600860008d8d85818110611e4857611e486142d2565b9050602002016020810190611e5d9190613e42565b6001600160a01b03166001600160a01b0316815260200190815260200160002060020160006001815260200190815260200160002054118015611ef257506000600860008d8d85818110611eb357611eb36142d2565b9050602002016020810190611ec89190613e42565b6001600160a01b031681526020808201929092526040908101600090812060018252909252902054115b15611f5b576001600c60008d8d85818110611f0f57611f0f6142d2565b9050602002016020810190611f249190613e42565b6001600160a01b0316815260208082019290925260409081016000908120600182529092529020805460ff19169115159190911790555b80611f6581613c0b565b915050611c47565b50506006805461ff001916610100179055505050505050505050565b6007548110611ff25760405162461bcd60e51b815260206004820152602f60248201527f43616e2774207769746864726177204275726e744b657920526577617264732060448201526e3a32b636103937bab7321032b7321760891b606482015260840161123b565b3360009081526008602090815260408083208484526001019091529020546120665760405162461bcd60e51b815260206004820152602160248201527f506c6179657220686173206e6f206275726e74204b65797320726577617264736044820152601760f91b606482015260840161123b565b6000818152600960209081526040808320600180820154600a90920154338652600885528386208787529091019093529083205490916120a591614060565b6120af919061403e565b336000818152600860209081526040808320878452600101909152808220829055519293509091829184156108fc02918591818181858888f193505050501580156120fe573d6000803e3d6000fd5b5060408051338152602081018490529081018490524260608201527fb5e4db2201bc42c36b8d56179812381a2065d561f6338a9c8a6b68cbaa417a38906080015b60405180910390a1505050565b60008060008060008061215f88886128f2565b6001600160a01b03891660009081526008602090815260408083208b845260028101835281842054600382015460059092019093529220549298509650945092506121aa8888612853565b6001600160a01b039098166000908152600860205260409020600701549598949793965091949293915050565b6007546000818152600960205260408120600801549091908083036111d157640218711a009250505090565b60065460ff16156122565760405162461bcd60e51b815260206004820152601960248201527f4d6967726174696f6e20686173206265656e206c6f636b656400000000000000604482015260640161123b565b600554612264908a90614077565b60c6146122b35760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f742065786365656420313938207573657273000000000000000000604482015260640161123b565b60005b60c6811015612600578888828181106122d1576122d16142d2565b90506020020135600860008d8d858181106122ee576122ee6142d2565b90506020020160208101906123039190613e42565b6001600160a01b031681526020808201929092526040908101600090812060018252909252812091909155878783818110612340576123406142d2565b9050602002013511156123bc5786868281811061235f5761235f6142d2565b90506020020135600860008d8d8581811061237c5761237c6142d2565b90506020020160208101906123919190613e42565b6001600160a01b03168152602080820192909252604090810160009081206001808352019092529020555b60008585838181106123d0576123d06142d2565b90506020020135111561244d578484828181106123ef576123ef6142d2565b90506020020135600860008d8d8581811061240c5761240c6142d2565b90506020020160208101906124219190613e42565b6001600160a01b0316815260208082019290925260409081016000908120600182526002019092529020555b6000838383818110612461576124616142d2565b905060200281019061247391906142e8565b905011156124f45782828281811061248d5761248d6142d2565b905060200281019061249f91906142e8565b600860008e8e868181106124b5576124b56142d2565b90506020020160208101906124ca9190613e42565b6001600160a01b031681526020810191909152604001600020600401916124f291908361432f565b505b6007546000908152600a602052604081206001918d8d8581811061251a5761251a6142d2565b905060200201602081019061252f9190613e42565b6001600160a01b0316815260208082019290925260409081016000908120805460ff191694151594909417909355600754835260099091529020600c018b8b8381811061257e5761257e6142d2565b90506020020160208101906125939190613e42565b81546001810183556000928352602083200180546001600160a01b0319166001600160a01b039290921691909117905560058054916125d183613c0b565b919050555060055460c6036125ee576006805460ff191660011790555b806125f881613c0b565b9150506122b6565b5050505050505050505050565b565b6000546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e90602401602060405180830381865afa158015612658573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061267c91906140c4565b6001600160a01b0316146126d25760405162461bcd60e51b815260206004820152601760248201527f596f7520646f6e2774206f776e2074686973204e46542e000000000000000000604482015260640161123b565b600154604051635a6163fd60e11b8152600481018390526001600160a01b039091169063b4c2c7fa90602401600060405180830381600087803b15801561271857600080fd5b505af1158015611a8e573d6000803e3d6000fd5b6003546040516307d1c18d60e51b81526001600160a01b038381166004830152606092169063fa3831a090602401600060405180830381865afa158015612777573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111d191908101906143ef565b600860205260009081526040902060038101546004820180549192916127c49061408a565b80601f01602080910402602001604051908101604052809291908181526020018280546127f09061408a565b801561283d5780601f106128125761010080835404028352916020019161283d565b820191906000526020600020905b81548152906001019060200180831161282057829003601f168201915b5050505050908060060154908060070154905084565b6001600160a01b03821660009081526008602052604081208161287685856128f2565b60008581526005840160209081526040808320546009928390529083209091015492935090916128a6919061402b565b6128b8670de0b6b3a76400008461403e565b6128c29190614060565b90506007548510156128d85792506111d1915050565b60068301546128e79082614077565b93506111d192505050565b6001600160a01b0382166000908152600860209081526040808320848452600281019092528220541580159061294c57506001600160a01b0384166000908152600c6020908152604080832086845290915290205460ff16155b156129d9576000838152600960209081526040808320600701546001600160a01b0388168452600883528184208785526002019092528220549091826129958362989680614060565b61299f919061403e565b6129b190670de0b6b3a7640000614060565b6000878152602086905260409020549091506129ce908290614077565b9450505050506111d1565b6000838152602091909152604090205490506111d1565b33600090815260086020908152604080832084845260020190915290205415801590612a375750336000908152600c6020908152604080832084845290915290205460ff16155b15612af05760008181526009602090815260408083206007015433845260088352818420858552600201909252822054909182612a778362989680614060565b612a81919061403e565b612a9390670de0b6b3a7640000614060565b336000908152600860209081526040808320888452909152812080549293508392909190612ac2908490614077565b9091555050336000908152600c602090815260408083208784529091529020805460ff191660011790555050505b50565b6007548103612bd8576001600160a01b038216600090815260086020908152604080832084845280835281842080549085905560019091019092528220805491928392612b41908490614077565b909155505060008281526009602052604081208054839290612b6490849061402b565b909155505060008281526009602052604081206001018054839290612b8a908490614077565b9091555050604080516001600160a01b03851681526020810183905242918101919091527f66a311d8c7fcd3d4187dc4da66257340daa47cb6b0ecf77584ea90f146f53f339060600161213f565b5050565b612be4611685565b80612c0357506007546000908152600960205260409020600301544210155b612c1f5760405162461bcd60e51b815260040161123b90614466565b600754600081815260096020526040902060038101544210612cb6578054600003612c9957612c5042610258614077565b60038201556064612c6285605a614060565b612c6c919061403e565b3360009081526008602052604081206006018054909190612c8e908490614077565b909155505050505050565b612ca16130a6565b612ca96132fb565b6064612c6285605a614060565b612cbe611685565b15610eac5761012c8160020154612cd59190614077565b4211612ce957612ce4846133e2565b610eac565b6004810154600160a01b900460ff16610eac576004810154600160a81b900460ff1615612d2057612d18613558565b612d206135d8565b612d2861364b565b81600801541115612d89576000612d3d613671565b600883018190556040805133815260208101839052428183015290519192507f621af463096d58966fa48f497088db472e960b9f399d8cbf787ec0f7d2253365919081900360600190a1505b6000612d94846116c2565b905084811115612e015760405162461bcd60e51b815260206004820152603260248201527f4e6f7420656e6f7567682045544820746f206275792074686520737065636966604482015271696564206e756d626572206f66206b65797360701b606482015260840161123b565b612e0a83613697565b3360009081526008602090815260408083208684526005019091528120549003612e525760098201543360009081526008602090815260408083208784526005019091529020555b612e5c8486613753565b6004820180546001600160a01b03191633179055611a8e846138c1565b612e81611685565b80612ea057506007546000908152600960205260409020600301544210155b612ebc5760405162461bcd60e51b815260040161123b90614466565b600754600081815260096020526040902060038101544210612f52578054600003612f3557612eed42610258614077565b60038201556064612eff84605a614060565b612f09919061403e565b3360009081526008602052604081206006018054909190612f2b908490614077565b9091555050505050565b612f3d6130a6565b612f456132fb565b6064612eff84605a614060565b612f5a611685565b156115855761012c8160020154612f719190614077565b4211612f8057611585836133e2565b6004810154600160a01b900460ff16611585576004810154600160a81b900460ff1615612fb757612faf613558565b612fb76135d8565b612fbf61364b565b81600801541115613020576000612fd4613671565b600883018190556040805133815260208101839052428183015290519192507f621af463096d58966fa48f497088db472e960b9f399d8cbf787ec0f7d2253365919081900360600190a1505b600061302b8461158a565b50905061303783613697565b336000908152600860209081526040808320868452600501909152812054900361307f5760098201543360009081526008602090815260408083208784526005019091529020555b6130898185613753565b6004820180546001600160a01b03191633179055610eac816138c1565b6007546000908152600960205260409020600381015442101561310b5760405162461bcd60e51b815260206004820152601860248201527f526f756e6420686173206e6f742079657420656e6465642e0000000000000000604482015260640161123b565b600481015460068201546001600160a01b039091169060006064613130836032614060565b61313a919061403e565b90506000606461314b846014614060565b613155919061403e565b905060006064613166856014614060565b613170919061403e565b90506000606461318186600a614060565b61318b919061403e565b6001600160a01b0387166000908152600860205260408120600601805492935086929091906131bb908490614077565b925050819055508287600a0160008282546131d69190614077565b92505081905550806009600060075460016131f19190614077565b815260200190815260200160002060060181905550600160009054906101000a90046001600160a01b03166001600160a01b031663c07401f0836040518263ffffffff1660e01b81526004016000604051808303818588803b15801561325657600080fd5b505af115801561326a573d6000803e3d6000fd5b5050505060048801805460ff60a01b1916600160a01b17905550600754604080519182526001600160a01b03881660208301528101869052606081018590526080810184905260a0810183905260c081018290524260e08201527f68888a78b8e7ab912daca530dfa166bc912793d9960370129b7ce52a88d6aa7d906101000160405180910390a150505050505050565b60016007600082825461330e9190614077565b9091555061332190506201518042614077565b60078054600090815260096020526040808220600290810194909455915481522001546133509061a8c0614077565b60078054600090815260096020818152604080842060039081019690965584548452808420600401805460ff60a01b191690558454845280842060019301929092559254808352918190206002810154940154815192835292820193909352918201527fb0b0c60f0267584d50a65485b5eff6babad43c5727703515fde33bb545b191149060600160405180910390a1565b60006127106133f36103e884614060565b6133fd919061403e565b60035433600090815260086020526040808220905163661c37fd60e01b815293945090926001600160a01b039092169163661c37fd916134439160049182019101614247565b602060405180830381865afa158015613460573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061348491906140c4565b6001600160a01b0316036134a05761349d60028261403e565b90505b60006134ac828461402b565b90508060096000600754815260200190815260200160002060070160008282546134d69190614077565b909155505033600090815260086020908152604080832060075484526002019091528120805483929061350a908490614077565b9091555050336000908152600860209081526040808320600780548552600590910183528184206001905554835260099091529020600401805460ff60a81b1916600160a81b179055505050565b6007805460009081526009602052604090200154156135a857600754600090815260096020526040812080546a084595161401484a000000929061359d908490614077565b9091555061260d9050565b60075460009081526009602052604081208054670de0b6b3a764000092906135d1908490614077565b9091555050565b60078054600090815260096020526040902060048101805460ff60a81b19169055908101541561361f57629896808160070154613615919061403e565b600882015561362b565b640218711a0060088201555b80600701548160060160008282546136439190614077565b909155505050565b6007546000818152600960205260408120600601549091906116bc90620f42409061403e565b6007546000818152600960205260408120600601549091906116bc90629896809061403e565b3360009081526008602052604090206136af826129f0565b60008281526020829052604090205415612bd8576000828152600582016020908152604080832054600992839052908320909101546136ee919061402b565b60008481526020849052604090205461371090670de0b6b3a76400009061403e565b61371a9190614060565b60008481526009602081815260408084209092015460058701909152908220556006840180549293508392909190612f2b908490614077565b600081116137ad5760405162461bcd60e51b815260206004820152602160248201527f4e6f7420656e6f75676820457468657220746f207075726368617365206b65796044820152607360f81b606482015260840161123b565b60006137c183670de0b6b3a7640000614060565b60075460008181526009602090815260408083203384526008835281842094845293909152812080549394509192849291906137fe908490614077565b90915550506009810154336000908152600860209081526040808320600754845260050190915281209190915581548391839161383c908490614077565b90915550506008810154640218711a006138568682614060565b6138609083614077565b60088401819055915061387285613925565b60408051338152602081018890529081018390524260608201527f061b93d2295a1ccd00b307b25e89ad7019e6ff618bc79313561f6a1d893e32459060800160405180910390a1505050505050565b60006138ce82601e614060565b905060006138de4261a8c0614077565b60075460009081526009602052604090206003015490915061390b90613905908490614077565b82613b84565b600754600090815260096020526040902060030155505050565b60006127106139366103e884614060565b613940919061403e565b60035433600090815260086020526040808220905163661c37fd60e01b815293945090926001600160a01b039092169163661c37fd916139869160049182019101614247565b602060405180830381865afa1580156139a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139c791906140c4565b6001600160a01b0316036139e3576139e060028261403e565b90505b60006139ef828461402b565b90506000612710613a0261138884614060565b613a0c919061403e565b9050613a1a81600754613b9c565b6000612710613a2b610bb885614060565b613a35919061403e565b9050806009600060075481526020019081526020016000206006016000828254613a5f9190614077565b9091555060009050612710613a766101f486614060565b613a80919061403e565b9050600160009054906101000a90046001600160a01b03166001600160a01b031663c07401f0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015613ad257600080fd5b505af1158015613ae6573d6000803e3d6000fd5b505050505060006127106105dc86613afe9190614060565b613b08919061403e565b9050600260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0826040518263ffffffff1660e01b815260040160206040518083038185885af1158015613b5f573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a091906144af565b6000818310613b935781613b95565b825b9392505050565b600754600090815260096020526040902054613bc190670de0b6b3a76400009061403e565b613bcb908361403e565b60008281526009602081905260408220018054909190613bec908490614077565b90915550505050565b634e487b7160e01b600052601160045260246000fd5b600060018201613c1d57613c1d613bf5565b5060010190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613c6357613c63613c24565b604052919050565b600067ffffffffffffffff821115613c8557613c85613c24565b50601f01601f191660200190565b600082601f830112613ca457600080fd5b8135613cb7613cb282613c6b565b613c3a565b818152846020838601011115613ccc57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215613cfc57600080fd5b823567ffffffffffffffff811115613d1357600080fd5b613d1f85828601613c93565b95602094909401359450505050565b6001600160a01b0381168114612af057600080fd5b60008060408385031215613d5657600080fd5b823591506020830135613d6881613d2e565b809150509250929050565b600060208284031215613d8557600080fd5b5035919050565b600060208284031215613d9e57600080fd5b813567ffffffffffffffff811115613db557600080fd5b613dc184828501613c93565b949350505050565b6020808252825182820181905260009190848201906040850190845b81811015613e0a5783516001600160a01b031683529284019291840191600101613de5565b50909695505050505050565b60008060408385031215613e2957600080fd5b8235613e3481613d2e565b946020939093013593505050565b600060208284031215613e5457600080fd5b8135613b9581613d2e565b60005b83811015613e7a578181015183820152602001613e62565b50506000910152565b60008151808452613e9b816020860160208601613e5f565b601f01601f19169290920160200192915050565b602081526000613b956020830184613e83565b60008083601f840112613ed457600080fd5b50813567ffffffffffffffff811115613eec57600080fd5b6020830191508360208260051b8501011115613f0757600080fd5b9250929050565b60008060008060008060008060008060a08b8d031215613f2d57600080fd5b8a3567ffffffffffffffff80821115613f4557600080fd5b613f518e838f01613ec2565b909c509a5060208d0135915080821115613f6a57600080fd5b613f768e838f01613ec2565b909a50985060408d0135915080821115613f8f57600080fd5b613f9b8e838f01613ec2565b909850965060608d0135915080821115613fb457600080fd5b613fc08e838f01613ec2565b909650945060808d0135915080821115613fd957600080fd5b50613fe68d828e01613ec2565b915080935050809150509295989b9194979a5092959850565b8481526080602082015260006140186080830186613e83565b6040830194909452506060015292915050565b818103818111156111d1576111d1613bf5565b60008261405b57634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176111d1576111d1613bf5565b808201808211156111d1576111d1613bf5565b600181811c9082168061409e57607f821691505b6020821081036140be57634e487b7160e01b600052602260045260246000fd5b50919050565b6000602082840312156140d657600080fd5b8151613b9581613d2e565b601f82111561158557600081815260208120601f850160051c810160208610156141085750805b601f850160051c820191505b8181101561412757828155600101614114565b505050505050565b815167ffffffffffffffff81111561414957614149613c24565b61415d81614157845461408a565b846140e1565b602080601f831160018114614192576000841561417a5750858301515b600019600386901b1c1916600185901b178555614127565b600085815260208120601f198616915b828110156141c1578886015182559484019460019091019084016141a2565b50858210156141df5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0383168152604060208201819052600090613dc190830184613e83565b6001600160a01b038416815260606020820181905260009061423790830185613e83565b9050826040830152949350505050565b600060208083526000845461425b8161408a565b8084870152604060018084166000811461427c5760018114614296576142c4565b60ff1985168984015283151560051b8901830195506142c4565b896000528660002060005b858110156142bc5781548b82018601529083019088016142a1565b8a0184019650505b509398975050505050505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126142ff57600080fd5b83018035915067ffffffffffffffff82111561431a57600080fd5b602001915036819003821315613f0757600080fd5b67ffffffffffffffff83111561434757614347613c24565b61435b83614355835461408a565b836140e1565b6000601f84116001811461438f57600085156143775750838201355b600019600387901b1c1916600186901b178355611a8e565b600083815260209020601f19861690835b828110156143c057868501358255602094850194600190920191016143a0565b50868210156143dd5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60006020828403121561440157600080fd5b815167ffffffffffffffff81111561441857600080fd5b8201601f8101841361442957600080fd5b8051614437613cb282613c6b565b81815285602083850101111561444c57600080fd5b61445d826020830160208601613e5f565b95945050505050565b60208082526029908201527f43616e6e6f74207075726368617365206b65797320647572696e6720746865206040820152680726f756e64206761760bc1b606082015260800190565b6000602082840312156144c157600080fd5b81518015158114613b9557600080fdfea2646970667358221220ec7ed10a1835846ac4948e982e8b5a1103e722702c93492d49ef2163555e1ac664736f6c63430008110033

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.