Contract 0xb51f46de65c00989e5f315686d80674477d15436

Contract Overview

Balance:
0 BNB

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f0470Compound Reinves...94151302021-06-03 17:50:35109 days 2 hrs ago0xed94e0c100689e4c423d494f1dfb08ca24441acf IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01055497
0x94cbf758c1a429308d415aef192d6735262ba3dc9a5008c4ea9bbb97f5506325Compound Reinves...94151302021-06-03 17:50:35109 days 2 hrs ago0xed94e0c100689e4c423d494f1dfb08ca24441acf IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01522183
0x657478dc9e7b5e167e6ac3aef3286524c7b27494101526e0fb76a12aa9af21f5Compound Reinves...94149102021-06-03 17:39:35109 days 2 hrs ago0x54994d2a72e67a0079e515959bdedd1743baf110 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01522161
0xdcae86e0121e653dac02e657be17ab5760cbde6b2f036244d440b5fef2e0c86bCompound Reinves...93782262021-06-02 11:03:54110 days 9 hrs ago0x9b1d0b78407955105e182946637deb181782ffbb IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01537195
0x2dcd776187a8c46ad82c0def96089a85e049f41bbb83d874c9499a15d92a8e34Compound Reinves...89688072021-05-19 4:36:08124 days 15 hrs ago0x7417e3bcde8726908895152a8f3925a756b1894d IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.0154112
0x040672ee67598a649593f13bc19e9ee2f7bf10129fbc93b3be4d3b48fb51b102Compound Reinves...89611292021-05-18 22:08:20124 days 22 hrs ago0xbf615f7dfcda9c84151d17fb41ba4984079f8ed3 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01530646
0x82af51868debe684bd858ffa39ebe468ea5d769986e01896ac6889b177a88813Compound Reinves...89533612021-05-18 15:39:56125 days 4 hrs ago0xad7f9b807bc0503aaf916650bd41d1a32e6ba66b IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01536926
0x6387132d8ec2245a4d294f97a2a1aac7153fde2eb06cb4f1d574046984553a26Compound Reinves...89494962021-05-18 12:26:41125 days 7 hrs ago0x54994d2a72e67a0079e515959bdedd1743baf110 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01548385
0x1baabcd7ae1b2240fdb5a2f0ceecbaba08d2f6ec5238dd62be3e04185c55c593Compound Reinves...89494832021-05-18 12:26:02125 days 7 hrs ago0xed94e0c100689e4c423d494f1dfb08ca24441acf IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01552585
0xe7aec5dbda1aac484345d38439412db1791c103ba3ea807cf4a4caaec923fa97Compound Reinves...88948682021-05-16 14:55:05127 days 5 hrs ago0xbf615f7dfcda9c84151d17fb41ba4984079f8ed3 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01526452
0x2f0761372a0847b4539b5bd31129a2c883aa2f92b31b96acce98255e330a3647Compound Reinves...88036252021-05-13 10:52:34130 days 9 hrs ago0xa7ef9bad8980ecb955307d11bd2f68b0eb54a09c IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01530646
0x5a07234ae2362e0c007c1ef99928c9bab5816b76bcd4ba50ab16425d64efc1bbCompound Reinves...87964902021-05-13 4:55:46130 days 15 hrs ago0xe95e75790ff1c6de1ea43bad4f78bf4918e333d2 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.00730433
0xa1927a9a4c5c47debf9b5fa04797f14aa1963489896d50947549e62427a7da06Compound Reinves...87817772021-05-12 16:39:33131 days 3 hrs ago0xb08b5eff6829fe614a0bb4be4ccd2eee1306ca68 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01599808
0x4b8d224859d7b97457dc926bae82774086d8b0055387d869972ee1848f124e15Compound Reinves...87758202021-05-12 11:41:42131 days 8 hrs ago0xb08b5eff6829fe614a0bb4be4ccd2eee1306ca68 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01599808
0xa3bf526b45160fea74f5b6ce379ba930ad168d34b5219682510ae86148fba900Compound Reinves...87627752021-05-12 0:28:53131 days 19 hrs ago0xb08b5eff6829fe614a0bb4be4ccd2eee1306ca68 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01599808
0xe8865e7c9b57179bbc3c1687dfbf2c893596bc7131b953fa5cde279803ae5ddbCompound Reinves...87510282021-05-11 14:36:15132 days 5 hrs ago0xb08b5eff6829fe614a0bb4be4ccd2eee1306ca68 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01599808
0xd77ec33b4ba51f002df9592cc53177ff5df2b9dcd2dd5ec9003f2837e1c7da6bCompound Reinves...87453292021-05-11 9:51:18132 days 10 hrs ago0xb08b5eff6829fe614a0bb4be4ccd2eee1306ca68 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01599808
0x9250fde378f13dc1d1197dcd0d8d4bd7031cdbca76f17b3a745782b0f0a4341bCompound Reinves...87304882021-05-10 21:29:15132 days 22 hrs ago0xb08b5eff6829fe614a0bb4be4ccd2eee1306ca68 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01599808
0x90d9914ac0025fd89f4e30ab3cdf096b2dc4701e223866730903144ce32c067dCompound Reinves...87255252021-05-10 17:21:06133 days 2 hrs ago0xb08b5eff6829fe614a0bb4be4ccd2eee1306ca68 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01599808
0x95074612d72490dd120547442599f016bec57827e462fe877a40b67c4e614c5fCompound Reinves...87195832021-05-10 12:24:00133 days 7 hrs ago0xb08b5eff6829fe614a0bb4be4ccd2eee1306ca68 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01599798
0x725cb942ab8002a1d24b92ba2a3c8f3c55d8e51b2ac40b29a655e43481cc0359Compound Reinves...87042382021-05-09 23:36:30133 days 20 hrs ago0xb08b5eff6829fe614a0bb4be4ccd2eee1306ca68 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01599796
0x1314c285906c9eef7d973a51a0844cc7389d7fb59fe196a226cc511dacf6925dCompound Reinves...87023022021-05-09 21:59:42133 days 22 hrs ago0xb08b5eff6829fe614a0bb4be4ccd2eee1306ca68 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01599796
0x87f7d175fd5882a56f61b8d32960521616e9358988e1eaf99243c4eca6fa0f24Compound Reinves...86965132021-05-09 17:10:15134 days 3 hrs ago0xb08b5eff6829fe614a0bb4be4ccd2eee1306ca68 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01599808
0x26106d2709981153e5696d0b2f67ab5546f86d9a9758b5bcecb1cf694ec592bbCompound Reinves...86911702021-05-09 12:42:58134 days 7 hrs ago0xb08b5eff6829fe614a0bb4be4ccd2eee1306ca68 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01599808
0x84fb7b23ea63939094ba155bf11496ae58bc24677bba96afff3e910829928e27Compound Reinves...86790652021-05-09 2:37:43134 days 17 hrs ago0xb08b5eff6829fe614a0bb4be4ccd2eee1306ca68 IN  0xb51f46de65c00989e5f315686d80674477d154360 BNB0.01599796
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0x1c1d2502026a6d9719234a9895f4f4f12d974d270 BNB
0x94cbf758c1a429308d415aef192d6735262ba3dc9a5008c4ea9bbb97f550632594151302021-06-03 17:50:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0x1c1d2502026a6d9719234a9895f4f4f12d974d270 BNB
0x94cbf758c1a429308d415aef192d6735262ba3dc9a5008c4ea9bbb97f550632594151302021-06-03 17:50:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0x0cbe86fea89dc40b6d93ce4cc53202bda5a43f1c0 BNB
0x94cbf758c1a429308d415aef192d6735262ba3dc9a5008c4ea9bbb97f550632594151302021-06-03 17:50:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0xcce6041082934aa28c1dcb746890818f495819d80 BNB
0x94cbf758c1a429308d415aef192d6735262ba3dc9a5008c4ea9bbb97f550632594151302021-06-03 17:50:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0xcce6041082934aa28c1dcb746890818f495819d80 BNB
0x94cbf758c1a429308d415aef192d6735262ba3dc9a5008c4ea9bbb97f550632594151302021-06-03 17:50:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0x0cbe86fea89dc40b6d93ce4cc53202bda5a43f1c0 BNB
0x94cbf758c1a429308d415aef192d6735262ba3dc9a5008c4ea9bbb97f550632594151302021-06-03 17:50:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0xcce6041082934aa28c1dcb746890818f495819d80 BNB
0x94cbf758c1a429308d415aef192d6735262ba3dc9a5008c4ea9bbb97f550632594151302021-06-03 17:50:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0xa89eaa719d1dbbaad042311feec6c9af0103a17e0 BNB
0x94cbf758c1a429308d415aef192d6735262ba3dc9a5008c4ea9bbb97f550632594151302021-06-03 17:50:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0xa89eaa719d1dbbaad042311feec6c9af0103a17e0 BNB
0x94cbf758c1a429308d415aef192d6735262ba3dc9a5008c4ea9bbb97f550632594151302021-06-03 17:50:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0x1c1d2502026a6d9719234a9895f4f4f12d974d270 BNB
0x657478dc9e7b5e167e6ac3aef3286524c7b27494101526e0fb76a12aa9af21f594149102021-06-03 17:39:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0x1c1d2502026a6d9719234a9895f4f4f12d974d270 BNB
0x657478dc9e7b5e167e6ac3aef3286524c7b27494101526e0fb76a12aa9af21f594149102021-06-03 17:39:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0x0cbe86fea89dc40b6d93ce4cc53202bda5a43f1c0 BNB
0x657478dc9e7b5e167e6ac3aef3286524c7b27494101526e0fb76a12aa9af21f594149102021-06-03 17:39:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0xcce6041082934aa28c1dcb746890818f495819d80 BNB
0x657478dc9e7b5e167e6ac3aef3286524c7b27494101526e0fb76a12aa9af21f594149102021-06-03 17:39:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0xcce6041082934aa28c1dcb746890818f495819d80 BNB
0x657478dc9e7b5e167e6ac3aef3286524c7b27494101526e0fb76a12aa9af21f594149102021-06-03 17:39:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0x0cbe86fea89dc40b6d93ce4cc53202bda5a43f1c0 BNB
0x657478dc9e7b5e167e6ac3aef3286524c7b27494101526e0fb76a12aa9af21f594149102021-06-03 17:39:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0xcce6041082934aa28c1dcb746890818f495819d80 BNB
0x657478dc9e7b5e167e6ac3aef3286524c7b27494101526e0fb76a12aa9af21f594149102021-06-03 17:39:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0xa89eaa719d1dbbaad042311feec6c9af0103a17e0 BNB
0x657478dc9e7b5e167e6ac3aef3286524c7b27494101526e0fb76a12aa9af21f594149102021-06-03 17:39:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0xa89eaa719d1dbbaad042311feec6c9af0103a17e0 BNB
0x657478dc9e7b5e167e6ac3aef3286524c7b27494101526e0fb76a12aa9af21f594149102021-06-03 17:39:35109 days 2 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0x1c1d2502026a6d9719234a9895f4f4f12d974d270 BNB
0xdcae86e0121e653dac02e657be17ab5760cbde6b2f036244d440b5fef2e0c86b93782262021-06-02 11:03:54110 days 9 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0x1c1d2502026a6d9719234a9895f4f4f12d974d270 BNB
0xdcae86e0121e653dac02e657be17ab5760cbde6b2f036244d440b5fef2e0c86b93782262021-06-02 11:03:54110 days 9 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0x0cbe86fea89dc40b6d93ce4cc53202bda5a43f1c0 BNB
0xdcae86e0121e653dac02e657be17ab5760cbde6b2f036244d440b5fef2e0c86b93782262021-06-02 11:03:54110 days 9 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0xcce6041082934aa28c1dcb746890818f495819d80 BNB
0xdcae86e0121e653dac02e657be17ab5760cbde6b2f036244d440b5fef2e0c86b93782262021-06-02 11:03:54110 days 9 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0xcce6041082934aa28c1dcb746890818f495819d80 BNB
0xdcae86e0121e653dac02e657be17ab5760cbde6b2f036244d440b5fef2e0c86b93782262021-06-02 11:03:54110 days 9 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0x0cbe86fea89dc40b6d93ce4cc53202bda5a43f1c0 BNB
0xdcae86e0121e653dac02e657be17ab5760cbde6b2f036244d440b5fef2e0c86b93782262021-06-02 11:03:54110 days 9 hrs ago 0xb51f46de65c00989e5f315686d80674477d15436 0xcce6041082934aa28c1dcb746890818f495819d80 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LiquidityMineReinvest

