Contract 0x5226c0d351541cc28798c3626d3dfcd6e78a8153

Contract Overview

Balance:
0 BNB
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x5aa3138944c2d39ee437d3effb5705ce865ce9d072785efe8b3ac45fe16b1e05Reset Cycle103346702021-07-05 17:50:1580 days 14 hrs ago0x9424062deaf1d34b8abc5ae0453d0a4c3cb17101 IN  0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB0.00023125
0x5240f9b8902f3c288eff7a3bfb6f4a4df8803dfc51eba3cc6f48a1f84987eb15Reset Cycle102294182021-07-02 2:07:3984 days 6 hrs ago0x9424062deaf1d34b8abc5ae0453d0a4c3cb17101 IN  0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB0.00023125
0x4521b339b2bc7c52eb8b1125b18f1e294a03bf99d1c9e7331a0a99753707d5d6Reset Cycle102196532021-07-01 17:59:2484 days 14 hrs ago0x9424062deaf1d34b8abc5ae0453d0a4c3cb17101 IN  0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB0.00023125
0x637343a08e12764844c6d10cbee8f7002414381c2a59791074fe4e0fc2168930Set Presenter102072462021-07-01 7:39:0385 days 58 mins ago0xfd69eeddbdbd0bab427ea290ed206f1e1bb746f9 IN  0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB0.0008705
0x512822d2b55108c4b3d35512187e39c572134c2a07c14e1df576fcc227712534Set Tokens102072322021-07-01 7:38:2185 days 59 mins ago0xfd69eeddbdbd0bab427ea290ed206f1e1bb746f9 IN  0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB0.00135804
0x917638f6baed0e7027bfe3830bf5560b210a0698802d8a3f41c056b2be0b996b0x60e06040102071962021-07-01 7:36:3385 days 1 hr ago0xfd69eeddbdbd0bab427ea290ed206f1e1bb746f9 IN  Contract Creation0 BNB0.065257
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xb8d3d7a6ffde566109dbf5b05186f1a01b299abef2c17d89a02ed3ef091893e1118701682021-08-28 10:25:2826 days 22 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0x81467c2ad2c0d7b71ec211269016dc0ae4be449bfca4a6f00cf99b1276040df9118359912021-08-27 5:56:0428 days 2 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0xc37de9e4ab1f870fbcbced6391153c555ad0fd24666b316b8010576f457f3013118356892021-08-27 5:40:5828 days 2 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0x0f382f42419d79f60d7cfc4426201a80c4d1e1fa9269885d20870d02ca2ab26b118354872021-08-27 5:30:5228 days 3 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0x2c06ed332be09a5488f74654661538aacdc2b11255a5f9ae33dc649ea02b83c3118353852021-08-27 5:25:4628 days 3 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0x56c3ebe338f1a207b1d8f17eec0f2d79f3f4ede7701f3a8301c3fff221ca701a118350812021-08-27 5:10:3428 days 3 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0x97c7142fee82744e3ba10a752afe61d23c88a16f57bee6cf6a781ce6dc8fcf64118348792021-08-27 5:00:2828 days 3 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0xed56f2a98ff44af191d5968c99a10f28224512ead4271a067f403d61de1905a1118347772021-08-27 4:55:2228 days 3 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0x1db78d8b2530d415adc7065dae7b6c88ed47962eb317f16e8e277deda145017d118344752021-08-27 4:40:1128 days 3 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0x19094b1ff5666cf0a0fb4f7ce168e7109c4a67f4a3905d6ea614a6b1f69274e4118342752021-08-27 4:30:0928 days 4 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0xa56bc30e3462f85768532d54b64db693c581c64f42640ccfa2c7aa835709c373118341732021-08-27 4:25:0328 days 4 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0x30ff666c21de4ffb514b7765d5e38443e8fc06f8433317c065bd7cfada0c9845118338702021-08-27 4:09:5428 days 4 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0x7e5c9a3232652c81c36a643a2cb54716130e9be1aeede8be794fe2cd77636fce118336682021-08-27 3:59:4828 days 4 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0xb5750ba6ec6c7813945f9cf08a3ae088a8847a6bc58c4eeeb0528ac689312e6d118335662021-08-27 3:54:4228 days 4 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0x216d0dedcd59440552bbf0eea9be5293dd834c6e5bcbdbde6be0f225d471e6e8118332632021-08-27 3:39:3328 days 4 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0x16db76090ca5855f268456d70fb1df34c64540b539b7e396c58cda1bce3b6306118330622021-08-27 3:29:3028 days 5 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0x4088479f5155bb4d9e873d513369cd0cdb80bd5ca463e379dd8ade7b9fa496d3118329602021-08-27 3:24:2428 days 5 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0xad73c397359e5715392e59ae01154fafa2f2fecd3903a45020be3db0c33919e9118326562021-08-27 3:09:1228 days 5 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0x31ab0643003fb41c12f5cb8299222b26a3341647601bbdf88d54598ed13035b8118324542021-08-27 2:59:0628 days 5 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0xeaf38260c065a8335962d880c2ecb298be19756f157c18490d3592f905c8e949118323522021-08-27 2:54:0028 days 5 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0x86d7c9c24621b35a56ba2c9cfb7ddf41ba6e43ddc8387bae90d905c799532c19118320482021-08-27 2:38:4828 days 5 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0x4258b8d3101cd454913026c2577adabc0e8085c58408496776d9007091e2aaf3118318462021-08-27 2:28:4228 days 6 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0x19bd0a4f77c03d284293f9581e08aee271b59c872b55cbc2742225151c5932f8118317442021-08-27 2:23:3628 days 6 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0xf831e6985be6d94a87223be5304bf5dde0a04b3d2c948fdc7e1f994c6e68f298118314412021-08-27 2:08:2728 days 6 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
0x553604c39ff1a8fffacdfa3ba5d14612b907ae4a6ca137963e9fb702918f6b5a118312392021-08-27 1:58:2128 days 6 hrs ago 0xa84ab22571ed9578f47b24ecf94ee75bf037d955 0x5226c0d351541cc28798c3626d3dfcd6e78a81530 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RIS3Store

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 7 : RIS3Store.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity 0.8.4;

import "./utils/Ownable.sol";
import "./utils/Maintainable.sol";
import "./interfaces/IERC20.sol";
import "./interfaces/IRIS3Store.sol";
import "./utils/Presenter.sol";
import "./utils/Maintainable.sol";


