Contract 0x5820790a4f100b6d53bf046fde2288f70687ea4d

Contract Overview

Balance:
0 BNB
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x30bef239416a3a6036d18bd2636f18e8de290811906936f84cfd2365dd3f0d34Advance90924172021-05-23 12:01:00120 days 9 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0xd26cc77f91b76e32d485ec03de04d17be8e68b15064d4cd402e912aebe0f4defAdvance90918162021-05-23 11:30:57120 days 9 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0xc52a25fabb075e990f18a3235a9452a08506b2ec2779673e245be76a855bbe43Advance90912212021-05-23 11:01:12120 days 10 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0x8f7d27342c0251d269b4b6410712da65065ea5bc98f493a1fcf4f28953e43ef3Advance90906142021-05-23 10:30:51120 days 10 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0xe95409b523478c2a4382c609922ce5d4c2143f0c74a29965ec00995be9078a6eAdvance90900202021-05-23 10:01:09120 days 11 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0xb0f2bf720836d275f3ca94054fb2cba90ab3e67de494e8a145475a8405a83d2fAdvance90894252021-05-23 9:31:24120 days 11 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0xb58c9fe904c79240bc37e155fc1be1ac4cd5269f159ca8e9437ade0ba71f2df4Advance90888182021-05-23 9:01:03120 days 12 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0x4a3daa62809450cc897159cf41c182530c17ecc7042180f283ef0d353a64c065Advance90882242021-05-23 8:31:21120 days 12 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0x60e16db3ecdb2c87c438a273a8de0d18f7cc5432531abb3256f42dca820bac7fAdvance90876182021-05-23 8:01:03120 days 13 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0xa3a1649892d01fafb555b27b77aea709caa86438f8d753e30d1b12afda11843dAdvance90870232021-05-23 7:31:18120 days 13 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0x1142daf17fdaddfeb9b7f2a0e9870d653d7a1fa7e0683182e6b8c87358200e8dAdvance90864162021-05-23 7:00:57120 days 14 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0x879f61d049743c03b024f70c897f5d27aea4a621d2040b0499e48f23d0d4275fAdvance90858222021-05-23 6:31:15120 days 14 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0xa28e3335e0a5cbfe0bf8eb051c12cfcf1490e523246208eeefedef376001e64bAdvance90852162021-05-23 6:00:57120 days 15 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0x4a0f352f7810ea55c201c9c3fa73bfd91511b6e2d85a0c2caab9550371328495Advance90846212021-05-23 5:31:12120 days 15 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0xdf968ca3a3b0e40ea2152b2a488b59dcadc2cff4152b1ac07779d499b9383886Advance90840142021-05-23 5:00:51120 days 16 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0x0abc466f731f9918f9cf10b03d8b3ca56b792b7150744e938b1dd1db0ffec552Advance90834202021-05-23 4:31:09120 days 16 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0x36f76c16d1710a070b5f5b26ed93a4cbfde857ad1f07499d9dce1d6e43fdbe66Advance90828142021-05-23 4:00:51120 days 17 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0x0ab3fb8077b435b259667797d98164893d4f052b8794653caa97864ceff29aeeAdvance90822212021-05-23 3:31:12120 days 17 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0xccace8a8bcb3b538031c8a33140774f2bba9c46ee38d22f33852532a2859571dAdvance90816162021-05-23 3:00:57120 days 18 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0xaceaaade1aa4aa66fb4aacc20e1ed7f6186544b91c65b5a158c5f1a11cae6186Advance90810212021-05-23 2:31:12120 days 18 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0x3c34806cf1f10dbb443e28fc5e694cbc0ad12f7f901cf093c542a1d2386e5141Advance90804252021-05-23 2:01:24120 days 19 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0x6082437b41d457dc84095427cf83055b27a37ccefd1dadc814a1a3799860eff9Advance90798332021-05-23 1:31:48120 days 19 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0x8a1f1d9caa35f24c3ff7c1942df5d9a7af944db7389318accf7c38e621a55bafAdvance90792202021-05-23 1:01:09120 days 20 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0x1cb2295f815135593a58ec6026c4e1b21d9e4868d8a7c90f640a5cf63c4a5592Advance90786162021-05-23 0:30:57120 days 20 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
0x650e7600f884c04378ebe776a419883abb2ba2ae88c91213f4079ea46b79c8b0Advance90780212021-05-23 0:01:12120 days 21 hrs ago0x03e5b588024a7faa9ff28897e3ea5525a8dddaa2 IN  0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB0.0053801
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
0xbdbd16fe009fbe0fc7096a832efdb4e461292a3eecb11f178dfa4efbca1f047094151302021-06-03 17:50:35109 days 3 hrs ago 0x1c1d2502026a6d9719234a9895f4f4f12d974d27 0x5820790a4f100b6d53bf046fde2288f70687ea4d0 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MaltDAO

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 13 : DAO.sol
pragma solidity >=0.6.6;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/upgrades/contracts/Initializable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