Compiler Version
v0.6.6+commit.6c089d02

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 17 : LPReinvest.sol
pragma solidity >=0.6.6;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/upgrades/contracts/Initializable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import '@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol';

import "../interfaces/ILiquidityMine.sol";
import "../interfaces/IDAO.sol";
import "../interfaces/IStabilizerNode.sol";
import "../interfaces/IMaltPoolPeriphery.sol";
import "../libraries/UniswapV2Library.sol";

struct ReinvestRebalance {
  uint256 rewardRemoval;
  uint256 maltRemoval;
  uint256 excess;
  uint256 minMalt;
  uint256 minReward;
}

contract LiquidityMineReinvest is Initializable {
  using SafeMath for uint256;
  using SafeERC20 for ERC20;

  ERC20 public malt;
  ERC20 public rewardToken;
  ERC20 public stakeToken;
  ILiquidityMine public liquidityMine;
  IDAO public dao;
  IMaltPoolPeriphery public maltPoolPeriphery;
  IUniswapV2Router02 public router;
  IStabilizerNode public stabilizerNode;

  event ReinvestReward(address account, uint256 reward, uint256 desiredMalt);
  event ReinvestMalt(address account, uint256 malt, uint256 desiredReward);
  event SplitReinvest(address account, uint256 amountReward, uint256 lpTokens);
  event SubsidizedReinvest(address account, uint256 amountReward, uint256 liquidity);

  function initialize(
    address _lpmine,
    address _dao,
    address _maltToken,
    address _rewardToken,
    address _periphery,
    address _router,
    address _stabilizerNode,
    address _uniswapV2Factory
  ) external initializer {
    liquidityMine = ILiquidityMine(_lpmine);
    dao = IDAO(_dao);
    malt = ERC20(_maltToken);
    rewardToken = ERC20(_rewardToken);
    maltPoolPeriphery = IMaltPoolPeriphery(_periphery);
    router = IUniswapV2Router02(_router);
    stabilizerNode = IStabilizerNode(_stabilizerNode);

    stakeToken = ERC20(UniswapV2Library.pairFor(_uniswapV2Factory, _maltToken, _rewardToken));
  }

  function reinvestReward(uint256 rewardLiquidity, uint256 desiredMalt) external {
    require(rewardLiquidity > 0, "Cannot reinvest 0");
    _verifyReinvest(desiredMalt, rewardLiquidity);

    uint256 maltLiquidity = maltPoolPeriphery.getOptimalLiquidity(address(malt), address(rewardToken), rewardLiquidity);

    liquidityMine.transferExcessMalt(msg.sender, maltLiquidity, desiredMalt);

    liquidityMine.reinvestLiquidity(msg.sender, maltLiquidity, rewardLiquidity, true, desiredMalt);

    emit ReinvestReward(msg.sender, rewardLiquidity, desiredMalt);
  }

  function reinvestMalt(uint256 maltLiquidity, uint256 desiredReward) external {
    require(maltLiquidity > 0, "Cannot reinvest 0");
    _verifyReinvest(maltLiquidity, desiredReward);

    uint256 rewardLiquidity = maltPoolPeriphery.getOptimalLiquidity(address(rewardToken), address(malt), maltLiquidity);

    liquidityMine.transferExcessReward(msg.sender, rewardLiquidity, desiredReward);

    liquidityMine.reinvestLiquidity(msg.sender, maltLiquidity, rewardLiquidity, false, desiredReward);

    emit ReinvestMalt(msg.sender, maltLiquidity, desiredReward);
  }

  function compoundReinvest(uint256 rewardLiquidity) external {
    require(rewardLiquidity > 0, "Cannot reinvest 0");
    _verifyReinvest(0, rewardLiquidity);

    rewardToken.safeTransferFrom(address(liquidityMine), address(this), rewardLiquidity);

    rewardToken.approve(address(router), rewardLiquidity);

    address[] memory path = new address[](2);
    path[0] = address(rewardToken);
    path[1] = address(malt);

    uint256 initialBalance = malt.balanceOf(address(this));

    router.swapExactTokensForTokens(
      rewardLiquidity.div(2),
      0, 
      path,
      address(this),
      now
    );

    uint256 finalBalance = malt.balanceOf(address(this));
    uint256 maltLiquidity = finalBalance - initialBalance;

    malt.approve(address(router), maltLiquidity);

    ReinvestRebalance memory rebalance = ReinvestRebalance({
      rewardRemoval: rewardLiquidity,
      maltRemoval: 0,
      excess: 0,
      minMalt: maltLiquidity.mul(95).div(100),
      minReward: rewardLiquidity.div(2).mul(95).div(100)
    });

    (,,uint256 liquidity) = router.addLiquidity(
      address(malt),
      address(rewardToken),
      maltLiquidity,
      rewardLiquidity.div(2),
      rebalance.minMalt,
      rebalance.minReward,
      address(liquidityMine),
      now
    );

    liquidityMine.updateBond(msg.sender, rebalance.rewardRemoval, 0, liquidity);

    emit SplitReinvest(msg.sender, rewardLiquidity, liquidity);
  }

  function subsidizedReinvest(uint256 rewardLiquidity) external {
    // This can only be called in the first week after launch
    require(dao.epoch() <= 336, "Only first 336 epochs");

    _verifyReinvest(0, rewardLiquidity);

    rewardToken.safeTransferFrom(address(liquidityMine), address(this), rewardLiquidity);

    uint256 maltLiquidity = maltPoolPeriphery.getOptimalLiquidity(address(malt), address(rewardToken), rewardLiquidity);

    liquidityMine.requestMint(maltLiquidity);

    malt.approve(address(router), maltLiquidity);
    rewardToken.approve(address(router), rewardLiquidity);

    (
      uint256 amountReward,
      uint256 amountMalt,
      uint256 liquidity
    ) = router.addLiquidity(
      address(rewardToken),
      address(malt),
      rewardLiquidity,
      maltLiquidity,
      rewardLiquidity.mul(95).div(100), // 5% slippage
      maltLiquidity.mul(95).div(100), // 5% slippage
      address(liquidityMine),
      now
    );

    if (amountReward < rewardLiquidity) {
      rewardToken.transfer(address(liquidityMine), rewardLiquidity - amountReward);
    }

    if (amountMalt < maltLiquidity) {
      // TODO  deal with Tue 20 Apr 2021 01:22:58 BST
      uint256 burnAmount = maltLiquidity.sub(amountMalt);
      liquidityMine.requestBurn(burnAmount);
    }

    liquidityMine.finalizeSubsidy(msg.sender, amountReward, liquidity);

    emit SubsidizedReinvest(msg.sender, rewardLiquidity, liquidity);
  }

  function _verifyReinvest(uint256 maltAmount, uint256 rewardAmount) internal view {
    // rewardLiquidity is the amount of reward to reinvest
    // desiredMalt is the amount of malt rewards to also put towards the reinvest.
    // The rest of the malt will need to be transfered from the accounts wallet
    (uint256 rewardEarned, uint256 maltEarned) = liquidityMine.earned(msg.sender);

    require(rewardAmount <= rewardEarned, "Cannot reinvest more than earned");
    require(maltAmount <= maltEarned, "Cannot reinvest more than earned");
  }
}

