Contract 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8

Contract Overview

Balance:
0 BNB
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xa118932c01b4eff95c9ad7cd65a7d05afed61572f6ab1ff8b981c1739ebe50f7Submit126521582021-09-24 18:42:546 hrs 9 mins ago0xdc3ebc37da53a644d67e5e3b5ba4eef88d969d5c IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00227006
0xac8523882b7aaeee6b017a023ab9af2002281b8297d1b760feee346860714b5aSubmit126521412021-09-24 18:42:036 hrs 10 mins ago0x998cb7821e605cc16b6174e7c50e19adb2dd2fb0 IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00226982
0x5df06387b97e1128aae1eeaae745b7e5f466c5b483a4911e92b4515a0d29bea4Submit126521272021-09-24 18:41:216 hrs 10 mins ago0xdc3ebc37da53a644d67e5e3b5ba4eef88d969d5c IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00203858
0x46504078b43e2148ced4e201fd481c4d1b76ba162132f59ddacf1594c5b25a01Submit126521082021-09-24 18:40:246 hrs 11 mins ago0x998cb7821e605cc16b6174e7c50e19adb2dd2fb0 IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00226994
0xf46818653f7c2a0edf063c78c47f59d6f7a11b722daadfd367f17f1801260b03Submit126520932021-09-24 18:39:396 hrs 12 mins ago0xdc3ebc37da53a644d67e5e3b5ba4eef88d969d5c IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00203834
0x555460aab1d4cc12edaa0d2607672821822a3cfe0e3c2d0a897c98539879dd82Submit126520752021-09-24 18:38:456 hrs 13 mins ago0x998cb7821e605cc16b6174e7c50e19adb2dd2fb0 IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00203858
0x7c7221647ecb3b8982f0c69eb385c523c56dd441b9e7db703bcde7a68abaf873Submit126520592021-09-24 18:37:576 hrs 14 mins ago0xdc3ebc37da53a644d67e5e3b5ba4eef88d969d5c IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00203858
0x079368c6144ed3f03cfe41808d2daec7d2f0975aaa88acac40615a6a1082909aSubmit126520412021-09-24 18:37:036 hrs 15 mins ago0x998cb7821e605cc16b6174e7c50e19adb2dd2fb0 IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00203858
0x2d0e72f35e3badb53b5c48f4183e0f0cd251da2c3787ec1a2cbb7f5975d5b5aeSubmit126520252021-09-24 18:36:156 hrs 16 mins ago0xdc3ebc37da53a644d67e5e3b5ba4eef88d969d5c IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00203858
0xa97b94df4f21677bf8972f6fef3ba7dec68a8ed2ced10c7da0196207f5045340Submit126520082021-09-24 18:35:246 hrs 16 mins ago0x998cb7821e605cc16b6174e7c50e19adb2dd2fb0 IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00203858
0xd661d42057ba403cffda84d85f4f711b6e3ec49e1c9508a39e82744ff7c0d794Submit126519902021-09-24 18:34:306 hrs 17 mins ago0xdc3ebc37da53a644d67e5e3b5ba4eef88d969d5c IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00203858
0xf53fd4bf6e0142b11c500a93cdd02a69dbf3ef4779387a489ca2dae8738190daSubmit126519732021-09-24 18:33:396 hrs 18 mins ago0x998cb7821e605cc16b6174e7c50e19adb2dd2fb0 IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00215336
0xbb5153ccee7628bf40588f797de1f9b123238f4afc1a6686ce4092d004744eb1Submit126519542021-09-24 18:32:426 hrs 19 mins ago0xdc3ebc37da53a644d67e5e3b5ba4eef88d969d5c IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00227006
0x096987570623bef081dc23654e3db281eef0535d379b740c6451a02c15fc9b61Submit126519392021-09-24 18:31:576 hrs 20 mins ago0x998cb7821e605cc16b6174e7c50e19adb2dd2fb0 IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.0020387
0xb55be2d8742a6163af101ff1b06e7d4bc31344ca23b7151dc0a81fac309a0de6Submit126519202021-09-24 18:31:006 hrs 21 mins ago0xdc3ebc37da53a644d67e5e3b5ba4eef88d969d5c IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00227006
0x5c4d419b9be11225abffd97251e73a0a5cd4ef2defe2c3396f9ad2d7538fe15dSubmit126519072021-09-24 18:30:216 hrs 21 mins ago0x998cb7821e605cc16b6174e7c50e19adb2dd2fb0 IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00203858
0x0d24a13062e42c5f58540fac27b4209b7c8bf43ffaa89b72fae401e67a19e2b5Submit126518882021-09-24 18:29:246 hrs 22 mins ago0xdc3ebc37da53a644d67e5e3b5ba4eef88d969d5c IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00203858
0xd5055a865028d1bf75453a66f143246d7f92c16844bd6edbeeb5a60466dc6e07Submit126518722021-09-24 18:28:366 hrs 23 mins ago0x998cb7821e605cc16b6174e7c50e19adb2dd2fb0 IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00203858
0xd47566f6b5613278c3a5d81ee7a5c18a1f0af56425cfc35b69c174af318997e3Submit126518552021-09-24 18:27:456 hrs 24 mins ago0xdc3ebc37da53a644d67e5e3b5ba4eef88d969d5c IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.0020387
0x8ab0ac418a21a0412f94a1a10295ae9628b823876cf7fb10ff1ee04e2c7623e7Submit126518382021-09-24 18:26:546 hrs 25 mins ago0x998cb7821e605cc16b6174e7c50e19adb2dd2fb0 IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00203858
0xbe9b86f8ae7fb02bfb309ea61233e134db0def1abc01c481a0455b16cb2dd895Submit126518202021-09-24 18:26:006 hrs 26 mins ago0xdc3ebc37da53a644d67e5e3b5ba4eef88d969d5c IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.0020387
0x24d46916ce1487acdef43d89bf89bab5c2c66c8b35fc5494b636921c58264fc2Submit126518032021-09-24 18:25:096 hrs 27 mins ago0x998cb7821e605cc16b6174e7c50e19adb2dd2fb0 IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.00203858
0x1b6db6318ab43e3ae819741a82770d3d82b7decee16fbae95d92fd4a99294b8dSubmit126517862021-09-24 18:24:186 hrs 27 mins ago0xdc3ebc37da53a644d67e5e3b5ba4eef88d969d5c IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.0020387
0xb827b7f8a0d830e562d4827ae42fa8c96a9e9470949a05d178a7e830c9f40b33Submit126517692021-09-24 18:23:276 hrs 28 mins ago0x998cb7821e605cc16b6174e7c50e19adb2dd2fb0 IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.0020387
0xc1cd6a1abe36be3b4f69aa5dc5e6e02ba872c563e34393fe76e2036c4752a829Submit126517522021-09-24 18:22:366 hrs 29 mins ago0xdc3ebc37da53a644d67e5e3b5ba4eef88d969d5c IN  0x339391ca3f2785ee11b109b25beb7c392aaeb5a80 BNB0.0020387
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xa118932c01b4eff95c9ad7cd65a7d05afed61572f6ab1ff8b981c1739ebe50f7126521582021-09-24 18:42:546 hrs 9 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0xa118932c01b4eff95c9ad7cd65a7d05afed61572f6ab1ff8b981c1739ebe50f7126521582021-09-24 18:42:546 hrs 9 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0xa118932c01b4eff95c9ad7cd65a7d05afed61572f6ab1ff8b981c1739ebe50f7126521582021-09-24 18:42:546 hrs 9 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0xac8523882b7aaeee6b017a023ab9af2002281b8297d1b760feee346860714b5a126521412021-09-24 18:42:036 hrs 10 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0xac8523882b7aaeee6b017a023ab9af2002281b8297d1b760feee346860714b5a126521412021-09-24 18:42:036 hrs 10 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0xac8523882b7aaeee6b017a023ab9af2002281b8297d1b760feee346860714b5a126521412021-09-24 18:42:036 hrs 10 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0x5df06387b97e1128aae1eeaae745b7e5f466c5b483a4911e92b4515a0d29bea4126521272021-09-24 18:41:216 hrs 10 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0x5df06387b97e1128aae1eeaae745b7e5f466c5b483a4911e92b4515a0d29bea4126521272021-09-24 18:41:216 hrs 10 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0x5df06387b97e1128aae1eeaae745b7e5f466c5b483a4911e92b4515a0d29bea4126521272021-09-24 18:41:216 hrs 10 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0x46504078b43e2148ced4e201fd481c4d1b76ba162132f59ddacf1594c5b25a01126521082021-09-24 18:40:246 hrs 11 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0x46504078b43e2148ced4e201fd481c4d1b76ba162132f59ddacf1594c5b25a01126521082021-09-24 18:40:246 hrs 11 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0x46504078b43e2148ced4e201fd481c4d1b76ba162132f59ddacf1594c5b25a01126521082021-09-24 18:40:246 hrs 11 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0xf46818653f7c2a0edf063c78c47f59d6f7a11b722daadfd367f17f1801260b03126520932021-09-24 18:39:396 hrs 12 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0xf46818653f7c2a0edf063c78c47f59d6f7a11b722daadfd367f17f1801260b03126520932021-09-24 18:39:396 hrs 12 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0xf46818653f7c2a0edf063c78c47f59d6f7a11b722daadfd367f17f1801260b03126520932021-09-24 18:39:396 hrs 12 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0x555460aab1d4cc12edaa0d2607672821822a3cfe0e3c2d0a897c98539879dd82126520752021-09-24 18:38:456 hrs 13 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0x555460aab1d4cc12edaa0d2607672821822a3cfe0e3c2d0a897c98539879dd82126520752021-09-24 18:38:456 hrs 13 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0x555460aab1d4cc12edaa0d2607672821822a3cfe0e3c2d0a897c98539879dd82126520752021-09-24 18:38:456 hrs 13 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0x7c7221647ecb3b8982f0c69eb385c523c56dd441b9e7db703bcde7a68abaf873126520592021-09-24 18:37:576 hrs 14 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0x7c7221647ecb3b8982f0c69eb385c523c56dd441b9e7db703bcde7a68abaf873126520592021-09-24 18:37:576 hrs 14 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0x7c7221647ecb3b8982f0c69eb385c523c56dd441b9e7db703bcde7a68abaf873126520592021-09-24 18:37:576 hrs 14 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0x079368c6144ed3f03cfe41808d2daec7d2f0975aaa88acac40615a6a1082909a126520412021-09-24 18:37:036 hrs 15 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0x079368c6144ed3f03cfe41808d2daec7d2f0975aaa88acac40615a6a1082909a126520412021-09-24 18:37:036 hrs 15 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0x079368c6144ed3f03cfe41808d2daec7d2f0975aaa88acac40615a6a1082909a126520412021-09-24 18:37:036 hrs 15 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
0x2d0e72f35e3badb53b5c48f4183e0f0cd251da2c3787ec1a2cbb7f5975d5b5ae126520252021-09-24 18:36:156 hrs 16 mins ago 0x339391ca3f2785ee11b109b25beb7c392aaeb5a8 0xe2c97b3a0aa1a46e070b48c343b7d3675406d0140 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Chain

