ETH Price: $2,629.47 (+1.86%)

Contract

0x7152513428b036D9828a906764eb879431c8dc27
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040150553422022-07-01 7:42:28851 days ago1656661348IN
 Create: MetaAndMagic
0 ETH0.0438719515.16567122

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MetaAndMagic

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 1 : MetaAndMagic.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;

contract MetaAndMagic {

    uint256 constant public precision = 1e12;

    address heroesAddress;
    address itemsAddress;

    uint256 public currentBoss;

    mapping(uint256 => Heroes) public heroes;
    mapping(uint256 => Boss)   public bosses;
    mapping(bytes32 => Fight)  public fights;     

    mapping(uint256 => uint256) public requests;  
    mapping(uint256 => uint256) public prizeValues;
    mapping(uint256 => address) public prizeTokens;

    // Oracle information
    address VRFcoord;
    uint64  subId;
    bytes32 keyhash;

     /*///////////////////////////////////////////////////////////////
                            DATA STRUCTURES
    //////////////////////////////////////////////////////////////*/

    struct Heroes { address owner; uint16 lastBoss; uint32 highestScore;}

    struct Fight  { uint16 heroId; uint16 boss; bytes10 items; uint32 start; uint32 count; bool claimedScore; bool claimedBoss; }
    
    struct Boss   { bytes8 stats; uint16 topScorers; uint56 highestScore; uint56 entries; uint56 winIndex; }

    struct Combat { uint256 hp; uint256 phyDmg; uint256 mgkDmg; uint256 phyRes; uint256 mgkRes; }

    enum Stat { HP, PHY_DMG, MGK_DMG, MGK_RES, MGK_PEN, PHY_RES, PHY_PEN, ELM }

    event FightResult(address sender, uint256 hero, uint256 boss, bytes10 items, uint256 score, bytes32 id);


    /*///////////////////////////////////////////////////////////////
                            ADMIN FUNCTIONS
    //////////////////////////////////////////////////////////////*/

    /**
        @dev Initialize contract 
    */
    function initialize(address heroes_, address items_) external {
        require(msg.sender == _owner());

        heroesAddress = heroes_;
        itemsAddress  = items_;
    }

    /**
        @dev Initialize oracle information 
    */
    function setUpOracle(address vrf_, bytes32 keyHash, uint64 subscriptionId) external {
        require(msg.sender == _owner());

        VRFcoord = vrf_;
        keyhash  = keyHash;
        subId    = subscriptionId;
    }

    /**
        @dev Add next week boss and move it 
    */
    function addBoss(address prizeToken, uint256 halfPrize, uint256 hp_, uint256 atk_, uint256 mgk_, uint256 mod_, uint256 element_) external {
        require(msg.sender == _owner(), "not allowed");
        uint256 boss = currentBoss + 1;

        prizeValues[boss] = halfPrize;
        prizeTokens[boss] = prizeToken;

        bosses[boss] = Boss({stats: bytes8(abi.encodePacked(uint16(hp_),uint16(atk_),uint16(mgk_), uint8(element_), uint8(mod_))), topScorers:0, highestScore: 0, entries:0, winIndex:0});
    }

    function moveBoss() external {
        require(msg.sender == _owner(), "not allowed");

        require(bosses[currentBoss + 1].stats != bytes8(0), "not set");

        currentBoss++;
    }

    /*///////////////////////////////////////////////////////////////
                            STAKING FUNCTIONS
    //////////////////////////////////////////////////////////////*/

    /**
        @dev Stake and or unstake a list of heroes
    */
    function manageHero(uint256[] calldata toStake, uint256[] calldata toUnstake) external {
        uint256 len = toStake.length;
        for (uint256 i = 0; i < len; i++) {
            stake(toStake[i]);
        }

        len = toUnstake.length;
        for (uint256 i = 0; i < len; i++) {
            unstake(toUnstake[i]);
        }
    }

    /**
        @dev Stake a single hero 
    */
    function stake(uint256 heroId) public {
        require(currentBoss != 0, "not started");
        _pull(heroesAddress, heroId);
        heroes[heroId] = Heroes(msg.sender, 0, 0);
    }

    /**
        @dev Unstake a single hero 
    */
    function unstake(uint256 heroId) public {
        Heroes memory hero = heroes[heroId];

        require(msg.sender == hero.owner,   "not owner");
        require(hero.lastBoss < currentBoss,"alredy entered");
        // transfer NFT
        _push(heroesAddress, hero.owner, heroId);

        delete heroes[heroId];
    }

    /*///////////////////////////////////////////////////////////////
                            FIGHT FUNCTIONS
    //////////////////////////////////////////////////////////////*/

    /**
        @dev Fight this week's boss
    */
    function fight(uint256 heroId, bytes10 items) public returns(bytes32 fightId) {
        Heroes memory hero = heroes[heroId];
        require(msg.sender == hero.owner, "not owner");

        _validateItems(items);

        uint256 currBoss = currentBoss;
        Boss memory boss = bosses[currBoss];

        require(boss.stats != bytes8(0), "invalid boss");

        uint256 score = _calculateScore(currBoss, boss.stats, heroId, items, msg.sender);

        if (hero.lastBoss < currBoss) {
            hero.lastBoss     = uint16(currBoss);
            hero.highestScore = 0;
        }

        fightId = getFightId(heroId, currBoss, items, msg.sender);
        require(fights[fightId].heroId == 0, "already fought");

        Fight memory fh = Fight(uint16(heroId), uint16(currBoss), items, 0, 0, false, false);

        if (score == boss.highestScore) boss.topScorers++; // Tied to the highest score;
        
        // This is a new highscore, so we reset the leaderboard
        if (score > boss.highestScore) {
            boss.highestScore = uint32(score);
            boss.topScorers   = 1;
        }

        // Getting Raffle tickets
        if (score > hero.highestScore) {
            uint32 diff = uint32(score - hero.highestScore);  

            fh.start = uint32(boss.entries) + 1;
            fh.count = diff;

            boss.entries += diff;            
            hero.highestScore = uint32(score);
        }

        bosses[currBoss] = boss;
        heroes[heroId]   = hero;
        fights[fightId]  = fh;

        emit FightResult(msg.sender, heroId, currBoss, items, score, fightId);
    }

    /**
        @dev Get the boss drop item from this week 
    */
    function getBossDrop(uint256 heroId_, uint boss_, bytes10 items_) external returns (uint256 bossItemId){
        bytes32 fightId = getFightId(heroId_, boss_, items_, msg.sender);

        Fight memory fh = fights[fightId];

        require(fh.boss == currentBoss, "claim over");
        require(fh.heroId != 0,         "non existent fight");
        require(!fh.claimedBoss,        "already claimed");

        uint256 score = _calculateScore(fh.boss, bosses[fh.boss].stats, fh.heroId, fh.items, msg.sender);
        require(score > 0, "not won");

        uint16[5] memory _items = _unpackItems(fh.items);
        for (uint256 i = 0; i < 5; i++) {
            if (_items[i] == 0) break;
            // Burn the item  if it's not burnt already
            if (IERC721(itemsAddress).ownerOf(_items[i]) != address(0)) require(MetaAndMagicLike(itemsAddress).burnFrom(msg.sender, _items[i]), "burn failed");
        }

        fights[fightId].claimedBoss = true;
        // Boss drops supplies are checked at the itemsAddress
        bossItemId = MetaAndMagicLike(fh.boss == 10 ? heroesAddress : itemsAddress).mintDrop(boss_, msg.sender);
    }

    /**
        @dev Get the prize for having the highest score
    */
    function getPrize(uint256 heroId_, uint256 boss_, bytes10 items_) external {
        bytes32 fightId = getFightId(heroId_, boss_, items_, msg.sender);
        
        Fight memory fh   = fights[fightId];
        Boss  memory boss = bosses[fh.boss];

        require(fh.boss < currentBoss, "not finished");
        require(!fh.claimedScore,      "already claimed");
    
        uint256 score  = _calculateScore(fh.boss, boss.stats, fh.heroId, fh.items, msg.sender);

        require(score == boss.highestScore && boss.highestScore != 0, "not high score");

        fights[fightId].claimedScore = true;

        if (prizeTokens[fh.boss] == 0xdAC17F958D2ee523a2206206994597C13D831ec7) {
            IERC20(0xdAC17F958D2ee523a2206206994597C13D831ec7).transfer(msg.sender, prizeValues[fh.boss] / boss.topScorers);
        } else {
            require(IERC20(prizeTokens[fh.boss]).transfer(msg.sender, prizeValues[fh.boss] / boss.topScorers));
        }
    }

    /**
        @dev Get the raffle prize
    */
    function getRafflePrize(uint256 heroId_, uint256 boss_, bytes10 items_) external {
        bytes32 fightId = getFightId(heroId_, boss_, items_, msg.sender);
        
        Fight memory fh   = fights[fightId];
        Boss  memory boss = bosses[fh.boss];

        require(fh.boss < currentBoss, "not finished");
        require(boss.highestScore > 0, "not fought");
        require(boss.winIndex != 0,    "not raffled");

        require(fh.start <= boss.winIndex && (fh.start + fh.count > boss.winIndex), "not winner");

        fights[fightId].count = 0;

        if (prizeTokens[fh.boss] == 0xdAC17F958D2ee523a2206206994597C13D831ec7) {
            IERC20(0xdAC17F958D2ee523a2206206994597C13D831ec7).transfer(msg.sender, prizeValues[fh.boss]);
        } else {
            require(IERC20(prizeTokens[fh.boss]).transfer(msg.sender, prizeValues[fh.boss]));
        }
    }

    /**
        @dev Request chainlink oracle for the week's raffle
    */
    function requestRaffleResult(uint256 boss_) external {
        require(boss_ < currentBoss,  "not finished");
        require(requests[boss_] == 0 || msg.sender == _owner(), "already requested");

        uint256 reqId = VRFCoordinatorV2Interface(VRFcoord).requestRandomWords(keyhash, subId, 3, 200000, 1);
        requests[boss_] = reqId;
    }

    /**
        @dev Chainlink specific function to fulfill the randomness request 
    */
    function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external {
        require(msg.sender == VRFcoord, "not allowed");
        for (uint256 index = currentBoss; index > 0; index--) {
            if (requests[index] == requestId) {
                Boss memory boss = bosses[index];

                bosses[index].winIndex = uint56(randomWords[0] % uint256(boss.entries) + 1); // 1 -> raffleEntry
            }
        }
   }

    /*///////////////////////////////////////////////////////////////
                            VIEW FUNCTIONS
    //////////////////////////////////////////////////////////////*/

    function getScore(bytes32 fightId, address player) external view returns(uint256 score) {
        Fight memory fh   = fights[fightId];
        require(fh.boss != 0);
        score = _calculateScore(fh.boss, bosses[fh.boss].stats, fh.heroId, fh.items,player);
    }

    function getFightId(uint256 hero_, uint256 boss_, bytes10 items_, address owner_) public pure returns (bytes32 id) {
        id = keccak256(abi.encode(hero_, boss_, items_, owner_));
    }

    /*///////////////////////////////////////////////////////////////
                            INTERNAL FUNCTIONS
    //////////////////////////////////////////////////////////////*/

    function _calculateScore(uint256 boss, bytes8 bossStats, uint256 heroId, bytes10 packedItems, address fighter) internal view virtual returns (uint256) {
        bytes10[6] memory stats = MetaAndMagicLike(heroesAddress).getStats(heroId);

        // Start with empty combat
        Combat memory combat = Combat(0,0,0,precision,precision);
        
        // Tally Hero modifies the combat memory inplace
        _tally(combat, stats, bossStats);

        uint16[5] memory items_ = _unpackItems(packedItems);
        for (uint256 i = 0; i < 5; i++) {
            if (items_[i] == 0) break;
            stats = MetaAndMagicLike(itemsAddress).getStats(items_[i]);
            _tally(combat, stats, bossStats);
        }
        
        uint256 crit = _critical(heroId,boss,packedItems,fighter);
        return _getResult(combat, bossStats, crit);
    }

    function _getResult(Combat memory combat, bytes10 bossStats, uint256 crit) internal pure returns (uint256) {        
        uint256 bossAtk         = combat.phyRes * _get(bossStats, Stat.PHY_DMG) / precision;
        uint256 bossMgk         = combat.mgkRes * _get(bossStats, Stat.MGK_DMG) / precision;
        uint256 totalHeroAttack = combat.phyDmg + combat.mgkDmg + ((combat.phyDmg + combat.mgkDmg) * crit / 1e18);
        
        if (bossAtk + bossMgk > combat.hp || totalHeroAttack < _get(bossStats, Stat.HP)) return 0;

        return totalHeroAttack - _get(bossStats, Stat.HP) + combat.hp - bossAtk + bossMgk;
    }

     /// @dev This is the core function for calculating scores
    function _tally(Combat memory combat, bytes10[6] memory stats , bytes8 bossStats) internal pure {
        uint256 bossPhyPen = _get(bossStats, Stat.PHY_PEN);
        uint256 bossMgkPen = _get(bossStats, Stat.MGK_PEN);
        bool    bossPhyRes = _get(bossStats, Stat.PHY_RES) == 1;
        bool    bossMgkRes = _get(bossStats, Stat.MGK_RES) == 1;

        uint256 itemElement = _get(stats[5], Stat.ELM);
        uint256 bossElement = uint8(uint64(bossStats) >> 8);

        for (uint256 i = 0; i < 6; i++) {
            // Sum HP
            combat.hp += _get(stats[i], Stat.HP);

            combat.phyDmg += _sumAtk(stats[i], Stat.PHY_DMG, Stat.PHY_PEN, bossPhyRes);

            uint256 mgk = _sumAtk(stats[i], Stat.MGK_DMG, Stat.MGK_PEN, bossMgkRes);
            uint256 adv = _getAdv(itemElement, bossElement);

            combat.mgkDmg += adv == 3 ?  0 : mgk * (adv == 1 ? 2 : 1) / (adv == 2 ? 2 : 1);

            combat.phyRes = _stack(combat.phyRes, stats[i], Stat.PHY_RES, bossPhyPen);
            combat.mgkRes = _stack(combat.mgkRes, stats[i], Stat.MGK_RES, bossMgkPen);

            combat.mgkRes = stackElement(combat.mgkRes, itemElement, bossElement);
        }
    }      

    function _critical(uint256 hero_, uint256 boss_, bytes10 items_, address fighter) internal pure returns (uint256 draw) {
        draw = uint256(getFightId(hero_, boss_, items_, fighter)) % 0.25e18 + 1;
    }

    function _get(bytes10 src, Stat stat) internal pure returns (uint256) {
        uint8 st = uint8(stat);

        if (st == 7) return uint8(uint80(src)); // Element
        if (st < 3)  return uint16(bytes2(src << (st * 16))); // Hp, PhyDmg or MgkDmg

        return (uint16(bytes2(src << (48))) & (1 << st - 3)) >> st - 3;
    }

    function _getAdv(uint256 ele, uint256 oppEle) internal pure returns (uint256 adv) {
        // Returns 0 if elements don't iteract
        if (ele == 0 || oppEle == 0) return 0;

        // Returns 1 if ele has advantage
        if (ele == oppEle - 1 || (ele == 4 && oppEle == 1)) return adv = 1;
        // // Returns 2 if ele has disavantage
        if (ele - 1 == oppEle || (ele == 1 && oppEle == 4)) return adv = 2;
        // Returns 3 if ele is the same
        if (ele == oppEle) return adv = 3;
    }

    function stackElement(uint256 val, uint256 ele, uint256 oppEle) internal pure returns (uint256) {
        uint256 adv = _getAdv(ele, oppEle);
        if (adv == 0) return val;

        if (adv == 3) return 0;

        if (adv == 1) return val * precision / (2 * precision);

        return val * 2 * precision / precision;
    }

    function _sumAtk(bytes10 src, Stat stat, Stat pen, bool bossRes) internal pure returns (uint256 sum) {
        sum  = _get(src, stat) / (((_get(src, pen) == 0) && bossRes) ? 2 : 1);
    }

    function _stack(uint256 val, bytes10 src, Stat res, uint256 oppPen) internal pure returns (uint256) {
        return _stack(val, _get(src, res), oppPen);
    }

    function _stack(uint256 val, uint256 res, uint256 oppPen) internal pure returns (uint256 ret) {
        ret = val * ((oppPen == 0) && (res == 1) ? 0.5e12: precision) / precision;
    }

    function _getPackedItems(uint16[5] memory items) internal pure returns(bytes10 packed) {
        packed = bytes10(abi.encodePacked(items[0], items[1], items[2], items[3], items[4]));
    }

    function _validateItems(bytes10 packedItems) internal view {
        uint16[5] memory items = _unpackItems(packedItems);
        
        for (uint256 i = 1; i < items.length; i++) {
            require(items[i - 1] == 0 ? items[i] == 0 : items[i - 1] > items[i], "invalid items"); 
            if (items[i] != 0) require(IERC721(itemsAddress).ownerOf(items[i]) == msg.sender, "not item owner");
        }
    }

    function _unpackItems(bytes10 items) internal pure returns(uint16[5] memory unpacked) {
        unpacked[0] = uint16(bytes2(items));
        unpacked[1] = uint16(bytes2(items << 16));
        unpacked[2] = uint16(bytes2(items << 32));
        unpacked[3] = uint16(bytes2(items << 48));
        unpacked[4] = uint16(bytes2(items << 64));
    }

    function _pull(address token, uint256 id) internal {
        require(IERC721(token).transferFrom(msg.sender, address(this), id), "failed transfer");
    }

    function _push(address token, address to_, uint256 id) internal {
        require(IERC721(token).transferFrom(address(this), address(to_), id), "transfer failed");
    }

    function _owner() internal view returns (address owner_) {
        bytes32 slot = bytes32(0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103);
        assembly {
            owner_ := sload(slot)
        }
    } 
}