File 2 of 17 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.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 3 of 17 : Initializable.sol
pragma solidity >=0.4.24 <0.7.0;


/**
 * @title Initializable
 *
 * @dev Helper contract to support initializer functions. To use it, replace
 * the constructor with a function that has the `initializer` modifier.
 * WARNING: Unlike constructors, initializer functions must be manually
 * invoked. This applies both to deploying an Initializable contract, as well
 * as extending an Initializable contract via inheritance.
 * WARNING: When used with inheritance, manual care must be taken to not invoke
 * a parent initializer twice, or ensure that all initializers are idempotent,
 * because this is not dealt with automatically as with constructors.
 */
contract Initializable {

  /**
   * @dev Indicates that the contract has been initialized.
   */
  bool private initialized;

  /**
   * @dev Indicates that the contract is in the process of being initialized.
   */
  bool private initializing;

  /**
   * @dev Modifier to use in the initializer function of a contract.
   */
  modifier initializer() {
    require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized");

    bool isTopLevelCall = !initializing;
    if (isTopLevelCall) {
      initializing = true;
      initialized = true;
    }

    _;

    if (isTopLevelCall) {
      initializing = false;
    }
  }

  /// @dev Returns true if and only if the function is running in the constructor
  function isConstructor() private view returns (bool) {
    // extcodesize checks the size of the code stored in an address, and
    // address returns the current address. Since the code is still not
    // deployed when running a constructor, any checks on its code size will
    // yield zero, making it an effective way to detect if a contract is
    // under construction or not.
    address self = address(this);
    uint256 cs;
    assembly { cs := extcodesize(self) }
    return cs == 0;
  }

  // Reserved storage space to allow for layout changes in the future.
  uint256[50] private ______gap;
}