Compiler Version
v0.6.8+commit.0bbfe453

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 13 : Chain.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.8;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@umb-network/toolbox/dist/contracts/lib/ValueDecoder.sol";

import "./interfaces/IStakingBank.sol";

import "./extensions/Registrable.sol";
import "./Registry.sol";

contract Chain is Registrable, Ownable {
  using ValueDecoder for bytes;

  // ========== STATE VARIABLES ========== //

  bytes constant public ETH_PREFIX = "\x19Ethereum Signed Message:\n32";

  struct Block {
    bytes32 root;
    uint32 dataTimestamp;
  }

  struct FirstClassData {
    uint224 value;
    uint32 dataTimestamp;
  }

  mapping(uint256 => Block) public blocks;
  mapping(bytes32 => FirstClassData) public fcds;

  IStakingBank public immutable stakingBank;
  uint32 public blocksCount;
  uint32 public immutable blocksCountOffset;
  uint16 public padding;
  uint16 public immutable requiredSignatures;

  // ========== CONSTRUCTOR ========== //

  constructor(
    address _contractRegistry,
    uint16 _padding,
    uint16 _requiredSignatures
  ) public Registrable(_contractRegistry) {
    padding = _padding;
    requiredSignatures = _requiredSignatures;
    Chain oldChain = Chain(Registry(_contractRegistry).getAddress("Chain"));

    blocksCountOffset = address(oldChain) != address(0x0)
      // +1 because it might be situation when tx is already in progress in old contract
      ? oldChain.blocksCount() + oldChain.blocksCountOffset() + 1
      : 0;

    // we not changing SB address that often, so lets save it once, it will save 10% gas
    stakingBank = stakingBankContract();
  }

  // ========== MUTATIVE FUNCTIONS ========== //

  function setPadding(uint16 _padding) external onlyOwner {
    padding = _padding;
    emit LogPadding(msg.sender, _padding);
  }

  function submit(
    uint32 _dataTimestamp,
    bytes32 _root,
    bytes32[] memory _keys,
    uint256[] memory _values,
    uint8[] memory _v,
    bytes32[] memory _r,
    bytes32[] memory _s
  ) public {
    uint32 lastBlockId = getLatestBlockId();
    require(blocks[lastBlockId].dataTimestamp + padding < block.timestamp, "do not spam");
    require(blocks[lastBlockId].dataTimestamp < _dataTimestamp, "can NOT submit older data");
    // we can't expect minter will have exactly the same timestamp
    // but for sure we can demand not to be off by a lot, that's why +3sec
    // temporary remove this condition, because recently on ropsten we see cases when minter/node
    // can be even 100sec behind
    // require(_dataTimestamp <= block.timestamp + 3,
    //   string(abi.encodePacked("oh, so you can predict the future:", _dataTimestamp - block.timestamp + 48)));
    require(_keys.length == _values.length, "numbers of keys and values not the same");

    bytes memory testimony = abi.encodePacked(_dataTimestamp, _root);

    for (uint256 i = 0; i < _keys.length; i++) {
      require(uint224(_values[i]) == _values[i], "FCD overflow");
      fcds[_keys[i]] = FirstClassData(uint224(_values[i]), _dataTimestamp);
      testimony = abi.encodePacked(testimony, _keys[i], _values[i]);
    }

    bytes32 affidavit = keccak256(testimony);
    uint256 power = 0;

    uint256 staked = stakingBank.totalSupply();
    address prevSigner = address(0x0);

    uint256 i = 0;

    for (; i < _v.length; i++) {
      address signer = recoverSigner(affidavit, _v[i], _r[i], _s[i]);
      uint256 balance = stakingBank.balanceOf(signer);

      require(prevSigner < signer, "validator included more than once");
      prevSigner = signer;
      if (balance == 0) continue;

      emit LogVoter(lastBlockId + 1, signer, balance);
      power += balance; // no need for safe math, if we overflow then we will not have enough power
    }

    require(i >= requiredSignatures, "not enough signatures");
    // we turn on power once we have proper DPoS
    // require(power * 100 / staked >= 66, "not enough power was gathered");

    blocks[lastBlockId + 1] = Block(_root, _dataTimestamp);
    blocksCount++;

    emit LogMint(msg.sender, lastBlockId + 1, staked, power);
  }

  // ========== VIEWS ========== //

  function getName() override external pure returns (bytes32) {
    return "Chain";
  }

  function recoverSigner(bytes32 _affidavit, uint8 _v, bytes32 _r, bytes32 _s) public pure returns (address) {
    bytes32 hash = keccak256(abi.encodePacked(ETH_PREFIX, _affidavit));
    return ecrecover(hash, _v, _r, _s);
  }

  function getStatus() external view returns(
    uint256 blockNumber,
    uint16 timePadding,
    uint32 lastDataTimestamp,
    uint32 lastBlockId,
    address nextLeader,
    uint32 nextBlockId,
    address[] memory validators,
    uint256[] memory powers,
    string[] memory locations,
    uint256 staked,
    uint16 minSignatures
  ) {
    blockNumber = block.number;
    timePadding = padding;
    lastBlockId = getLatestBlockId();
    lastDataTimestamp = blocks[lastBlockId].dataTimestamp;
    minSignatures = requiredSignatures;

    staked = stakingBank.totalSupply();
    uint256 numberOfValidators = stakingBank.getNumberOfValidators();
    powers = new uint256[](numberOfValidators);
    validators = new address[](numberOfValidators);
    locations = new string[](numberOfValidators);

    for (uint256 i = 0; i < numberOfValidators; i++) {
      validators[i] = stakingBank.addresses(i);
      (, locations[i]) = stakingBank.validators(validators[i]);
      powers[i] = stakingBank.balanceOf(validators[i]);
    }

    nextBlockId = getBlockIdAtTimestamp(block.timestamp + 1);

    nextLeader = numberOfValidators > 0
      ? validators[getLeaderIndex(numberOfValidators, block.timestamp + 1)]
      : address(0);
  }

  function getBlockId() public view returns (uint32) {
    return getBlockIdAtTimestamp(block.timestamp);
  }

  // this function does not works for past timestamps
  function getBlockIdAtTimestamp(uint256 _timestamp) public view returns (uint32) {
    uint32 _blocksCount = blocksCount + blocksCountOffset;

    if (_blocksCount == 0) {
      return 0;
    }

    if (blocks[_blocksCount - 1].dataTimestamp + padding < _timestamp) {
      return _blocksCount;
    }

    return _blocksCount - 1;
  }

  function getLatestBlockId() public view returns (uint32) {
    return blocksCount + blocksCountOffset - 1;
  }

  // note: I think its time to move leader selection from Chain
  // we don't have anchor so we using timestamp, but timestamp if available without calling blockchain
  // I will leave this methods but it should be deprecated soon
  function getLeaderIndex(uint256 _numberOfValidators, uint256 _timestamp) public view returns (uint256) {
    uint32 latestBlockId = getLatestBlockId();

    // timePadding + 1 => because padding is a space between blocks, so next round starts on first block after padding
    uint256 validatorIndex = latestBlockId +
      (_timestamp - blocks[latestBlockId].dataTimestamp) / (padding + 1);

    return uint16(validatorIndex % _numberOfValidators);
  }

  function getNextLeaderAddress() public view returns (address) {
    return getLeaderAddressAtTime(block.timestamp + 1);
  }

  function getLeaderAddress() public view returns (address) {
    return getLeaderAddressAtTime(block.timestamp);
  }

  // @todo - properly handled non-enabled validators, newly added validators, and validators with low stake
  function getLeaderAddressAtTime(uint256 _timestamp) public view returns (address) {
    uint256 numberOfValidators = stakingBank.getNumberOfValidators();

    if (numberOfValidators == 0) {
      return address(0x0);
    }

    uint256 validatorIndex = getLeaderIndex(numberOfValidators, _timestamp);

    return stakingBank.addresses(validatorIndex);
  }

  function verifyProof(bytes32[] memory _proof, bytes32 _root, bytes32 _leaf) public pure returns (bool) {
    if (_root == bytes32(0)) {
      return false;
    }

    return MerkleProof.verify(_proof, _root, _leaf);
  }

  function hashLeaf(bytes memory _key, bytes memory _value) public pure returns (bytes32) {
    return keccak256(abi.encodePacked(_key, _value));
  }

  function verifyProofForBlock(
    uint256 _blockId,
    bytes32[] memory _proof,
    bytes memory _key,
    bytes memory _value
  ) public view returns (bool) {
    return verifyProof(_proof, blocks[_blockId].root, keccak256(abi.encodePacked(_key, _value)));
  }

  function bytesToBytes32Array(
    bytes memory _data,
    uint256 _offset,
    uint256 _items
  ) public pure returns (bytes32[] memory) {
    bytes32[] memory dataList = new bytes32[](_items);

    for (uint256 i = 0; i < _items; i++) {
      bytes32 temp;
      uint256 idx = (i + 1 + _offset) * 32;

      assembly {
        temp := mload(add(_data, idx))
      }

      dataList[i] = temp;
    }

    return (dataList);
  }

  function verifyProofs(
    uint32[] memory _blockIds,
    bytes memory _proofs,
    uint256[] memory _proofItemsCounter,
    bytes32[] memory _leaves
  ) public view returns (bool[] memory results) {
    results = new bool[](_leaves.length);
    uint256 offset = 0;

    for (uint256 i = 0; i < _leaves.length; i++) {
      results[i] = verifyProof(
        bytesToBytes32Array(_proofs, offset, _proofItemsCounter[i]),
        blocks[_blockIds[i]].root,
        _leaves[i]
      );

      offset += _proofItemsCounter[i];
    }
  }

  function getBlockRoot(uint32 _blockId) external view returns (bytes32) {
    return blocks[_blockId].root;
  }

  function getBlockTimestamp(uint32 _blockId) external view returns (uint32) {
    return blocks[_blockId].dataTimestamp;
  }

  function getCurrentValues(bytes32[] calldata _keys)
  external view returns (uint256[] memory values, uint32[] memory timestamps) {
    timestamps = new uint32[](_keys.length);
    values = new uint256[](_keys.length);

    for (uint i=0; i<_keys.length; i++) {
      FirstClassData storage numericFCD = fcds[_keys[i]];
      values[i] = uint256(numericFCD.value);
      timestamps[i] = numericFCD.dataTimestamp;
    }
  }

  function getCurrentValue(bytes32 _key) external view returns (uint256 value, uint256 timestamp) {
    FirstClassData storage numericFCD = fcds[_key];
    return (uint256(numericFCD.value), numericFCD.dataTimestamp);
  }

  // ========== EVENTS ========== //

  event LogPadding(address indexed executor, uint16 timePadding);
  event LogMint(address indexed minter, uint256 blockId, uint256 staked, uint256 power);
  event LogVoter(uint256 indexed blockId, address indexed voter, uint256 vote);
}