import "./interfaces/IBurnMintableERC20.sol";
import "./interfaces/IOracle.sol";
import "./interfaces/IStabilizer.sol";
import "./Permissions.sol";

contract MaltDAO is Initializable, Permissions {
  using SafeMath for uint256;

  IBurnMintableERC20 public malt;
  IOracle public oracle;
  IStabilizer public stabilizer;
  address payable public treasuryMultisig;
  uint256 public epoch = 0;
  uint256 public epochLength;
  uint256 public genesisTime;
  uint256 public advanceIncentive = 100; // 100 Malt

  event Advance(uint256 indexed epoch, uint256 block, uint256 timestamp);
  event TransferETH(address recipient, uint256 amount);
  event TransferToken(address recipient, address token, uint256 amount);
  event Mint(address recipient, uint256 amount);
  event SetMaltToken(address maltToken);
  event SetEpochLength(uint256 length);
  event SetAdvanceIncentive(uint256 incentive);
  event SetOracle(address oracle);

  function initialize(
    address _malt,
    address _oracle,
    address payable _treasuryMultisig,
    uint256 _epochLength,
    uint256 _genesisTime,
    address _timelock,
    address _stabilizer
  ) external initializer {
    treasuryMultisig = _treasuryMultisig;
    oracle = IOracle(_oracle);
    stabilizer = IStabilizer(_stabilizer);

    _setMaltToken(_malt);
    _setEpochLength(_epochLength);

    _adminSetup(_timelock);

    genesisTime = _genesisTime;

    // 10000 Malt for initial liquidity
    malt.mint(msg.sender, 10000e18);
    // 1000 Malt to 0xScotch
    malt.mint(0xa5DCdFe31e1955acFc20416513ae10c101C68445, 1000e18);
  }

  receive() external payable {}

  function advance() external {
    require(block.timestamp >= getEpochStartTime(epoch + 1), "Cannot advance epoch until start of new epoch");

    oracle.updateAll();

    incrementEpoch();

    stabilizer.advance();

    malt.mint(msg.sender, advanceIncentive * 1e18);

    emit Advance(epoch, block.number, block.timestamp);
  }

  function getEpochStartTime(uint256 _epoch) public view returns (uint256) {
    return genesisTime.add(epochLength.mul(_epoch));
  }

  function sendTreasuryETH(uint256 amount)
    public
    onlyRole(TIMELOCK_ROLE, "Must have timelock role")
  {
    require(amount <= address(this).balance, "Insufficient funds to transfer");
    treasuryMultisig.transfer(amount);
    emit TransferETH(treasuryMultisig, amount);
  }

  function sendTreasuryToken(address _token, uint256 amount)
    public
    onlyRole(TIMELOCK_ROLE, "Must have timelock role")
  {
    ERC20 token = ERC20(_token);
    require(amount <= token.balanceOf(address(this)), "Insufficient funds to transfer");

    token.transfer(treasuryMultisig, amount);
    emit TransferToken(treasuryMultisig, _token, amount);
  }

  function mint(address to, uint256 amount)
    public
    onlyRole(TIMELOCK_ROLE, "Must have timelock role")
  {
    require(amount > 0, "Cannot have zero amount");
    malt.mint(to, amount);
    emit Mint(to, amount);
  }

  function setMaltToken(address _malt)
    public
    onlyRole(TIMELOCK_ROLE, "Must have timelock role")
  {
    _setMaltToken(_malt);
  }

  function setEpochLength(uint256 _length)
    public
    onlyRole(TIMELOCK_ROLE, "Must have timelock role")
  {
    require(_length > 0, "Cannot have zero length epochs");
    _setEpochLength(_length);
  }

  function setAdvanceIncentive(uint256 incentive)
    external
    onlyRole(TIMELOCK_ROLE, "Must have timelock role")
  {
    advanceIncentive = incentive;
    emit SetAdvanceIncentive(incentive);
  }

  function setOracle(address _oracle)
    external
    onlyRole(TIMELOCK_ROLE, "Must have timelock role")
  {
    oracle = IOracle(_oracle);
    emit SetOracle(_oracle);
  }

  /* Internal methods */
  function incrementEpoch() internal {
    epoch = epoch.add(1);
  }
  
  function _setEpochLength(uint256 length) internal {
    epochLength = length;
    emit SetEpochLength(length);
  }

  function _setMaltToken(address _malt) internal {
    malt = IBurnMintableERC20(_malt);
    emit SetMaltToken(_malt);
  }

}