File 4 of 17 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../../GSN/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.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;

    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 5 of 17 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

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

File 6 of 17 : IUniswapV2Router02.sol
pragma solidity >=0.6.2;

import './IUniswapV2Router01.sol';

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountETH);
    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}

File 7 of 17 : ILiquidityMine.sol
pragma solidity >=0.6.6;

interface ILiquidityMine {
  function totalStaged() external view returns (uint256);
  function totalBonded() external view returns (uint256);
  function totalClaimable() external view returns (uint256);
  function totalRewarded() external view returns (uint256);
  function balanceOfStaged(address account) external view returns (uint256);
  function balanceOfBonded(address account) external view returns (uint256);
  function balanceOfClaimable(address account) external view returns (uint256);
  function realValueOfBonded(address account) external view returns (uint256, uint256);
  function declareReward(uint256 amount) external;
  function declareMaltReward(uint256 amount) external;
  function advance() external;
  function reinvestLiquidity(
    address account,
    uint256 liquidityMalt,
    uint256 liquidityReward,
    bool rebalanceMalt,
    uint256 otherQuantity
  ) external; 
  function transferExcessMalt(address account, uint256 requiredMalt, uint256 maltAmount) external;
  function transferExcessReward(address account, uint256 requiredReward, uint256 rewardAmount) external;
  function requestMint(uint256 amount) external;
  function requestBurn(uint256 amount) external;
  function finalizeSubsidy(address account, uint256 amountReward, uint256 liquidity) external;
  function updateBond(address account, uint256 amountReward, uint256 maltRemoval, uint256 liquidity) external;
  function earned(address account) external view returns (uint256 earnedReward, uint256 earnedMalt);
}