File 2 of 13 : MerkleProof.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev These functions deal with verification of Merkle trees (hash trees),
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        bytes32 computedHash = leaf;

        for (uint256 i = 0; i < proof.length; i++) {
            bytes32 proofElement = proof[i];

            if (computedHash <= proofElement) {
                // Hash(current computed hash + current element of the proof)
                computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
            }
        }

        // Check if the computed hash (root) is equal to the provided root
        return computedHash == root;
    }
}

File 3 of 13 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

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

File 4 of 13 : ValueDecoder.sol
//SPDX-License-Identifier: Unlicensed
pragma solidity >=0.6.8;

library ValueDecoder {
  function toUint(bytes memory _bytes) internal pure returns (uint256 value) {
    assembly {
      value := mload(add(_bytes, 32))
    }
  }

  function toUint(bytes32 _bytes) internal pure returns (uint256 value) {
    assembly {
      value := _bytes
    }
  }
}

File 5 of 13 : IStakingBank.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.8;

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

interface IStakingBank is IERC20 {
  function receiveApproval(address _from) external returns (bool success);

  function withdraw(uint256 _value) external returns (bool success);

  function create(address _id, string calldata _location) external;

  function update(address _id, string calldata _location) external;

  function addresses(uint256 _ix) external view returns (address);