File 2 of 13 : 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 13 : 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 13 : 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 13 : IBurnMintableERC20.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 IBurnMintableERC20 {
    /**
     * @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);

    function decimals() external view returns (uint256);

    function burn(uint256 amount) external;
    function mint(address account, uint256 amount) external;

    /**
     * @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 6 of 13 : IOracle.sol
pragma solidity >=0.6.6;

interface IOracle {
  function update(address tokenA) external;
  function updateAll() external;
  function consult(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut, bool valid);
  function initializeNewTokenPair(address tokenA) external; 
  function getRecentReserves(address tokenA) external view returns (uint reserves);
}

File 7 of 13 : IStabilizer.sol
pragma solidity >=0.6.6;

interface IStabilizer {
  function requestMint(uint256 amount) external;
  function requestBurn(uint256 amount) external;
  function setEnabledOnStabilizerNode(uint256 index, bool enabled) external;
  function removeStabilizerNode(address _node) external;
  function addNewStabilizerNode(address _node, address _rewardToken) external;
  function userTotalMaltBonded(address account) external view returns (uint256);
  function advance() external;
}

File 8 of 13 : Permissions.sol
pragma solidity >=0.6.6;

import "@openzeppelin/contracts/access/AccessControl.sol";

contract Permissions is AccessControl {
  // Timelock has absolute power across the system
  bytes32 public constant TIMELOCK_ROLE = keccak256("TIMELOCK_ROLE");
  bytes32 public constant GOVERNOR_ROLE = keccak256("GOVERNOR_ROLE");

  // Can mint/burn Malt
  bytes32 public constant MONETARY_REGULATOR_ROLE = keccak256("MONETARY_REGULATOR_ROLE");

  // Contract types
  bytes32 public constant STABILIZER_NODE_ROLE = keccak256("STABILIZER_NODE_ROLE");
  bytes32 public constant LIQUIDITY_MINE_ROLE = keccak256("LIQUIDITY_MINE_ROLE");
  bytes32 public constant AUCTION_ROLE = keccak256("AUCTION_ROLE");

  address internal admin;

  mapping(address => uint256) public lastBlock; // protect against reentrancy

  function _adminSetup(address _timelock) internal {
    _roleSetup(TIMELOCK_ROLE, _timelock);
    _roleSetup(GOVERNOR_ROLE, _timelock);
    _roleSetup(MONETARY_REGULATOR_ROLE, _timelock);
    _roleSetup(STABILIZER_NODE_ROLE, _timelock);

    admin = _timelock;
  }

  function assignRole(bytes32 role, address _assignee)
    external
    onlyRole(TIMELOCK_ROLE, "Only timelock can assign roles")
  {
    _setupRole(role, _assignee);
  }

  function removeRole(bytes32 role, address _entity)
    external
    onlyRole(TIMELOCK_ROLE, "Only timelock can revoke roles")
  {
    revokeRole(role, _entity);
  }

  function reassignAdmin(address _admin)
    external
    onlyRole(TIMELOCK_ROLE, "Only timelock can assign roles")
  {
    _swapRole(_admin, admin, TIMELOCK_ROLE);
    _swapRole(_admin, admin, GOVERNOR_ROLE);
    _swapRole(_admin, admin, MONETARY_REGULATOR_ROLE);
    _swapRole(_admin, admin, STABILIZER_NODE_ROLE);

    admin = _admin;
  }

  function _swapRole(address newAccount, address oldAccount, bytes32 role) internal {
    revokeRole(role, oldAccount);
    _setupRole(role, newAccount);
  }

  function _roleSetup(bytes32 role, address account) internal {
    _setupRole(role, account);
    _setRoleAdmin(role, TIMELOCK_ROLE);
  }

  function _onlyRole(bytes32 role, string memory reason) internal view {
    require(
      hasRole(
        role,
        _msgSender()
      ),
      reason
    );
  }

  function _notSameBlock() internal {
    require(
      block.number > lastBlock[_msgSender()],
      "Can't carry out actions in the same block"
    );
    lastBlock[_msgSender()] = block.number;
  }

  // Using internal function calls here reduces compiled bytecode size
  modifier onlyRole(bytes32 role, string memory reason) {
    _onlyRole(role, reason);
    _;
  }

  modifier notSameBlock() {
    _notSameBlock();
    _;
  }
}

File 9 of 13 : 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 10 of 13 : 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 11 of 13 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../utils/EnumerableSet.sol";
import "../utils/Address.sol";
import "../GSN/Context.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context {
    using EnumerableSet for EnumerableSet.AddressSet;
    using Address for address;

    struct RoleData {
        EnumerableSet.AddressSet members;
        bytes32 adminRole;
    }

    mapping (bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view returns (bool) {
        return _roles[role].members.contains(account);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view returns (uint256) {
        return _roles[role].members.length();
    }

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view returns (address) {
        return _roles[role].members.at(index);
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant");

        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke");

        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        emit RoleAdminChanged(role, _roles[role].adminRole, adminRole);
        _roles[role].adminRole = adminRole;
    }

    function _grantRole(bytes32 role, address account) private {
        if (_roles[role].members.add(account)) {
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (_roles[role].members.remove(account)) {
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

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

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        require(set._values.length > index, "EnumerableSet: index out of bounds");
        return set._values[index];
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint256(_at(set._inner, index)));
    }


    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}

File 13 of 13 : 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);
            }
        }
    }
}

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

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Advance","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"incentive","type":"uint256"}],"name":"SetAdvanceIncentive","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"length","type":"uint256"}],"name":"SetEpochLength","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"maltToken","type":"address"}],"name":"SetMaltToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oracle","type":"address"}],"name":"SetOracle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferETH","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferToken","type":"event"},{"inputs":[],"name":"AUCTION_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GOVERNOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LIQUIDITY_MINE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MONETARY_REGULATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STABILIZER_NODE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIMELOCK_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"advance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"advanceIncentive","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"_assignee","type":"address"}],"name":"assignRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"epoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epochLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"genesisTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"getEpochStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_malt","type":"address"},{"internalType":"address","name":"_oracle","type":"address"},{"internalType":"address payable","name":"_treasuryMultisig","type":"address"},{"internalType":"uint256","name":"_epochLength","type":"uint256"},{"internalType":"uint256","name":"_genesisTime","type":"uint256"},{"internalType":"address","name":"_timelock","type":"address"},{"internalType":"address","name":"_stabilizer","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"malt","outputs":[{"internalType":"contract IBurnMintableERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"oracle","outputs":[{"internalType":"contract IOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"reassignAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"_entity","type":"address"}],"name":"removeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sendTreasuryETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sendTreasuryToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"incentive","type":"uint256"}],"name":"setAdvanceIncentive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_length","type":"uint256"}],"name":"setEpochLength","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_malt","type":"address"}],"name":"setMaltToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oracle","type":"address"}],"name":"setOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stabilizer","outputs":[{"internalType":"contract IStabilizer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasuryMultisig","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040526000603a556064603d5534801561001a57600080fd5b50611e0f8061002a6000396000f3fe6080604052600436106102135760003560e01c80637565d49111610118578063b5702cfb116100a0578063d547741f1161006f578063d547741f146105a2578063dff87bcb146105c2578063ea105ac7146105d7578063f288a2e2146105ec578063f6ba0007146106015761021a565b8063b5702cfb14610543578063bf62840814610558578063ca15c8731461056d578063ccc574901461058d5761021a565b8063900cf0cf116100e7578063900cf0cf146104ac5780639010d07c146104c157806391d14854146104e1578063952ca92c1461050e578063a217fddf1461052e5761021a565b80637565d491146104405780637adbf973146104555780637dc0d1d0146104755780637e47961c146104975761021a565b8063430730a31161019b57806357d775f81161016a57806357d775f8146103ab5780636213b727146103c0578063633e9e09146103e0578063669edee7146104005780636c96d945146104205761021a565b8063430730a3146103415780634652f0cf1461035657806350ff2eb01461036b57806354eea7961461038b5761021a565b80632f2ff15d116101e25780632f2ff15d146102ac57806330a727b3146102cc57806336568abe146102ec57806340c10f191461030c57806342c6498a1461032c5761021a565b80630ff6b0211461021f5780632328be8914610241578063248a9ca314610261578063271d1603146102975761021a565b3661021a57005b600080fd5b34801561022b57600080fd5b5061023f61023a3660046117d7565b610621565b005b34801561024d57600080fd5b5061023f61025c3660046118c1565b61072a565b34801561026d57600080fd5b5061028161027c3660046118c1565b61081c565b60405161028e9190611a4f565b60405180910390f35b3480156102a357600080fd5b50610281610831565b3480156102b857600080fd5b5061023f6102c73660046118d9565b610848565b3480156102d857600080fd5b5061023f6102e73660046118d9565b610890565b3480156102f857600080fd5b5061023f6103073660046118d9565b6108f4565b34801561031857600080fd5b5061023f610327366004611876565b610936565b34801561033857600080fd5b50610281610a3b565b34801561034d57600080fd5b50610281610a41565b34801561036257600080fd5b50610281610a4d565b34801561037757600080fd5b5061023f6103863660046118c1565b610a59565b34801561039757600080fd5b5061023f6103a63660046118c1565b610ad0565b3480156103b757600080fd5b50610281610b40565b3480156103cc57600080fd5b5061023f6103db3660046117f3565b610b46565b3480156103ec57600080fd5b506102816103fb3660046118c1565b610d1c565b34801561040c57600080fd5b5061023f61041b366004611876565b610d4b565b34801561042c57600080fd5b5061023f61043b3660046117d7565b610f01565b34801561044c57600080fd5b50610281610f4c565b34801561046157600080fd5b5061023f6104703660046117d7565b610f58565b34801561048157600080fd5b5061048a610fe5565b60405161028e91906119f3565b3480156104a357600080fd5b5061048a610ff4565b3480156104b857600080fd5b50610281611003565b3480156104cd57600080fd5b5061048a6104dc366004611908565b611009565b3480156104ed57600080fd5b506105016104fc3660046118d9565b61102e565b60405161028e9190611a44565b34801561051a57600080fd5b506102816105293660046117d7565b61104c565b34801561053a57600080fd5b5061028161105e565b34801561054f57600080fd5b50610281611063565b34801561056457600080fd5b5061048a611069565b34801561057957600080fd5b506102816105883660046118c1565b611078565b34801561059957600080fd5b5061028161108f565b3480156105ae57600080fd5b5061023f6105bd3660046118d9565b61109b565b3480156105ce57600080fd5b5061048a6110d5565b3480156105e357600080fd5b5061023f6110e4565b3480156105f857600080fd5b50610281611297565b34801561060d57600080fd5b5061023f61061c3660046118d9565b6112a3565b60405161062d906119da565b60405180910390206040518060400160405280601e81526020017f4f6e6c792074696d656c6f636b2063616e2061737369676e20726f6c657300008152506106758282611301565b6034546040516106a39185916001600160a01b0390911690610696906119da565b604051809103902061132c565b6034546040516106c49185916001600160a01b039091169061069690611989565b6034546040516106e59185916001600160a01b039091169061069690611941565b6034546040516107069185916001600160a01b0390911690610696906119a2565b5050603480546001600160a01b0319166001600160a01b0392909216919091179055565b604051610736906119da565b6040518091039020604051806040016040528060178152602001600080516020611dba83398151915281525061076c8282611301565b478311156107955760405162461bcd60e51b815260040161078c90611d0d565b60405180910390fd5b6039546040516001600160a01b039091169084156108fc029085906000818181858888f193505050501580156107cf573d6000803e3d6000fd5b506039546040517ffd69c215b8b91dab5e96ff0bcbaf5dc372919948eea2003ae16481c036f816f89161080f916001600160a01b03909116908690611a2b565b60405180910390a1505050565b60009081526033602052604090206002015490565b60405161083d9061196a565b604051809103902081565b600082815260336020526040902060020154610866906104fc611340565b6108825760405162461bcd60e51b815260040161078c90611aed565b61088c8282611344565b5050565b60405161089c906119da565b60405180910390206040518060400160405280601e81526020017f4f6e6c792074696d656c6f636b2063616e2061737369676e20726f6c657300008152506108e48282611301565b6108ee8484610882565b50505050565b6108fc611340565b6001600160a01b0316816001600160a01b03161461092c5760405162461bcd60e51b815260040161078c90611d44565b61088c82826113b3565b604051610942906119da565b6040518091039020604051806040016040528060178152602001600080516020611dba8339815191528152506109788282611301565b600083116109985760405162461bcd60e51b815260040161078c90611b3c565b6036546040516340c10f1960e01b81526001600160a01b03909116906340c10f19906109ca9087908790600401611a2b565b600060405180830381600087803b1580156109e457600080fd5b505af11580156109f8573d6000803e3d6000fd5b505050507f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968858484604051610a2d929190611a2b565b60405180910390a150505050565b603c5481565b60405161083d906119c2565b60405161083d906119a2565b604051610a65906119da565b6040518091039020604051806040016040528060178152602001600080516020611dba833981519152815250610a9b8282611301565b603d8390556040517ff87fcd87c403ed91b1a4767896453755e08dad56f43389814cb40c159234cdd79061080f908590611a4f565b604051610adc906119da565b6040518091039020604051806040016040528060178152602001600080516020611dba833981519152815250610b128282611301565b60008311610b325760405162461bcd60e51b815260040161078c90611c88565b610b3b83611422565b505050565b603b5481565b600054610100900460ff1680610b5f5750610b5f611462565b80610b6d575060005460ff16155b610b895760405162461bcd60e51b815260040161078c90611cbf565b600054610100900460ff16158015610bb4576000805460ff1961ff0019909116610100171660011790555b603980546001600160a01b038089166001600160a01b031992831617909255603780548a84169083161790556038805492851692909116919091179055610bfa88611468565b610c0385611422565b610c0c836114b3565b603c8490556036546040516340c10f1960e01b81526001600160a01b03909116906340c10f1990610c4d90339069021e19e0c9bab240000090600401611a2b565b600060405180830381600087803b158015610c6757600080fd5b505af1158015610c7b573d6000803e3d6000fd5b50506036546040516340c10f1960e01b81526001600160a01b0390911692506340c10f199150610cce9073a5dcdfe31e1955acfc20416513ae10c101c6844590683635c9adc5dea0000090600401611a2b565b600060405180830381600087803b158015610ce857600080fd5b505af1158015610cfc573d6000803e3d6000fd5b505050508015610d12576000805461ff00191690555b5050505050505050565b6000610d45610d3683603b5461151f90919063ffffffff16565b603c549063ffffffff61155916565b92915050565b604051610d57906119da565b6040518091039020604051806040016040528060178152602001600080516020611dba833981519152815250610d8d8282611301565b6040516370a0823160e01b815284906001600160a01b038216906370a0823190610dbb9030906004016119f3565b60206040518083038186803b158015610dd357600080fd5b505afa158015610de7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0b9190611929565b841115610e2a5760405162461bcd60e51b815260040161078c90611d0d565b60395460405163a9059cbb60e01b81526001600160a01b038381169263a9059cbb92610e5e92909116908890600401611a2b565b602060405180830381600087803b158015610e7857600080fd5b505af1158015610e8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb091906118a1565b506039546040517f3844b7075ed6e7d4b61342769cb2b1b325cba410a62932affaa90aee247dadf591610ef2916001600160a01b039091169088908890611a07565b60405180910390a15050505050565b604051610f0d906119da565b6040518091039020604051806040016040528060178152602001600080516020611dba833981519152815250610f438282611301565b610b3b83611468565b60405161083d90611941565b604051610f64906119da565b6040518091039020604051806040016040528060178152602001600080516020611dba833981519152815250610f9a8282611301565b603780546001600160a01b0319166001600160a01b0385161790556040517fd3b5d1e0ffaeff528910f3663f0adace7694ab8241d58e17a91351ced2e080319061080f9085906119f3565b6037546001600160a01b031681565b6038546001600160a01b031681565b603a5481565b6000828152603360205260408120611027908363ffffffff61157e16565b9392505050565b6000828152603360205260408120611027908363ffffffff61158a16565b60356020526000908152604090205481565b600081565b603d5481565b6039546001600160a01b031681565b6000818152603360205260408120610d459061159f565b60405161083d90611989565b6000828152603360205260409020600201546110b9906104fc611340565b61092c5760405162461bcd60e51b815260040161078c90611bf7565b6036546001600160a01b031681565b6110f2603a54600101610d1c565b4210156111115760405162461bcd60e51b815260040161078c90611baa565b603760009054906101000a90046001600160a01b03166001600160a01b03166353d786936040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561116157600080fd5b505af1158015611175573d6000803e3d6000fd5b505050506111816115aa565b603860009054906101000a90046001600160a01b03166001600160a01b031663ea105ac76040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156111d157600080fd5b505af11580156111e5573d6000803e3d6000fd5b5050603654603d546040516340c10f1960e01b81526001600160a01b0390921693506340c10f199250611227913391670de0b6b3a76400000290600401611a2b565b600060405180830381600087803b15801561124157600080fd5b505af1158015611255573d6000803e3d6000fd5b50505050603a547fc30b728d1c19e5db3678b8ea9e9a063a5655071e1a325c2f7fdbca48baa90600434260405161128d929190611d93565b60405180910390a2565b60405161083d906119da565b6040516112af906119da565b60405180910390206040518060400160405280601e81526020017f4f6e6c792074696d656c6f636b2063616e207265766f6b6520726f6c657300008152506112f78282611301565b6108ee848461109b565b61130d826104fc611340565b8190610b3b5760405162461bcd60e51b815260040161078c9190611a58565b611336818361109b565b610b3b8184610882565b3390565b6000828152603360205260409020611362908263ffffffff6115c316565b1561088c5761136f611340565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526033602052604090206113d1908263ffffffff6115d816565b1561088c576113de611340565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b603b8190556040517f4dedf67314f36a910a071ddf15137666fe15c021b8d001fba5df4a2254cd4b9690611457908390611a4f565b60405180910390a150565b303b1590565b603680546001600160a01b0319166001600160a01b0383161790556040517fd33053b9645d44bc0465df9f99906649aeed03ef8cd8800085e738e01aacacf1906114579083906119f3565b6114d06040516114c2906119da565b6040518091039020826115ed565b6114df6040516114c290611989565b6114ee6040516114c290611941565b6114fd6040516114c2906119a2565b603480546001600160a01b0319166001600160a01b0392909216919091179055565b60008261152e57506000610d45565b8282028284828161153b57fe5b04146110275760405162461bcd60e51b815260040161078c90611c47565b6000828201838110156110275760405162461bcd60e51b815260040161078c90611b73565b60006110278383611614565b6000611027836001600160a01b038416611659565b6000610d4582611671565b603a546115be90600163ffffffff61155916565b603a55565b6000611027836001600160a01b038416611675565b6000611027836001600160a01b0384166116bf565b6115f78282610882565b61088c82604051611607906119da565b6040518091039020611785565b815460009082106116375760405162461bcd60e51b815260040161078c90611aab565b82600001828154811061164657fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b60006116818383611659565b6116b757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610d45565b506000610d45565b6000818152600183016020526040812054801561177b57835460001980830191908101906000908790839081106116f257fe5b906000526020600020015490508087600001848154811061170f57fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061173f57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610d45565b6000915050610d45565b600082815260336020526040808220600201549051839285917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a460009182526033602052604090912060020155565b6000602082840312156117e8578081fd5b813561102781611da1565b600080600080600080600060e0888a03121561180d578283fd5b873561181881611da1565b9650602088013561182881611da1565b9550604088013561183881611da1565b9450606088013593506080880135925060a088013561185681611da1565b915060c088013561186681611da1565b8091505092959891949750929550565b60008060408385031215611888578182fd5b823561189381611da1565b946020939093013593505050565b6000602082840312156118b2578081fd5b81518015158114611027578182fd5b6000602082840312156118d2578081fd5b5035919050565b600080604083850312156118eb578182fd5b8235915060208301356118fd81611da1565b809150509250929050565b6000806040838503121561191a578182fd5b50508035926020909101359150565b60006020828403121561193a578081fd5b5051919050565b7f4d4f4e45544152595f524547554c41544f525f524f4c45000000000000000000815260170190565b724c49515549444954595f4d494e455f524f4c4560681b815260130190565b6c474f5645524e4f525f524f4c4560981b8152600d0190565b7353544142494c495a45525f4e4f44455f524f4c4560601b815260140190565b6b41554354494f4e5f524f4c4560a01b8152600c0190565b6c54494d454c4f434b5f524f4c4560981b8152600d0190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b6000602080835283518082850152825b81811015611a8457858101830151858201604001528201611a68565b81811115611a955783604083870101525b50601f01601f1916929092016040019392505050565b60208082526022908201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b6020808252602f908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201526e0818591b5a5b881d1bc819dc985b9d608a1b606082015260800190565b60208082526017908201527f43616e6e6f742068617665207a65726f20616d6f756e74000000000000000000604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252602d908201527f43616e6e6f7420616476616e63652065706f636820756e74696c20737461727460408201526c040decc40dccaee40cae0dec6d609b1b606082015260800190565b60208082526030908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201526f2061646d696e20746f207265766f6b6560801b606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252601e908201527f43616e6e6f742068617665207a65726f206c656e6774682065706f6368730000604082015260600190565b6020808252602e908201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560408201526d195b881a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252601e908201527f496e73756666696369656e742066756e647320746f207472616e736665720000604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201526e103937b632b9903337b91039b2b63360891b606082015260800190565b918252602082015260400190565b6001600160a01b0381168114611db657600080fd5b5056fe4d75737420686176652074696d656c6f636b20726f6c65000000000000000000a26469706673582212205a02d0b1a65a199d0591d727e860c23e50d197cdad1561cd189d832dc0809c4564736f6c63430006060033

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