File 8 of 17 : IDAO.sol
pragma solidity >=0.6.6;

interface IDAO {
  function epoch() external view returns (uint256);
  function epochLength() external view returns (uint256);
  function genesisTime() external view returns (uint256);
  function getEpochStartTime(uint256 _epoch) external view returns (uint256);
  function getLockedMalt(address account) external view returns (uint256);
}

File 9 of 17 : IStabilizerNode.sol
pragma solidity >=0.6.6;

import "./IAuction.sol";

interface IStabilizerNode {
  function initialize(address dao) external;
  function requiredMint() external;
  function distributeSupply(uint256 amount) external;
  function liquidityMine() external view returns (address);
  function requestMint(uint256 amount) external;
  function requestBurn(uint256 amount) external;
  function stabilize() external;
  function auction() external view returns (IAuction);
  function auctionPreBurn(
    uint256 maxSpend,
    uint256 rRatio,
    uint256 decimals
  ) external returns (
    uint256 initialReservePledge,
    uint256 initialBurn
  );
}

File 10 of 17 : IMaltPoolPeriphery.sol
pragma solidity >=0.6.6;

interface IMaltPoolPeriphery {
  function maltMarketPrice() external view returns (uint256 price, uint256 decimals);
  function reserves() external view returns (uint256 maltSupply, uint256 rewardSupply);
  function reserveRatio() external view returns (uint256, uint256); 
  function calculateAuctionPricing(
    uint256 rRatio
  ) external returns (uint256 startingPrice, uint256 endingPrice);
  function calculateMintingTradeSize(uint256 dampingFactor) external view returns (uint256);
  function calculateBurningTradeSize() external view returns (uint256);
  function calculateFixedReward(uint256, uint256) external view returns (uint256);
  function realValueOfLPToken(uint256 amount) external view returns (uint256, uint256);
  function getOptimalLiquidity(address tokenA, address tokenB, uint256 liquidityB) external view returns (uint256 liquidityA);
}

File 11 of 17 : UniswapV2Library.sol
pragma solidity >=0.5.0;

import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol';

import "@openzeppelin/contracts/math/SafeMath.sol";

library UniswapV2Library {
    using SafeMath for uint;

    // returns sorted token addresses, used to handle return values from pairs sorted in this order
    function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
        require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
        (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
        require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
    }

    // calculates the CREATE2 address for a pair without making any external calls
    function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
        (address token0, address token1) = sortTokens(tokenA, tokenB);
        pair = address(uint(keccak256(abi.encodePacked(
                hex'ff',
                factory,
                keccak256(abi.encodePacked(token0, token1)),
                hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
            ))));
    }

    // fetches and sorts the reserves for a pair
    function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
        (address token0,) = sortTokens(tokenA, tokenB);
        (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
        (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
    }

    // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
    function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
        require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
        require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        amountB = amountA.mul(reserveB) / reserveA;
    }

    // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
        require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        uint amountInWithFee = amountIn.mul(997);
        uint numerator = amountInWithFee.mul(reserveOut);
        uint denominator = reserveIn.mul(1000).add(amountInWithFee);
        amountOut = numerator / denominator;
    }

    // given an output amount of an asset and pair reserves, returns a required input amount of the other asset
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
        require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        uint numerator = reserveIn.mul(amountOut).mul(1000);
        uint denominator = reserveOut.sub(amountOut).mul(997);
        amountIn = (numerator / denominator).add(1);
    }

    // performs chained getAmountOut calculations on any number of pairs
    function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
        require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
        amounts = new uint[](path.length);
        amounts[0] = amountIn;
        for (uint i; i < path.length - 1; i++) {
            (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
            amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
        }
    }

    // performs chained getAmountIn calculations on any number of pairs
    function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
        require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
        amounts = new uint[](path.length);
        amounts[amounts.length - 1] = amountOut;
        for (uint i = path.length - 1; i > 0; i--) {
            (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
            amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
        }
    }
}

File 12 of 17 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with 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 13 of 17 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.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 14 of 17 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @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 on 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");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        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);
            }
        }
    }
}

File 15 of 17 : IUniswapV2Router01.sol
pragma solidity >=0.6.2;

interface IUniswapV2Router01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}

File 16 of 17 : IAuction.sol
pragma solidity >=0.6.6;