// RIS3Gov will be presenter of store
contract RIS3Store is IRIS3Store, Presenter, Maintainable {

  uint256[3] public TAX_RATES_OPTIONS = [10, 20, 30];
  uint256[3] public PROD_RATES_OPTIONS = [100000 * 1 ether, 300000 * 1 ether, 500000 * 1 ether];

  struct UserInfo {
    uint256 farmAmount;
    uint256 factoryAmount;
    uint256 citizenAmount;
    uint256 lastWithdrawFarmTime;
    uint256 lastWithdrawFactoryTime;
    uint256 lastWithdrawCitizenTime;
    bool registered;
  }

  // Info of each user that stakes
  mapping(address => UserInfo) public userInfo;
  address[] public users;
  uint256 public totalFactoryAmount;
  uint256 public totalFarmAmount;
  uint256 public totalCitizenAmount;
  uint256 public totalTaxAmount;
  uint256 public farmRewardAmount;
  uint256 public factoryRewardAmount;
  uint256 public citizenRewardAmount;
  uint256 public totalCitizenReward;

  // Gov config
  // ["Socialism", "Democracy", "Dictatorship"]
  uint256 public currentGovIndex;
  // TAX_RATES_OPTIONS
  uint256 public currentTaxRatesIndex;
  // PROD_RATES_OPTIONS
  uint256 public currentProdRatesIndex;
  // ["Distribute all", "Half distribute", "Burn all"]
  uint256 public currentTaxPoolUsesIndex;
  //current cycle number
  uint256 public currentCycleNo = 0;
  //dictatorAddress if gov type is 2
  address public dictatorAddress;

  //Next Gov Config
  uint256 public nextGovIndex;
  uint256 public nextTaxRatesIndex;
  uint256 public nextProdRatesIndex;
  uint256 public nextTaxPoolUsesIndex;
 
  ///@notice votes collection
  uint256 public currentVoteCounts;
  mapping(uint256 => mapping(uint256 => uint256)) public votesByTaxRateType;
  mapping(uint256 => mapping(uint256 => uint256)) public votesByProdRatesType;
  mapping(uint256 => mapping(uint256 => uint256)) public votesByTaxPoolUsesType;
  mapping(uint256 => mapping(uint256 => uint256)) public voteByGovernmentIndex;

  /// @notice for dictator address voting
  mapping(address => bool) public dictatorRigistration;
  address[] public dictatorAddresses;

  mapping(uint256 => mapping(address => uint256)) public votesByAddress;
  ///@notice last voting time by address
  mapping(address => mapping(uint256 => uint256)) public lastVoteCastTime;

  //token addreses
  IERC20 public ris3;
  IERC20 public ris3BNBLP;

  event SetTokens(address ris3, address ris3BNBLP);
  event Deposit(address indexed user, uint256 amount, uint _type);
  event Withdraw(address indexed user, uint256 amount);
  event SaveUserVote(address userAddress, uint256 govType, uint256 noOfVotes);
  event SaveElection(uint256 currentTaxPoolUsesIndex, uint256 govType, uint256 totalVoteCounts);
  event ResetCycle(uint256 currentTaxPoolUsesIndex, uint256 blockNumber);
  event Restore(address oldStore, address newStore);

  /**
   * @dev get user object
   *
   * Requirements
   *
   * - `_user` user address.
   *
   * Access
   *
   * - PUBLIC
   */
  function getUserInfo(address _user) public view returns(uint256 farmAmount,
                                                    uint256 factoryAmount,
                                                    uint256 citizenAmount,
                                                    uint256 lastWithdrawFarmTime,
                                                    uint256 lastWithdrawFactoryTime,
                                                    uint256 lastWithdrawCitizenTime,
                                                    bool registered ) {
    UserInfo memory user = userInfo[_user];

    return (
      user.farmAmount,
      user.factoryAmount,
      user.citizenAmount,
      user.lastWithdrawFarmTime,
      user.lastWithdrawFactoryTime,
      user.lastWithdrawCitizenTime,
      user.registered
    );

  }

  /**
   * @dev get user array length
   *
   * Access
   *
   * - USER
   */
  function getUsersLength() public view returns (uint256) {
    return users.length;
  }

  /**
   * @dev get dictator array length
   *
   * Access
   *
   * - USER
   */
  function getDictatorAddressesLength() public view returns (uint256) {
    return dictatorAddresses.length;
  }

  /**
   * @dev get current voting counts
   *
   * Access
   *
   * - USER
   */
  function getCurrentVoteCounts() public view returns (uint256 _voteCounts) {
    return currentVoteCounts;
  }

  /**
  * @dev get last vote start time
  *
  * Access
  *
  * - PUBLIC
  */
  function getLastVoteCastTimeByAddress(address _userAddress) public view returns (uint256 _lastVoteCastTime) {
    return lastVoteCastTime[_userAddress][currentCycleNo];
  }

  /**
   * @dev get current laws
   *
   * Access
   *
   * - PUBLIC
   */
  function getCurrentLaws() public view returns (uint256 taxRates, uint256 prodRates) {
    taxRates = TAX_RATES_OPTIONS[currentTaxRatesIndex];
    prodRates = PROD_RATES_OPTIONS[currentProdRatesIndex];
  }

  /**
   * @dev get user total votes
   *
   * Requirements
   *
   * - `_user` user address.
   *
   * Access
   *
   * - PUBLIC
   */
  function getUserVotes(address _user) public view returns (uint256 votes) {
    UserInfo memory user = userInfo[_user];
    return user.citizenAmount;
  }

  /**
   * @dev get user reward by type
   *
   * Requirements
   *
   * - `_user` user type.
   * - `_type` 0 is Farm, 1 is Factory, 2 is citizen.
   *
   * Access
   *
   * - PUBLIC
   */
  function getUserShare(address _user, uint _type) public view returns (uint256 share) {
    UserInfo memory user = userInfo[_user];

    if (_type == 0) {
      share = (user.farmAmount * 1e8) / totalFarmAmount;
    } else if (_type == 1) {
      share = (user.factoryAmount * 1e8) / totalFactoryAmount;
    } else if (_type == 2) {
      share = (user.citizenAmount * 1e8) / totalCitizenAmount;
    }
  }

  /**
   * @dev get ris token
   *
   * Access
   *
   * - PUBLIC
   */
  function getRis3Address() external override view returns (address) {
    return address(ris3);
  }

  /**
   * @dev get total tax collected
   *
   * Access
   *
   * - PUBLIC
   */
  function getTotalTaxCollected() external override view returns (uint256) {
    return totalTaxAmount;
  }

  /**
   * @dev check user pending reward
   *
   * Requirements
   *
   * - `_user` address of user.
   * - `_type` 0 for farm, 1 for factory, 3 for citizen
   *
   * Access
   *
   * - ADMIN
   */
  function getPendingReward(address _user, uint _type) external override view onlyAdmin returns(uint256, uint256){
    (uint256 taxRate, uint256 totalRewards) = getCurrentLaws();
    return _calculateReward(_user, _type, taxRate, totalRewards);
  }

  /**
   * @dev check if user already collected the reward in cycle
   *
   * Requirements
   *
   * - `_user` address of user.
   * - `_type` 0 for farm, 1 for factory, 3 for citizen
   * - `_startTime` stage start time.
   * - `_endTime` stage end time.
   *
   * Access
   *
   * - User
   */
  function getAlreadyCollectedReward(address _user, uint _type, uint256 _startTime, uint256 _endTime) external override view returns (bool){
    UserInfo memory user = userInfo[_user];

    if (_type == 0) {
      return user.lastWithdrawFarmTime >= _startTime && user.lastWithdrawFarmTime < _endTime;
    } else if (_type == 1) {
      return user.lastWithdrawFactoryTime >= _startTime && user.lastWithdrawFactoryTime < _endTime;
    } else if (_type == 2) {
      return user.lastWithdrawCitizenTime >= _startTime && user.lastWithdrawCitizenTime < _endTime;
    }

    return false;
  }

  /**
   * @dev user can add tax by sending `_tax` from ris3 Token
   *
   * Emits a {AddTax} event.
   *
   * Requirements
   *
   * - `_tax` amount of tax.
   *
   * Access
   *
   * - User
   */
  function addTax(uint256 _tax) override public {
    totalTaxAmount = totalTaxAmount + _tax;
  }

  /**
   * @dev owner can set `_ris3` and `_ris3BNBLP` initially
   *
   * Emits a {SetToken} event.
   *
   * Requirements
   *
   * - `_ris3` ris3 token address.
   * - `_ris3BNBLP` ris3 BNB LP pair address.
   *
   * Access
   *
   * - Admin
   */
  function setTokens(address _ris3, address _ris3BNBLP) override onlyAdmin external {
    ifNotMaintenance();
    ris3 = IERC20(_ris3);
    ris3BNBLP = IERC20(_ris3BNBLP);

    emit SetTokens(_ris3, _ris3BNBLP);
  }

  /**
   * @dev restore userInfo to new store
   *
   * Emits a Restore event
   * Requirements
   *
   * - `_store` old store address
   * - `_startIndex` start index of users array
   * - `_endIndex` end index of users array
   *
   * Access
   *
   * - ADMIN
   */
  function restoreUsers(address _store, uint _startIndex, uint _endIndex) external onlyOwner {
    ifMaintenance();
    RIS3Store oldStore = RIS3Store(_store);

    for(uint index = _startIndex; index < _endIndex; index++){
      address user = oldStore.users(index);
      users.push(user); 
      (uint256 farmAmount, 
      uint256 factoryAmount,
      uint256 citizenAmount,
      uint256 lastWithdrawFarmTime,
      uint256 lastWithdrawFactoryTime,
      uint256 lastWithdrawCitizenTime,
      bool registered
      ) = oldStore.getUserInfo(user);

      userInfo[user] = UserInfo(farmAmount, factoryAmount, citizenAmount, lastWithdrawFarmTime, lastWithdrawFactoryTime, lastWithdrawCitizenTime, registered);
    }
  }

  /**
   * @dev restore a store to new store
   *
   * Emits a Restore event
   * Requirements
   *
   * - `_store` old store address
   *
   * Access
   *
   * - ADMIN
   */
  function restore(address _store) external onlyOwner {
    ifMaintenance();
    
    RIS3Store oldStore = RIS3Store(_store);
    currentGovIndex = oldStore.currentGovIndex();
    currentTaxRatesIndex = oldStore.currentTaxRatesIndex();
    currentProdRatesIndex = oldStore.currentProdRatesIndex();
    currentTaxPoolUsesIndex = oldStore.currentTaxPoolUsesIndex();
    currentCycleNo = oldStore.currentCycleNo();
    dictatorAddress = oldStore.dictatorAddress();
    nextGovIndex = oldStore.nextGovIndex();
    nextTaxRatesIndex = oldStore.nextTaxRatesIndex();
    nextProdRatesIndex = oldStore.nextProdRatesIndex();
    nextTaxPoolUsesIndex = oldStore.nextTaxPoolUsesIndex();
    currentVoteCounts = oldStore.currentVoteCounts();
    totalFactoryAmount = oldStore.totalFactoryAmount();
    totalFarmAmount = oldStore.totalFarmAmount();
    totalCitizenAmount = oldStore.totalCitizenAmount();
    totalTaxAmount = oldStore.totalTaxAmount();
    farmRewardAmount = oldStore.farmRewardAmount();
    factoryRewardAmount = oldStore.factoryRewardAmount();
    citizenRewardAmount = oldStore.citizenRewardAmount();
    totalCitizenReward = oldStore.totalCitizenReward();

    uint length = oldStore.getDictatorAddressesLength();

    for (uint index; index < length; index++){
      address dictator = oldStore.dictatorAddresses(index);
      dictatorAddresses.push(dictator);
      dictatorRigistration[dictator] = true;
    }
        
    emit Restore(_store, address(this));
  }

  /**
   * @dev admin can reset  cycle
   *
   * Emits a {ResetCycle} event.
   *
   * Access
   *
   * - Admin
   */
  function resetCycle() override onlyAdmin external {
    ifNotMaintenance();
    currentVoteCounts = 0;
    //increase cycle no
    currentCycleNo++;
    //assign next government values to current government values
    currentGovIndex = nextGovIndex;
    currentProdRatesIndex = nextProdRatesIndex;
    currentTaxRatesIndex = nextTaxRatesIndex;
    currentTaxPoolUsesIndex = nextTaxPoolUsesIndex;
    //tax distribution
    _distributeTax();
    // delete dictatorAddresses;
    //add logs
    emit ResetCycle(currentCycleNo, block.number);
  }

  /**
   * @dev if user want to stake `_amount` by giving the type `_type` and user address
   *
   * Emits a {Deposit} event.
   *
   * Requirements
   *
   * - `_amount` cannot be the zero.
   * - `_type` 0 is Farm, 1 is Factory, 2 is Citizen.
   * - `_sender` user address who want to deposit tokens
   *
   * Access
   *
   * - ADMIN
   */
  function deposit(uint256 _amount, uint _type, address _sender) override onlyAdmin external {
    ifNotMaintenance();
    UserInfo storage user = userInfo[_sender];

    if (_type == 0) {
      _depositFarm(_amount, user, _sender);
    } else if (_type == 1) {
      _depositFactory(_amount, user, _sender);
    } else if (_type == 2) {
      _depositCitizen(_amount, user, _sender);
    }

    //user to register
    if (user.registered == false) {
      user.registered = true;
      users.push(_sender);
    }
    emit Deposit(_sender, _amount, _type);
  }

  /**
   * @dev set reward on new cycle
   *
   * Access
   *
   * - ADMIN
   */
  function setRewards() external override onlyAdmin {
    ifNotMaintenance();
    //mine new tokens for farm and factory
    uint256 prodAmount = PROD_RATES_OPTIONS[currentProdRatesIndex];
    farmRewardAmount = prodAmount;
    factoryRewardAmount = prodAmount;
  }

  /**
   * @dev user want to claim farm reward
   *
   * Requirements
   *
   * - `_amount` reward amount for the farm
   * - `_type` 0 for farm and 1 for factory
   * - `_taxRate` taxRate from the government
   * - `_tota;Rewards` total Rewards
   * - `_user` user address
   *
   * Access
   *
   * - ADMIN
   */
  function claimRewards(address _user, uint _type) external override onlyAdmin {
    ifNotMaintenance();
    (uint256 taxRate, uint256 totalRewards) = getCurrentLaws();
    (uint256 amount, uint256 tax) = _calculateReward(_user, _type, taxRate, totalRewards);
    require(amount > 0, "amount should be greater than 0");
    UserInfo storage user = userInfo[_user];

    if (_type == 0) {
      farmRewardAmount = farmRewardAmount - amount - tax;
      user.lastWithdrawFarmTime = block.timestamp;
    } else if (_type == 1) {
      factoryRewardAmount = factoryRewardAmount - amount - tax;
      user.lastWithdrawFactoryTime = block.timestamp;
    }
    else if (_type == 2) {
      citizenRewardAmount = citizenRewardAmount - amount;
      user.lastWithdrawCitizenTime = block.timestamp;
    }

    ris3.mint(amount);
    ris3.transfer(_user, amount);
    addTax(tax);
  }

  /**
   * @dev reset reward for farm and factory
   *
   * Access
   *
   * - ADMIN
   */
  function resetRewards() override onlyAdmin external {
    ifNotMaintenance();
    farmRewardAmount = 0;
    factoryRewardAmount = 0;
  }

  /**
   * @dev save user vote
   *
   * Requirements
   *
   * - `_governmentIndex` type of government
   * - `_taxRates` tax rates law
   * - `_prodRates` prod rates law
   * - `_taxPoolUses` tax pool uses law
   * - `_dictatorAddress` dictatorAddresses in case dictatorship
   * - `_user`
   * Access
   *
   * - ADMIN
   */
  function saveUserVote(uint256 _governmentIndex, uint256 _taxRates, uint256 _prodRates, uint256 _taxPoolUses, address _dictatorAddress, address _user) override external onlyAdmin {
    ifNotMaintenance();
    uint256 userVotes = getUserVotes(_user);
    require(userVotes > 0, "You do not have any vote");
    //TODO need to see this condition
    require(lastVoteCastTime[_user][currentCycleNo] == 0, "Already vote is casted");

    lastVoteCastTime[_user][currentCycleNo] = block.timestamp;
    voteByGovernmentIndex[currentCycleNo][_governmentIndex] += userVotes;

    //for Democracy
    if (_governmentIndex == 1) {
      votesByTaxRateType[currentCycleNo][_taxRates] += userVotes;
      votesByProdRatesType[currentCycleNo][_prodRates] += userVotes;
      votesByTaxPoolUsesType[currentCycleNo][_taxPoolUses] += userVotes;
    }
    else if (_governmentIndex == 2) {//for Dictatorship
      votesByAddress[currentCycleNo][_dictatorAddress] += userVotes;
      if (dictatorRigistration[_dictatorAddress] == false) {
        dictatorAddresses.push(_dictatorAddress);
        dictatorRigistration[_dictatorAddress] = true;
      }
    }

    currentVoteCounts += userVotes;
    //add logs
    emit SaveUserVote(msg.sender, _governmentIndex, userVotes);
  }

  /**
   * @dev this function will be call to finish the election and calculate voting result
   *
   * Access
   *
   * - ADMIN
   */
  function saveElection() override external onlyAdmin {
    ifNotMaintenance();
    uint256 maxVotes;
    for (uint256 i = 0; i < 3; i++) {
      if (voteByGovernmentIndex[currentCycleNo][i] > maxVotes) {
        maxVotes = voteByGovernmentIndex[currentCycleNo][i];
        nextGovIndex = i;
      }
    }

    uint256 maxTaxRateVotes;
    uint256 maxProdVotes;
    uint256 maxTaxPoolVotes;

    //set laws for Socialism, if no voting set the socialism law
    if (nextGovIndex == 0 || currentVoteCounts == 0) {
      nextTaxRatesIndex = 2;
      nextProdRatesIndex = 2;
      nextTaxPoolUsesIndex = 0;
      nextGovIndex = 0;
      dictatorAddress = address(0);
    }
    //set laws for Democracy
    else if (nextGovIndex == 1) {
      for (uint256 i = 0; i < 3; i++) {
        //choose tax rates vote
        if (votesByTaxRateType[currentCycleNo][i] > maxTaxRateVotes) {
          maxTaxRateVotes = votesByTaxRateType[currentCycleNo][i];
          nextTaxRatesIndex = i;
        }
        //choose production rates vote
        if (votesByProdRatesType[currentCycleNo][i] > maxProdVotes) {
          maxProdVotes = votesByProdRatesType[currentCycleNo][i];
          nextProdRatesIndex = i;
        }
        //choose tax pool uses votes
        if (votesByTaxPoolUsesType[currentCycleNo][i] > maxTaxPoolVotes) {
          maxTaxPoolVotes = votesByTaxPoolUsesType[currentCycleNo][i];
          nextTaxPoolUsesIndex = i;
        }
      }
      dictatorAddress = address(0);
    }
    //set default laws in case of dictator. dictator can change laws within specified duration
    else {
      uint256 maxVoteFor;
      for (uint256 i = 0; i < dictatorAddresses.length; i++) {
        if (votesByAddress[currentCycleNo][dictatorAddresses[i]] > maxVoteFor) {
          maxVoteFor = votesByAddress[currentCycleNo][dictatorAddresses[i]];
          dictatorAddress = dictatorAddresses[i];
        }
      }

      //default rules in case dictator did not select
      nextTaxRatesIndex = 1;
      nextProdRatesIndex = 1;
      nextTaxPoolUsesIndex = 0;
    }
    //add logs
    emit SaveElection(currentCycleNo, currentGovIndex, currentVoteCounts);
  }

  /**
   * @dev save dictator vote
   *
   * Requirements
   *
   * - `_taxRates` choose tax rate.
   * - `_prodRates` choose prod rate.
   * - `_taxPoolUses` tax uses rate.
   * - `_user` dictator address.
   *
   * Access
   *
   * - ADMIN
   */
  function saveDictatorVote(uint256 _taxRates, uint256 _prodRates, uint256 _taxPoolUses, address _user) override external onlyAdmin {
    ifNotMaintenance();
    require(nextGovIndex == 2, "Wrong government type");
    require(dictatorAddress == _user, "Only dictator");
    require(_taxRates < 3, "Wrong tax rate option");
    require(_prodRates < 3, "Wrong production rates option");
    require(_taxPoolUses < 3, "Wrong taxPoolUses option");

    nextTaxRatesIndex = _taxRates;
    nextProdRatesIndex = _prodRates;
    nextTaxPoolUsesIndex = _taxPoolUses;
  }

  /**
   * @dev if user want to unstake `_amount` only citizen withdraw
   *
   * Emits a {Withdraw} event.
   *
   * Requirements
   *
   * - `_amount` cannot be the zero address.
   * - `_sender` user address who want to unstake tokens
   *
   * Access
   *
   * - ADMIN
   */
  function withdraw(uint256 _amount, address _sender) override onlyAdmin external {
    ifNotMaintenance();
    UserInfo storage user = userInfo[_sender];
    _withdrawCitizen(_amount, user, _sender);

    emit Withdraw(_sender, _amount);
  }

  /**
   * @dev if owner want to withdraw tokens from contract
   *
   * Emits a {Withdraw} event.
   *
   * Requirements
   *
   * - `_token` IER20 standard of token.
   * - `_amount` amount of tokens to withdraw
   *
   * Access
   *
   * - OWNER
   */
  function emergencyTokenWithdraw(address _token, uint256 _amount) external onlyOwner {
    ifNotMaintenance();
    require(_token != address(0), '0 address');
    require(_amount > 0, 'amount not 0');

    IERC20 token = IERC20(_token);
    uint256 balance = token.balanceOf(address(this));
    require(_amount <= balance, 'not enough amount');

    token.transfer(owner(), _amount);
  }

  /**
   * @dev if user want to deposit ris3 tokens in farm by sending `amounts`, `_user` info and `_sender` address
   *
   * Requirements
   *
   * - `_amount` should be ris3 tokens
   * - `_user` UserInfo of the user
   * - `_sender` user address who want to unstake tokens
   *
   * Access
   *
   * - INTERNAL
   */
  function _depositFarm(uint256 _amount, UserInfo storage _user, address _sender) internal {
    _user.farmAmount = _user.farmAmount + _amount;
    totalFarmAmount = totalFarmAmount + _amount;

    ris3.transferFrom(_sender, address(this), _amount);
    ris3.burn(_amount);
  }

  /**
   * @dev if user want to deposit ris3 BNB LP tokens in factory by sending `amounts`, `_user` info and `_sender` address
   *
   * Requirements
   *
   * - `_amount` should be ris3 BNB LP tokens
   * - `_user` UserInfo of the user
   * - `_sender` user address who want to unstake tokens
   *
   * Access
   *
   * - INTERNAL
   */
  function _depositFactory(uint256 _amount, UserInfo storage _user, address _sender) internal {
    _user.factoryAmount = _user.factoryAmount + _amount;
    totalFactoryAmount = totalFactoryAmount + _amount;

    ris3BNBLP.transferFrom(_sender, address(this), _amount);
  }

  /**
   * @dev if user want to deposit ris3 tokens in citizen by sending `amounts`, `_user` info and `_sender` address
   *
   * Requirements
   *
   * - `_amount` should be ris3 tokens
   * - `_user` UserInfo of the user
   * - `_sender` user address who want to unstake tokens
   *
   * Access
   *
   * - INTERNAL
   */
  function _depositCitizen(uint256 _amount, UserInfo storage _user, address _sender) internal {
    _user.citizenAmount = _user.citizenAmount + _amount;
    totalCitizenAmount = totalCitizenAmount + _amount;

    ris3.transferFrom(_sender, address(this), _amount);
    ris3.burn(_amount);
  }

  /**
   * @dev if user want to deposit ris3 tokens in citizen by sending `amounts`, `_user` info and `_sender` address
   *
   * Requirements
   *
   * - `_amount` should be ris3 tokens and should have enough citizen stake
   * - `_user` UserInfo of the user
   * - `_sender` user address who want to unstake tokens
   *
   * Access
   *
   * - INTERNAL
   */
  function _withdrawCitizen(uint256 _amount, UserInfo storage _user, address _sender) internal {
    require(_amount <= _user.citizenAmount, 'you dont have enough citizen stake');

    _user.citizenAmount = _user.citizenAmount - _amount;
    totalCitizenAmount = totalCitizenAmount - _amount;
    ris3.mint(_amount);

    ris3.transfer(_sender, _amount);
  }

  /**
   * @dev tax distribution according to tax uses
   *
   * Requirements
   *
   * Access
   *
   * - INTERNAL
   */
  function _distributeTax() internal {
    if (currentTaxPoolUsesIndex == 0) {//distribute all
      citizenRewardAmount = totalTaxAmount;
      totalCitizenReward = totalTaxAmount;
    } else if (currentTaxPoolUsesIndex == 1) {// distribute half
      citizenRewardAmount = totalTaxAmount / 2;
      totalCitizenReward = totalTaxAmount / 2;
    } else if (currentTaxPoolUsesIndex == 2) {//burn all
      citizenRewardAmount = 0;
      totalCitizenReward = 0;
    }

    totalTaxAmount = 0;
  }

  /**
   * @dev calculate the user rewards
   *
   * Requirements
   *
   * - `_user` address of user.
   * - `_type` 0 for farm, 1 for factory, 2 for citizen.
   * - `_taxRate` current tax rate.
   * - `_totalRewards` total rewards will be calculated against type.
   *
   * Access
   *
   * - INTERNAL
   */
  function _calculateReward(address _user, uint _type, uint256 _taxRate, uint256 _totalRewards) internal view returns (uint256 amount, uint256 tax){
    uint256 share = getUserShare(_user, _type);
    if (_type == 2) {// in case of citizen np tax will be deducted from reward
      amount = (citizenRewardAmount * share) / 1e8;
      tax = 0;
    } else {
      amount = (_totalRewards * share) / 1e8;
      tax = (amount * _taxRate) / 100;
      amount = amount - tax;
    }
  }
}