  function validators(address _id) external view returns (address id, string memory location);

  function getNumberOfValidators() external view returns (uint256);
}

File 6 of 13 : Registrable.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.6.8;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "../interfaces/IRegistry.sol";
import "../interfaces/IStakingBank.sol";

abstract contract Registrable {
  IRegistry public contractRegistry;

  // ========== CONSTRUCTOR ========== //

  constructor(address _contractRegistry) internal {
    require(_contractRegistry != address(0x0), "_registry is empty");
    contractRegistry = IRegistry(_contractRegistry);
  }

  // ========== MODIFIERS ========== //

  modifier onlyFromContract(address _msgSender, bytes32 _contractName) {
    require(
      contractRegistry.getAddress(_contractName) == _msgSender,
        string(abi.encodePacked("caller is not ", _contractName))
    );
    _;
  }

  modifier withRegistrySetUp() {
    require(address(contractRegistry) != address(0x0), "_registry is empty");
    _;
  }

  // ========== VIEWS ========== //

  function getName() virtual external pure returns (bytes32);

  function stakingBankContract() public view returns (IStakingBank) {
    return IStakingBank(contractRegistry.requireAndGetAddress("StakingBank"));
  }

  function tokenContract() public view withRegistrySetUp returns (ERC20) {
    return ERC20(contractRegistry.requireAndGetAddress("UMB"));
  }
}

File 7 of 13 : Registry.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.6.8;

// Inheritance
import "@openzeppelin/contracts/access/Ownable.sol";

import "./extensions/Registrable.sol";

contract Registry is Ownable {
  mapping(bytes32 => address) public registry;

  // ========== EVENTS ========== //

  event LogRegistered(address indexed destination, bytes32 name);

  // ========== MUTATIVE FUNCTIONS ========== //

  function importAddresses(bytes32[] calldata _names, address[] calldata _destinations) external onlyOwner {
    require(_names.length == _destinations.length, "Input lengths must match");

    for (uint i = 0; i < _names.length; i++) {
      registry[_names[i]] = _destinations[i];
      emit LogRegistered(_destinations[i], _names[i]);
    }
  }

  function importContracts(address[] calldata _destinations) external onlyOwner {
    for (uint i = 0; i < _destinations.length; i++) {
      bytes32 name = Registrable(_destinations[i]).getName();
      registry[name] = _destinations[i];
      emit LogRegistered(_destinations[i], name);
    }
  }

  // ========== VIEWS ========== //

  function requireAndGetAddress(bytes32 name) external view returns (address) {
    address _foundAddress = registry[name];
    require(_foundAddress != address(0), string(abi.encodePacked("Name not registered: ", name)));
    return _foundAddress;
  }

  function getAddress(bytes32 _bytes) external view returns (address) {
    return registry[_bytes];
  }

  function getAddressByString(string memory _name) public view returns (address) {
    return registry[stringToBytes32(_name)];
  }

  function stringToBytes32(string memory _string) public pure returns (bytes32 result) {
    bytes memory tempEmptyStringTest = bytes(_string);

    if (tempEmptyStringTest.length == 0) {
      return 0x0;
    }

    assembly {
      result := mload(add(_string, 32))
    }
  }
}

File 8 of 13 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.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 GSN 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 payable) {
        return 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 9 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
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);
}

File 10 of 13 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "../../GSN/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20 {
    using SafeMath for uint256;
    using Address for address;

    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name, string memory symbol) public {
        _name = name;
        _symbol = symbol;
        _decimals = 18;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
     * called.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view returns (uint8) {
        return _decimals;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20};
     *
     * Requirements:
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal {
        _decimals = decimals_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}

File 11 of 13 : IRegistry.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.6.8;


interface IRegistry {
    function getAddress(bytes32 name) external view returns (address);

    function requireAndGetAddress(bytes32 name) external view returns (address);
}

File 12 of 13 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

File 13 of 13 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies in extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 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");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_contractRegistry","type":"address"},{"internalType":"uint16","name":"_padding","type":"uint16"},{"internalType":"uint16","name":"_requiredSignatures","type":"uint16"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"uint256","name":"blockId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"staked","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"power","type":"uint256"}],"name":"LogMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"executor","type":"address"},{"indexed":false,"internalType":"uint16","name":"timePadding","type":"uint16"}],"name":"LogPadding","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"blockId","type":"uint256"},{"indexed":true,"internalType":"address","name":"voter","type":"address"},{"indexed":false,"internalType":"uint256","name":"vote","type":"uint256"}],"name":"LogVoter","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"},{"inputs":[],"name":"ETH_PREFIX","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"blocks","outputs":[{"internalType":"bytes32","name":"root","type":"bytes32"},{"internalType":"uint32","name":"dataTimestamp","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blocksCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blocksCountOffset","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"uint256","name":"_offset","type":"uint256"},{"internalType":"uint256","name":"_items","type":"uint256"}],"name":"bytesToBytes32Array","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"contractRegistry","outputs":[{"internalType":"contract IRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"fcds","outputs":[{"internalType":"uint224","name":"value","type":"uint224"},{"internalType":"uint32","name":"dataTimestamp","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBlockId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"getBlockIdAtTimestamp","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_blockId","type":"uint32"}],"name":"getBlockRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_blockId","type":"uint32"}],"name":"getBlockTimestamp","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_key","type":"bytes32"}],"name":"getCurrentValue","outputs":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_keys","type":"bytes32[]"}],"name":"getCurrentValues","outputs":[{"internalType":"uint256[]","name":"values","type":"uint256[]"},{"internalType":"uint32[]","name":"timestamps","type":"uint32[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLatestBlockId","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLeaderAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"getLeaderAddressAtTime","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_numberOfValidators","type":"uint256"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"getLeaderIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getName","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getNextLeaderAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStatus","outputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"internalType":"uint16","name":"timePadding","type":"uint16"},{"internalType":"uint32","name":"lastDataTimestamp","type":"uint32"},{"internalType":"uint32","name":"lastBlockId","type":"uint32"},{"internalType":"address","name":"nextLeader","type":"address"},{"internalType":"uint32","name":"nextBlockId","type":"uint32"},{"internalType":"address[]","name":"validators","type":"address[]"},{"internalType":"uint256[]","name":"powers","type":"uint256[]"},{"internalType":"string[]","name":"locations","type":"string[]"},{"internalType":"uint256","name":"staked","type":"uint256"},{"internalType":"uint16","name":"minSignatures","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_key","type":"bytes"},{"internalType":"bytes","name":"_value","type":"bytes"}],"name":"hashLeaf","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"padding","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_affidavit","type":"bytes32"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"recoverSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requiredSignatures","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_padding","type":"uint16"}],"name":"setPadding","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingBank","outputs":[{"internalType":"contract IStakingBank","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingBankContract","outputs":[{"internalType":"contract IStakingBank","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_dataTimestamp","type":"uint32"},{"internalType":"bytes32","name":"_root","type":"bytes32"},{"internalType":"bytes32[]","name":"_keys","type":"bytes32[]"},{"internalType":"uint256[]","name":"_values","type":"uint256[]"},{"internalType":"uint8[]","name":"_v","type":"uint8[]"},{"internalType":"bytes32[]","name":"_r","type":"bytes32[]"},{"internalType":"bytes32[]","name":"_s","type":"bytes32[]"}],"name":"submit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenContract","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"},{"internalType":"bytes32","name":"_root","type":"bytes32"},{"internalType":"bytes32","name":"_leaf","type":"bytes32"}],"name":"verifyProof","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_blockId","type":"uint256"},{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"},{"internalType":"bytes","name":"_key","type":"bytes"},{"internalType":"bytes","name":"_value","type":"bytes"}],"name":"verifyProofForBlock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32[]","name":"_blockIds","type":"uint32[]"},{"internalType":"bytes","name":"_proofs","type":"bytes"},{"internalType":"uint256[]","name":"_proofItemsCounter","type":"uint256[]"},{"internalType":"bytes32[]","name":"_leaves","type":"bytes32[]"}],"name":"verifyProofs","outputs":[{"internalType":"bool[]","name":"results","type":"bool[]"}],"stateMutability":"view","type":"function"}]