interface MetaAndMagicLike {
    function getStats(uint256 id_) external view returns(bytes10[6] memory stats);
    function mintDrop(uint256 bossId, address to_) external returns(uint256 id);
    function burnFrom(address from, uint256 id) external returns (bool);
}

interface IERC721 {
    function transferFrom(address from_, address to_, uint256 id_) external returns(bool);
    function ownerOf(uint256 id) external view returns(address);
}

interface IERC20 {
    function transfer(address to_, uint256 id_) external returns(bool);
}

interface VRFCoordinatorV2Interface {
    function requestRandomWords(
    bytes32 keyHash,
    uint64 subId,
    uint16 minimumRequestConfirmations,
    uint32 callbackGasLimit,
    uint32 numWords
  ) external returns (uint256 requestId);
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"hero","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"boss","type":"uint256"},{"indexed":false,"internalType":"bytes10","name":"items","type":"bytes10"},{"indexed":false,"internalType":"uint256","name":"score","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"FightResult","type":"event"},{"inputs":[{"internalType":"address","name":"prizeToken","type":"address"},{"internalType":"uint256","name":"halfPrize","type":"uint256"},{"internalType":"uint256","name":"hp_","type":"uint256"},{"internalType":"uint256","name":"atk_","type":"uint256"},{"internalType":"uint256","name":"mgk_","type":"uint256"},{"internalType":"uint256","name":"mod_","type":"uint256"},{"internalType":"uint256","name":"element_","type":"uint256"}],"name":"addBoss","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"bosses","outputs":[{"internalType":"bytes8","name":"stats","type":"bytes8"},{"internalType":"uint16","name":"topScorers","type":"uint16"},{"internalType":"uint56","name":"highestScore","type":"uint56"},{"internalType":"uint56","name":"entries","type":"uint56"},{"internalType":"uint56","name":"winIndex","type":"uint56"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentBoss","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"heroId","type":"uint256"},{"internalType":"bytes10","name":"items","type":"bytes10"}],"name":"fight","outputs":[{"internalType":"bytes32","name":"fightId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"fights","outputs":[{"internalType":"uint16","name":"heroId","type":"uint16"},{"internalType":"uint16","name":"boss","type":"uint16"},{"internalType":"bytes10","name":"items","type":"bytes10"},{"internalType":"uint32","name":"start","type":"uint32"},{"internalType":"uint32","name":"count","type":"uint32"},{"internalType":"bool","name":"claimedScore","type":"bool"},{"internalType":"bool","name":"claimedBoss","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"heroId_","type":"uint256"},{"internalType":"uint256","name":"boss_","type":"uint256"},{"internalType":"bytes10","name":"items_","type":"bytes10"}],"name":"getBossDrop","outputs":[{"internalType":"uint256","name":"bossItemId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"hero_","type":"uint256"},{"internalType":"uint256","name":"boss_","type":"uint256"},{"internalType":"bytes10","name":"items_","type":"bytes10"},{"internalType":"address","name":"owner_","type":"address"}],"name":"getFightId","outputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"heroId_","type":"uint256"},{"internalType":"uint256","name":"boss_","type":"uint256"},{"internalType":"bytes10","name":"items_","type":"bytes10"}],"name":"getPrize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"heroId_","type":"uint256"},{"internalType":"uint256","name":"boss_","type":"uint256"},{"internalType":"bytes10","name":"items_","type":"bytes10"}],"name":"getRafflePrize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"fightId","type":"bytes32"},{"internalType":"address","name":"player","type":"address"}],"name":"getScore","outputs":[{"internalType":"uint256","name":"score","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"heroes","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint16","name":"lastBoss","type":"uint16"},{"internalType":"uint32","name":"highestScore","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"heroes_","type":"address"},{"internalType":"address","name":"items_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"toStake","type":"uint256[]"},{"internalType":"uint256[]","name":"toUnstake","type":"uint256[]"}],"name":"manageHero","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"moveBoss","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"precision","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"prizeTokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"prizeValues","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"boss_","type":"uint256"}],"name":"requestRaffleResult","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"requests","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vrf_","type":"address"},{"internalType":"bytes32","name":"keyHash","type":"bytes32"},{"internalType":"uint64","name":"subscriptionId","type":"uint64"}],"name":"setUpOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"heroId","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"heroId","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061335d806100206000396000f3fe608060405234801561001057600080fd5b506004361061014d5760003560e01c806381d12c58116100c3578063a694fc3a1161007c578063a694fc3a1461041a578063a8d4a03b1461042d578063b3897c3b1461049f578063b90e1a1e146104b2578063d3b5dc3b146104c5578063d528acf1146104d157600080fd5b806381d12c58146102ee578063856f8c351461030e578063878a808b1461031757806391d056661461033757806396b9d24d146103f45780639b8f43611461040757600080fd5b8063485cc95511610115578063485cc9551461024057806349cf508414610253578063603ce1fe146102745780636813925e14610287578063771a5fa2146102c85780637f2c9aab146102db57600080fd5b806309d25f37146101525780631fe543e314610167578063204597e01461017a5780632e17de781461021a57806332ed53911461022d575b600080fd5b610165610160366004612fe0565b6104d9565b005b610165610175366004612f02565b610905565b6101d1610188366004612eab565b60046020526000908152604090205460c081901b9061ffff600160401b8204169066ffffffffffffff600160501b8204811691600160881b8104821691600160c01b9091041685565b604080516001600160c01b0319909616865261ffff909416602086015266ffffffffffffff928316938501939093528116606084015216608082015260a0015b60405180910390f35b610165610228366004612eab565b610a44565b61016561023b366004612ce9565b610b4f565b61016561024e366004612cb0565b610bb8565b61026661026136600461300e565b610c13565b604051908152602001610211565b610266610282366004612ec4565b610c69565b6102b0610295366004612eab565b6008602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610211565b6101656102d6366004612d38565b610d45565b6102666102e9366004612fe0565b610f1a565b6102666102fc366004612eab565b60066020526000908152604090205481565b61026660025481565b610266610325366004612eab565b60076020526000908152604090205481565b6103a2610345366004612eab565b60056020526000908152604090205461ffff8082169162010000810490911690640100000000810460b01b9063ffffffff600160701b8204811691600160901b81049091169060ff600160b01b8204811691600160b81b90041687565b6040805161ffff98891681529790961660208801526001600160b01b03199094169486019490945263ffffffff918216606086015216608084015290151560a0830152151560c082015260e001610211565b610165610402366004612fe0565b6113bc565b610165610415366004612e1d565b6117d3565b610165610428366004612eab565b611854565b61047161043b366004612eab565b6003602052600090815260409020546001600160a01b03811690600160a01b810461ffff1690600160b01b900463ffffffff1683565b604080516001600160a01b03909416845261ffff909216602084015263ffffffff1690820152606001610211565b6102666104ad366004612fbb565b611922565b6101656104c0366004612eab565b611e7c565b61026664e8d4a5100081565b610165611fde565b60006104e784848433610c13565b6000818152600560209081526040808320815160e081018352905461ffff808216835262010000820481168386018181526001600160b01b0319640100000000850460b01b168587015263ffffffff600160701b85048116606080880191909152600160901b860490911660808088019190915260ff600160b01b87048116151560a0808a0191909152600160b81b90970416151560c080890191909152938a52600489529887902087519586018852546001600160c01b03199381901b939093168552600160401b830484169785019790975266ffffffffffffff600160501b8304811696850196909652600160881b8204861696840196909652600160c01b90049093169481019490945260025492519495509316106106245760405162461bcd60e51b815260040161061b9061307d565b60405180910390fd5b8160a00151156106685760405162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4818db185a5b5959608a1b604482015260640161061b565b600061068f836020015161ffff168360000151856000015161ffff168660400151336120a1565b9050816040015166ffffffffffffff16811480156106b95750604082015166ffffffffffffff1615155b6106f65760405162461bcd60e51b815260206004820152600e60248201526d6e6f7420686967682073636f726560901b604482015260640161061b565b6000848152600560209081526040808320805460ff60b01b1916600160b01b1790558582015161ffff168352600890915290205473dac17f958d2ee523a2206206994597c13d831ec76001600160a01b0390911614156108275773dac17f958d2ee523a2206206994597c13d831ec76001600160a01b031663a9059cbb33846020015161ffff1660076000886020015161ffff168152602001908152602001600020546107a39190613136565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b1580156107e957600080fd5b505af11580156107fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108219190612e89565b506108fc565b6020808401805161ffff9081166000908152600884526040808220548786015194518416835260079095529020546001600160a01b039093169263a9059cbb92339261087592911690613136565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b1580156108bb57600080fd5b505af11580156108cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f39190612e89565b6108fc57600080fd5b50505050505050565b6009546001600160a01b0316331461092f5760405162461bcd60e51b815260040161061b90613058565b6002545b8015610a3f57600081815260066020526040902054831415610a2d576000818152600460209081526040808320815160a08101835290546001600160c01b031960c082901b16825261ffff600160401b8204169382019390935266ffffffffffffff600160501b8404811692820192909252600160881b8304821660608201819052600160c01b90930490911660808201528451909285916109d7576109d76132ad565b60200260200101516109e99190613257565b6109f49060016130d4565b6000838152600460205260409020805466ffffffffffffff92909216600160c01b0266ffffffffffffff60c01b19909216919091179055505b80610a3781613203565b915050610933565b505050565b600081815260036020908152604091829020825160608101845290546001600160a01b038116808352600160a01b820461ffff1693830193909352600160b01b900463ffffffff16928101929092523314610acd5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015260640161061b565b600254816020015161ffff1610610b175760405162461bcd60e51b815260206004820152600e60248201526d185b1c99591e48195b9d195c995960921b604482015260640161061b565b6000548151610b30916001600160a01b0316908461228d565b50600090815260036020526040902080546001600160d01b0319169055565b600080516020613308833981519152546001600160a01b0316336001600160a01b031614610b7c57600080fd5b60098054600a9390935567ffffffffffffffff909116600160a01b026001600160e01b03199092166001600160a01b0390931692909217179055565b600080516020613308833981519152546001600160a01b0316336001600160a01b031614610be557600080fd5b600080546001600160a01b039384166001600160a01b03199182161790915560018054929093169116179055565b60408051602081018690529081018490526001600160b01b0319831660608201526001600160a01b038216608082015260009060a001604051602081830303815290604052805190602001209050949350505050565b6000828152600560209081526040808320815160e081018352905461ffff8082168352620100008204169382018490526001600160b01b0319640100000000820460b01b169282019290925263ffffffff600160701b830481166060830152600160901b830416608082015260ff600160b01b83048116151560a0830152600160b81b909204909116151560c082015290610d0357600080fd5b60208082015161ffff9081166000818152600490935260409283902054845193850151610d3d94929360c09290921b9290911690876120a1565b949350505050565b600080516020613308833981519152546001600160a01b0316336001600160a01b031614610d855760405162461bcd60e51b815260040161061b90613058565b60006002546001610d9691906130d4565b60008181526007602090815260408083208b905560089091529081902080546001600160a01b0319166001600160a01b038c16179055805160a081019091526001600160f01b031960f089811b821660c084015288811b821660c284015287901b1660c48201526001600160f81b031960f885811b821660c684015286901b1660c78201529091508060c88101604051602081830303815290604052610e3b906131cc565b6001600160c01b031916815260006020808301829052604080840183905260608085018490526080948501849052958352600482529182902084518154928601519386015196860151959094015160c09490941c69ffffffffffffffffffff1990921691909117600160401b61ffff9093169290920291909117600160501b600160c01b031916600160501b66ffffffffffffff9586160266ffffffffffffff60881b191617600160881b938516939093029290921766ffffffffffffff60c01b1916600160c01b939091169290920291909117905550505050505050565b600080610f2985858533610c13565b600081815260056020908152604091829020825160e081018452905461ffff8082168352620100008204169282018390526001600160b01b0319640100000000820460b01b169382019390935263ffffffff600160701b840481166060830152600160901b840416608082015260ff600160b01b84048116151560a0830152600160b81b909304909216151560c0830152600254929350909114610ffc5760405162461bcd60e51b815260206004820152600a60248201526931b630b4b69037bb32b960b11b604482015260640161061b565b805161ffff166110435760405162461bcd60e51b81526020600482015260126024820152711b9bdb88195e1a5cdd195b9d08199a59da1d60721b604482015260640161061b565b8060c00151156110875760405162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4818db185a5b5959608a1b604482015260640161061b565b60208082015161ffff908116600081815260049093526040808420548551918601516110be9460c09290921b9290911690336120a1565b9050600081116110fa5760405162461bcd60e51b81526020600482015260076024820152663737ba103bb7b760c91b604482015260640161061b565b60006111098360400151612353565b905060005b60058110156112dd57818160058110611129576111296132ad565b602002015161ffff1661113b576112dd565b6001546000906001600160a01b0316636352211e848460058110611161576111616132ad565b60200201516040516001600160e01b031960e084901b16815261ffff909116600482015260240160206040518083038186803b1580156111a057600080fd5b505afa1580156111b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d89190612c93565b6001600160a01b0316146112cb576001546001600160a01b03166379cc67903384846005811061120a5761120a6132ad565b60200201516040516001600160e01b031960e085901b1681526001600160a01b03909216600483015261ffff166024820152604401602060405180830381600087803b15801561125957600080fd5b505af115801561126d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112919190612e89565b6112cb5760405162461bcd60e51b815260206004820152600b60248201526a189d5c9b8819985a5b195960aa1b604482015260640161061b565b806112d58161323c565b91505061110e565b506000848152600560209081526040909120805460ff60b81b1916600160b81b179055830151600a61ffff90911614611321576001546001600160a01b031661132e565b6000546001600160a01b03165b604051630355993160e41b8152600481018990523360248201526001600160a01b039190911690633559931090604401602060405180830381600087803b15801561137857600080fd5b505af115801561138c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b09190612ee9565b98975050505050505050565b60006113ca84848433610c13565b6000818152600560209081526040808320815160e081018352905461ffff808216835262010000820481168386018181526001600160b01b0319640100000000850460b01b168587015263ffffffff600160701b85048116606080880191909152600160901b860490911660808088019190915260ff600160b01b87048116151560a0808a0191909152600160b81b90970416151560c080890191909152938a52600489529887902087519586018852546001600160c01b03199381901b939093168552600160401b830484169785019790975266ffffffffffffff600160501b8304811696850196909652600160881b8204861696840196909652600160c01b90049093169481019490945260025492519495509316106114fe5760405162461bcd60e51b815260040161061b9061307d565b6000816040015166ffffffffffffff16116115485760405162461bcd60e51b815260206004820152600a6024820152691b9bdd08199bdd59da1d60b21b604482015260640161061b565b608081015166ffffffffffffff166115905760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd081c9859999b195960aa1b604482015260640161061b565b806080015166ffffffffffffff16826060015163ffffffff16111580156115dc5750806080015166ffffffffffffff16826080015183606001516115d491906130ec565b63ffffffff16115b6116155760405162461bcd60e51b815260206004820152600a6024820152693737ba103bb4b73732b960b11b604482015260640161061b565b6000838152600560209081526040808320805463ffffffff60901b191690558482015161ffff16835260089091529020546001600160a01b031673dac17f958d2ee523a2206206994597c13d831ec714156117165760208281015161ffff166000908152600790915260409081902054905163a9059cbb60e01b8152336004820152602481019190915273dac17f958d2ee523a2206206994597c13d831ec79063a9059cbb90604401602060405180830381600087803b1580156116d857600080fd5b505af11580156116ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117109190612e89565b506117cb565b6020828101805161ffff9081166000908152600884526040808220549351909216815260079093529182902054915163a9059cbb60e01b815233600482015260248101929092526001600160a01b03169063a9059cbb90604401602060405180830381600087803b15801561178a57600080fd5b505af115801561179e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c29190612e89565b6117cb57600080fd5b505050505050565b8260005b81811015611812576118008686838181106117f4576117f46132ad565b90506020020135611854565b8061180a8161323c565b9150506117d7565b5081905060005b818110156117cb57611842848483818110611836576118366132ad565b90506020020135610a44565b8061184c8161323c565b915050611819565b6002546118915760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd081cdd185c9d195960aa1b604482015260640161061b565b6000546118a7906001600160a01b03168261239a565b60408051606081018252338152600060208083018281528385018381529583526003909152929020905181549251935163ffffffff16600160b01b0263ffffffff60b01b1961ffff95909516600160a01b026001600160b01b03199094166001600160a01b0392909216919091179290921792909216179055565b6000828152600360209081526040808320815160608101835290546001600160a01b038116808352600160a01b820461ffff1694830194909452600160b01b900463ffffffff16918101919091529033146119ab5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015260640161061b565b6119b483612462565b600254600081815260046020908152604091829020825160a08101845290546001600160c01b031960c082901b1680835261ffff600160401b8304169383019390935266ffffffffffffff600160501b8204811694830194909452600160881b810484166060830152600160c01b90049092166080830152611a675760405162461bcd60e51b815260206004820152600c60248201526b696e76616c696420626f737360a01b604482015260640161061b565b6000611a7a8383600001518989336120a1565b905082846020015161ffff161015611a9e5761ffff83166020850152600060408501525b611aaa87848833610c13565b60008181526005602052604090205490955061ffff1615611afe5760405162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e48199bdd59da1d60921b604482015260640161061b565b6040805160e08101825261ffff808a168252851660208201526001600160b01b03198816818301526000606082018190526080820181905260a0820181905260c08201529083015166ffffffffffffff16821415611b6e5760208301805190611b668261321a565b61ffff169052505b826040015166ffffffffffffff16821115611b975763ffffffff82166040840152600160208401525b846040015163ffffffff16821115611c19576000856040015163ffffffff1683611bc19190613192565b905083606001516001611bd491906130ec565b63ffffffff908116606080850191909152908216608084018190529085018051611bff908390613114565b66ffffffffffffff169052505063ffffffff821660408601525b60008481526004602090815260408083208651815484890151848a01516060808c01516080808e015166ffffffffffffff908116600160c01b0266ffffffffffffff60c01b19938216600160881b0266ffffffffffffff60881b1992909616600160501b0291909116600160501b600160c01b031961ffff978816600160401b0269ffffffffffffffffffff1990991660c09a8b1c179890981797909716969096179390931716939093179094558e8752600386528487208c5181548e8901518f89015163ffffffff908116600160b01b90810263ffffffff60b01b19938816600160a01b026001600160b01b03199095166001600160a01b03909616959095179390931791909116929092179092558e8952600588529786902089518154988b01518b890151958c0151978c015160a08d0151978d01511515600160b81b0260ff60b81b1998151590950260ff60b01b19918d16600160901b029190911664ffffffffff60901b1999909c16600160701b0263ffffffff60701b1960b09890981c640100000000029790971671ffffffffffffffffffffffffffff0000000019928716620100000263ffffffff19909c1693909616929092179990991798909816929092179290921793909316959095179390931792909216929092179055517f5cd7b4e6ac4b4756d574743a419c03b4db84645bd85707b345c7df8e32819c3a90611e699033908b9088908c9088908d906001600160a01b03969096168652602086019490945260408501929092526001600160b01b0319166060840152608083015260a082015260c00190565b60405180910390a1505050505092915050565b6002548110611e9d5760405162461bcd60e51b815260040161061b9061307d565b6000818152600660205260409020541580611ed85750600080516020613308833981519152546001600160a01b0316336001600160a01b0316145b611f185760405162461bcd60e51b8152602060048201526011602482015270185b1c9958591e481c995c5d595cdd1959607a1b604482015260640161061b565b600954600a546040516305d3b1d360e41b81526004810191909152600160a01b820467ffffffffffffffff1660248201526003604482015262030d406064820152600160848201526000916001600160a01b031690635d3b1d309060a401602060405180830381600087803b158015611f9057600080fd5b505af1158015611fa4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fc89190612ee9565b6000928352600660205260409092209190915550565b600080516020613308833981519152546001600160a01b0316336001600160a01b03161461201e5760405162461bcd60e51b815260040161061b90613058565b60025460009060049082906120349060016130d4565b815260208101919091526040016000205460c01b6001600160c01b031916141561208a5760405162461bcd60e51b81526020600482015260076024820152661b9bdd081cd95d60ca1b604482015260640161061b565b6002805490600061209a8361323c565b9190505550565b60008054604051637b30396560e01b81526004810186905282916001600160a01b031690637b3039659060240160c06040518083038186803b1580156120e657600080fd5b505afa1580156120fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061211e9190612d8d565b905060006040518060a0016040528060008152602001600081526020016000815260200164e8d4a51000815260200164e8d4a510008152509050612163818389612659565b600061216e86612353565b905060005b60058110156122595781816005811061218e5761218e6132ad565b602002015161ffff166121a057612259565b6001546001600160a01b0316637b3039658383600581106121c3576121c36132ad565b60200201516040516001600160e01b031960e084901b16815261ffff909116600482015260240160c06040518083038186803b15801561220257600080fd5b505afa158015612216573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223a9190612d8d565b935061224783858b612659565b806122518161323c565b915050612173565b506000612268888b898961287d565b905061227f836001600160c01b03198b16836128b2565b9a9950505050505050505050565b6040516323b872dd60e01b81523060048201526001600160a01b038381166024830152604482018390528416906323b872dd90606401602060405180830381600087803b1580156122dd57600080fd5b505af11580156122f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123159190612e89565b610a3f5760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b604482015260640161061b565b61235b612c29565b60f082901c815261ffff60e083901c8116602083015260d083901c8116604083015260c083901c8116606083015260b09290921c909116608082015290565b6040516323b872dd60e01b8152336004820152306024820152604481018290526001600160a01b038316906323b872dd90606401602060405180830381600087803b1580156123e857600080fd5b505af11580156123fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124209190612e89565b61245e5760405162461bcd60e51b815260206004820152600f60248201526e3330b4b632b2103a3930b739b332b960891b604482015260640161061b565b5050565b600061246d82612353565b905060015b6005811015610a3f5781612487600183613192565b60058110612497576124976132ad565b602002015161ffff16156124eb578181600581106124b7576124b76132ad565b602002015161ffff16826124cc600184613192565b600581106124dc576124dc6132ad565b602002015161ffff1611612508565b8181600581106124fd576124fd6132ad565b602002015161ffff16155b6125445760405162461bcd60e51b815260206004820152600d60248201526c696e76616c6964206974656d7360981b604482015260640161061b565b818160058110612556576125566132ad565b602002015161ffff16156126475760015433906001600160a01b0316636352211e848460058110612589576125896132ad565b60200201516040516001600160e01b031960e084901b16815261ffff909116600482015260240160206040518083038186803b1580156125c857600080fd5b505afa1580156125dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126009190612c93565b6001600160a01b0316146126475760405162461bcd60e51b815260206004820152600e60248201526d3737ba1034ba32b69037bbb732b960911b604482015260640161061b565b806126518161323c565b915050612472565b60006126706001600160c01b0319831660066129dd565b905060006126896001600160c01b0319841660046129dd565b905060006126a26001600160c01b0319851660056129dd565b600114905060006126be6001600160c01b0319861660036129dd565b600114905060006126d7876005602002015160076129dd565b905060ff60c887901c1660005b60068110156128715761270e898260068110612702576127026132ad565b602002015160006129dd565b8a518b9061271d9083906130d4565b905250612744898260068110612735576127356132ad565b60200201516001600688612a88565b8a60200181815161275591906130d4565b905250600061277e8a836006811061276f5761276f6132ad565b60200201516002600488612a88565b9050600061278c8585612ac3565b9050806003146127d957806002146127a55760016127a8565b60025b60ff16816001146127ba5760016127bd565b60025b6127ca9060ff168461314a565b6127d49190613136565b6127dc565b60005b8c6040018181516127ed91906130d4565b90525060608c0151612818908c856006811061280b5761280b6132ad565b602002015160058c612b4d565b60608d015260808c0151612845908c8560068110612838576128386132ad565b602002015160038b612b4d565b60808d01819052612857908686612b63565b60808d0152508190506128698161323c565b9150506126e4565b50505050505050505050565b60006703782dace9d9000061289486868686610c13565b61289e9190613257565b6128a99060016130d4565b95945050505050565b60008064e8d4a510006128c68560016129dd565b86606001516128d5919061314a565b6128df9190613136565b9050600064e8d4a510006128f48660026129dd565b8760800151612903919061314a565b61290d9190613136565b90506000670de0b6b3a7640000858860400151896020015161292f91906130d4565b612939919061314a565b6129439190613136565b8760400151886020015161295791906130d4565b61296191906130d4565b875190915061297083856130d4565b118061298557506129828660006129dd565b81105b1561299657600093505050506129d6565b818388600001516129a88960006129dd565b6129b29085613192565b6129bc91906130d4565b6129c69190613192565b6129d091906130d4565b93505050505b9392505050565b6000808260078111156129f2576129f2613297565b90508060ff1660071415612a0f578360b01c60ff16915050612a82565b60038160ff161015612a4557612a26816010613169565b60ff16846001600160b01b031916901b60f01c61ffff16915050612a82565b612a506003826131a9565b60ff16612a5e6003836131a9565b60ff166001901b6030866001600160b01b031916901b60f01c61ffff1616901c9150505b92915050565b6000612a9485846129dd565b158015612a9e5750815b612aa9576001612aac565b60025b60ff16612ab986866129dd565b6128a99190613136565b6000821580612ad0575081155b15612add57506000612a82565b612ae8600183613192565b831480612b005750826004148015612b005750816001145b15612b0d57506001612a82565b81612b19600185613192565b1480612b305750826001148015612b305750816004145b15612b3d57506002612a82565b81831415612a8257506003612a82565b60006128a985612b5d86866129dd565b84612be9565b600080612b708484612ac3565b905080612b8057849150506129d6565b8060031415612b935760009150506129d6565b8060011415612bcd57612bac64e8d4a51000600261314a565b612bbb64e8d4a510008761314a565b612bc59190613136565b9150506129d6565b64e8d4a5100080612bdf87600261314a565b612ab9919061314a565b600064e8d4a5100082158015612bff5750836001145b612c0e5764e8d4a51000612c15565b64746a5288005b612c1f908661314a565b610d3d9190613136565b6040518060a001604052806005906020820280368337509192915050565b60008083601f840112612c5957600080fd5b50813567ffffffffffffffff811115612c7157600080fd5b6020830191508360208260051b8501011115612c8c57600080fd5b9250929050565b600060208284031215612ca557600080fd5b81516129d6816132d9565b60008060408385031215612cc357600080fd5b8235612cce816132d9565b91506020830135612cde816132d9565b809150509250929050565b600080600060608486031215612cfe57600080fd5b8335612d09816132d9565b925060208401359150604084013567ffffffffffffffff81168114612d2d57600080fd5b809150509250925092565b600080600080600080600060e0888a031215612d5357600080fd5b8735612d5e816132d9565b9960208901359950604089013598606081013598506080810135975060a0810135965060c00135945092505050565b600060c08284031215612d9f57600080fd5b82601f830112612dae57600080fd5b60405160c0810181811067ffffffffffffffff82111715612dd157612dd16132c3565b604052808360c08101861015612de657600080fd5b60005b6006811015612e12578151612dfd816132f1565b83526020928301929190910190600101612de9565b509195945050505050565b60008060008060408587031215612e3357600080fd5b843567ffffffffffffffff80821115612e4b57600080fd5b612e5788838901612c47565b90965094506020870135915080821115612e7057600080fd5b50612e7d87828801612c47565b95989497509550505050565b600060208284031215612e9b57600080fd5b815180151581146129d657600080fd5b600060208284031215612ebd57600080fd5b5035919050565b60008060408385031215612ed757600080fd5b823591506020830135612cde816132d9565b600060208284031215612efb57600080fd5b5051919050565b60008060408385031215612f1557600080fd5b8235915060208084013567ffffffffffffffff80821115612f3557600080fd5b818601915086601f830112612f4957600080fd5b813581811115612f5b57612f5b6132c3565b8060051b9150612f6c8483016130a3565b8181528481019084860184860187018b1015612f8757600080fd5b600095505b83861015612faa578035835260019590950194918601918601612f8c565b508096505050505050509250929050565b60008060408385031215612fce57600080fd5b823591506020830135612cde816132f1565b600080600060608486031215612ff557600080fd5b83359250602084013591506040840135612d2d816132f1565b6000806000806080858703121561302457600080fd5b8435935060208501359250604085013561303d816132f1565b9150606085013561304d816132d9565b939692955090935050565b6020808252600b908201526a1b9bdd08185b1b1bddd95960aa1b604082015260600190565b6020808252600c908201526b1b9bdd08199a5b9a5cda195960a21b604082015260600190565b604051601f8201601f1916810167ffffffffffffffff811182821017156130cc576130cc6132c3565b604052919050565b600082198211156130e7576130e761326b565b500190565b600063ffffffff80831681851680830382111561310b5761310b61326b565b01949350505050565b600066ffffffffffffff80831681851680830382111561310b5761310b61326b565b60008261314557613145613281565b500490565b60008160001904831182151516156131645761316461326b565b500290565b600060ff821660ff84168160ff048111821515161561318a5761318a61326b565b029392505050565b6000828210156131a4576131a461326b565b500390565b600060ff821660ff8416808210156131c3576131c361326b565b90039392505050565b805160208201516001600160c01b031980821692919060088310156131fb5780818460080360031b1b83161693505b505050919050565b6000816132125761321261326b565b506000190190565b600061ffff808316818114156132325761323261326b565b6001019392505050565b60006000198214156132505761325061326b565b5060010190565b60008261326657613266613281565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146132ee57600080fd5b50565b6001600160b01b0319811681146132ee57600080fdfeb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103a2646970667358221220a351d9ae9dd7ae5d0c1a555551317cef63bd1df9ec175230a7b01321cf2c452c64736f6c63430008070033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061014d5760003560e01c806381d12c58116100c3578063a694fc3a1161007c578063a694fc3a1461041a578063a8d4a03b1461042d578063b3897c3b1461049f578063b90e1a1e146104b2578063d3b5dc3b146104c5578063d528acf1146104d157600080fd5b806381d12c58146102ee578063856f8c351461030e578063878a808b1461031757806391d056661461033757806396b9d24d146103f45780639b8f43611461040757600080fd5b8063485cc95511610115578063485cc9551461024057806349cf508414610253578063603ce1fe146102745780636813925e14610287578063771a5fa2146102c85780637f2c9aab146102db57600080fd5b806309d25f37146101525780631fe543e314610167578063204597e01461017a5780632e17de781461021a57806332ed53911461022d575b600080fd5b610165610160366004612fe0565b6104d9565b005b610165610175366004612f02565b610905565b6101d1610188366004612eab565b60046020526000908152604090205460c081901b9061ffff600160401b8204169066ffffffffffffff600160501b8204811691600160881b8104821691600160c01b9091041685565b604080516001600160c01b0319909616865261ffff909416602086015266ffffffffffffff928316938501939093528116606084015216608082015260a0015b60405180910390f35b610165610228366004612eab565b610a44565b61016561023b366004612ce9565b610b4f565b61016561024e366004612cb0565b610bb8565b61026661026136600461300e565b610c13565b604051908152602001610211565b610266610282366004612ec4565b610c69565b6102b0610295366004612eab565b6008602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610211565b6101656102d6366004612d38565b610d45565b6102666102e9366004612fe0565b610f1a565b6102666102fc366004612eab565b60066020526000908152604090205481565b61026660025481565b610266610325366004612eab565b60076020526000908152604090205481565b6103a2610345366004612eab565b60056020526000908152604090205461ffff8082169162010000810490911690640100000000810460b01b9063ffffffff600160701b8204811691600160901b81049091169060ff600160b01b8204811691600160b81b90041687565b6040805161ffff98891681529790961660208801526001600160b01b03199094169486019490945263ffffffff918216606086015216608084015290151560a0830152151560c082015260e001610211565b610165610402366004612fe0565b6113bc565b610165610415366004612e1d565b6117d3565b610165610428366004612eab565b611854565b61047161043b366004612eab565b6003602052600090815260409020546001600160a01b03811690600160a01b810461ffff1690600160b01b900463ffffffff1683565b604080516001600160a01b03909416845261ffff909216602084015263ffffffff1690820152606001610211565b6102666104ad366004612fbb565b611922565b6101656104c0366004612eab565b611e7c565b61026664e8d4a5100081565b610165611fde565b60006104e784848433610c13565b6000818152600560209081526040808320815160e081018352905461ffff808216835262010000820481168386018181526001600160b01b0319640100000000850460b01b168587015263ffffffff600160701b85048116606080880191909152600160901b860490911660808088019190915260ff600160b01b87048116151560a0808a0191909152600160b81b90970416151560c080890191909152938a52600489529887902087519586018852546001600160c01b03199381901b939093168552600160401b830484169785019790975266ffffffffffffff600160501b8304811696850196909652600160881b8204861696840196909652600160c01b90049093169481019490945260025492519495509316106106245760405162461bcd60e51b815260040161061b9061307d565b60405180910390fd5b8160a00151156106685760405162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4818db185a5b5959608a1b604482015260640161061b565b600061068f836020015161ffff168360000151856000015161ffff168660400151336120a1565b9050816040015166ffffffffffffff16811480156106b95750604082015166ffffffffffffff1615155b6106f65760405162461bcd60e51b815260206004820152600e60248201526d6e6f7420686967682073636f726560901b604482015260640161061b565b6000848152600560209081526040808320805460ff60b01b1916600160b01b1790558582015161ffff168352600890915290205473dac17f958d2ee523a2206206994597c13d831ec76001600160a01b0390911614156108275773dac17f958d2ee523a2206206994597c13d831ec76001600160a01b031663a9059cbb33846020015161ffff1660076000886020015161ffff168152602001908152602001600020546107a39190613136565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b1580156107e957600080fd5b505af11580156107fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108219190612e89565b506108fc565b6020808401805161ffff9081166000908152600884526040808220548786015194518416835260079095529020546001600160a01b039093169263a9059cbb92339261087592911690613136565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b1580156108bb57600080fd5b505af11580156108cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f39190612e89565b6108fc57600080fd5b50505050505050565b6009546001600160a01b0316331461092f5760405162461bcd60e51b815260040161061b90613058565b6002545b8015610a3f57600081815260066020526040902054831415610a2d576000818152600460209081526040808320815160a08101835290546001600160c01b031960c082901b16825261ffff600160401b8204169382019390935266ffffffffffffff600160501b8404811692820192909252600160881b8304821660608201819052600160c01b90930490911660808201528451909285916109d7576109d76132ad565b60200260200101516109e99190613257565b6109f49060016130d4565b6000838152600460205260409020805466ffffffffffffff92909216600160c01b0266ffffffffffffff60c01b19909216919091179055505b80610a3781613203565b915050610933565b505050565b600081815260036020908152604091829020825160608101845290546001600160a01b038116808352600160a01b820461ffff1693830193909352600160b01b900463ffffffff16928101929092523314610acd5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015260640161061b565b600254816020015161ffff1610610b175760405162461bcd60e51b815260206004820152600e60248201526d185b1c99591e48195b9d195c995960921b604482015260640161061b565b6000548151610b30916001600160a01b0316908461228d565b50600090815260036020526040902080546001600160d01b0319169055565b600080516020613308833981519152546001600160a01b0316336001600160a01b031614610b7c57600080fd5b60098054600a9390935567ffffffffffffffff909116600160a01b026001600160e01b03199092166001600160a01b0390931692909217179055565b600080516020613308833981519152546001600160a01b0316336001600160a01b031614610be557600080fd5b600080546001600160a01b039384166001600160a01b03199182161790915560018054929093169116179055565b60408051602081018690529081018490526001600160b01b0319831660608201526001600160a01b038216608082015260009060a001604051602081830303815290604052805190602001209050949350505050565b6000828152600560209081526040808320815160e081018352905461ffff8082168352620100008204169382018490526001600160b01b0319640100000000820460b01b169282019290925263ffffffff600160701b830481166060830152600160901b830416608082015260ff600160b01b83048116151560a0830152600160b81b909204909116151560c082015290610d0357600080fd5b60208082015161ffff9081166000818152600490935260409283902054845193850151610d3d94929360c09290921b9290911690876120a1565b949350505050565b600080516020613308833981519152546001600160a01b0316336001600160a01b031614610d855760405162461bcd60e51b815260040161061b90613058565b60006002546001610d9691906130d4565b60008181526007602090815260408083208b905560089091529081902080546001600160a01b0319166001600160a01b038c16179055805160a081019091526001600160f01b031960f089811b821660c084015288811b821660c284015287901b1660c48201526001600160f81b031960f885811b821660c684015286901b1660c78201529091508060c88101604051602081830303815290604052610e3b906131cc565b6001600160c01b031916815260006020808301829052604080840183905260608085018490526080948501849052958352600482529182902084518154928601519386015196860151959094015160c09490941c69ffffffffffffffffffff1990921691909117600160401b61ffff9093169290920291909117600160501b600160c01b031916600160501b66ffffffffffffff9586160266ffffffffffffff60881b191617600160881b938516939093029290921766ffffffffffffff60c01b1916600160c01b939091169290920291909117905550505050505050565b600080610f2985858533610c13565b600081815260056020908152604091829020825160e081018452905461ffff8082168352620100008204169282018390526001600160b01b0319640100000000820460b01b169382019390935263ffffffff600160701b840481166060830152600160901b840416608082015260ff600160b01b84048116151560a0830152600160b81b909304909216151560c0830152600254929350909114610ffc5760405162461bcd60e51b815260206004820152600a60248201526931b630b4b69037bb32b960b11b604482015260640161061b565b805161ffff166110435760405162461bcd60e51b81526020600482015260126024820152711b9bdb88195e1a5cdd195b9d08199a59da1d60721b604482015260640161061b565b8060c00151156110875760405162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4818db185a5b5959608a1b604482015260640161061b565b60208082015161ffff908116600081815260049093526040808420548551918601516110be9460c09290921b9290911690336120a1565b9050600081116110fa5760405162461bcd60e51b81526020600482015260076024820152663737ba103bb7b760c91b604482015260640161061b565b60006111098360400151612353565b905060005b60058110156112dd57818160058110611129576111296132ad565b602002015161ffff1661113b576112dd565b6001546000906001600160a01b0316636352211e848460058110611161576111616132ad565b60200201516040516001600160e01b031960e084901b16815261ffff909116600482015260240160206040518083038186803b1580156111a057600080fd5b505afa1580156111b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d89190612c93565b6001600160a01b0316146112cb576001546001600160a01b03166379cc67903384846005811061120a5761120a6132ad565b60200201516040516001600160e01b031960e085901b1681526001600160a01b03909216600483015261ffff166024820152604401602060405180830381600087803b15801561125957600080fd5b505af115801561126d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112919190612e89565b6112cb5760405162461bcd60e51b815260206004820152600b60248201526a189d5c9b8819985a5b195960aa1b604482015260640161061b565b806112d58161323c565b91505061110e565b506000848152600560209081526040909120805460ff60b81b1916600160b81b179055830151600a61ffff90911614611321576001546001600160a01b031661132e565b6000546001600160a01b03165b604051630355993160e41b8152600481018990523360248201526001600160a01b039190911690633559931090604401602060405180830381600087803b15801561137857600080fd5b505af115801561138c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b09190612ee9565b98975050505050505050565b60006113ca84848433610c13565b6000818152600560209081526040808320815160e081018352905461ffff808216835262010000820481168386018181526001600160b01b0319640100000000850460b01b168587015263ffffffff600160701b85048116606080880191909152600160901b860490911660808088019190915260ff600160b01b87048116151560a0808a0191909152600160b81b90970416151560c080890191909152938a52600489529887902087519586018852546001600160c01b03199381901b939093168552600160401b830484169785019790975266ffffffffffffff600160501b8304811696850196909652600160881b8204861696840196909652600160c01b90049093169481019490945260025492519495509316106114fe5760405162461bcd60e51b815260040161061b9061307d565b6000816040015166ffffffffffffff16116115485760405162461bcd60e51b815260206004820152600a6024820152691b9bdd08199bdd59da1d60b21b604482015260640161061b565b608081015166ffffffffffffff166115905760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd081c9859999b195960aa1b604482015260640161061b565b806080015166ffffffffffffff16826060015163ffffffff16111580156115dc5750806080015166ffffffffffffff16826080015183606001516115d491906130ec565b63ffffffff16115b6116155760405162461bcd60e51b815260206004820152600a6024820152693737ba103bb4b73732b960b11b604482015260640161061b565b6000838152600560209081526040808320805463ffffffff60901b191690558482015161ffff16835260089091529020546001600160a01b031673dac17f958d2ee523a2206206994597c13d831ec714156117165760208281015161ffff166000908152600790915260409081902054905163a9059cbb60e01b8152336004820152602481019190915273dac17f958d2ee523a2206206994597c13d831ec79063a9059cbb90604401602060405180830381600087803b1580156116d857600080fd5b505af11580156116ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117109190612e89565b506117cb565b6020828101805161ffff9081166000908152600884526040808220549351909216815260079093529182902054915163a9059cbb60e01b815233600482015260248101929092526001600160a01b03169063a9059cbb90604401602060405180830381600087803b15801561178a57600080fd5b505af115801561179e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c29190612e89565b6117cb57600080fd5b505050505050565b8260005b81811015611812576118008686838181106117f4576117f46132ad565b90506020020135611854565b8061180a8161323c565b9150506117d7565b5081905060005b818110156117cb57611842848483818110611836576118366132ad565b90506020020135610a44565b8061184c8161323c565b915050611819565b6002546118915760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd081cdd185c9d195960aa1b604482015260640161061b565b6000546118a7906001600160a01b03168261239a565b60408051606081018252338152600060208083018281528385018381529583526003909152929020905181549251935163ffffffff16600160b01b0263ffffffff60b01b1961ffff95909516600160a01b026001600160b01b03199094166001600160a01b0392909216919091179290921792909216179055565b6000828152600360209081526040808320815160608101835290546001600160a01b038116808352600160a01b820461ffff1694830194909452600160b01b900463ffffffff16918101919091529033146119ab5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015260640161061b565b6119b483612462565b600254600081815260046020908152604091829020825160a08101845290546001600160c01b031960c082901b1680835261ffff600160401b8304169383019390935266ffffffffffffff600160501b8204811694830194909452600160881b810484166060830152600160c01b90049092166080830152611a675760405162461bcd60e51b815260206004820152600c60248201526b696e76616c696420626f737360a01b604482015260640161061b565b6000611a7a8383600001518989336120a1565b905082846020015161ffff161015611a9e5761ffff83166020850152600060408501525b611aaa87848833610c13565b60008181526005602052604090205490955061ffff1615611afe5760405162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e48199bdd59da1d60921b604482015260640161061b565b6040805160e08101825261ffff808a168252851660208201526001600160b01b03198816818301526000606082018190526080820181905260a0820181905260c08201529083015166ffffffffffffff16821415611b6e5760208301805190611b668261321a565b61ffff169052505b826040015166ffffffffffffff16821115611b975763ffffffff82166040840152600160208401525b846040015163ffffffff16821115611c19576000856040015163ffffffff1683611bc19190613192565b905083606001516001611bd491906130ec565b63ffffffff908116606080850191909152908216608084018190529085018051611bff908390613114565b66ffffffffffffff169052505063ffffffff821660408601525b60008481526004602090815260408083208651815484890151848a01516060808c01516080808e015166ffffffffffffff908116600160c01b0266ffffffffffffff60c01b19938216600160881b0266ffffffffffffff60881b1992909616600160501b0291909116600160501b600160c01b031961ffff978816600160401b0269ffffffffffffffffffff1990991660c09a8b1c179890981797909716969096179390931716939093179094558e8752600386528487208c5181548e8901518f89015163ffffffff908116600160b01b90810263ffffffff60b01b19938816600160a01b026001600160b01b03199095166001600160a01b03909616959095179390931791909116929092179092558e8952600588529786902089518154988b01518b890151958c0151978c015160a08d0151978d01511515600160b81b0260ff60b81b1998151590950260ff60b01b19918d16600160901b029190911664ffffffffff60901b1999909c16600160701b0263ffffffff60701b1960b09890981c640100000000029790971671ffffffffffffffffffffffffffff0000000019928716620100000263ffffffff19909c1693909616929092179990991798909816929092179290921793909316959095179390931792909216929092179055517f5cd7b4e6ac4b4756d574743a419c03b4db84645bd85707b345c7df8e32819c3a90611e699033908b9088908c9088908d906001600160a01b03969096168652602086019490945260408501929092526001600160b01b0319166060840152608083015260a082015260c00190565b60405180910390a1505050505092915050565b6002548110611e9d5760405162461bcd60e51b815260040161061b9061307d565b6000818152600660205260409020541580611ed85750600080516020613308833981519152546001600160a01b0316336001600160a01b0316145b611f185760405162461bcd60e51b8152602060048201526011602482015270185b1c9958591e481c995c5d595cdd1959607a1b604482015260640161061b565b600954600a546040516305d3b1d360e41b81526004810191909152600160a01b820467ffffffffffffffff1660248201526003604482015262030d406064820152600160848201526000916001600160a01b031690635d3b1d309060a401602060405180830381600087803b158015611f9057600080fd5b505af1158015611fa4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fc89190612ee9565b6000928352600660205260409092209190915550565b600080516020613308833981519152546001600160a01b0316336001600160a01b03161461201e5760405162461bcd60e51b815260040161061b90613058565b60025460009060049082906120349060016130d4565b815260208101919091526040016000205460c01b6001600160c01b031916141561208a5760405162461bcd60e51b81526020600482015260076024820152661b9bdd081cd95d60ca1b604482015260640161061b565b6002805490600061209a8361323c565b9190505550565b60008054604051637b30396560e01b81526004810186905282916001600160a01b031690637b3039659060240160c06040518083038186803b1580156120e657600080fd5b505afa1580156120fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061211e9190612d8d565b905060006040518060a0016040528060008152602001600081526020016000815260200164e8d4a51000815260200164e8d4a510008152509050612163818389612659565b600061216e86612353565b905060005b60058110156122595781816005811061218e5761218e6132ad565b602002015161ffff166121a057612259565b6001546001600160a01b0316637b3039658383600581106121c3576121c36132ad565b60200201516040516001600160e01b031960e084901b16815261ffff909116600482015260240160c06040518083038186803b15801561220257600080fd5b505afa158015612216573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223a9190612d8d565b935061224783858b612659565b806122518161323c565b915050612173565b506000612268888b898961287d565b905061227f836001600160c01b03198b16836128b2565b9a9950505050505050505050565b6040516323b872dd60e01b81523060048201526001600160a01b038381166024830152604482018390528416906323b872dd90606401602060405180830381600087803b1580156122dd57600080fd5b505af11580156122f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123159190612e89565b610a3f5760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b604482015260640161061b565b61235b612c29565b60f082901c815261ffff60e083901c8116602083015260d083901c8116604083015260c083901c8116606083015260b09290921c909116608082015290565b6040516323b872dd60e01b8152336004820152306024820152604481018290526001600160a01b038316906323b872dd90606401602060405180830381600087803b1580156123e857600080fd5b505af11580156123fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124209190612e89565b61245e5760405162461bcd60e51b815260206004820152600f60248201526e3330b4b632b2103a3930b739b332b960891b604482015260640161061b565b5050565b600061246d82612353565b905060015b6005811015610a3f5781612487600183613192565b60058110612497576124976132ad565b602002015161ffff16156124eb578181600581106124b7576124b76132ad565b602002015161ffff16826124cc600184613192565b600581106124dc576124dc6132ad565b602002015161ffff1611612508565b8181600581106124fd576124fd6132ad565b602002015161ffff16155b6125445760405162461bcd60e51b815260206004820152600d60248201526c696e76616c6964206974656d7360981b604482015260640161061b565b818160058110612556576125566132ad565b602002015161ffff16156126475760015433906001600160a01b0316636352211e848460058110612589576125896132ad565b60200201516040516001600160e01b031960e084901b16815261ffff909116600482015260240160206040518083038186803b1580156125c857600080fd5b505afa1580156125dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126009190612c93565b6001600160a01b0316146126475760405162461bcd60e51b815260206004820152600e60248201526d3737ba1034ba32b69037bbb732b960911b604482015260640161061b565b806126518161323c565b915050612472565b60006126706001600160c01b0319831660066129dd565b905060006126896001600160c01b0319841660046129dd565b905060006126a26001600160c01b0319851660056129dd565b600114905060006126be6001600160c01b0319861660036129dd565b600114905060006126d7876005602002015160076129dd565b905060ff60c887901c1660005b60068110156128715761270e898260068110612702576127026132ad565b602002015160006129dd565b8a518b9061271d9083906130d4565b905250612744898260068110612735576127356132ad565b60200201516001600688612a88565b8a60200181815161275591906130d4565b905250600061277e8a836006811061276f5761276f6132ad565b60200201516002600488612a88565b9050600061278c8585612ac3565b9050806003146127d957806002146127a55760016127a8565b60025b60ff16816001146127ba5760016127bd565b60025b6127ca9060ff168461314a565b6127d49190613136565b6127dc565b60005b8c6040018181516127ed91906130d4565b90525060608c0151612818908c856006811061280b5761280b6132ad565b602002015160058c612b4d565b60608d015260808c0151612845908c8560068110612838576128386132ad565b602002015160038b612b4d565b60808d01819052612857908686612b63565b60808d0152508190506128698161323c565b9150506126e4565b50505050505050505050565b60006703782dace9d9000061289486868686610c13565b61289e9190613257565b6128a99060016130d4565b95945050505050565b60008064e8d4a510006128c68560016129dd565b86606001516128d5919061314a565b6128df9190613136565b9050600064e8d4a510006128f48660026129dd565b8760800151612903919061314a565b61290d9190613136565b90506000670de0b6b3a7640000858860400151896020015161292f91906130d4565b612939919061314a565b6129439190613136565b8760400151886020015161295791906130d4565b61296191906130d4565b875190915061297083856130d4565b118061298557506129828660006129dd565b81105b1561299657600093505050506129d6565b818388600001516129a88960006129dd565b6129b29085613192565b6129bc91906130d4565b6129c69190613192565b6129d091906130d4565b93505050505b9392505050565b6000808260078111156129f2576129f2613297565b90508060ff1660071415612a0f578360b01c60ff16915050612a82565b60038160ff161015612a4557612a26816010613169565b60ff16846001600160b01b031916901b60f01c61ffff16915050612a82565b612a506003826131a9565b60ff16612a5e6003836131a9565b60ff166001901b6030866001600160b01b031916901b60f01c61ffff1616901c9150505b92915050565b6000612a9485846129dd565b158015612a9e5750815b612aa9576001612aac565b60025b60ff16612ab986866129dd565b6128a99190613136565b6000821580612ad0575081155b15612add57506000612a82565b612ae8600183613192565b831480612b005750826004148015612b005750816001145b15612b0d57506001612a82565b81612b19600185613192565b1480612b305750826001148015612b305750816004145b15612b3d57506002612a82565b81831415612a8257506003612a82565b60006128a985612b5d86866129dd565b84612be9565b600080612b708484612ac3565b905080612b8057849150506129d6565b8060031415612b935760009150506129d6565b8060011415612bcd57612bac64e8d4a51000600261314a565b612bbb64e8d4a510008761314a565b612bc59190613136565b9150506129d6565b64e8d4a5100080612bdf87600261314a565b612ab9919061314a565b600064e8d4a5100082158015612bff5750836001145b612c0e5764e8d4a51000612c15565b64746a5288005b612c1f908661314a565b610d3d9190613136565b6040518060a001604052806005906020820280368337509192915050565b60008083601f840112612c5957600080fd5b50813567ffffffffffffffff811115612c7157600080fd5b6020830191508360208260051b8501011115612c8c57600080fd5b9250929050565b600060208284031215612ca557600080fd5b81516129d6816132d9565b60008060408385031215612cc357600080fd5b8235612cce816132d9565b91506020830135612cde816132d9565b809150509250929050565b600080600060608486031215612cfe57600080fd5b8335612d09816132d9565b925060208401359150604084013567ffffffffffffffff81168114612d2d57600080fd5b809150509250925092565b600080600080600080600060e0888a031215612d5357600080fd5b8735612d5e816132d9565b9960208901359950604089013598606081013598506080810135975060a0810135965060c00135945092505050565b600060c08284031215612d9f57600080fd5b82601f830112612dae57600080fd5b60405160c0810181811067ffffffffffffffff82111715612dd157612dd16132c3565b604052808360c08101861015612de657600080fd5b60005b6006811015612e12578151612dfd816132f1565b83526020928301929190910190600101612de9565b509195945050505050565b60008060008060408587031215612e3357600080fd5b843567ffffffffffffffff80821115612e4b57600080fd5b612e5788838901612c47565b90965094506020870135915080821115612e7057600080fd5b50612e7d87828801612c47565b95989497509550505050565b600060208284031215612e9b57600080fd5b815180151581146129d657600080fd5b600060208284031215612ebd57600080fd5b5035919050565b60008060408385031215612ed757600080fd5b823591506020830135612cde816132d9565b600060208284031215612efb57600080fd5b5051919050565b60008060408385031215612f1557600080fd5b8235915060208084013567ffffffffffffffff80821115612f3557600080fd5b818601915086601f830112612f4957600080fd5b813581811115612f5b57612f5b6132c3565b8060051b9150612f6c8483016130a3565b8181528481019084860184860187018b1015612f8757600080fd5b600095505b83861015612faa578035835260019590950194918601918601612f8c565b508096505050505050509250929050565b60008060408385031215612fce57600080fd5b823591506020830135612cde816132f1565b600080600060608486031215612ff557600080fd5b83359250602084013591506040840135612d2d816132f1565b6000806000806080858703121561302457600080fd5b8435935060208501359250604085013561303d816132f1565b9150606085013561304d816132d9565b939692955090935050565b6020808252600b908201526a1b9bdd08185b1b1bddd95960aa1b604082015260600190565b6020808252600c908201526b1b9bdd08199a5b9a5cda195960a21b604082015260600190565b604051601f8201601f1916810167ffffffffffffffff811182821017156130cc576130cc6132c3565b604052919050565b600082198211156130e7576130e761326b565b500190565b600063ffffffff80831681851680830382111561310b5761310b61326b565b01949350505050565b600066ffffffffffffff80831681851680830382111561310b5761310b61326b565b60008261314557613145613281565b500490565b60008160001904831182151516156131645761316461326b565b500290565b600060ff821660ff84168160ff048111821515161561318a5761318a61326b565b029392505050565b6000828210156131a4576131a461326b565b500390565b600060ff821660ff8416808210156131c3576131c361326b565b90039392505050565b805160208201516001600160c01b031980821692919060088310156131fb5780818460080360031b1b83161693505b505050919050565b6000816132125761321261326b565b506000190190565b600061ffff808316818114156132325761323261326b565b6001019392505050565b60006000198214156132505761325061326b565b5060010190565b60008261326657613266613281565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146132ee57600080fd5b50565b6001600160b01b0319811681146132ee57600080fdfeb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103a2646970667358221220a351d9ae9dd7ae5d0c1a555551317cef63bd1df9ec175230a7b01321cf2c452c64736f6c63430008070033

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  ]

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.