Contract 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197

Contract Overview

Balance:
0 BTT

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xf22e369a9341123b861aa2541b46823aba7fa7b416009b0ebc4a092c7bbac721Claim Reward189453432023-02-28 19:07:15393 days 14 hrs ago0x017e10efdb065ca88fcb62452227d9a8bbeb3cbb IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT805.101
0xcff81ed86cb9f87d270565a76d0552d29ff8e0133a72106006f1520e9f0f2910Allocate Reward189452702023-02-28 19:04:45393 days 14 hrs ago0xf2e3fbdc5038ca680a76bd416933abf0a1500c96 IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT1,553.742
0xe67d20d45b5b3c7a444ace5ceaf88dd1e7837fc2aabae7297ed0ea168e39df9dClaim Reward189448802023-02-28 18:51:21393 days 14 hrs ago0x017e10efdb065ca88fcb62452227d9a8bbeb3cbb IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT363.8997
0x4059332383ce677e3276dec795e74460a449ed01c81cc823547285c3b84a1de2Withdraw187527632023-02-24 4:47:19398 days 5 hrs ago0x017e10efdb065ca88fcb62452227d9a8bbeb3cbb IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT1,045.8501
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41Stake187527042023-02-24 4:45:21398 days 5 hrs ago0x017e10efdb065ca88fcb62452227d9a8bbeb3cbb IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT5,865.2961
0x5c978f2231e5addc7c673c612e33c36373932b19ecaedcfc5e9398ef7d15e6a7Withdraw187526972023-02-24 4:45:03398 days 5 hrs ago0x017e10efdb065ca88fcb62452227d9a8bbeb3cbb IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT2,236.8546
0xf6b620c3df9909f9db0aec94dfa6adbcae2f60313198033e78d6db4d5375898cClaim Reward187516982023-02-24 4:10:45398 days 5 hrs ago0x017e10efdb065ca88fcb62452227d9a8bbeb3cbb IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT363.8997
0xbc88f2ab35ffe4f031f0de85ba6294444693906c69a1f6a4c7f3abf2a343775bStake187516402023-02-24 4:08:45398 days 5 hrs ago0x017e10efdb065ca88fcb62452227d9a8bbeb3cbb IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT5,865.2961
0x2d81b2056cb6b2ea397a2fa297fcea0fc17f76a7297ba13a0b9d1e6e723a7744Withdraw187516302023-02-24 4:08:25398 days 5 hrs ago0x017e10efdb065ca88fcb62452227d9a8bbeb3cbb IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT2,236.8546
0x91954456de3b35916511186dd14e3d577a435aa2e9e97b0a10382638c618bc4dStake187516182023-02-24 4:08:01398 days 5 hrs ago0x017e10efdb065ca88fcb62452227d9a8bbeb3cbb IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT4,740.21
0x4c0221727a1a4499b229511c8b974fbbec99c4f3b5f6a06e365e1df00abb1a53Stake187515522023-02-24 4:05:45398 days 5 hrs ago0x017e10efdb065ca88fcb62452227d9a8bbeb3cbb IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT2,082.0747
0x6cb2b76adaebbf3f7ae330459bc5f84f7145d74c81e5f647fa7fd8f966ae2aceStake187389862023-02-23 20:53:45398 days 12 hrs ago0x9610f65f06337d332d08ffe1109b311d33f681d8 IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT1,618.8789
0x66819bea98414b1a9e725d863dda91dbe9c64f20f59d38daa3f4cc791e418691Claim Reward187389682023-02-23 20:53:09398 days 12 hrs ago0x9610f65f06337d332d08ffe1109b311d33f681d8 IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT363.8997
0xe465a285d84128c32ab05195d1002b15fd3f344579cc8e61cb94c1a7667275d0Withdraw187383692023-02-23 20:32:35398 days 13 hrs ago0x9610f65f06337d332d08ffe1109b311d33f681d8 IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT1,000.2801
0x4476a6116947b5af67b906744c188929acb312662a7f3632f96601dddbea8365Withdraw187383112023-02-23 20:30:35398 days 13 hrs ago0x9610f65f06337d332d08ffe1109b311d33f681d8 IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT1,026.3201
0x17e6cfab93938c2d3bebd04f7494b3215692bfeebdd0ddaf34e4c4305c954a08Stake186845272023-02-22 13:41:43399 days 20 hrs ago0x9610f65f06337d332d08ffe1109b311d33f681d8 IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT2,310.6408
0x3f1161d6f187f7dc08be2994ca6ab0af53c3b2eac249fa15e59982a0c1b38824Withdraw186844582023-02-22 13:39:21399 days 20 hrs ago0x9610f65f06337d332d08ffe1109b311d33f681d8 IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT1,274.4999
0x33b66090142a1bbccc94393f5876b9afc01c651de3f06ed2cf4ca1cfbffc17d8Stake186843132023-02-22 13:34:23399 days 20 hrs ago0x9610f65f06337d332d08ffe1109b311d33f681d8 IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT3,117.6669
0x2d494fb8d6ec69ab39ab716c0ddc536ebd8f0cf0e26e5e4cb6b46617de2fed59Stake186790982023-02-22 10:35:05399 days 23 hrs ago0x9610f65f06337d332d08ffe1109b311d33f681d8 IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT1,573.3089
0x454a33a956987e8ae73c3bd0f3212d259d18b4fa53b8ddea33c4466f9478d5aeStake186789772023-02-22 10:30:59399 days 23 hrs ago0x9610f65f06337d332d08ffe1109b311d33f681d8 IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT1,936.9389
0x7bba0cee43a440a678ddd46148a33fc1acacac37e87c0025170475fbdb85a93aWithdraw186789582023-02-22 10:30:17399 days 23 hrs ago0x9610f65f06337d332d08ffe1109b311d33f681d8 IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT948.4512
0x8c84f37fe5102d6be138c4c2e4cdb99dd00d9bd5afeec198e2c8f336ee658544Stake186789452023-02-22 10:29:51399 days 23 hrs ago0x9610f65f06337d332d08ffe1109b311d33f681d8 IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT1,618.8789
0xc6c9b15b0af2ecdc9190578e6ec6826c30924fbf0f37c50787912c57d9d0a45aWithdraw186785762023-02-22 10:17:09399 days 23 hrs ago0x9610f65f06337d332d08ffe1109b311d33f681d8 IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT1,207.4097
0x5a9216b83a35ab7012004f6bb960e3733826cadacdf7aac9978da59df1b6c81cStake186785622023-02-22 10:16:41399 days 23 hrs ago0x9610f65f06337d332d08ffe1109b311d33f681d8 IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT1,523.1447
0xb9c40ad4ba88379c3e11d166e07fda16afdebdc9c87d7f3b7f9c636fb018737bWithdraw186783952023-02-22 10:10:55399 days 23 hrs ago0x9610f65f06337d332d08ffe1109b311d33f681d8 IN  0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT1,023.3999
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xf22e369a9341123b861aa2541b46823aba7fa7b416009b0ebc4a092c7bbac721189453432023-02-28 19:07:15393 days 14 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xdc332535823a197cf0a5e3116d319a1eea960b670 BTT
0xf22e369a9341123b861aa2541b46823aba7fa7b416009b0ebc4a092c7bbac721189453432023-02-28 19:07:15393 days 14 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xdc332535823a197cf0a5e3116d319a1eea960b670 BTT
0xcff81ed86cb9f87d270565a76d0552d29ff8e0133a72106006f1520e9f0f2910189452702023-02-28 19:04:45393 days 14 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0x1fed6e2254c9bdea0fb3bcf1c006bfa932c653840 BTT
0x4059332383ce677e3276dec795e74460a449ed01c81cc823547285c3b84a1de2187527632023-02-24 4:47:19398 days 5 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f0 BTT
0x4059332383ce677e3276dec795e74460a449ed01c81cc823547285c3b84a1de2187527632023-02-24 4:47:19398 days 5 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f0 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f0 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f0 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f0 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f0 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f0 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f0 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f0 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f0 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f0 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f0 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd1970 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f0 BTT
0xc55dcab5fef643b5b826d7b769c22c764d303e6b1bdfd783d20077b762d57a41187527042023-02-24 4:45:21398 days 5 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f0 BTT
0x5c978f2231e5addc7c673c612e33c36373932b19ecaedcfc5e9398ef7d15e6a7187526972023-02-24 4:45:03398 days 5 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f0 BTT
0x5c978f2231e5addc7c673c612e33c36373932b19ecaedcfc5e9398ef7d15e6a7187526972023-02-24 4:45:03398 days 5 hrs ago 0x3a5072fc8d3fe3be86e7ca1b26d265d53d6dd197 0xd8434110e23f25ecfefc5c985c9fdc5131ac8a7f0 BTT
[ Download CSV Export 
Index Block
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x39137a7735c0Ee775d1876b56612B1b07676FCeC
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
DamxRobotStaking

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

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

pragma solidity ^0.8.18;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

interface RobotNFT {
    function getTokenPower(uint256 tokenId) external view returns (uint256);
}

interface IEpochRewardDistributor {
    function distribute(address rewardToken, uint256 amount) external returns (uint256);
}

contract DamxRobotStaking is IERC721Receiver, Ownable, ReentrancyGuard
{
    using SafeERC20 for IERC20;

    struct Memberseat {
        uint256 lastSnapshotIndex;
        uint256 rewardEarned;
    }

    struct BoardroomSnapshot {
        uint256 time;
        uint256 rewardReceived;
        uint256 rewardPerShare;
    }

    /* ========== STATE VARIABLES ========== */
    bool public isInitialized;
    uint256 public totalPower;
    uint256 public totalSupply;
    uint256 public totalRewardDistributed;
    mapping(address => uint256) public balances;
    mapping(address => uint256[]) public depositedNFT;
    mapping(uint256 => address) public stakerOfNFT;

    // epoch
    uint256 public lastEpochTime;
    uint256 public epoch = 0;
    uint256 public epochLength = 0;

    // reward
    uint256 public epochReward;

    address public nft;
    address public reward; // USDC

    address public distributor;

    mapping(address => Memberseat) public members;
    BoardroomSnapshot[] public boardroomHistory;

    mapping(address => bool) public keeper;

    /* ========== EVENTS ========== */

    event Staked(address indexed user, uint256 tokenId, uint256 weight);
    event Withdrawn(address indexed user, uint256 tokenId, uint256 weight);
    event EmergencyWithdraw(
        address indexed user,
        uint256 tokenId
    );
    event RewardPaid(address indexed user, uint256 earned);
    event RewardTaxed(address indexed user, uint256 taxed);
    event RewardAdded(address indexed user, uint256 amount);
    event OnERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes data
    );

    /* ========== Modifiers =============== */

    modifier checkEpoch() {
        uint256 _nextEpochPoint = nextEpochPoint();
        require(block.timestamp >= _nextEpochPoint, "!opened");

        _;

        lastEpochTime = _nextEpochPoint;
        epoch += 1;
    }

    modifier onlyKeeper() {
        require(keeper[msg.sender], "!keeper");
        _;
    }

    modifier memberExists() {
        require(balances[msg.sender] > 0, "The member does not exist");
        _;
    }


    modifier updateReward(address member) {
        if (member != address(0)) {
            _updateReward(member);
        }
        _;
    }

    function _updateReward(address member) internal {
        Memberseat memory seat = members[member];
        seat.rewardEarned = earned(member);
        seat.lastSnapshotIndex = latestSnapshotIndex();
        members[member] = seat;
    }


    /* ========== GOVERNANCE ========== */

    constructor(
        address _nft,
        address _reward,
        uint256 _startTime,
        uint256 _epochLength,
        uint256 _epochReward
    )  {

        reward = _reward;
        nft = _nft;
        BoardroomSnapshot memory genesisSnapshot = BoardroomSnapshot({
        time : block.number,
        rewardReceived : 0,
        rewardPerShare : 0
        });
        boardroomHistory.push(genesisSnapshot);

        epochLength = _epochLength;
        lastEpochTime = _startTime - epochLength;

        epochReward = _epochReward;
        keeper[msg.sender] = true;
    }

    function initialize(
        address _distributor
    ) external onlyOwner {
        require(!isInitialized, "RewardTracker: already initialized");
        isInitialized = true;
        distributor = _distributor;
    }


    function setNextEpochPoint(uint256 _nextEpochPoint) external onlyKeeper {
        require(
            _nextEpochPoint >= block.timestamp,
            "nextEpochPoint could not be the past"
        );
        lastEpochTime = _nextEpochPoint - epochLength;
    }


    function setEpochReward(uint256 _epochReward) external onlyKeeper {
        epochReward = _epochReward;
    }


    function setKeeper(address _address, bool _on) external onlyOwner {
        keeper[_address] = _on;
    }


    function nextEpochPoint() public view returns (uint256) {
        return lastEpochTime + epochLength;
    }

    function latestSnapshotIndex() public view returns (uint256) {
        return boardroomHistory.length - 1;
    }

    function getLatestSnapshot() internal view returns (BoardroomSnapshot memory){
        return boardroomHistory[latestSnapshotIndex()];
    }

    function getLastSnapshotIndexOf(address member) public view returns (uint256)
    {
        return members[member].lastSnapshotIndex;
    }

    function getLastSnapshotOf(address member) internal view returns (BoardroomSnapshot memory){
        return boardroomHistory[getLastSnapshotIndexOf(member)];
    }

    function rewardPerShare() public view returns (uint256) {
        return getLatestSnapshot().rewardPerShare;
    }

    function balanceOf(address _account) public view returns (uint256) {
        uint256[] memory tokenIds = depositedNFT[_account];
        return tokenIds.length;
    }

    function earned(address member) public view returns (uint256) {
        uint256 latestRPS = getLatestSnapshot().rewardPerShare;
        uint256 storedRPS = getLastSnapshotOf(member).rewardPerShare;

        return (balances[member] * (latestRPS - storedRPS)) / 1e18 + members[member].rewardEarned;
    }

    function _stake(address _account, uint256 _tokenId) internal virtual {
        uint256 _power = uint256(RobotNFT(nft).getTokenPower(_tokenId));
        require(_power > 0, "invalid power");
        totalPower += _power;
        totalSupply += 1;
        balances[_account] += _power;
        depositedNFT[_account].push(_tokenId);
        stakerOfNFT[_tokenId] = _account;
        IERC721(nft).safeTransferFrom(_account, address(this), _tokenId);
        emit Staked(_account, _tokenId, _power);
    }

    function tokenOfOwnerByIndex(address _account, uint256 index) external view returns (uint256){
        return depositedNFT[_account][index];
    }

    function _removeUserCard(address _account, uint256 _tokenId) internal returns (bool){
        uint256[] storage tokenIds = depositedNFT[_account];
        uint256 _numCards = tokenIds.length;
        for (uint256 i = 0; i < _numCards; i++) {
            if (tokenIds[i] == _tokenId) {
                if (i < _numCards - 1) {
                    tokenIds[i] = tokenIds[_numCards - 1];
                }
                delete tokenIds[_numCards - 1];
                tokenIds.pop();
                return true;
            }
        }
        return false;
    }

    function _withdraw(address _account, uint256 _tokenId) internal virtual {
        uint256 _power = uint256(RobotNFT(nft).getTokenPower(_tokenId));
        totalPower -= _power;
        totalSupply -= 1;
        balances[msg.sender] -= _power;
        stakerOfNFT[_tokenId] = address(0);
        require(
            _removeUserCard(_account, _tokenId),
            "Can not remove tokenId"
        );
        IERC721(nft).safeTransferFrom(address(this), _account, _tokenId);
        emit Withdrawn(_account, _tokenId, _power);
    }

    function stake(uint256[] memory _tokenIds) external nonReentrant updateReward(msg.sender)
    {
        if (members[msg.sender].rewardEarned > 0) {
            claimReward();
        }
        for (uint256 i = 0; i < _tokenIds.length; i++) {
            _stake(msg.sender, _tokenIds[i]);
        }
    }

    function withdraw(uint256[] memory _tokenIds) external nonReentrant memberExists updateReward(msg.sender)
    {
        if (members[msg.sender].rewardEarned > 0) {
            claimReward();
        }
        for (uint256 i = 0; i < _tokenIds.length; i++) {
            _withdraw(msg.sender, _tokenIds[i]);
        }
    }


    function claimReward() public updateReward(msg.sender) {
        uint256 _earned = members[msg.sender].rewardEarned;
        if (_earned > 0) {
            members[msg.sender].rewardEarned = 0;
            _safeRewardTransfer(msg.sender, _earned);
            emit RewardPaid(msg.sender, _earned);
        }
    }

    function _safeRewardTransfer(address _to, uint256 _amount) internal returns (uint256) {
        IERC20 _reward = IERC20(reward);
        uint256 _rewardBal = _reward.balanceOf(address(this));
        if (_rewardBal > 0) {
            if (_amount > _rewardBal) {
                _reward.safeTransfer(_to, _rewardBal);
                return _rewardBal;
            } else {
                _reward.safeTransfer(_to, _amount);
                return _amount;
            }
        }
        return 0;
    }


    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external override returns (bytes4) {
        emit OnERC721Received(operator, from, tokenId, data);
        return this.onERC721Received.selector;
    }


    function allocateReward() external {
        allocateRewardManually(epochReward);
    }

    function allocateRewardManually(uint256 _amount) public nonReentrant checkEpoch onlyKeeper
    {
        require(_amount > 0, "Cannot allocate 0");
        require(totalPower > 0, "Cannot allocate when totalSupply is 0");
        epochReward = _amount;

        // Create & add new snapshot
        uint256 prevRPS = getLatestSnapshot().rewardPerShare;
        uint256 nextRPS = prevRPS + ((_amount * 1e18) / totalPower);

        BoardroomSnapshot memory newSnapshot = BoardroomSnapshot({
        time : block.number,
        rewardReceived : _amount,
        rewardPerShare : nextRPS
        });
        boardroomHistory.push(newSnapshot);

        IEpochRewardDistributor(distributor).distribute(reward, _amount);
        totalRewardDistributed += _amount;
        emit RewardAdded(msg.sender, _amount);
    }
}