interface IAuction {
  function checkAuctionFinalization() external returns (
    bool shouldFinalize,
    uint256 id
  );
  function currentAuctionId() external view returns (uint256);
  function auctionActive(uint256 _id) external view returns (bool);
  function capCommitment(
    uint256 _id,
    uint256 _commitment
  ) external view returns (
    uint256 realCommitment,
    uint256 purchaseCommitment
  );
  function commitFunds(
    uint256 _id,
    uint256 _commitment,
    uint256 _maltPurchased,
    address account
  ) external;
  function userClaimableArbTokens(
    address account,
    uint256 auctionId
  ) external view returns (uint256);
  function claimArb(
    uint256 _id,
    address account,
    uint256 amount
  ) external returns (bool);
  function claimableArbitrageRewards() external view returns (uint256);
  function setupAuctionFinalization(uint256 _id) external returns (
    uint256 averageMaltPrice,
    uint256 commitments,
    uint256 startingPrice,
    uint256 finalPrice,
    uint256 preAuctionReserveRatio,
    uint256 initialReservePledge
  );
  function allocateArbRewards(
    uint256 rewarded,
    uint256 replenishSplit
  ) external returns (uint256);
  function createAuction(uint256 pegPrice) external returns (
    uint256 initialPurchase,
    bool executeBurn
  );
  function getActiveAuction() external view returns (
    uint256 auctionId,
    uint256 maxCommitments,
    uint256 commitments,
    uint256 maltPurchased,
    uint256 startingPrice,
    uint256 endingPrice,
    uint256 finalPrice,
    uint256 pegPrice,
    uint256 startingTime,
    uint256 endingTime,
    uint256 initialReservePledge
  );
  function getAuction(uint256 id) external view returns (
    uint256 auctionId,
    uint256 maxCommitments,
    uint256 commitments,
    uint256 maltPurchased,
    uint256 startingPrice,
    uint256 endingPrice,
    uint256 finalPrice,
    uint256 pegPrice,
    uint256 startingTime,
    uint256 endingTime,
    uint256 initialReservePledge
  );
  function balanceOfArbTokens(
    uint256 auctionId,
    address account
  ) external view returns (uint256);
  function getAuctionCommitments(uint256 auctionId) external view returns (uint256, uint256);
}

File 17 of 17 : IUniswapV2Pair.sol
pragma solidity >=0.5.0;