60e06040523480156200001157600080fd5b50604051620049a0380380620049a0833981810160405281019062000037919062000538565b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415620000ab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000a29062000663565b60405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506000620000fe6200040a60201b60201c565b905080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350816004806101000a81548161ffff021916908361ffff1602179055508061ffff1660c08161ffff1660f01b8152505060008373ffffffffffffffffffffffffffffffffffffffff166321f8a7216040518163ffffffff1660e01b8152600401620002079062000685565b60206040518083038186803b1580156200022057600080fd5b505afa15801562000235573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200025b91906200050c565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156200029b576000620003a4565b60018173ffffffffffffffffffffffffffffffffffffffff166377839fe66040518163ffffffff1660e01b815260040160206040518083038186803b158015620002e457600080fd5b505afa158015620002f9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200031f91906200058e565b8273ffffffffffffffffffffffffffffffffffffffff16637353cbcb6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200036657600080fd5b505afa1580156200037b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003a191906200058e565b01015b63ffffffff1660a08163ffffffff1660e01b81525050620003ca6200041260201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250505050505062000751565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166346bcb49d6040518163ffffffff1660e01b81526004016200046e9062000648565b60206040518083038186803b1580156200048757600080fd5b505afa1580156200049c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004c291906200050c565b905090565b600081519050620004d88162000703565b92915050565b600081519050620004ef816200071d565b92915050565b600081519050620005068162000737565b92915050565b6000602082840312156200051f57600080fd5b60006200052f84828501620004c7565b91505092915050565b6000806000606084860312156200054e57600080fd5b60006200055e86828701620004c7565b93505060206200057186828701620004de565b92505060406200058486828701620004de565b9150509250925092565b600060208284031215620005a157600080fd5b6000620005b184828501620004f5565b91505092915050565b7f5374616b696e6742616e6b000000000000000000000000000000000000000000815250565b6000620005ef601283620006a0565b91507f5f726567697374727920697320656d70747900000000000000000000000000006000830152602082019050919050565b7f436861696e000000000000000000000000000000000000000000000000000000815250565b60006020820190506200065e60008301620005ba565b919050565b600060208201905081810360008301526200067e81620005e0565b9050919050565b60006020820190506200069b6000830162000622565b919050565b600082825260208201905092915050565b6000620006be82620006d3565b9050919050565b600061ffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600063ffffffff82169050919050565b6200070e81620006b1565b81146200071a57600080fd5b50565b6200072881620006c5565b81146200073457600080fd5b50565b6200074281620006f3565b81146200074e57600080fd5b50565b60805160601c60a05160e01c60c05160f01c6141d8620007c86000398061118952806113855280611d0c525080611c2d5280611c545280612077525080610a5b5280610ef15280610ff052806113a8528061144a52806115d852806116c752806117a15280612192528061225352506141d86000f3fe608060405234801561001057600080fd5b50600436106102115760003560e01c8063805d343211610125578063ca4d29d2116100ad578063e76c0b571161007c578063e76c0b5714610679578063ed9975c314610697578063ef19f3e7146106b5578063f25b3f99146106e5578063f2fde38b1461071657610211565b8063ca4d29d2146105ca578063cbb1b2c7146105fa578063d3d3ea081461062b578063d45167d01461064957610211565b8063abf410e5116100f4578063abf410e5146104eb578063adf1639d14610509578063bef9f8a11461053a578063bf66e3ba1461056a578063c3369db81461059a57610211565b8063805d3432146104615780638d068043146104915780638da5cb5b146104af5780639f6119d7146104cd57610211565b806340a9e5e3116101a857806355a373d61161017757806355a373d6146103df578063637180a8146103fd578063715018a61461041b5780637353cbcb1461042557806377839fe61461044357610211565b806340a9e5e31461034f578063485e055d1461036b5780634bc935d7146103875780634e69d560146103b757610211565b8063243b68f9116101e4578063243b68f9146102b257806324c89a49146102e257806326f3ab8b1461030057806334ba34811461033157610211565b80630f2acc3e146102165780631374df0b1461024657806317d7de7c14610264578063199dadc514610282575b600080fd5b610230600480360381019061022b9190612bfa565b610732565b60405161023d91906138b8565b60405180910390f35b61024e610765565b60405161025b9190613b06565b60405180910390f35b61026c610778565b60405161027991906138b8565b60405180910390f35b61029c60048036038101906102979190612d48565b6107a0565b6040516102a9919061389d565b60405180910390f35b6102cc60048036038101906102c79190612c66565b6107f5565b6040516102d99190613844565b60405180910390f35b6102ea610897565b6040516102f79190613941565b60405180910390f35b61031a600480360381019061031591906129ff565b6108d0565b604051610328929190613866565b60405180910390f35b610339610a59565b6040516103469190613999565b60405180910390f35b61036960048036038101906103649190612ccd565b610a7d565b005b61038560048036038101906103809190612e58565b610b81565b005b6103a1600480360381019061039c9190612a44565b6112f9565b6040516103ae919061389d565b60405180910390f35b6103bf611324565b6040516103d69b9a99989796959493929190613b65565b60405180910390f35b6103e76118cf565b6040516103f49190613963565b60405180910390f35b610405611a0e565b6040516104129190613999565b60405180910390f35b610423611abd565b005b61042d611c15565b60405161043a9190613c4e565b60405180910390f35b61044b611c2b565b6040516104589190613c4e565b60405180910390f35b61047b60048036038101906104769190612cf6565b611c4f565b6040516104889190613c4e565b60405180910390f35b610499611d0a565b6040516104a69190613b06565b60405180910390f35b6104b7611d2e565b6040516104c49190613807565b60405180910390f35b6104d5611d58565b6040516104e29190613807565b60405180910390f35b6104f3611d6b565b604051610500919061397e565b60405180910390f35b610523600480360381019061051e9190612b6e565b611d90565b604051610531929190613c25565b60405180910390f35b610554600480360381019061054f9190612e2f565b611e1d565b60405161056191906138b8565b60405180910390f35b610584600480360381019061057f9190612aab565b611e43565b6040516105919190613822565b60405180910390f35b6105b460048036038101906105af9190612e2f565b611f5a565b6040516105c19190613c4e565b60405180910390f35b6105e460048036038101906105df9190612df3565b611f90565b6040516105f19190613b4a565b60405180910390f35b610614600480360381019061060f9190612b6e565b612015565b604051610622929190613b21565b60405180910390f35b610633612071565b6040516106409190613c4e565b60405180910390f35b610663600480360381019061065e9190612b97565b6120b0565b6040516106709190613807565b60405180910390f35b61068161216d565b60405161068e9190613c4e565b60405180910390f35b61069f61217d565b6040516106ac9190613807565b60405180910390f35b6106cf60048036038101906106ca9190612cf6565b61218d565b6040516106dc9190613807565b60405180910390f35b6106ff60048036038101906106fa9190612cf6565b612304565b60405161070d9291906138d3565b60405180910390f35b610730600480360381019061072b9190612959565b612338565b005b600082826040516020016107479291906137b7565b60405160208183030381529060405280519060200120905092915050565b6004809054906101000a900461ffff1681565b60007f436861696e000000000000000000000000000000000000000000000000000000905090565b60006107eb84600260008881526020019081526020016000206000015485856040516020016107d09291906137b7565b604051602081830303815290604052805190602001206112f9565b9050949350505050565b6060808267ffffffffffffffff8111801561080f57600080fd5b5060405190808252806020026020018201604052801561083e5781602001602082028036833780820191505090505b50905060008090505b8381101561088b5760008060208760018501010290508088015191508184848151811061087057fe5b60200260200101818152505050508080600101915050610847565b50809150509392505050565b6040518060400160405280601c81526020017f19457468657265756d205369676e6564204d6573736167653a0a33320000000081525081565b6060808383905067ffffffffffffffff811180156108ed57600080fd5b5060405190808252806020026020018201604052801561091c5781602001602082028036833780820191505090505b5090508383905067ffffffffffffffff8111801561093957600080fd5b506040519080825280602002602001820160405280156109685781602001602082028036833780820191505090505b50915060008090505b84849050811015610a515760006003600087878581811061098e57fe5b90506020020135815260200190815260200160002090508060000160009054906101000a90047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168483815181106109fc57fe5b60200260200101818152505080600001601c9054906101000a900463ffffffff16838381518110610a2957fe5b602002602001019063ffffffff16908163ffffffff1681525050508080600101915050610971565b509250929050565b7f000000000000000000000000000000000000000000000000000000000000000081565b610a856124ff565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0b90613aad565b60405180910390fd5b806004806101000a81548161ffff021916908361ffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167f22d3c53dc5741f3378120ad17e6ae419e28fecb3c4c2572ca0de779d825f63f482604051610b769190613b06565b60405180910390a250565b6000610b8b612071565b9050426004809054906101000a900461ffff1661ffff16600260008463ffffffff16815260200190815260200160002060010160009054906101000a900463ffffffff160163ffffffff1610610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90613a14565b60405180910390fd5b8763ffffffff16600260008363ffffffff16815260200190815260200160002060010160009054906101000a900463ffffffff1663ffffffff1610610c90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8790613ae6565b60405180910390fd5b8451865114610cd4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ccb90613a6d565b60405180910390fd5b60608888604051602001610ce99291906137db565b604051602081830303815290604052905060008090505b8751811015610edb57868181518110610d1557fe5b6020026020010151878281518110610d2957fe5b60200260200101517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1614610d8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d86906139f4565b60405180910390fd5b6040518060400160405280888381518110610da657fe5b60200260200101517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1681526020018b63ffffffff16815250600360008a8481518110610deb57fe5b6020026020010151815260200190815260200160002060008201518160000160006101000a8154817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff02191690837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505081888281518110610e8f57fe5b6020026020010151888381518110610ea357fe5b6020026020010151604051602001610ebd9392919061377e565b60405160208183030381529060405291508080600101915050610d00565b50600081805190602001209050600080905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5557600080fd5b505afa158015610f69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8d9190612d1f565b9050600080905060008090505b8951811015611187576000610fea868c8481518110610fb557fe5b60200260200101518c8581518110610fc957fe5b60200260200101518c8681518110610fdd57fe5b60200260200101516120b0565b905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b81526004016110479190613807565b60206040518083038186803b15801561105f57600080fd5b505afa158015611073573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110979190612d1f565b90508173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1610611107576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fe90613a8d565b60405180910390fd5b819350600081141561111a57505061117a565b8173ffffffffffffffffffffffffffffffffffffffff1660018a0163ffffffff167fbac7552ab5da8d0588709ddb75aceec28520646f54bca1cc5e6e104db61935ec8360405161116a9190613b4a565b60405180910390a3808601955050505b8080600101915050610f9a565b7f000000000000000000000000000000000000000000000000000000000000000061ffff168110156111ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e5906139d4565b60405180910390fd5b60405180604001604052808e81526020018f63ffffffff168152506002600060018a0163ffffffff1681526020019081526020016000206000820151816000015560208201518160010160006101000a81548163ffffffff021916908363ffffffff1602179055509050506004600081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff160217905550503373ffffffffffffffffffffffffffffffffffffffff167f5f11830295067c4bcc7d02d4e3b048cd7427be50a3aeb6afc9d3d559ee64bcfa6001890185876040516112e193929190613c69565b60405180910390a25050505050505050505050505050565b60008060001b83141561130f576000905061131d565b61131a848484612507565b90505b9392505050565b6000806000806000806060806060600080439a506004809054906101000a900461ffff169950611352612071565b9750600260008963ffffffff16815260200190815260200160002060010160009054906101000a900463ffffffff1698507f000000000000000000000000000000000000000000000000000000000000000090507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561140c57600080fd5b505afa158015611420573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114449190612d1f565b915060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639031d9136040518163ffffffff1660e01b815260040160206040518083038186803b1580156114ae57600080fd5b505afa1580156114c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e69190612d1f565b90508067ffffffffffffffff811180156114ff57600080fd5b5060405190808252806020026020018201604052801561152e5781602001602082028036833780820191505090505b5094508067ffffffffffffffff8111801561154857600080fd5b506040519080825280602002602001820160405280156115775781602001602082028036833780820191505090505b5095508067ffffffffffffffff8111801561159157600080fd5b506040519080825280602002602001820160405280156115c557816020015b60608152602001906001900390816115b05790505b50935060008090505b81811015611880577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663edf26d9b826040518263ffffffff1660e01b815260040161162f9190613b4a565b60206040518083038186803b15801561164757600080fd5b505afa15801561165b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061167f9190612982565b87828151811061168b57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663fa52c7d888838151811061170d57fe5b60200260200101516040518263ffffffff1660e01b81526004016117319190613807565b60006040518083038186803b15801561174957600080fd5b505afa15801561175d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061178691906129ab565b905085828151811061179457fe5b60200260200101819052507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a082318883815181106117e757fe5b60200260200101516040518263ffffffff1660e01b815260040161180b9190613807565b60206040518083038186803b15801561182357600080fd5b505afa158015611837573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185b9190612d1f565b86828151811061186757fe5b60200260200101818152505080806001019150506115ce565b5061188d60014201611c4f565b96506000811161189e5760006118bf565b856118ac8260014201611f90565b815181106118b657fe5b60200260200101515b975050909192939495969798999a565b60008073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611961576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195890613a4d565b60405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166346bcb49d6040518163ffffffff1660e01b81526004016119b990613acd565b60206040518083038186803b1580156119d157600080fd5b505afa1580156119e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a099190612982565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166346bcb49d6040518163ffffffff1660e01b8152600401611a6890613a34565b60206040518083038186803b158015611a8057600080fd5b505afa158015611a94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab89190612982565b905090565b611ac56124ff565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4b90613aad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600460009054906101000a900463ffffffff1681565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000807f0000000000000000000000000000000000000000000000000000000000000000600460009054906101000a900463ffffffff1601905060008163ffffffff161415611ca2576000915050611d05565b826004809054906101000a900461ffff1661ffff16600260006001850363ffffffff16815260200190815260200160002060010160009054906101000a900463ffffffff160163ffffffff161015611cfd5780915050611d05565b600181039150505b919050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000611d666001420161218d565b905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060006003600085815260200190815260200160002090508060000160009054906101000a90047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1681600001601c9054906101000a900463ffffffff168063ffffffff1690509250925050915091565b6000600260008363ffffffff168152602001908152602001600020600001549050919050565b6060815167ffffffffffffffff81118015611e5d57600080fd5b50604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b509050600080905060008090505b8351811015611f5057611f0d611ec48784888581518110611eb757fe5b60200260200101516107f5565b600260008a8581518110611ed457fe5b602002602001015163ffffffff16815260200190815260200160002060000154868481518110611f0057fe5b60200260200101516112f9565b838281518110611f1957fe5b602002602001019015159081151581525050848181518110611f3757fe5b6020026020010151820191508080600101915050611e9a565b5050949350505050565b6000600260008363ffffffff16815260200190815260200160002060010160009054906101000a900463ffffffff169050919050565b600080611f9b612071565b9050600060016004809054906101000a900461ffff160161ffff16600260008463ffffffff16815260200190815260200160002060010160009054906101000a900463ffffffff1663ffffffff16850381611ff257fe5b048263ffffffff1601905084818161200657fe5b0661ffff169250505092915050565b60036020528060005260406000206000915090508060000160009054906101000a90047bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169080600001601c9054906101000a900463ffffffff16905082565b600060017f0000000000000000000000000000000000000000000000000000000000000000600460009054906101000a900463ffffffff160103905090565b6000806040518060400160405280601c81526020017f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250866040516020016120fb929190613756565b6040516020818303038152906040528051906020012090506001818686866040516000815260200160405260405161213694939291906138fc565b6020604051602081039080840390855afa158015612158573d6000803e3d6000fd5b50505060206040510351915050949350505050565b600061217842611c4f565b905090565b60006121884261218d565b905090565b6000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639031d9136040518163ffffffff1660e01b815260040160206040518083038186803b1580156121f657600080fd5b505afa15801561220a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061222e9190612d1f565b905060008114156122435760009150506122ff565b600061224f8285611f90565b90507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663edf26d9b826040518263ffffffff1660e01b81526004016122aa9190613b4a565b60206040518083038186803b1580156122c257600080fd5b505afa1580156122d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122fa9190612982565b925050505b919050565b60026020528060005260406000206000915090508060000154908060010160009054906101000a900463ffffffff16905082565b6123406124ff565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146123cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123c690613aad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561243f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612436906139b4565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b60008082905060008090505b85518110156125a557600086828151811061252a57fe5b6020026020010151905080831161256b57828160405160200161254e92919061372a565b604051602081830303815290604052805190602001209250612597565b808360405160200161257e92919061372a565b6040516020818303038152906040528051906020012092505b508080600101915050612513565b508381149150509392505050565b6000813590506125c281614118565b92915050565b6000815190506125d781614118565b92915050565b60008083601f8401126125ef57600080fd5b8235905067ffffffffffffffff81111561260857600080fd5b60208301915083602082028301111561262057600080fd5b9250929050565b600082601f83011261263857600080fd5b813561264b61264682613ccd565b613ca0565b9150818183526020840193506020810190508385602084028201111561267057600080fd5b60005b838110156126a057816126868882612833565b845260208401935060208301925050600181019050612673565b5050505092915050565b600082601f8301126126bb57600080fd5b81356126ce6126c982613cf5565b613ca0565b915081818352602084019350602081019050838560208402820111156126f357600080fd5b60005b8381101561272357816127098882612905565b8452602084019350602083019250506001810190506126f6565b5050505092915050565b600082601f83011261273e57600080fd5b813561275161274c82613d1d565b613ca0565b9150818183526020840193506020810190508385602084028201111561277657600080fd5b60005b838110156127a6578161278c888261292f565b845260208401935060208301925050600181019050612779565b5050505092915050565b600082601f8301126127c157600080fd5b81356127d46127cf82613d45565b613ca0565b915081818352602084019350602081019050838560208402820111156127f957600080fd5b60005b83811015612829578161280f8882612944565b8452602084019350602083019250506001810190506127fc565b5050505092915050565b6000813590506128428161412f565b92915050565b600082601f83011261285957600080fd5b813561286c61286782613d6d565b613ca0565b9150808252602083016020830185838301111561288857600080fd5b612893838284614092565b50505092915050565b600082601f8301126128ad57600080fd5b81516128c06128bb82613d99565b613ca0565b915080825260208301602083018583830111156128dc57600080fd5b6128e78382846140a1565b50505092915050565b6000813590506128ff81614146565b92915050565b6000813590506129148161415d565b92915050565b6000815190506129298161415d565b92915050565b60008135905061293e81614174565b92915050565b6000813590506129538161418b565b92915050565b60006020828403121561296b57600080fd5b6000612979848285016125b3565b91505092915050565b60006020828403121561299457600080fd5b60006129a2848285016125c8565b91505092915050565b600080604083850312156129be57600080fd5b60006129cc858286016125c8565b925050602083015167ffffffffffffffff8111156129e957600080fd5b6129f58582860161289c565b9150509250929050565b60008060208385031215612a1257600080fd5b600083013567ffffffffffffffff811115612a2c57600080fd5b612a38858286016125dd565b92509250509250929050565b600080600060608486031215612a5957600080fd5b600084013567ffffffffffffffff811115612a7357600080fd5b612a7f86828701612627565b9350506020612a9086828701612833565b9250506040612aa186828701612833565b9150509250925092565b60008060008060808587031215612ac157600080fd5b600085013567ffffffffffffffff811115612adb57600080fd5b612ae78782880161272d565b945050602085013567ffffffffffffffff811115612b0457600080fd5b612b1087828801612848565b935050604085013567ffffffffffffffff811115612b2d57600080fd5b612b39878288016126aa565b925050606085013567ffffffffffffffff811115612b5657600080fd5b612b6287828801612627565b91505092959194509250565b600060208284031215612b8057600080fd5b6000612b8e84828501612833565b91505092915050565b60008060008060808587031215612bad57600080fd5b6000612bbb87828801612833565b9450506020612bcc87828801612944565b9350506040612bdd87828801612833565b9250506060612bee87828801612833565b91505092959194509250565b60008060408385031215612c0d57600080fd5b600083013567ffffffffffffffff811115612c2757600080fd5b612c3385828601612848565b925050602083013567ffffffffffffffff811115612c5057600080fd5b612c5c85828601612848565b9150509250929050565b600080600060608486031215612c7b57600080fd5b600084013567ffffffffffffffff811115612c9557600080fd5b612ca186828701612848565b9350506020612cb286828701612905565b9250506040612cc386828701612905565b9150509250925092565b600060208284031215612cdf57600080fd5b6000612ced848285016128f0565b91505092915050565b600060208284031215612d0857600080fd5b6000612d1684828501612905565b91505092915050565b600060208284031215612d3157600080fd5b6000612d3f8482850161291a565b91505092915050565b60008060008060808587031215612d5e57600080fd5b6000612d6c87828801612905565b945050602085013567ffffffffffffffff811115612d8957600080fd5b612d9587828801612627565b935050604085013567ffffffffffffffff811115612db257600080fd5b612dbe87828801612848565b925050606085013567ffffffffffffffff811115612ddb57600080fd5b612de787828801612848565b91505092959194509250565b60008060408385031215612e0657600080fd5b6000612e1485828601612905565b9250506020612e2585828601612905565b9150509250929050565b600060208284031215612e4157600080fd5b6000612e4f8482850161292f565b91505092915050565b600080600080600080600060e0888a031215612e7357600080fd5b6000612e818a828b0161292f565b9750506020612e928a828b01612833565b965050604088013567ffffffffffffffff811115612eaf57600080fd5b612ebb8a828b01612627565b955050606088013567ffffffffffffffff811115612ed857600080fd5b612ee48a828b016126aa565b945050608088013567ffffffffffffffff811115612f0157600080fd5b612f0d8a828b016127b0565b93505060a088013567ffffffffffffffff811115612f2a57600080fd5b612f368a828b01612627565b92505060c088013567ffffffffffffffff811115612f5357600080fd5b612f5f8a828b01612627565b91505092959891949750929550565b6000612f7a8383612ffa565b60208301905092915050565b6000612f928383613263565b60208301905092915050565b6000612faa8383613281565b60208301905092915050565b6000612fc2838361334d565b905092915050565b6000612fd683836136a2565b60208301905092915050565b6000612fee83836136e6565b60208301905092915050565b61300381613f6f565b82525050565b61301281613f6f565b82525050565b600061302382613e25565b61302d8185613ecb565b935061303883613dc5565b8060005b838110156130695781516130508882612f6e565b975061305b83613e7d565b92505060018101905061303c565b5085935050505092915050565b600061308182613e30565b61308b8185613edc565b935061309683613dd5565b8060005b838110156130c75781516130ae8882612f86565b97506130b983613e8a565b92505060018101905061309a565b5085935050505092915050565b60006130df82613e3b565b6130e98185613eed565b93506130f483613de5565b8060005b8381101561312557815161310c8882612f9e565b975061311783613e97565b9250506001810190506130f8565b5085935050505092915050565b600061313d82613e46565b6131478185613efe565b93508360208202850161315985613df5565b8060005b8581101561319557848403895281516131768582612fb6565b945061318183613ea4565b925060208a0199505060018101905061315d565b50829750879550505050505092915050565b60006131b282613e51565b6131bc8185613f0f565b93506131c783613e05565b8060005b838110156131f85781516131df8882612fca565b97506131ea83613eb1565b9250506001810190506131cb565b5085935050505092915050565b600061321082613e5c565b61321a8185613f20565b935061322583613e15565b8060005b8381101561325657815161323d8882612fe2565b975061324883613ebe565b925050600181019050613229565b5085935050505092915050565b61326c81613f81565b82525050565b61327b81613f81565b82525050565b61328a81613f8d565b82525050565b61329981613f8d565b82525050565b6132b06132ab82613f8d565b6140d4565b82525050565b60006132c182613e67565b6132cb8185613f31565b93506132db8185602086016140a1565b6132e4816140fa565b840191505092915050565b60006132fa82613e67565b6133048185613f42565b93506133148185602086016140a1565b80840191505092915050565b61332981614014565b82525050565b61333881614038565b82525050565b6133478161405c565b82525050565b600061335882613e72565b6133628185613f4d565b93506133728185602086016140a1565b61337b816140fa565b840191505092915050565b6000613393602683613f5e565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006133f9601583613f5e565b91507f6e6f7420656e6f756768207369676e61747572657300000000000000000000006000830152602082019050919050565b6000613439600c83613f5e565b91507f464344206f766572666c6f7700000000000000000000000000000000000000006000830152602082019050919050565b6000613479600b83613f5e565b91507f646f206e6f74207370616d0000000000000000000000000000000000000000006000830152602082019050919050565b7f5374616b696e6742616e6b000000000000000000000000000000000000000000815250565b60006134df601283613f5e565b91507f5f726567697374727920697320656d70747900000000000000000000000000006000830152602082019050919050565b600061351f602783613f5e565b91507f6e756d62657273206f66206b65797320616e642076616c756573206e6f74207460008301527f68652073616d65000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613585602183613f5e565b91507f76616c696461746f7220696e636c75646564206d6f7265207468616e206f6e6360008301527f65000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006135eb602083613f5e565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b7f554d420000000000000000000000000000000000000000000000000000000000815250565b6000613651601983613f5e565b91507f63616e204e4f54207375626d6974206f6c6465722064617461000000000000006000830152602082019050919050565b61368d81613f97565b82525050565b61369c81613fc5565b82525050565b6136ab81613fed565b82525050565b6136ba81613fed565b82525050565b6136d16136cc82613fed565b6140de565b82525050565b6136e081614080565b82525050565b6136ef81613ff7565b82525050565b6136fe81613ff7565b82525050565b61371561371082613ff7565b6140e8565b82525050565b61372481614007565b82525050565b6000613736828561329f565b602082019150613746828461329f565b6020820191508190509392505050565b600061376282856132ef565b915061376e828461329f565b6020820191508190509392505050565b600061378a82866132ef565b9150613796828561329f565b6020820191506137a682846136c0565b602082019150819050949350505050565b60006137c382856132ef565b91506137cf82846132ef565b91508190509392505050565b60006137e78285613704565b6004820191506137f7828461329f565b6020820191508190509392505050565b600060208201905061381c6000830184613009565b92915050565b6000602082019050818103600083015261383c8184613076565b905092915050565b6000602082019050818103600083015261385e81846130d4565b905092915050565b6000604082019050818103600083015261388081856131a7565b905081810360208301526138948184613205565b90509392505050565b60006020820190506138b26000830184613272565b92915050565b60006020820190506138cd6000830184613290565b92915050565b60006040820190506138e86000830185613290565b6138f560208301846136f5565b9392505050565b60006080820190506139116000830187613290565b61391e602083018661371b565b61392b6040830185613290565b6139386060830184613290565b95945050505050565b6000602082019050818103600083015261395b81846132b6565b905092915050565b60006020820190506139786000830184613320565b92915050565b6000602082019050613993600083018461332f565b92915050565b60006020820190506139ae600083018461333e565b92915050565b600060208201905081810360008301526139cd81613386565b9050919050565b600060208201905081810360008301526139ed816133ec565b9050919050565b60006020820190508181036000830152613a0d8161342c565b9050919050565b60006020820190508181036000830152613a2d8161346c565b9050919050565b6000602082019050613a48600083016134ac565b919050565b60006020820190508181036000830152613a66816134d2565b9050919050565b60006020820190508181036000830152613a8681613512565b9050919050565b60006020820190508181036000830152613aa681613578565b9050919050565b60006020820190508181036000830152613ac6816135de565b9050919050565b6000602082019050613ae16000830161361e565b919050565b60006020820190508181036000830152613aff81613644565b9050919050565b6000602082019050613b1b6000830184613684565b92915050565b6000604082019050613b366000830185613693565b613b4360208301846136f5565b9392505050565b6000602082019050613b5f60008301846136b1565b92915050565b600061016082019050613b7b600083018e6136b1565b613b88602083018d613684565b613b95604083018c6136f5565b613ba2606083018b6136f5565b613baf608083018a613009565b613bbc60a08301896136f5565b81810360c0830152613bce8188613018565b905081810360e0830152613be281876131a7565b9050818103610100830152613bf78186613132565b9050613c076101208301856136b1565b613c15610140830184613684565b9c9b505050505050505050505050565b6000604082019050613c3a60008301856136b1565b613c4760208301846136b1565b9392505050565b6000602082019050613c6360008301846136f5565b92915050565b6000606082019050613c7e60008301866136d7565b613c8b60208301856136b1565b613c9860408301846136b1565b949350505050565b6000604051905081810181811067ffffffffffffffff82111715613cc357600080fd5b8060405250919050565b600067ffffffffffffffff821115613ce457600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115613d0c57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115613d3457600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115613d5c57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115613d8457600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff821115613db057600080fd5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613f7a82613fa5565b9050919050565b60008115159050919050565b6000819050919050565b600061ffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b600061401f82614026565b9050919050565b600061403182613fa5565b9050919050565b60006140438261404a565b9050919050565b600061405582613fa5565b9050919050565b60006140678261406e565b9050919050565b600061407982613fa5565b9050919050565b600061408b82613ff7565b9050919050565b82818337600083830152505050565b60005b838110156140bf5780820151818401526020810190506140a4565b838111156140ce576000848401525b50505050565b6000819050919050565b6000819050919050565b60006140f38261410b565b9050919050565b6000601f19601f8301169050919050565b60008160e01b9050919050565b61412181613f6f565b811461412c57600080fd5b50565b61413881613f8d565b811461414357600080fd5b50565b61414f81613f97565b811461415a57600080fd5b50565b61416681613fed565b811461417157600080fd5b50565b61417d81613ff7565b811461418857600080fd5b50565b61419481614007565b811461419f57600080fd5b5056fea2646970667358221220b52be7b9c4399593a5977db94db253355bbe4d89d5e2aa46990f8a6ab37553b364736f6c634300060800330000000000000000000000008f98d3b5c911206c1ac08b9938875620a03bcd59000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000002

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

0000000000000000000000008f98d3b5c911206c1ac08b9938875620a03bcd59000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000002
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000008f98d3b5c911206c1ac08b9938875620a03bcd59
Arg [1] : 000000000000000000000000000000000000000000000000000000000000003c
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000002


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