File 2 of 7 : IERC20.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity 0.8.4;

interface IERC20 {
  /**
   * @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 `recipient`.
   *
   * Returns a boolean value indicating whether the operation succeeded.
   *
   * Emits a {Transfer} event.
   */
  function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool);


  /**
   * @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);

  // Calculate fee
  function calculateAmountsAfterFee(
    address sender,
    uint256 amount
  ) external view returns (uint256 transferToAmount, uint256 transferToFeeDistributorAmount);

  // Mint by only owner
  function mint(uint256 amount) external;

  // Burn
  function burn(uint256 amount) external;
}

File 3 of 7 : IRIS3Store.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity 0.8.4;

interface IRIS3Store {
  function getRis3Address() external view returns (address);

  function getTotalTaxCollected() external view returns (uint256);

  function getAlreadyCollectedReward(address _user, uint _type, uint256 _startTime, uint256 _endTime) external view returns (bool);

  function getPendingReward(address _user, uint _type) external view returns(uint256, uint256);

  function addTax(uint256 _tax) external;

  function resetRewards() external;

  function setRewards() external;

  function claimRewards(address _user, uint _type) external;

  function setTokens(address _ris3, address _ris3BNBLP) external;

  function resetCycle() external;

  function deposit(uint256 _amount, uint _type, address sender) external;

  function withdraw(uint256 _amount, address _sender) external;

  function saveUserVote(uint256 _governmentIndex, uint256 _taxRates, uint256 _prodRates, uint256 _taxPoolUses, address _dictatorAddress, address _user) external;

  function saveElection() external;

  function saveDictatorVote(uint256 _taxRates, uint256 _prodRates, uint256 _taxPoolUses, address _user) external;

}

File 4 of 7 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.4;

abstract contract Context {
  function _msgSender() internal view virtual returns (address payable) {
    return payable(msg.sender);
  }

  function _msgData() internal view virtual returns (bytes memory) {
    this;
    // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
    return msg.data;
  }
}

File 5 of 7 : Maintainable.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity 0.8.4;

import "./Ownable.sol";

contract Maintainable is Ownable {

  bool public isMaintenance;
  bool public isOutdated;

  // Check if contract is not in maintenance
  function ifNotMaintenance() internal view {
    require(!isMaintenance, "Maintenance");
    require(!isOutdated, "Outdated");
  }

  // Check if contract on maintenance for restore
  function ifMaintenance() internal view {
    require(isMaintenance, "!Maintenance");
  }

  // Enable maintenance
  function enableMaintenance(bool status) onlyOwner public {
    isMaintenance = status;
  }

  // Enable outdated
  function enableOutdated(bool status) onlyOwner public {
    isOutdated = status;
  }

}

File 6 of 7 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.4;

import "./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.
 */
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 () {
    address msgSender = _msgSender();
    _owner = msgSender;
    emit OwnershipTransferred(address(0), msgSender);
  }

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

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(_owner == _msgSender(), "Ownable: caller is not the owner");
    _;
  }

  /**
   * @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");
    emit OwnershipTransferred(_owner, newOwner);
    _owner = newOwner;
  }
}

File 7 of 7 : Presenter.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity 0.8.4;

import "./Context.sol";
import "./Ownable.sol";

contract Presenter is Ownable {

  address public presenter;

  function setPresenter(address _presenter) onlyOwner public {
    presenter = _presenter;
  }

  function isPresenter() public view returns (bool) {
    return presenter == _msgSender();
  }

  modifier onlyAdmin() {
    require(owner() == _msgSender() || isPresenter(), "Caller is not the admin");
    _;
  }
}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_type","type":"uint256"}],"name":"Deposit","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":false,"internalType":"uint256","name":"currentTaxPoolUsesIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"ResetCycle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldStore","type":"address"},{"indexed":false,"internalType":"address","name":"newStore","type":"address"}],"name":"Restore","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"currentTaxPoolUsesIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"govType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalVoteCounts","type":"uint256"}],"name":"SaveElection","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"userAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"govType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"noOfVotes","type":"uint256"}],"name":"SaveUserVote","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"ris3","type":"address"},{"indexed":false,"internalType":"address","name":"ris3BNBLP","type":"address"}],"name":"SetTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"PROD_RATES_OPTIONS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"TAX_RATES_OPTIONS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tax","type":"uint256"}],"name":"addTax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"citizenRewardAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_type","type":"uint256"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentCycleNo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentGovIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentProdRatesIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentTaxPoolUsesIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentTaxRatesIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentVoteCounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_type","type":"uint256"},{"internalType":"address","name":"_sender","type":"address"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dictatorAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"dictatorAddresses","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"dictatorRigistration","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"emergencyTokenWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"enableMaintenance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"enableOutdated","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factoryRewardAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"farmRewardAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_type","type":"uint256"},{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"}],"name":"getAlreadyCollectedReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentLaws","outputs":[{"internalType":"uint256","name":"taxRates","type":"uint256"},{"internalType":"uint256","name":"prodRates","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentVoteCounts","outputs":[{"internalType":"uint256","name":"_voteCounts","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDictatorAddressesLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_userAddress","type":"address"}],"name":"getLastVoteCastTimeByAddress","outputs":[{"internalType":"uint256","name":"_lastVoteCastTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_type","type":"uint256"}],"name":"getPendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRis3Address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalTaxCollected","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserInfo","outputs":[{"internalType":"uint256","name":"farmAmount","type":"uint256"},{"internalType":"uint256","name":"factoryAmount","type":"uint256"},{"internalType":"uint256","name":"citizenAmount","type":"uint256"},{"internalType":"uint256","name":"lastWithdrawFarmTime","type":"uint256"},{"internalType":"uint256","name":"lastWithdrawFactoryTime","type":"uint256"},{"internalType":"uint256","name":"lastWithdrawCitizenTime","type":"uint256"},{"internalType":"bool","name":"registered","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_type","type":"uint256"}],"name":"getUserShare","outputs":[{"internalType":"uint256","name":"share","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserVotes","outputs":[{"internalType":"uint256","name":"votes","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUsersLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isMaintenance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOutdated","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPresenter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"lastVoteCastTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextGovIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextProdRatesIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextTaxPoolUsesIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextTaxRatesIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presenter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"resetCycle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resetRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_store","type":"address"}],"name":"restore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_store","type":"address"},{"internalType":"uint256","name":"_startIndex","type":"uint256"},{"internalType":"uint256","name":"_endIndex","type":"uint256"}],"name":"restoreUsers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ris3","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ris3BNBLP","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_taxRates","type":"uint256"},{"internalType":"uint256","name":"_prodRates","type":"uint256"},{"internalType":"uint256","name":"_taxPoolUses","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"saveDictatorVote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saveElection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_governmentIndex","type":"uint256"},{"internalType":"uint256","name":"_taxRates","type":"uint256"},{"internalType":"uint256","name":"_prodRates","type":"uint256"},{"internalType":"uint256","name":"_taxPoolUses","type":"uint256"},{"internalType":"address","name":"_dictatorAddress","type":"address"},{"internalType":"address","name":"_user","type":"address"}],"name":"saveUserVote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_presenter","type":"address"}],"name":"setPresenter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_ris3","type":"address"},{"internalType":"address","name":"_ris3BNBLP","type":"address"}],"name":"setTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalCitizenAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalCitizenReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalFactoryAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalFarmAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTaxAmount","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":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"farmAmount","type":"uint256"},{"internalType":"uint256","name":"factoryAmount","type":"uint256"},{"internalType":"uint256","name":"citizenAmount","type":"uint256"},{"internalType":"uint256","name":"lastWithdrawFarmTime","type":"uint256"},{"internalType":"uint256","name":"lastWithdrawFactoryTime","type":"uint256"},{"internalType":"uint256","name":"lastWithdrawCitizenTime","type":"uint256"},{"internalType":"bool","name":"registered","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"users","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"voteByGovernmentIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"votesByAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"votesByProdRatesType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"votesByTaxPoolUsesType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"votesByTaxRateType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_sender","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60e0604052600a6080908152601460a052601e60c05262000025906002906003620000ca565b506040805160608101825269152d02c7e14af68000008152693f870857a3e0e380000060208201526969e10de76676d0800000918101919091526200006f90600590600362000112565b5060006016553480156200008257600080fd5b50600080546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35062000165565b826003810192821562000100579160200282015b8281111562000100578251829060ff16905591602001919060010190620000de565b506200010e9291506200014e565b5090565b826003810192821562000100579160200282015b828111156200010057825182906001600160501b031690559160200191906001019062000126565b5b808211156200010e57600081556001016200014f565b61375b80620001756000396000f3fe608060405234801561001057600080fd5b50600436106103fb5760003560e01c806374d3bae511610215578063af38fc1e11610125578063cbab993b116100b8578063dddd415f11610087578063dddd415f146109a0578063eacfaa19146109b3578063eed9184b146109c6578063f2fde38b146109d9578063fa3064c2146109ec57600080fd5b8063cbab993b1461095e578063cbc7854e14610971578063d16395e414610984578063db339b351461098d57600080fd5b8063b866aa1c116100f4578063b866aa1c146108f3578063c5f38d48146108fc578063c9ebccec14610932578063cae585ec1461095557600080fd5b8063af38fc1e146108c5578063af878972146108ce578063af99d42c146108d7578063b18a735c146108ea57600080fd5b8063973d8cff116101a85780639d1046c9116101775780639d1046c91461084c5780639fd48c8b1461085f578063a1f79b2e1461088a578063a605643014610892578063ad29f5da146108bd57600080fd5b8063973d8cff1461080a5780639772135e1461081e578063999ffd97146108265780639a99b4f01461083957600080fd5b8063923947ce116101e4578063923947ce146107d35780639271c203146107e75780639417ef31146107ef578063950c7822146107f757600080fd5b806374d3bae51461077857806378c8bea41461079c5780638da5cb5b146107af5780638dbdbe6d146107c057600080fd5b806348ed287b116103105780635ca454f7116102a3578063678bd66f11610272578063678bd66f1461073a57806368ab8f971461074d5780636bc21ad814610755578063722e8ad514610766578063731cd0041461076f57600080fd5b80635ca454f7146106645780635e04a6da1461066d5780635f5eb518146106805780636386c1c7146106ab57600080fd5b806353a8b6ff116102df57806353a8b6ff146106415780635420b4b11461064a578063595b1a3e146106535780635aaf78f11461065b57600080fd5b806348ed287b1461060a5780634bbe8228146106125780634f168c83146106255780635273ace91461063857600080fd5b8063276db39911610393578063377a228711610362578063377a22871461056f57806339f4c0121461059a57806341460431146105ad578063440859db146105d657806347142b6b1461060157600080fd5b8063276db39914610523578063317cb1511461052c578063365b98b21461053f5780633746fd7c1461055257600080fd5b806318fc882a116103cf57806318fc882a146104575780631959a0021461048257806319d992c0146105075780632769d99a1461051a57600080fd5b8062f714ce14610400578063080d2c751461041557806310025250146104285780631850096314610444575b600080fd5b61041361040e36600461347b565b6109f5565b005b610413610423366004613303565b610ab5565b610431600b5481565b6040519081526020015b60405180910390f35b61043161045236600461344b565b61159b565b60015461046a906001600160a01b031681565b6040516001600160a01b03909116815260200161043b565b6104d0610490366004613303565b6008602052600090815260409020805460018201546002830154600384015460048501546005860154600690960154949593949293919290919060ff1687565b604080519788526020880196909652948601939093526060850191909152608084015260a0830152151560c082015260e00161043b565b60175461046a906001600160a01b031681565b61043160125481565b61043160135481565b61041361053a36600461337a565b6115b2565b61046a61054d36600461344b565b6117cf565b61055a6117f9565b6040805192835260208301919091520161043b565b61043161057d36600461349f565b601d60209081526000928352604080842090915290825290205481565b6104136105a836600461344b565b61184e565b6104316105bb36600461349f565b60208080526000928352604080842090915290825290205481565b6104316105e436600461337a565b602460209081526000928352604080842090915290825290205481565b61043160195481565b610413611862565b6104136106203660046134f8565b611c03565b610413610633366004613413565b611ddd565b610431600f5481565b61043160165481565b610431600d5481565b600954610431565b610431601c5481565b610431601b5481565b61041361067b366004613538565b611e25565b61043161068e36600461347b565b602360209081526000928352604080842090915290825290205481565b6104d06106b9366004613303565b6001600160a01b0316600090815260086020908152604091829020825160e081018452815480825260018301549382018490526002830154948201859052600383015460608301819052600484015460808401819052600585015460a0850181905260069095015460ff16151560c090940184905291969495949093919290565b61043161074836600461344b565b612154565b610413612164565b6025546001600160a01b031661046a565b61043160155481565b61043160185481565b60015461078c90600160a81b900460ff1681565b604051901515815260200161043b565b6104316107aa36600461337a565b6121e2565b6000546001600160a01b031661046a565b6104136107ce3660046134c0565b6122c8565b60015461078c90600160a01b900460ff1681565b61041361241a565b600d54610431565b610431610805366004613303565b6124dd565b61078c6001546001600160a01b0316331490565b601c54610431565b61055a61083436600461337a565b61254b565b61041361084736600461337a565b6125ba565b61078c61085a3660046133d9565b612804565b61043161086d36600461349f565b601e60209081526000928352604080842090915290825290205481565b602254610431565b6104316108a036600461349f565b601f60209081526000928352604080842090915290825290205481565b6104136128eb565b610431600e5481565b61043160145481565b6104136108e53660046133a5565b612943565b610431600c5481565b610431600a5481565b61043161090a366004613303565b6001600160a01b03166000908152602460209081526040808320601654845290915290205490565b61078c610940366004613303565b60216020526000908152604090205460ff1681565b61043160115481565b60255461046a906001600160a01b031681565b61041361097f366004613342565b612bae565b610431601a5481565b60265461046a906001600160a01b031681565b61046a6109ae36600461344b565b612c68565b6104136109c1366004613303565b612c78565b6104136109d4366004613413565b612cc4565b6104136109e7366004613303565b612d0c565b61043160105481565b6000546001600160a01b0316331480610a1d5750610a1d6001546001600160a01b0316331490565b610a425760405162461bcd60e51b8152600401610a3990613629565b60405180910390fd5b610a4a612df6565b6001600160a01b0381166000908152600860205260409020610a6d838284612e85565b816001600160a01b03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436484604051610aa891815260200190565b60405180910390a2505050565b6000546001600160a01b03163314610adf5760405162461bcd60e51b8152600401610a39906135f4565b610ae7612ff5565b6000819050806001600160a01b0316632769d99a6040518163ffffffff1660e01b815260040160206040518083038186803b158015610b2557600080fd5b505afa158015610b39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5d9190613463565b601281905550806001600160a01b031663276db3996040518163ffffffff1660e01b815260040160206040518083038186803b158015610b9c57600080fd5b505afa158015610bb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd49190613463565b601381905550806001600160a01b031663af8789726040518163ffffffff1660e01b815260040160206040518083038186803b158015610c1357600080fd5b505afa158015610c27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4b9190613463565b601481905550806001600160a01b031663722e8ad56040518163ffffffff1660e01b815260040160206040518083038186803b158015610c8a57600080fd5b505afa158015610c9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc29190613463565b601581905550806001600160a01b03166353a8b6ff6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0157600080fd5b505afa158015610d15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d399190613463565b601681905550806001600160a01b03166319d992c06040518163ffffffff1660e01b815260040160206040518083038186803b158015610d7857600080fd5b505afa158015610d8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db09190613326565b601760006101000a8154816001600160a01b0302191690836001600160a01b03160217905550806001600160a01b031663731cd0046040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0f57600080fd5b505afa158015610e23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e479190613463565b601881905550806001600160a01b03166347142b6b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e8657600080fd5b505afa158015610e9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ebe9190613463565b601981905550806001600160a01b031663d16395e46040518163ffffffff1660e01b815260040160206040518083038186803b158015610efd57600080fd5b505afa158015610f11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f359190613463565b601a81905550806001600160a01b0316635ca454f76040518163ffffffff1660e01b815260040160206040518083038186803b158015610f7457600080fd5b505afa158015610f88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fac9190613463565b601b81905550806001600160a01b0316635aaf78f16040518163ffffffff1660e01b815260040160206040518083038186803b158015610feb57600080fd5b505afa158015610fff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110239190613463565b601c81905550806001600160a01b031663b866aa1c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561106257600080fd5b505afa158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190613463565b600a81905550806001600160a01b031663100252506040518163ffffffff1660e01b815260040160206040518083038186803b1580156110d957600080fd5b505afa1580156110ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111119190613463565b600b81905550806001600160a01b031663b18a735c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561115057600080fd5b505afa158015611164573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111889190613463565b600c81905550806001600160a01b0316635420b4b16040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c757600080fd5b505afa1580156111db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ff9190613463565b600d81905550806001600160a01b031663af38fc1e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561123e57600080fd5b505afa158015611252573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112769190613463565b600e81905550806001600160a01b0316635273ace96040518163ffffffff1660e01b815260040160206040518083038186803b1580156112b557600080fd5b505afa1580156112c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ed9190613463565b600f81905550806001600160a01b031663fa3064c26040518163ffffffff1660e01b815260040160206040518083038186803b15801561132c57600080fd5b505afa158015611340573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113649190613463565b601081905550806001600160a01b031663cae585ec6040518163ffffffff1660e01b815260040160206040518083038186803b1580156113a357600080fd5b505afa1580156113b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113db9190613463565b6011819055506000816001600160a01b031663a1f79b2e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561141c57600080fd5b505afa158015611430573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114549190613463565b905060005b818110156115545760405163dddd415f60e01b8152600481018290526000906001600160a01b0385169063dddd415f9060240160206040518083038186803b1580156114a457600080fd5b505afa1580156114b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114dc9190613326565b6022805460018181019092557f61035b26e3e9eee00e0d72fd1ee8ddca6894550dca6916ea2ac6baa90d11e5100180546001600160a01b039093166001600160a01b031990931683179055600091825260216020526040909120805460ff19169091179055508061154c816136ce565b915050611459565b50604080516001600160a01b03851681523060208201527fb95ec3f41d24efb986cb4cd84a41a925e70418150f3f23ff889a3899278138e2910160405180910390a1505050565b600581600381106115ab57600080fd5b0154905081565b6000546001600160a01b031633146115dc5760405162461bcd60e51b8152600401610a39906135f4565b6115e4612df6565b6001600160a01b0382166116265760405162461bcd60e51b815260206004820152600960248201526830206164647265737360b81b6044820152606401610a39565b600081116116655760405162461bcd60e51b815260206004820152600c60248201526b0616d6f756e74206e6f7420360a41b6044820152606401610a39565b6040516370a0823160e01b815230600482015282906000906001600160a01b038316906370a082319060240160206040518083038186803b1580156116a957600080fd5b505afa1580156116bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e19190613463565b9050808311156117275760405162461bcd60e51b81526020600482015260116024820152701b9bdd08195b9bdd59da08185b5bdd5b9d607a1b6044820152606401610a39565b816001600160a01b031663a9059cbb6117486000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101869052604401602060405180830381600087803b15801561179057600080fd5b505af11580156117a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c8919061342f565b5050505050565b600981815481106117df57600080fd5b6000918252602090912001546001600160a01b0316905081565b60008060026013546003811061181f57634e487b7160e01b600052603260045260246000fd5b0154915060056014546003811061184657634e487b7160e01b600052603260045260246000fd5b015490509091565b80600d5461185c9190613660565b600d5550565b6000546001600160a01b031633148061188a575061188a6001546001600160a01b0316331490565b6118a65760405162461bcd60e51b8152600401610a3990613629565b6118ae612df6565b6000805b60038110156119125760165460009081526020808052604080832084845290915290205482101561190057601654600090815260208080526040808320848452909152902054601882905591505b8061190a816136ce565b9150506118b2565b506000806000601854600014806119295750601c54155b156119575760026019819055601a556000601b819055601855601780546001600160a01b0319169055611bb6565b60185460011415611a715760005b6003811015611a5b576016546000908152601d602090815260408083208484529091529020548410156119b7576016546000908152601d60209081526040808320848452909152902054601982905593505b6016546000908152601e60209081526040808320848452909152902054831015611a00576016546000908152601e60209081526040808320848452909152902054601a82905592505b6016546000908152601f60209081526040808320848452909152902054821015611a49576016546000908152601f60209081526040808320848452909152902054601b82905591505b80611a53816136ce565b915050611965565b50601780546001600160a01b0319169055611bb6565b6000805b602254811015611ba45781602360006016548152602001908152602001600020600060228481548110611ab857634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020541115611b9257602360006016548152602001908152602001600020600060228381548110611b1b57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054602280549193509082908110611b6657634e487b7160e01b600052603260045260246000fd5b600091825260209091200154601780546001600160a01b0319166001600160a01b039092169190911790555b80611b9c816136ce565b915050611a75565b505060016019819055601a556000601b555b601654601254601c5460408051938452602084019290925282820152517ff4c612c044b44b7167023f5b9271501022469faec5abe9b213995fe7a49c73c99181900360600190a150505050565b6000546001600160a01b0316331480611c2b5750611c2b6001546001600160a01b0316331490565b611c475760405162461bcd60e51b8152600401610a3990613629565b611c4f612df6565b601854600214611c995760405162461bcd60e51b815260206004820152601560248201527457726f6e6720676f7665726e6d656e74207479706560581b6044820152606401610a39565b6017546001600160a01b03828116911614611ce65760405162461bcd60e51b815260206004820152600d60248201526c27b7363c903234b1ba30ba37b960991b6044820152606401610a39565b60038410611d2e5760405162461bcd60e51b81526020600482015260156024820152742bb937b733903a30bc103930ba329037b83a34b7b760591b6044820152606401610a39565b60038310611d7e5760405162461bcd60e51b815260206004820152601d60248201527f57726f6e672070726f64756374696f6e207261746573206f7074696f6e0000006044820152606401610a39565b60038210611dce5760405162461bcd60e51b815260206004820152601860248201527f57726f6e6720746178506f6f6c55736573206f7074696f6e00000000000000006044820152606401610a39565b50601992909255601a55601b55565b6000546001600160a01b03163314611e075760405162461bcd60e51b8152600401610a39906135f4565b60018054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331480611e4d5750611e4d6001546001600160a01b0316331490565b611e695760405162461bcd60e51b8152600401610a3990613629565b611e71612df6565b6000611e7c826124dd565b905060008111611ece5760405162461bcd60e51b815260206004820152601860248201527f596f7520646f206e6f74206861766520616e7920766f746500000000000000006044820152606401610a39565b6001600160a01b0382166000908152602460209081526040808320601654845290915290205415611f3a5760405162461bcd60e51b8152602060048201526016602482015275105b1c9958591e481d9bdd19481a5cc818d85cdd195960521b6044820152606401610a39565b6001600160a01b03821660009081526024602090815260408083206016805485529083528184204290555483528180528083208a845290915281208054839290611f85908490613660565b9091555050600187141561202c576016546000908152601d6020908152604080832089845290915281208054839290611fbf908490613660565b90915550506016546000908152601e6020908152604080832088845290915281208054839290611ff0908490613660565b90915550506016546000908152601f6020908152604080832087845290915281208054839290612021908490613660565b909155506120f39050565b86600214156120f35760165460009081526023602090815260408083206001600160a01b03871684529091528120805483929061206a908490613660565b90915550506001600160a01b03831660009081526021602052604090205460ff166120f3576022805460018082019092557f61035b26e3e9eee00e0d72fd1ee8ddca6894550dca6916ea2ac6baa90d11e5100180546001600160a01b0319166001600160a01b0386169081179091556000908152602160205260409020805460ff191690911790555b80601c60008282546121059190613660565b909155505060408051338152602081018990529081018290527ff14ae76529bee724f090d66d052494e0269bd3cd02ff7a64f89ab27cc8d1b4119060600160405180910390a150505050505050565b600281600381106115ab57600080fd5b6000546001600160a01b031633148061218c575061218c6001546001600160a01b0316331490565b6121a85760405162461bcd60e51b8152600401610a3990613629565b6121b0612df6565b60006005601454600381106121d557634e487b7160e01b600052603260045260246000fd5b0154600e819055600f5550565b6001600160a01b0382166000908152600860209081526040808320815160e081018352815481526001820154938101939093526002810154918301919091526003810154606083015260048101546080830152600581015460a08301526006015460ff16151560c08201528261227657600b548151612265906305f5e100613698565b61226f9190613678565b91506122c1565b826001141561229557600a546020820151612265906305f5e100613698565b82600214156122c157600c5460408201516122b4906305f5e100613698565b6122be9190613678565b91505b5092915050565b6000546001600160a01b03163314806122f057506122f06001546001600160a01b0316331490565b61230c5760405162461bcd60e51b8152600401610a3990613629565b612314612df6565b6001600160a01b0381166000908152600860205260409020826123415761233c84828461303d565b612369565b82600114156123555761233c848284613145565b8260021415612369576123698482846131aa565b600681015460ff166123d057600681018054600160ff1990911681179091556009805491820181556000527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b0319166001600160a01b0384161790555b60408051858152602081018590526001600160a01b038416917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15910160405180910390a250505050565b6000546001600160a01b031633148061244257506124426001546001600160a01b0316331490565b61245e5760405162461bcd60e51b8152600401610a3990613629565b612466612df6565b6000601c819055601680549161247b836136ce565b9091555050601854601255601a54601455601954601355601b546015556124a061320f565b601654604080519182524360208301527f63118e3a893a3e735d1e4b71894189e4c2879dd628f84ca0922229b338e36a29910160405180910390a1565b6001600160a01b0316600090815260086020908152604091829020825160e0810184528154815260018201549281019290925260028101549282018390526003810154606083015260048101546080830152600581015460a08301526006015460ff16151560c09091015290565b6000805481906001600160a01b031633148061257657506125766001546001600160a01b0316331490565b6125925760405162461bcd60e51b8152600401610a3990613629565b60008061259d6117f9565b915091506125ad86868484613277565b9350935050509250929050565b6000546001600160a01b03163314806125e257506125e26001546001600160a01b0316331490565b6125fe5760405162461bcd60e51b8152600401610a3990613629565b612606612df6565b6000806126116117f9565b9150915060008061262486868686613277565b91509150600082116126785760405162461bcd60e51b815260206004820152601f60248201527f616d6f756e742073686f756c642062652067726561746572207468616e2030006044820152606401610a39565b6001600160a01b0386166000908152600860205260409020856126bc578183600e546126a491906136b7565b6126ae91906136b7565b600e5542600382015561270d565b85600114156126ec578183600f546126d491906136b7565b6126de91906136b7565b600f5542600482015561270d565b856002141561270d578260105461270391906136b7565b6010554260058201555b60255460405163140e25ad60e31b8152600481018590526001600160a01b039091169063a0712d6890602401600060405180830381600087803b15801561275357600080fd5b505af1158015612767573d6000803e3d6000fd5b505060255460405163a9059cbb60e01b81526001600160a01b038b8116600483015260248201889052909116925063a9059cbb9150604401602060405180830381600087803b1580156127b957600080fd5b505af11580156127cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127f1919061342f565b506127fb8261184e565b50505050505050565b6001600160a01b0384166000908152600860209081526040808320815160e081018352815481526001820154938101939093526002810154918301919091526003810154606083015260048101546080830152600581015460a08301526006015460ff16151560c082015284612893578381606001511015801561288b5750828160600151105b9150506128e3565b84600114156128b8578381608001511015801561288b575060800151821190506128e3565b84600214156128dd57838160a001511015801561288b575060a00151821190506128e3565b60009150505b949350505050565b6000546001600160a01b031633148061291357506129136001546001600160a01b0316331490565b61292f5760405162461bcd60e51b8152600401610a3990613629565b612937612df6565b6000600e819055600f55565b6000546001600160a01b0316331461296d5760405162461bcd60e51b8152600401610a39906135f4565b612975612ff5565b82825b828110156117c857604051631b2dcc5960e11b8152600481018290526000906001600160a01b0384169063365b98b29060240160206040518083038186803b1580156129c357600080fd5b505afa1580156129d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129fb9190613326565b6009805460018101825560009182527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b0319166001600160a01b03848116918217909255604051636386c1c760e01b815260048101919091529293509091829182918291829182918291908b1690636386c1c79060240160e06040518083038186803b158015612a9457600080fd5b505afa158015612aa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612acc9190613595565b96509650965096509650965096506040518060e00160405280888152602001878152602001868152602001858152602001848152602001838152602001821515815250600860008a6001600160a01b03166001600160a01b03168152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff02191690831515021790555090505050505050505050508080612ba6906136ce565b915050612978565b6000546001600160a01b0316331480612bd65750612bd66001546001600160a01b0316331490565b612bf25760405162461bcd60e51b8152600401610a3990613629565b612bfa612df6565b602580546001600160a01b038481166001600160a01b03199283168117909355602680549185169190921681179091556040805192835260208301919091527f68be50e9ea9adbc012cefe148f13d238e819ab9ec1e69d4b2a6140b748479074910160405180910390a15050565b602281815481106117df57600080fd5b6000546001600160a01b03163314612ca25760405162461bcd60e51b8152600401610a39906135f4565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314612cee5760405162461bcd60e51b8152600401610a39906135f4565b60018054911515600160a81b0260ff60a81b19909216919091179055565b6000546001600160a01b03163314612d365760405162461bcd60e51b8152600401610a39906135f4565b6001600160a01b038116612d9b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a39565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600154600160a01b900460ff1615612e3e5760405162461bcd60e51b815260206004820152600b60248201526a4d61696e74656e616e636560a81b6044820152606401610a39565b600154600160a81b900460ff1615612e835760405162461bcd60e51b815260206004820152600860248201526713dd5d19185d195960c21b6044820152606401610a39565b565b8160020154831115612ee45760405162461bcd60e51b815260206004820152602260248201527f796f7520646f6e74206861766520656e6f75676820636974697a656e207374616044820152616b6560f01b6064820152608401610a39565b828260020154612ef491906136b7565b6002830155600c54612f079084906136b7565b600c5560255460405163140e25ad60e31b8152600481018590526001600160a01b039091169063a0712d6890602401600060405180830381600087803b158015612f5057600080fd5b505af1158015612f64573d6000803e3d6000fd5b505060255460405163a9059cbb60e01b81526001600160a01b03858116600483015260248201889052909116925063a9059cbb91506044015b602060405180830381600087803b158015612fb757600080fd5b505af1158015612fcb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fef919061342f565b50505050565b600154600160a01b900460ff16612e835760405162461bcd60e51b815260206004820152600c60248201526b214d61696e74656e616e636560a01b6044820152606401610a39565b815461304a908490613660565b8255600b5461305a908490613660565b600b556025546040516323b872dd60e01b81526001600160a01b03838116600483015230602483015260448201869052909116906323b872dd906064015b602060405180830381600087803b1580156130b257600080fd5b505af11580156130c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130ea919061342f565b50602554604051630852cd8d60e31b8152600481018590526001600160a01b03909116906342966c6890602401600060405180830381600087803b15801561313157600080fd5b505af11580156127fb573d6000803e3d6000fd5b8282600101546131559190613660565b6001830155600a54613168908490613660565b600a556026546040516323b872dd60e01b81526001600160a01b03838116600483015230602483015260448201869052909116906323b872dd90606401612f9d565b8282600201546131ba9190613660565b6002830155600c546131cd908490613660565b600c556025546040516323b872dd60e01b81526001600160a01b03838116600483015230602483015260448201869052909116906323b872dd90606401613098565b60155461322657600d546010819055601155613270565b6015546001141561325a576002600d546132409190613678565b601055600d5461325290600290613678565b601155613270565b6015546002141561327057600060108190556011555b6000600d55565b600080600061328687876121e2565b905085600214156132b9576305f5e100816010546132a49190613698565b6132ae9190613678565b9250600091506132f9565b6305f5e1006132c88286613698565b6132d29190613678565b925060646132e08685613698565b6132ea9190613678565b91506132f682846136b7565b92505b5094509492505050565b600060208284031215613314578081fd5b813561331f816136ff565b9392505050565b600060208284031215613337578081fd5b815161331f816136ff565b60008060408385031215613354578081fd5b823561335f816136ff565b9150602083013561336f816136ff565b809150509250929050565b6000806040838503121561338c578182fd5b8235613397816136ff565b946020939093013593505050565b6000806000606084860312156133b9578081fd5b83356133c4816136ff565b95602085013595506040909401359392505050565b600080600080608085870312156133ee578081fd5b84356133f9816136ff565b966020860135965060408601359560600135945092505050565b600060208284031215613424578081fd5b813561331f81613717565b600060208284031215613440578081fd5b815161331f81613717565b60006020828403121561345c578081fd5b5035919050565b600060208284031215613474578081fd5b5051919050565b6000806040838503121561348d578182fd5b82359150602083013561336f816136ff565b600080604083850312156134b1578182fd5b50508035926020909101359150565b6000806000606084860312156134d4578283fd5b833592506020840135915060408401356134ed816136ff565b809150509250925092565b6000806000806080858703121561350d578384fd5b843593506020850135925060408501359150606085013561352d816136ff565b939692955090935050565b60008060008060008060c08789031215613550578182fd5b863595506020870135945060408701359350606087013592506080870135613577816136ff565b915060a0870135613587816136ff565b809150509295509295509295565b600080600080600080600060e0888a0312156135af578485fd5b875196506020880151955060408801519450606088015193506080880151925060a0880151915060c08801516135e481613717565b8091505092959891949750929550565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526017908201527f43616c6c6572206973206e6f74207468652061646d696e000000000000000000604082015260600190565b60008219821115613673576136736136e9565b500190565b60008261369357634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156136b2576136b26136e9565b500290565b6000828210156136c9576136c96136e9565b500390565b60006000198214156136e2576136e26136e9565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461371457600080fd5b50565b801515811461371457600080fdfea26469706673582212206289ee747cdfe218b92be38f8843bfd6b69eddc6f6dcf6509abf94a2b7af17f764736f6c63430008040033

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