interface IUniswapV2Pair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}

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

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"malt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"desiredReward","type":"uint256"}],"name":"ReinvestMalt","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"desiredMalt","type":"uint256"}],"name":"ReinvestReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lpTokens","type":"uint256"}],"name":"SplitReinvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"liquidity","type":"uint256"}],"name":"SubsidizedReinvest","type":"event"},{"inputs":[{"internalType":"uint256","name":"rewardLiquidity","type":"uint256"}],"name":"compoundReinvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dao","outputs":[{"internalType":"contract IDAO","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_lpmine","type":"address"},{"internalType":"address","name":"_dao","type":"address"},{"internalType":"address","name":"_maltToken","type":"address"},{"internalType":"address","name":"_rewardToken","type":"address"},{"internalType":"address","name":"_periphery","type":"address"},{"internalType":"address","name":"_router","type":"address"},{"internalType":"address","name":"_stabilizerNode","type":"address"},{"internalType":"address","name":"_uniswapV2Factory","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"liquidityMine","outputs":[{"internalType":"contract ILiquidityMine","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"malt","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maltPoolPeriphery","outputs":[{"internalType":"contract IMaltPoolPeriphery","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"maltLiquidity","type":"uint256"},{"internalType":"uint256","name":"desiredReward","type":"uint256"}],"name":"reinvestMalt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"rewardLiquidity","type":"uint256"},{"internalType":"uint256","name":"desiredMalt","type":"uint256"}],"name":"reinvestReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stabilizerNode","outputs":[{"internalType":"contract IStabilizerNode","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakeToken","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"rewardLiquidity","type":"uint256"}],"name":"subsidizedReinvest","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50611d57806100206000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063a313eebe1161008c578063d2b76f5e11610066578063d2b76f5e146101dc578063dff87bcb146101f9578063f7c618c114610201578063f887ea4014610209576100cf565b8063a313eebe146101a9578063a58214b8146101cc578063ba854990146101d4576100cf565b806339cb1826146100d45780634162169f146100f857806351ed6a30146101005780636e71ad711461010857806386e5e7171461012d5780638a29e2de1461014a575b600080fd5b6100dc610211565b604080516001600160a01b039092168252519081900360200190f35b6100dc610220565b6100dc61022f565b61012b6004803603604081101561011e57600080fd5b508035906020013561023e565b005b61012b6004803603602081101561014357600080fd5b503561045d565b61012b600480360361010081101561016157600080fd5b506001600160a01b038135811691602081013582169160408201358116916060810135821691608082013581169160a081013582169160c082013581169160e0013516610b0c565b61012b600480360360408110156101bf57600080fd5b5080359060200135610c4f565b6100dc610e6b565b6100dc610e7a565b61012b600480360360208110156101f257600080fd5b5035610e89565b6100dc611459565b6100dc611468565b6100dc611477565b6038546001600160a01b031681565b6037546001600160a01b031681565b6035546001600160a01b031681565b60008211610287576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207265696e76657374203607c1b604482015290519081900360640190fd5b6102918183611486565b60385460335460345460408051631a8cf4cf60e11b81526001600160a01b039384166004820152918316602483015260448201869052516000939290921691633519e99e91606480820192602092909190829003018186803b1580156102f657600080fd5b505afa15801561030a573d6000803e3d6000fd5b505050506040513d602081101561032057600080fd5b505160365460408051630f49287160e21b8152336004820152602481018490526044810186905290519293506001600160a01b0390911691633d24a1c49160648082019260009290919082900301818387803b15801561037f57600080fd5b505af1158015610393573d6000803e3d6000fd5b50506036546040805163a807228160e01b81523360048201526024810186905260448101889052600160648201526084810187905290516001600160a01b03909216935063a8072281925060a48082019260009290919082900301818387803b1580156103ff57600080fd5b505af1158015610413573d6000803e3d6000fd5b5050604080513381526020810187905280820186905290517fa0b64e2cf71234075e1a1d38dd1f63370729cf08764b2bf398f1c593aeaac9f29350908190036060019150a1505050565b600081116104a6576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207265696e76657374203607c1b604482015290519081900360640190fd5b6104b1600082611486565b6036546034546104d5916001600160a01b039182169116308463ffffffff6115b716565b6034546039546040805163095ea7b360e01b81526001600160a01b039283166004820152602481018590529051919092169163095ea7b39160448083019260209291908290030181600087803b15801561052e57600080fd5b505af1158015610542573d6000803e3d6000fd5b505050506040513d602081101561055857600080fd5b50506040805160028082526060808301845292602083019080368337505060345482519293506001600160a01b03169183915060009061059457fe5b6001600160a01b0392831660209182029290920101526033548251911690829060019081106105bf57fe5b6001600160a01b03928316602091820292909201810191909152603354604080516370a0823160e01b8152306004820152905160009492909216926370a0823192602480840193829003018186803b15801561061a57600080fd5b505afa15801561062e573d6000803e3d6000fd5b505050506040513d602081101561064457600080fd5b50516039549091506001600160a01b03166338ed173961066b85600263ffffffff61161116565b60008530426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03166001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156106e95781810151838201526020016106d1565b505050509050019650505050505050600060405180830381600087803b15801561071257600080fd5b505af1158015610726573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561074f57600080fd5b810190808051604051939291908464010000000082111561076f57600080fd5b90830190602082018581111561078457600080fd5b82518660208202830111640100000000821117156107a157600080fd5b82525081516020918201928201910280838360005b838110156107ce5781810151838201526020016107b6565b505050509190910160408181526033546370a0823160e01b83523060048401529051600097506001600160a01b0390911695506370a08231945060248083019450602093509091829003018186803b15801561082957600080fd5b505afa15801561083d573d6000803e3d6000fd5b505050506040513d602081101561085357600080fd5b50516033546039546040805163095ea7b360e01b81526001600160a01b0392831660048201528685036024820181905291519495509093919092169163095ea7b39160448083019260209291908290030181600087803b1580156108b657600080fd5b505af11580156108ca573d6000803e3d6000fd5b505050506040513d60208110156108e057600080fd5b506108eb9050611c2e565b6040518060a00160405280878152602001600081526020016000815260200161092f6064610923605f8761165c90919063ffffffff16565b9063ffffffff61161116565b815260200161095b6064610923605f61094f8c600263ffffffff61161116565b9063ffffffff61165c16565b90526039546033546034549293506000926001600160a01b039283169263e8e337009281169116866109948c600263ffffffff61161116565b60608089015160808a0151603654604080516001600160e01b031960e08c901b1681526001600160a01b03998a166004820152978916602489015260448801969096526064870194909452608486019190915260a4850152931660c48301524260e48301525161010480830193928290030181600087803b158015610a1857600080fd5b505af1158015610a2c573d6000803e3d6000fd5b505050506040513d6060811015610a4257600080fd5b50604090810151603654845183516316b9872560e11b815233600482015260248101919091526000604482018190526064820184905293519294506001600160a01b0390911692632d730e4a9260848084019382900301818387803b158015610aaa57600080fd5b505af1158015610abe573d6000803e3d6000fd5b505060408051338152602081018b905280820185905290517fedda17d135e3fc62086df0e0aa11f21d9bb6c8adb6fb2f4c8b7f61afe1c2ded59350908190036060019150a150505050505050565b600054610100900460ff1680610b255750610b256116b5565b80610b33575060005460ff16155b610b6e5760405162461bcd60e51b815260040180806020018281038252602e815260200180611cca602e913960400191505060405180910390fd5b600054610100900460ff16158015610b99576000805460ff1961ff0019909116610100171660011790555b603680546001600160a01b03199081166001600160a01b038c8116919091179092556037805482168b84161790556033805482168a8416179055603480548216898416179055603880548216888416179055603980548216878416179055603a8054909116918516919091179055610c128288886116bb565b603580546001600160a01b0319166001600160a01b03929092169190911790558015610c44576000805461ff00191690555b505050505050505050565b60008211610c98576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207265696e76657374203607c1b604482015290519081900360640190fd5b610ca28282611486565b60385460345460335460408051631a8cf4cf60e11b81526001600160a01b039384166004820152918316602483015260448201869052516000939290921691633519e99e91606480820192602092909190829003018186803b158015610d0757600080fd5b505afa158015610d1b573d6000803e3d6000fd5b505050506040513d6020811015610d3157600080fd5b505160365460408051637451415d60e01b8152336004820152602481018490526044810186905290519293506001600160a01b0390911691637451415d9160648082019260009290919082900301818387803b158015610d9057600080fd5b505af1158015610da4573d6000803e3d6000fd5b50506036546040805163a807228160e01b815233600482015260248101889052604481018690526000606482018190526084820188905291516001600160a01b03909316945063a8072281935060a4808201939182900301818387803b158015610e0d57600080fd5b505af1158015610e21573d6000803e3d6000fd5b5050604080513381526020810187905280820186905290517f0f3b5d485195341553ef972353e9f362f8264a4be30c7517664a879ef3518ea69350908190036060019150a1505050565b603a546001600160a01b031681565b6036546001600160a01b031681565b6037546040805163900cf0cf60e01b81529051610150926001600160a01b03169163900cf0cf916004808301926020929190829003018186803b158015610ecf57600080fd5b505afa158015610ee3573d6000803e3d6000fd5b505050506040513d6020811015610ef957600080fd5b50511115610f46576040805162461bcd60e51b81526020600482015260156024820152744f6e6c79206669727374203333362065706f63687360581b604482015290519081900360640190fd5b610f51600082611486565b603654603454610f75916001600160a01b039182169116308463ffffffff6115b716565b60385460335460345460408051631a8cf4cf60e11b81526001600160a01b039384166004820152918316602483015260448201859052516000939290921691633519e99e91606480820192602092909190829003018186803b158015610fda57600080fd5b505afa158015610fee573d6000803e3d6000fd5b505050506040513d602081101561100457600080fd5b50516036546040805163125ccf4160e21b81526004810184905290519293506001600160a01b03909116916349733d049160248082019260009290919082900301818387803b15801561105657600080fd5b505af115801561106a573d6000803e3d6000fd5b50506033546039546040805163095ea7b360e01b81526001600160a01b03928316600482015260248101879052905191909216935063095ea7b3925060448083019260209291908290030181600087803b1580156110c757600080fd5b505af11580156110db573d6000803e3d6000fd5b505050506040513d60208110156110f157600080fd5b50506034546039546040805163095ea7b360e01b81526001600160a01b039283166004820152602481018690529051919092169163095ea7b39160448083019260209291908290030181600087803b15801561114c57600080fd5b505af1158015611160573d6000803e3d6000fd5b505050506040513d602081101561117657600080fd5b5050603954603454603354600092839283926001600160a01b039283169263e8e33700928116911688886111b6606461092384605f63ffffffff61165c16565b6111cc60646109238d605f63ffffffff61165c16565b603654604080516001600160e01b031960e08b901b1681526001600160a01b039889166004820152968816602488015260448701959095526064860193909352608485019190915260a48401529290921660c48201524260e482015290516101048083019260609291908290030181600087803b15801561124c57600080fd5b505af1158015611260573d6000803e3d6000fd5b505050506040513d606081101561127657600080fd5b508051602082015160409092015190945090925090508483101561131b576034546036546040805163a9059cbb60e01b81526001600160a01b03928316600482015286890360248201529051919092169163a9059cbb9160448083019260209291908290030181600087803b1580156112ee57600080fd5b505af1158015611302573d6000803e3d6000fd5b505050506040513d602081101561131857600080fd5b50505b8382101561139f576000611335858463ffffffff61177b16565b60365460408051632f8d75e360e01b81526004810184905290519293506001600160a01b0390911691632f8d75e39160248082019260009290919082900301818387803b15801561138557600080fd5b505af1158015611399573d6000803e3d6000fd5b50505050505b60365460408051637ed3353960e11b8152336004820152602481018690526044810184905290516001600160a01b039092169163fda66a729160648082019260009290919082900301818387803b1580156113f957600080fd5b505af115801561140d573d6000803e3d6000fd5b5050604080513381526020810189905280820185905290517f398bab7bc4071f8cde0deb371e9492eb77edaa25b1b526370404d407e39b8d7b9350908190036060019150a15050505050565b6033546001600160a01b031681565b6034546001600160a01b031681565b6039546001600160a01b031681565b603654604080516246613160e11b8152336004820152815160009384936001600160a01b0390911692628cc2629260248083019392829003018186803b1580156114cf57600080fd5b505afa1580156114e3573d6000803e3d6000fd5b505050506040513d60408110156114f957600080fd5b50805160209091015190925090508183111561155c576040805162461bcd60e51b815260206004820181905260248201527f43616e6e6f74207265696e76657374206d6f7265207468616e206561726e6564604482015290519081900360640190fd5b808411156115b1576040805162461bcd60e51b815260206004820181905260248201527f43616e6e6f74207265696e76657374206d6f7265207468616e206561726e6564604482015290519081900360640190fd5b50505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526115b19085906117bd565b600061165383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611873565b90505b92915050565b60008261166b57506000611656565b8282028284828161167857fe5b04146116535760405162461bcd60e51b8152600401808060200182810382526021815260200180611ca96021913960400191505060405180910390fd5b303b1590565b60008060006116ca8585611917565b604080516bffffffffffffffffffffffff19606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501206001600160f81b031960688401529a90941b9093166069840152607d8301989098527f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b600061165383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506119f5565b6060611812826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a4f9092919063ffffffff16565b80519091501561186e5780806020019051602081101561183157600080fd5b505161186e5760405162461bcd60e51b815260040180806020018281038252602a815260200180611cf8602a913960400191505060405180910390fd5b505050565b600081836118ff5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156118c45781810151838201526020016118ac565b50505050905090810190601f1680156118f15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161190b57fe5b049150505b9392505050565b600080826001600160a01b0316846001600160a01b0316141561196b5760405162461bcd60e51b8152600401808060200182810382526025815260200180611c5e6025913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b03161061198b57828461198e565b83835b90925090506001600160a01b0382166119ee576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b9250929050565b60008184841115611a475760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156118c45781810151838201526020016118ac565b505050900390565b6060611a5e8484600085611a66565b949350505050565b606082471015611aa75760405162461bcd60e51b8152600401808060200182810382526026815260200180611c836026913960400191505060405180910390fd5b611ab085611bc2565b611b01576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310611b405780518252601f199092019160209182019101611b21565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611ba2576040519150601f19603f3d011682016040523d82523d6000602084013e611ba7565b606091505b5091509150611bb7828286611bc8565b979650505050505050565b3b151590565b60608315611bd7575081611910565b825115611be75782518084602001fd5b60405162461bcd60e51b81526020600482018181528451602484015284518593919283926044019190850190808383600083156118c45781810151838201526020016118ac565b6040518060a001604052806000815260200160008152602001600081526020016000815260200160008152509056fe556e697377617056324c6962726172793a204944454e544943414c5f414444524553534553416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a65645361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220a960071a2ebed16152b64f64ac76118fb1e9266aef5199cb22af858db380a16164736f6c63430006060033

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