File 2 of 11 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 5 of 11 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

File 7 of 11 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

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

pragma solidity ^0.8.0;

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_nft","type":"address"},{"internalType":"address","name":"_reward","type":"address"},{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_epochLength","type":"uint256"},{"internalType":"uint256","name":"_epochReward","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"OnERC721Received","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"earned","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"taxed","type":"uint256"}],"name":"RewardTaxed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"weight","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"weight","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"allocateReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"allocateRewardManually","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"boardroomHistory","outputs":[{"internalType":"uint256","name":"time","type":"uint256"},{"internalType":"uint256","name":"rewardReceived","type":"uint256"},{"internalType":"uint256","name":"rewardPerShare","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"depositedNFT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"distributor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"member","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epochLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epochReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"member","type":"address"}],"name":"getLastSnapshotIndexOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_distributor","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"keeper","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastEpochTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestSnapshotIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"members","outputs":[{"internalType":"uint256","name":"lastSnapshotIndex","type":"uint256"},{"internalType":"uint256","name":"rewardEarned","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextEpochPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nft","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reward","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epochReward","type":"uint256"}],"name":"setEpochReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bool","name":"_on","type":"bool"}],"name":"setKeeper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nextEpochPoint","type":"uint256"}],"name":"setNextEpochPoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakerOfNFT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPower","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRewardDistributed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102265760003560e01c8063714b465811610130578063bfe10928116100b8578063db3ad22c1161007c578063db3ad22c146104d8578063e8cf8608146104e1578063ec9bccd314610504578063f2fde38b14610517578063fdc3a7621461052a57600080fd5b8063bfe1092814610469578063c4d66de81461047c578063c58e38431461048f578063c5967c26146104bd578063d1b9e853146104c557600080fd5b8063900cf0cf116100ff578063900cf0cf1461041f578063983d95ce14610428578063ab9bebde1461043b578063b88a802f1461044e578063ba79f6b01461045657600080fd5b8063714b4658146103d4578063715018a6146103fd57806389c614b8146104055780638da5cb5b1461040e57600080fd5b80632f745c59116101b35780633f9e3f04116101825780633f9e3f0414610395578063446a2ec81461039d57806347ccca02146103a557806357d775f8146103b857806370a08231146103c157600080fd5b80632f745c591461033357806330188ee814610346578063372a45981461034f578063392e53cd1461037857600080fd5b80631604e416116101fa5780631604e416146102ce57806318160ddd146102d7578063228cb733146102e057806327e235e31461030b5780632abd4dee1461032b57600080fd5b80628cc2621461022b57806308ae4b0c146102515780630fbf0a931461028d578063150b7a02146102a2575b600080fd5b61023e610239366004611924565b61053d565b6040519081526020015b60405180910390f35b61027861025f366004611924565b6010602052600090815260409020805460019091015482565b60408051928352602083019190915201610248565b6102a061029b36600461195c565b6105d0565b005b6102b56102b0366004611a1a565b610657565b6040516001600160e01b03199091168152602001610248565b61023e600c5481565b61023e60045481565b600e546102f3906001600160a01b031681565b6040516001600160a01b039091168152602001610248565b61023e610319366004611924565b60066020526000908152604090205481565b6102a06106aa565b61023e610341366004611ab5565b6106b7565b61023e60055481565b6102f361035d366004611adf565b6008602052600090815260409020546001600160a01b031681565b6002546103859060ff1681565b6040519015158152602001610248565b61023e6106f5565b61023e61070c565b600d546102f3906001600160a01b031681565b61023e600b5481565b61023e6103cf366004611924565b61071f565b61023e6103e2366004611924565b6001600160a01b031660009081526010602052604090205490565b6102a061078a565b61023e60095481565b6000546001600160a01b03166102f3565b61023e600a5481565b6102a061043636600461195c565b61079c565b61023e610449366004611ab5565b610876565b6102a06108a7565b6102a0610464366004611adf565b610928565b600f546102f3906001600160a01b031681565b6102a061048a366004611924565b61095c565b6104a261049d366004611adf565b6109f2565b60408051938452602084019290925290820152606001610248565b61023e610a25565b6102a06104d3366004611b06565b610a37565b61023e60035481565b6103856104ef366004611924565b60126020526000908152604090205460ff1681565b6102a0610512366004611adf565b610a6a565b6102a0610525366004611924565b610d63565b6102a0610538366004611adf565b610dd9565b600080610548610e77565b604001519050600061055984610ef1565b6040908101516001600160a01b038616600090815260106020529190912060010154909150670de0b6b3a76400006105918385611b53565b6001600160a01b0387166000908152600660205260409020546105b49190611b66565b6105be9190611b7d565b6105c89190611b9f565b949350505050565b6105d8610f84565b3380156105e8576105e881610fdd565b3360009081526010602052604090206001015415610608576106086108a7565b60005b8251811015610649576106373384838151811061062a5761062a611bb2565b6020026020010151611050565b8061064181611bc8565b91505061060b565b505061065460018055565b50565b60007f15e63df890c010799d5a5fbe20c68fa6097dfd0d0203223676f1517927e506548686868686604051610690959493929190611be1565b60405180910390a150630a85bd0160e11b95945050505050565b6106b5600c54610a6a565b565b6001600160a01b03821660009081526007602052604081208054839081106106e1576106e1611bb2565b906000526020600020015490505b92915050565b60115460009061070790600190611b53565b905090565b6000610716610e77565b60400151905090565b6001600160a01b03811660009081526007602090815260408083208054825181850281018501909352808352849383018282801561077c57602002820191906000526020600020905b815481526020019060010190808311610768575b505092519695505050505050565b610792611255565b6106b560006112af565b6107a4610f84565b336000908152600660205260409020546108055760405162461bcd60e51b815260206004820152601960248201527f546865206d656d62657220646f6573206e6f742065786973740000000000000060448201526064015b60405180910390fd5b3380156108155761081581610fdd565b3360009081526010602052604090206001015415610835576108356108a7565b60005b8251811015610649576108643384838151811061085757610857611bb2565b60200260200101516112ff565b8061086e81611bc8565b915050610838565b6007602052816000526040600020818154811061089257600080fd5b90600052602060002001600091509150505481565b3380156108b7576108b781610fdd565b33600090815260106020526040902060010154801561092457336000818152601060205260408120600101556108ed90826114dc565b5060405181815233907fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e04869060200160405180910390a25b5050565b3360009081526012602052604090205460ff166109575760405162461bcd60e51b81526004016107fc90611c35565b600c55565b610964611255565b60025460ff16156109c25760405162461bcd60e51b815260206004820152602260248201527f526577617264547261636b65723a20616c726561647920696e697469616c697a604482015261195960f21b60648201526084016107fc565b6002805460ff19166001179055600f80546001600160a01b039092166001600160a01b0319909216919091179055565b60118181548110610a0257600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b6000600b546009546107079190611b9f565b610a3f611255565b6001600160a01b03919091166000908152601260205260409020805460ff1916911515919091179055565b610a72610f84565b6000610a7c610a25565b905080421015610ab85760405162461bcd60e51b8152602060048201526007602482015266085bdc195b995960ca1b60448201526064016107fc565b3360009081526012602052604090205460ff16610ae75760405162461bcd60e51b81526004016107fc90611c35565b60008211610b2b5760405162461bcd60e51b8152602060048201526011602482015270043616e6e6f7420616c6c6f63617465203607c1b60448201526064016107fc565b600060035411610b8b5760405162461bcd60e51b815260206004820152602560248201527f43616e6e6f7420616c6c6f63617465207768656e20746f74616c537570706c79604482015264020697320360dc1b60648201526084016107fc565b600c8290556000610b9a610e77565b604001519050600060035484670de0b6b3a7640000610bb99190611b66565b610bc39190611b7d565b610bcd9083611b9f565b60408051606081018252438152602081018781528183018481526011805460018101825560009190915283517f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c6860039092029182015591517f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c69830155517f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c6a90910155600f54600e549251631f72642160e31b81526001600160a01b03938416600482015260248101899052939450909291169063fb932108906044016020604051808303816000875af1158015610cc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cec9190611c56565b508460056000828254610cff9190611b9f565b909155505060405185815233907fac24935fd910bc682b5ccb1a07b718cadf8cf2f6d1404c4f3ddc3662dae40e299060200160405180910390a2505050806009819055506001600a6000828254610d569190611b9f565b9091555050600180555050565b610d6b611255565b6001600160a01b038116610dd05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107fc565b610654816112af565b3360009081526012602052604090205460ff16610e085760405162461bcd60e51b81526004016107fc90611c35565b42811015610e645760405162461bcd60e51b8152602060048201526024808201527f6e65787445706f6368506f696e7420636f756c64206e6f7420626520746865206044820152631c185cdd60e21b60648201526084016107fc565b600b54610e719082611b53565b60095550565b610e9b60405180606001604052806000815260200160008152602001600081525090565b6011610ea56106f5565b81548110610eb557610eb5611bb2565b90600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050905090565b610f1560405180606001604052806000815260200160008152602001600081525090565b6011610f36836001600160a01b031660009081526010602052604090205490565b81548110610f4657610f46611bb2565b906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820154815250509050919050565b600260015403610fd65760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107fc565b6002600155565b6001600160a01b03811660009081526010602090815260409182902082518084019093528054835260010154908201526110168261053d565b60208201526110236106f5565b81526001600160a01b03909116600090815260106020908152604090912082518155910151600190910155565b600d546040516343e2ec1960e11b8152600481018390526000916001600160a01b0316906387c5d83290602401602060405180830381865afa15801561109a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110be9190611c56565b9050600081116111005760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b2103837bbb2b960991b60448201526064016107fc565b80600360008282546111129190611b9f565b9250508190555060016004600082825461112c9190611b9f565b90915550506001600160a01b03831660009081526006602052604081208054839290611159908490611b9f565b90915550506001600160a01b03838116600081815260076020908152604080832080546001810182559084528284200187905586835260089091529081902080546001600160a01b03191683179055600d549051632142170760e11b8152600481019290925230602483015260448201859052909116906342842e0e90606401600060405180830381600087803b1580156111f357600080fd5b505af1158015611207573d6000803e3d6000fd5b505060408051858152602081018590526001600160a01b03871693507f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee909250015b60405180910390a2505050565b6000546001600160a01b031633146106b55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107fc565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600d546040516343e2ec1960e11b8152600481018390526000916001600160a01b0316906387c5d83290602401602060405180830381865afa158015611349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136d9190611c56565b905080600360008282546113819190611b53565b9250508190555060016004600082825461139b9190611b53565b909155505033600090815260066020526040812080548392906113bf908490611b53565b9091555050600082815260086020526040902080546001600160a01b03191690556113ea83836115a3565b61142f5760405162461bcd60e51b815260206004820152601660248201527510d85b881b9bdd081c995b5bdd99481d1bdad95b925960521b60448201526064016107fc565b600d54604051632142170760e11b81523060048201526001600160a01b03858116602483015260448201859052909116906342842e0e90606401600060405180830381600087803b15801561148357600080fd5b505af1158015611497573d6000803e3d6000fd5b505060408051858152602081018590526001600160a01b03871693507f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc6925001611248565b600e546040516370a0823160e01b81523060048201526000916001600160a01b031690829082906370a0823190602401602060405180830381865afa158015611529573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154d9190611c56565b90508015611598578084111561157a576115716001600160a01b03831686836116bc565b91506106ef9050565b61158e6001600160a01b03831686866116bc565b83925050506106ef565b506000949350505050565b6001600160a01b03821660009081526007602052604081208054825b818110156116b057848382815481106115da576115da611bb2565b90600052602060002001540361169e576115f5600183611b53565b8110156116425782611608600184611b53565b8154811061161857611618611bb2565b906000526020600020015483828154811061163557611635611bb2565b6000918252602090912001555b8261164e600184611b53565b8154811061165e5761165e611bb2565b90600052602060002001600090558280548061167c5761167c611c6f565b60019003818190600052602060002001600090559055600193505050506106ef565b806116a881611bc8565b9150506115bf565b50600095945050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261170e908490611713565b505050565b6000611768826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166117e59092919063ffffffff16565b80519091501561170e57808060200190518101906117869190611c85565b61170e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107fc565b60606105c8848460008585600080866001600160a01b0316858760405161180c9190611cc6565b60006040518083038185875af1925050503d8060008114611849576040519150601f19603f3d011682016040523d82523d6000602084013e61184e565b606091505b509150915061185f8783838761186a565b979650505050505050565b606083156118d95782516000036118d2576001600160a01b0385163b6118d25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107fc565b50816105c8565b6105c883838151156118ee5781518083602001fd5b8060405162461bcd60e51b81526004016107fc9190611ce2565b80356001600160a01b038116811461191f57600080fd5b919050565b60006020828403121561193657600080fd5b61193f82611908565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561196f57600080fd5b823567ffffffffffffffff8082111561198757600080fd5b818501915085601f83011261199b57600080fd5b8135818111156119ad576119ad611946565b8060051b604051601f19603f830116810181811085821117156119d2576119d2611946565b6040529182528482019250838101850191888311156119f057600080fd5b938501935b82851015611a0e578435845293850193928501926119f5565b98975050505050505050565b600080600080600060808688031215611a3257600080fd5b611a3b86611908565b9450611a4960208701611908565b935060408601359250606086013567ffffffffffffffff80821115611a6d57600080fd5b818801915088601f830112611a8157600080fd5b813581811115611a9057600080fd5b896020828501011115611aa257600080fd5b9699959850939650602001949392505050565b60008060408385031215611ac857600080fd5b611ad183611908565b946020939093013593505050565b600060208284031215611af157600080fd5b5035919050565b801515811461065457600080fd5b60008060408385031215611b1957600080fd5b611b2283611908565b91506020830135611b3281611af8565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106ef576106ef611b3d565b80820281158282048414176106ef576106ef611b3d565b600082611b9a57634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156106ef576106ef611b3d565b634e487b7160e01b600052603260045260246000fd5b600060018201611bda57611bda611b3d565b5060010190565b6001600160a01b038681168252851660208201526040810184905260806060820181905281018290526000828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b60208082526007908201526610b5b2b2b832b960c91b604082015260600190565b600060208284031215611c6857600080fd5b5051919050565b634e487b7160e01b600052603160045260246000fd5b600060208284031215611c9757600080fd5b815161193f81611af8565b60005b83811015611cbd578181015183820152602001611ca5565b50506000910152565b60008251611cd8818460208701611ca2565b9190910192915050565b6020815260008251806020840152611d01816040850160208701611ca2565b601f01601f1916919091016040019291505056fea264697066735822122017536af7dba9147cf393dbb7cedd0af633568922241aed6495e1879554f6be6364736f6c63430008120033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading