MATIC Price: $1.01 (-3.20%)
Gas: 194 GWei
 

Overview

MATIC Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo200.573550815760711398 MATIC

MATIC Value

$202.87 (@ $1.01/MATIC)

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Claim209472252021-11-03 21:11:09875 days ago1635973869IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0007638630
Claim205410432021-10-24 0:29:22886 days ago1635035362IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0008366430
Claim205327352021-10-23 19:05:45886 days ago1635015945IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0008366430
Claim205128882021-10-23 6:04:11887 days ago1634969051IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0008366430
Claim205053752021-10-23 1:02:29887 days ago1634950949IN
0x5fAF120f...F78F6F0D4
0 MATIC0.000920333
Claim205007812021-10-22 21:48:16887 days ago1634939296IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0007638630
Claim205004932021-10-22 21:34:08887 days ago1634938448IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0008366430
Claim204946142021-10-22 17:38:40887 days ago1634924320IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0011155240
Claim204409862021-10-21 5:43:08889 days ago1634794988IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0008366430
Claim204358532021-10-21 2:25:22889 days ago1634783122IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0007089930
Claim204358532021-10-21 2:25:22889 days ago1634783122IN
0x5fAF120f...F78F6F0D4
0 MATIC0.000037791.35531013
Claim204335982021-10-21 1:01:02889 days ago1634778062IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0007638630
Claim204317742021-10-20 23:51:58889 days ago1634773918IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0008366430
Claim204274752021-10-20 20:58:42889 days ago1634763522IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0012270744
Claim204271212021-10-20 20:42:14889 days ago1634762534IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0007638630
Claim204269782021-10-20 20:37:20889 days ago1634762240IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0007638630
Claim204259212021-10-20 19:54:38889 days ago1634759678IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0008366430
Claim204255012021-10-20 19:36:54889 days ago1634758614IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0007638630
Claim204254472021-10-20 19:34:02889 days ago1634758442IN
0x5fAF120f...F78F6F0D4
0 MATIC0.001273150
Claim204245862021-10-20 18:54:10889 days ago1634756050IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0007638630
Claim204242192021-10-20 18:37:50889 days ago1634755070IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0008366430
Claim204230272021-10-20 17:37:52889 days ago1634751472IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0009411536.963
Claim204223252021-10-20 17:07:00889 days ago1634749620IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0007638630
Claim204222462021-10-20 17:03:06889 days ago1634749386IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0008366430
Claim204214792021-10-20 16:34:36889 days ago1634747676IN
0x5fAF120f...F78F6F0D4
0 MATIC0.0008402433
View all transactions

Latest 25 internal transactions (View All)

Parent Txn Hash Block From To Value
209472252021-11-03 21:11:09875 days ago1635973869
0x5fAF120f...F78F6F0D4
8 MATIC
205410432021-10-24 0:29:22886 days ago1635035362
0x5fAF120f...F78F6F0D4
6 MATIC
205327352021-10-23 19:05:45886 days ago1635015945
0x5fAF120f...F78F6F0D4
124 MATIC
205128882021-10-23 6:04:11887 days ago1634969051
0x5fAF120f...F78F6F0D4
49 MATIC
205053752021-10-23 1:02:29887 days ago1634950949
0x5fAF120f...F78F6F0D4
163 MATIC
205007812021-10-22 21:48:16887 days ago1634939296
0x5fAF120f...F78F6F0D4
30 MATIC
205004932021-10-22 21:34:08887 days ago1634938448
0x5fAF120f...F78F6F0D4
4.2 MATIC
204946142021-10-22 17:38:40887 days ago1634924320
0x5fAF120f...F78F6F0D4
100 MATIC
204409862021-10-21 5:43:08889 days ago1634794988
0x5fAF120f...F78F6F0D4
64.1 MATIC
204358532021-10-21 2:25:22889 days ago1634783122
0x5fAF120f...F78F6F0D4
43.85 MATIC
204335982021-10-21 1:01:02889 days ago1634778062
0x5fAF120f...F78F6F0D4
400 MATIC
204317742021-10-20 23:51:58889 days ago1634773918
0x5fAF120f...F78F6F0D4
110 MATIC
204274752021-10-20 20:58:42889 days ago1634763522
0x5fAF120f...F78F6F0D4
500 MATIC
204271212021-10-20 20:42:14889 days ago1634762534
0x5fAF120f...F78F6F0D4
130 MATIC
204269782021-10-20 20:37:20889 days ago1634762240
0x5fAF120f...F78F6F0D4
560 MATIC
204259212021-10-20 19:54:38889 days ago1634759678
0x5fAF120f...F78F6F0D4
20 MATIC
204255012021-10-20 19:36:54889 days ago1634758614
0x5fAF120f...F78F6F0D4
485 MATIC
204254472021-10-20 19:34:02889 days ago1634758442
0x5fAF120f...F78F6F0D4
5,069.42 MATIC
204245862021-10-20 18:54:10889 days ago1634756050
0x5fAF120f...F78F6F0D4
250 MATIC
204242192021-10-20 18:37:50889 days ago1634755070
0x5fAF120f...F78F6F0D4
99 MATIC
204230272021-10-20 17:37:52889 days ago1634751472
0x5fAF120f...F78F6F0D4
488 MATIC
204223252021-10-20 17:07:00889 days ago1634749620
0x5fAF120f...F78F6F0D4
0.4 MATIC
204222462021-10-20 17:03:06889 days ago1634749386
0x5fAF120f...F78F6F0D4
10 MATIC
204214792021-10-20 16:34:36889 days ago1634747676
0x5fAF120f...F78F6F0D4
59 MATIC
204193892021-10-20 15:16:19889 days ago1634742979
0x5fAF120f...F78F6F0D4
123.6685211 MATIC
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MarketGeneration

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity Multiple files format)

File 27 of 35: MarketGeneration.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

import "./IMarketDistribution.sol";
import "./IMarketGeneration.sol";
import "./TokensRecoverable.sol";
import "./SafeERC20.sol";
import "./SafeMath.sol";
import "./IERC20.sol";
import "./IWETH.sol";

contract MarketGeneration is TokensRecoverable, IMarketGeneration
{
    using SafeERC20 for IERC20;
    using SafeMath for uint256;

    mapping (address => uint256) public override contribution;
    mapping (address => uint256) public override referralPoints;
    uint256 public override totalReferralPoints;
    uint256 public override totalContribution;
    address public immutable devAddress;    

    bool public isActive;

    IERC20 public baseToken;
    IMarketDistribution public marketDistribution;
    uint256 public refundsAllowedUntil;

    constructor(address _devAddress)
    {
        devAddress = _devAddress;
    }

    modifier active()
    {
        require (isActive, "Distribution not active");
        _;
    }

    function init(IERC20 _baseToken) public ownerOnly()
    {
        require (!isActive && block.timestamp >= refundsAllowedUntil, "Already activated");
        baseToken = _baseToken;
    }

    function activate(IMarketDistribution _marketDistribution) public ownerOnly()
    {
        require (!isActive && block.timestamp >= refundsAllowedUntil, "Already activated");        
        require (address(_marketDistribution) != address(0));
        marketDistribution = _marketDistribution;
        isActive = true;
    }

    function setMarketDistribution(IMarketDistribution _marketDistribution) public ownerOnly() active()
    {
        require (address(_marketDistribution) != address(0), "Invalid market distribution");
        if (_marketDistribution == marketDistribution) { return; }
        marketDistribution = _marketDistribution;

        // Give everyone 1 day to claim refunds if they don't approve of the new distributor
        refundsAllowedUntil = block.timestamp + 86400;
    }

    function complete() public ownerOnly() active()
    {
        require (block.timestamp >= refundsAllowedUntil, "Refund period is still active");
        isActive = false;
        if (address(this).balance == 0) { return; }
        IWETH(address(baseToken)).deposit{ value: address(this).balance }();
        baseToken.safeApprove(address(marketDistribution), uint256(-1));

        marketDistribution.distribute();
    }

    function allowRefunds() public ownerOnly() active()
    {
        isActive = false;
        refundsAllowedUntil = uint256(-1);
    }

    function refund(uint256 amount) private
    {
        (bool success,) = msg.sender.call{ value: amount }("");
        require (success, "Refund transfer failed");  
          
        totalContribution -= amount;
        contribution[msg.sender] = 0;

        uint256 refPoints = referralPoints[msg.sender];

        if (refPoints > 0)
        {
            totalReferralPoints -= refPoints;
            referralPoints[msg.sender] = 0;
        }
    }

    function claim() public 
    {
        uint256 amount = contribution[msg.sender];

        require (amount > 0, "Nothing to claim");
        
        if (refundsAllowedUntil > block.timestamp) 
        {
            refund(amount);
        }
        else 
        {
            marketDistribution.claim(msg.sender);
        }
    }

    function claimReferralRewards() public
    {
        require (referralPoints[msg.sender] > 0, "No rewards to claim");
        
        uint256 refShare = referralPoints[msg.sender];
        referralPoints[msg.sender] = 0;
        marketDistribution.claimReferralRewards(msg.sender, refShare);
    }

    function contribute(address referral) public payable active() 
    {
        if (referral == address(0) || referral == msg.sender) 
        {
            referralPoints[devAddress] += msg.value;
            totalReferralPoints += msg.value;
        }
        else 
        {
            referralPoints[msg.sender] += msg.value;
            referralPoints[referral] += msg.value;
            totalReferralPoints +=(msg.value + msg.value);
        }

        contribution[msg.sender] += msg.value;
        totalContribution += msg.value;
    }

    receive() external payable active()
    {
        contribute(address(0));
    }
}

File 1 of 35: Address.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

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

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

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

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

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

File 2 of 35: BlackListRegistry.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

import "./Owned.sol";

contract BlackListRegistry is Owned
{
    mapping (address => bool) public blackList;
    
    function setBlackListed(address account, bool blackListed) public ownerOnly()
    {
        blackList[account] = blackListed;
    }
}

File 3 of 35: ERC20.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

/* ROOTKIT:
Simplified thanks to higher solidity version
But same functionality
*/

import "./IERC20.sol";
import "./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}.
 */
abstract contract ERC20 is IERC20 
{
    using SafeMath for uint256;

    mapping (address => uint256) internal _balanceOf;
    mapping (address => mapping (address => uint256)) public override allowance;

    uint256 public override totalSupply;

    string public override name;
    string public override symbol;
    uint8 public override decimals = 18;

    /**
     * @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) 
    {
        name = _name;
        symbol = _symbol;
    }

    function balanceOf(address a) public virtual override view returns (uint256) { return _balanceOf[a]; }

    /**
     * @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(msg.sender, recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(msg.sender, 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);
        uint256 oldAllowance = allowance[sender][msg.sender];
        if (oldAllowance != uint256(-1)) {
            _approve(sender, msg.sender, oldAllowance.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(msg.sender, spender, allowance[msg.sender][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(msg.sender, spender, allowance[msg.sender][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);

        _balanceOf[sender] = _balanceOf[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balanceOf[recipient] = _balanceOf[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);
        _balanceOf[account] = _balanceOf[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);

        _balanceOf[account] = _balanceOf[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");

        allowance[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 4 of 35: ERC31337.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

/* ROOTKIT:
A wrapped token, where the underlying token can be swept
and used for other purposes
Governed by an installable floor calculator contract
Sweepable by designated sweeper addresses
*/

import "./IERC20.sol";
import "./SafeERC20.sol";
import "./IFloorCalculator.sol";
import "./WrappedERC20.sol";
import "./IERC31337.sol";

contract ERC31337 is WrappedERC20, IERC31337
{
    using SafeERC20 for IERC20;

    IFloorCalculator public override floorCalculator;
    
    mapping (address => bool) public override sweepers;

    constructor(IERC20 _wrappedToken, string memory _name, string memory _symbol)
        WrappedERC20(_wrappedToken, _name, _symbol)
    {
    }

    function setFloorCalculator(IFloorCalculator _floorCalculator) public override ownerOnly()
    {
        floorCalculator = _floorCalculator;
    }

    function setSweeper(address sweeper, bool allow) public override ownerOnly()
    {
        sweepers[sweeper] = allow;
    }

    function sweepFloor(address to) public override returns (uint256 amountSwept)
    {
        require (to != address(0));
        require (sweepers[msg.sender], "Sweepers only");
        amountSwept = floorCalculator.calculateSubFloor(wrappedToken, this);
        if (amountSwept > 0) {
            wrappedToken.safeTransfer(to, amountSwept);
        }
    }
}

File 5 of 35: FeeSplitter.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

import "./IERC20.sol";
import "./IGatedERC20.sol";
import "./SafeMath.sol";
import "./SafeERC20.sol";
import "./Address.sol";
import "./TokensRecoverable.sol";
import './IUniswapV2Router02.sol';

contract FeeSplitter is TokensRecoverable
{
    using SafeMath for uint256;
    using SafeERC20 for IERC20;
    using Address for address;
    
    address public devAddress;    
    address public rootFeederAddress;
    address public immutable deployerAddress;
    IUniswapV2Router02 public immutable router;
    IERC20 public immutable chainToken;
   
    mapping (IGatedERC20 => uint256) public burnRates;
    mapping (IGatedERC20 => uint256) public sellRates;
    mapping (IGatedERC20 => uint256) public keepRates;

    mapping (IGatedERC20 => address[]) public chainTokenFeeCollectors;
    mapping (IGatedERC20 => uint256[]) public chainTokenFeeRates;

    mapping (IGatedERC20 => address[]) public rootedTokenFeeCollectors;
    mapping (IGatedERC20 => uint256[]) public rootedTokenFeeRates;

    constructor(address _devAddress, address _rootFeederAddress, IUniswapV2Router02 _router)
    {
        deployerAddress = msg.sender;
        devAddress = _devAddress;
        rootFeederAddress = _rootFeederAddress;
        router = _router;
        chainToken = IERC20(_router.WETH());   
    }

    function setDevAddress(address _devAddress) public
    {
        require (msg.sender == deployerAddress || msg.sender == devAddress, "Not a deployer or dev address");
        devAddress = _devAddress;
    }

    function setRootFeederAddress(address _rootFeederAddress) public ownerOnly()
    {
        rootFeederAddress = _rootFeederAddress;
    }

    function setFees(IGatedERC20 token, uint256 burnRate, uint256 sellRate, uint256 keepRate) public ownerOnly() // 100% = 10000
    {
        require (burnRate + sellRate + keepRate == 10000, "Total fee rate must be 100%");
        
        burnRates[token] = burnRate;
        sellRates[token] = sellRate;
        keepRates[token] = keepRate;
        
        token.approve(address(router), uint256(-1));
    }

    function setChainTokenFeeCollectors(IGatedERC20 token, address[] memory collectors, uint256[] memory rates) public ownerOnly() // 100% = 10000
    {
        require (collectors.length == rates.length, "Fee Collectors and Rates must be the same size");
        require (collectors[0] == devAddress && collectors[1] == rootFeederAddress, "First address must be dev address, second address must be rootFeeder address");
        
        uint256 totalRate = 0;
        for (uint256 i = 0; i < rates.length; i++)
        {
            totalRate = totalRate + rates[i];
        }
        
        require (totalRate == 10000, "Total fee rate must be 100%");

        chainTokenFeeCollectors[token] = collectors;
        chainTokenFeeRates[token] = rates;
    }

    function setRootedTokenFeeCollectors(IGatedERC20 token, address[] memory collectors, uint256[] memory rates) public ownerOnly() // 100% = 10000
    {
        require (collectors.length == rates.length, "Fee Collectors and Rates must be the same size");
        
        uint256 totalRate = 0;
        for (uint256 i = 0; i < rates.length; i++)
        {
            totalRate = totalRate + rates[i];
        }

        require (totalRate == 10000, "Total fee rate must be 100%");

        rootedTokenFeeCollectors[token] = collectors;
        rootedTokenFeeRates[token] = rates;
    }

    function payFees(IGatedERC20 token) public
    {
        uint256 balance = token.balanceOf(address(this));
        require (balance > 0, "Nothing to pay");

        if (burnRates[token] > 0)
        {
            uint256 burnAmount = burnRates[token] * balance / 10000;
            token.burn(burnAmount);
        }

        if (sellRates[token] > 0)
        {
            uint256 sellAmount = sellRates[token] * balance / 10000;
            
            address[] memory path = new address[](2);
            path[0] = address(token);
            path[1] = address(chainToken);
            uint256[] memory amounts = router.swapExactTokensForTokens(sellAmount, 0, path, address(this), block.timestamp);

            address[] memory collectors = chainTokenFeeCollectors[token];
            uint256[] memory rates = chainTokenFeeRates[token];
            distribute(chainToken, amounts[1], collectors, rates);
        }

        if (keepRates[token] > 0)
        {
            uint256 keepAmount = keepRates[token] * balance / 10000;
            address[] memory collectors = rootedTokenFeeCollectors[token];
            uint256[] memory rates = rootedTokenFeeRates[token];
            distribute(token, keepAmount, collectors, rates);
        }
    }
    
    function distribute(IERC20 token, uint256 amount, address[] memory collectors, uint256[] memory rates) private
    {
        for (uint256 i = 0; i < collectors.length; i++)
        {
            address collector = collectors[i];
            uint256 rate = rates[i];

            if (rate > 0)
            {
                uint256 feeAmount = rate * amount / 10000;
                token.transfer(collector, feeAmount);
            }
        }
    }
}

File 6 of 35: FreeParticipantRegistry.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

import "./Owned.sol";

contract FreeParticipantRegistry is Owned
{
    address transferGate;
    mapping (address => bool) public freeParticipantControllers;
    mapping (address => bool) public freeParticipant;

    modifier transferGateOnly()
    {
        require (msg.sender == transferGate, "Transfer Gate only");
        _;
    }

    function setTransferGate(address _transferGate) public ownerOnly()
    {
        transferGate = _transferGate;
    }

    function setFreeParticipantController(address freeParticipantController, bool allow) public transferGateOnly()
    {
        freeParticipantControllers[freeParticipantController] = allow;
    }

    function setFreeParticipant(address participant, bool free) public transferGateOnly()
    {
        freeParticipant[participant] = free;
    }
}

File 7 of 35: GatedERC20.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;
pragma experimental ABIEncoderV2;

/* ROOTKIT:
A standard ERC20 with an extra hook: An installable transfer
gate allowing for token tax and burn on transfer
*/

import "./ERC20.sol";
import "./ITransferGate.sol";
import "./SafeMath.sol";
import "./TokensRecoverable.sol";
import "./IGatedERC20.sol";

abstract contract GatedERC20 is ERC20, TokensRecoverable, IGatedERC20
{
    using SafeMath for uint256;

    ITransferGate public override transferGate;

    constructor(string memory _name, string memory _symbol) ERC20(_name, _symbol)
    {
    }

    function setTransferGate(ITransferGate _transferGate) public override ownerOnly()
    {
        transferGate = _transferGate;
    }

    function _transfer(address sender, address recipient, uint256 amount) internal virtual override 
    {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        ITransferGate _transferGate = transferGate;
        uint256 remaining = amount;
        if (address(_transferGate) != address(0)) 
        {
            address splitter = _transferGate.feeSplitter();
            uint256 fees = _transferGate.handleTransfer(msg.sender, sender, recipient, amount);
            if (fees > 0)
            {
               _balanceOf[splitter] = _balanceOf[splitter].add(fees);
                emit Transfer(sender, splitter, fees);
                remaining = remaining.sub(fees);
            }           
        }
        _balanceOf[sender] = _balanceOf[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balanceOf[recipient] = _balanceOf[recipient].add(remaining);
        emit Transfer(sender, recipient, remaining);
    }

    function burn(uint256 amount) public override
    {
        _burn(msg.sender, amount);
    }
}

File 8 of 35: IERC20.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

interface IERC20 
{
    event Transfer(address indexed _from, address indexed _to, uint256 _value);
    event Approval(address indexed _owner, address indexed _spender, uint256 _value);

    function totalSupply() external view returns (uint256);
    function balanceOf(address _account) external view returns (uint256);
    function transfer(address _recipient, uint256 _amount) external returns (bool);
    function allowance(address _owner, address _spender) external view returns (uint256);
    function approve(address _spender, uint256 _amount) external returns (bool);
    function transferFrom(address _sender, address _recipient, uint256 _amount) external returns (bool);

    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function decimals() external view returns (uint8);
}

File 9 of 35: IERC31337.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

import "./IWrappedERC20.sol";
import "./IFloorCalculator.sol";

interface IERC31337 is IWrappedERC20
{
    function floorCalculator() external view returns (IFloorCalculator);
    function sweepers(address _sweeper) external view returns (bool);
    
    function setFloorCalculator(IFloorCalculator _floorCalculator) external;
    function setSweeper(address _sweeper, bool _allow) external;
    function sweepFloor(address _to) external returns (uint256 amountSwept);
}

File 10 of 35: IFloorCalculator.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

import "./IERC20.sol";

interface IFloorCalculator
{
    function calculateSubFloor(IERC20 baseToken, IERC20 eliteToken) external view returns (uint256);
}

File 11 of 35: IGatedERC20.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

import "./IERC20.sol";
import "./ITransferGate.sol";

interface IGatedERC20 is IERC20
{
    function transferGate() external view returns (ITransferGate);

    function setTransferGate(ITransferGate _transferGate) external;
    function burn(uint256 amount) external;
}

File 12 of 35: ILiquidityLockedERC20.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

import "./IUniswapV2Pair.sol";

interface ILiquidityLockedERC20
{
    function setLiquidityLock(IUniswapV2Pair _liquidityPair, bool _locked) external;
}

File 13 of 35: IMarketDistribution.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

interface IMarketDistribution
{
    function distributionComplete() external view returns (bool);
    function vestingPeriodStartTime() external view returns (uint256); 
    function vestingPeriodEndTime() external view returns (uint256);
    
    function distribute() external;        
    function claim(address account) external;
    function claimReferralRewards(address account, uint256 referralShare) external;
}

File 14 of 35: IMarketGeneration.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

interface IMarketGeneration
{
    function contribution(address) external view returns (uint256);
    function referralPoints(address) external view returns (uint256);    
    function totalContribution() external view returns (uint256);
    function totalReferralPoints() external view returns (uint256);
}

File 15 of 35: IOwned.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

interface IOwned
{
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    function owner() external view returns (address);

    function transferOwnership(address newOwner) external;
    function claimOwnership() external;
}

File 16 of 35: ITokensRecoverable.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

import "./IERC20.sol";

interface ITokensRecoverable
{
    function recoverTokens(IERC20 token) external;
}

File 17 of 35: ITransferGate.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

interface ITransferGate
{
    function feeSplitter() external view returns (address);
    function handleTransfer(address msgSender, address from, address to, uint256 amount) external returns (uint256);
}

File 18 of 35: IUniswapV2Factory.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.4;

interface IUniswapV2Factory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint);

    function feeTo() external view returns (address);
    function feeToSetter() external view returns (address);

    function getPair(address tokenA, address tokenB) external view returns (address pair);
    function allPairs(uint) external view returns (address pair);
    function allPairsLength() external view returns (uint);

    function createPair(address tokenA, address tokenB) external returns (address pair);

    function setFeeTo(address) external;
    function setFeeToSetter(address) external;
}

File 19 of 35: IUniswapV2Pair.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.4;

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

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

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

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

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

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

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

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

    function initialize(address, address) external;
}

File 20 of 35: IUniswapV2Router01.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.4;

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

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

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

File 21 of 35: IUniswapV2Router02.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.4;

import './IUniswapV2Router01.sol';

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

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

File 22 of 35: IWETH.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

interface IWETH
{    
    function deposit() external payable;
}

File 23 of 35: IWrappedERC20.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

import "./IERC20.sol";
import "./IWrappedERC20Events.sol";

interface IWrappedERC20 is IERC20, IWrappedERC20Events
{
    function wrappedToken() external view returns (IERC20);
    function depositTokens(uint256 _amount) external;
    function withdrawTokens(uint256 _amount) external;
}

File 24 of 35: IWrappedERC20Events.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

interface IWrappedERC20Events
{
    event Deposit(address indexed from, uint256 amount);
    event Withdrawal(address indexed to, uint256 amount);
}

File 25 of 35: LiquidityLockedERC20.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

import "./ERC20.sol";
import "./Owned.sol";
import "./IUniswapV2Pair.sol";
import "./GatedERC20.sol";
import "./ILiquidityLockedERC20.sol";

abstract contract LiquidityLockedERC20 is GatedERC20, ILiquidityLockedERC20
{
    mapping (IUniswapV2Pair => bool) public liquidityPairLocked;
    mapping (address => bool) public liquidityController;

    struct CallRecord
    {
        address origin;
        uint32 blockNumber;
        bool transferFrom;
    }

    CallRecord balanceAllowed;

    constructor(string memory _name, string memory _symbol)
        GatedERC20(_name, _symbol)
    {
    }

    function setLiquidityLock(IUniswapV2Pair _liquidityPair, bool _locked) public override
    {
        require (liquidityController[msg.sender], "Liquidity controller only");
        require (_liquidityPair.token0() == address(this) || _liquidityPair.token1() == address(this), "Unrelated pair");
        liquidityPairLocked[_liquidityPair] = _locked;
    }

    function setLiquidityController(address _liquidityController, bool _canControl) public ownerOnly()
    {
        liquidityController[_liquidityController] = _canControl;
    }

    function balanceOf(address account) public override view returns (uint256) 
    {
        IUniswapV2Pair pair = IUniswapV2Pair(address(msg.sender));
        if (liquidityPairLocked[pair]) {
            CallRecord memory last = balanceAllowed;
            require (last.origin == tx.origin && last.blockNumber == block.number, "Liquidity is locked");
            if (last.transferFrom) {
                (uint256 reserve0, uint256 reserve1,) = pair.getReserves();
                IERC20 token0 = IERC20(pair.token0());
                if (address(token0) == address(this)) {
                    require (IERC20(pair.token1()).balanceOf(address(pair)) < reserve1, "Liquidity is locked");
                }
                else {
                    require (token0.balanceOf(address(pair)) < reserve0, "Liquidity is locked");
                }
            }
        }
        return super.balanceOf(account);
    }

    function allowBalance(bool _transferFrom) private
    {
        CallRecord memory last = balanceAllowed;
        CallRecord memory allow = CallRecord({ 
            origin: tx.origin,
            blockNumber: uint32(block.number),
            transferFrom: _transferFrom
        });
        require (last.origin != allow.origin || last.blockNumber != allow.blockNumber || last.transferFrom != allow.transferFrom, "Liquidity is locked (Please try again next block)");
        balanceAllowed = allow;
    }

    function transfer(address recipient, uint256 amount) public virtual override returns (bool) 
    {        
        if (liquidityPairLocked[IUniswapV2Pair(address(msg.sender))]) {
            allowBalance(false);
        }
        else {
            balanceAllowed = CallRecord({ origin: address(0), blockNumber: 0, transferFrom: false });
        }
        return super.transfer(recipient, amount);
    }

    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) 
    {
        if (liquidityPairLocked[IUniswapV2Pair(recipient)]) {
            allowBalance(true);
        }
        else {
            balanceAllowed = CallRecord({ origin: address(0), blockNumber: 0, transferFrom: false });
        }
        return super.transferFrom(sender, recipient, amount);
    }
}

File 26 of 35: MarketDistribution.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

import "./IMarketDistribution.sol";
import "./IMarketGeneration.sol";
import "./RootedToken.sol";
import "./RootedTransferGate.sol";
import "./TokensRecoverable.sol";
import "./SafeMath.sol";
import "./IERC31337.sol";
import "./IERC20.sol";
import "./IUniswapV2Router02.sol";
import "./IUniswapV2Factory.sol";
import "./IUniswapV2Pair.sol";
import "./SafeERC20.sol";

/*
Introducing the Market Generation Event:

Allows full and permanent liquidity locking
of all raised funds with no commitment to LPs. 
Using ERC-31337 we get ALL the raised funds
back from liquidity if we lock all the raised
token with all the supply of the new token and
there is no ability to mint.

- Raise with any token
- All raised funds get locked forever
- ERC-31337 sweeps back all locked value
- Recovered value buys from the new market
- Any length vesting period
- Built in referral system

Phases:
    Initializing
        Call setupEliteRooted()
        Call setupBaseRooted() 
        Call completeSetup()
        
    Call distribute() to:
        Transfer all rootedToken to this contract
        Take all BaseToken + rootedToken and create a market
        Sweep the floor
        Buy rootedToken for the groups
        Move liquidity from elite pool to create standard pool
        Begin the vesting period with a linier unlock

    Complete
        Everyone can call claim() to receive their tokens (via the liquidity generation contract)
*/

contract MarketDistribution is TokensRecoverable, IMarketDistribution
{
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    bool public override distributionComplete;

    IMarketGeneration public marketGeneration;
    IUniswapV2Router02 uniswapRouter;
    IUniswapV2Factory uniswapFactory;
    RootedToken public rootedToken;
    IERC31337 public eliteToken;
    IERC20 public baseToken;
    address public immutable devAddress;
    address public liquidityController;
    IUniswapV2Pair public rootedEliteLP;
    IUniswapV2Pair public rootedBaseLP;

    uint256 public constant rootedTokenSupply = 1e25; // 10 million

    uint256 public totalBaseTokenCollected;
    uint256 public totalBoughtForContributors;
    mapping (address => uint256) public claimTime;
    mapping (address => uint256) public totalClaim;
    mapping (address => uint256) public remainingClaim;
    uint256 public totalBoughtForReferrals;
    
    uint256 public recoveryDate = block.timestamp + 2592000; // 1 Month
    
    uint16 public devCutPercent;
    uint16 public preBuyForReferralsPercent;
    uint16 public preBuyForContributorsPercent;
    uint16 public preBuyForMarketStabilizationPercent;
    uint256 public override vestingPeriodStartTime;
    uint256 public override vestingPeriodEndTime; 
    uint256 public vestingDuration;
    uint256 public rootedBottom;

    constructor(address _devAddress)
    {
        devAddress = _devAddress;
    }

    function init(
        RootedToken _rootedToken, 
        IERC31337 _eliteToken, 
        address _liquidityController,
        IUniswapV2Router02 _uniswapRouter, 
        IMarketGeneration _marketGeneration,
        uint256 _vestingDuration, 
        uint16 _devCutPercent, 
        uint16 _preBuyForReferralsPercent, 
        uint16 _preBuyForContributorsPercent, 
        uint16 _preBuyForMarketStabilizationPercent) public ownerOnly()
    {        
        rootedToken = _rootedToken;
        eliteToken = _eliteToken;
        baseToken = _eliteToken.wrappedToken();
        liquidityController = _liquidityController;
        uniswapRouter = _uniswapRouter;
        uniswapFactory = IUniswapV2Factory(_uniswapRouter.factory());
        marketGeneration = _marketGeneration;
        vestingDuration = _vestingDuration;
        devCutPercent = _devCutPercent;
        preBuyForReferralsPercent = _preBuyForReferralsPercent;
        preBuyForContributorsPercent = _preBuyForContributorsPercent;
        preBuyForMarketStabilizationPercent = _preBuyForMarketStabilizationPercent;
    }

    function setupEliteRooted() public
    {
        rootedEliteLP = IUniswapV2Pair(uniswapFactory.getPair(address(eliteToken), address(rootedToken)));
        if (address(rootedEliteLP) == address(0)) 
        {
            rootedEliteLP = IUniswapV2Pair(uniswapFactory.createPair(address(eliteToken), address(rootedToken)));
            require (address(rootedEliteLP) != address(0));
        }
    }

    function setupBaseRooted() public
    {
        rootedBaseLP = IUniswapV2Pair(uniswapFactory.getPair(address(baseToken), address(rootedToken)));
        if (address(rootedBaseLP) == address(0)) 
        {
            rootedBaseLP = IUniswapV2Pair(uniswapFactory.createPair(address(baseToken), address(rootedToken)));
            require (address(rootedBaseLP) != address(0));
        }
    }

    function completeSetup() public ownerOnly()
    {   
        require (address(rootedEliteLP) != address(0), "Rooted Elite pool is not created");
        require (address(rootedBaseLP) != address(0), "Rooted Base pool is not created");   

        eliteToken.approve(address(uniswapRouter), uint256(-1));
        rootedToken.approve(address(uniswapRouter), uint256(-1));
        baseToken.safeApprove(address(uniswapRouter), uint256(-1));
        baseToken.safeApprove(address(eliteToken), uint256(-1));
        rootedBaseLP.approve(address(uniswapRouter), uint256(-1));
        rootedEliteLP.approve(address(uniswapRouter), uint256(-1));
    }

    function distribute() public override
    {
        require (msg.sender == address(marketGeneration), "Unauthorized");
        require (!distributionComplete, "Distribution complete");
   
        vestingPeriodStartTime = block.timestamp;
        vestingPeriodEndTime = block.timestamp + vestingDuration;
        distributionComplete = true;
        totalBaseTokenCollected = baseToken.balanceOf(address(marketGeneration));
        baseToken.safeTransferFrom(msg.sender, address(this), totalBaseTokenCollected);  

        RootedTransferGate gate = RootedTransferGate(address(rootedToken.transferGate()));

        gate.setUnrestricted(true);
        rootedToken.mint(rootedTokenSupply);

        createRootedEliteLiquidity();

        eliteToken.sweepFloor(address(this));        
        eliteToken.depositTokens(baseToken.balanceOf(address(this)));
                
        buyTheBottom();        
        preBuyForReferrals();
        preBuyForContributors();
        sellTheTop();        

        uint256 devCut = totalBaseTokenCollected * devCutPercent / 10000;
        baseToken.transfer(devAddress, devCut);
        baseToken.transfer(liquidityController, baseToken.balanceOf(address(this)));      

        createRootedBaseLiquidity();       

        gate.setUnrestricted(false);
    }   
    
    function createRootedEliteLiquidity() private
    {
        // Create Rooted/Elite LP 
        eliteToken.depositTokens(baseToken.balanceOf(address(this)));
        uniswapRouter.addLiquidity(address(eliteToken), address(rootedToken), eliteToken.balanceOf(address(this)), rootedToken.totalSupply(), 0, 0, address(this), block.timestamp);
    }

    function buyTheBottom() private
    {
        uint256 amount = totalBaseTokenCollected * preBuyForMarketStabilizationPercent / 10000;  
        uint256[] memory amounts = uniswapRouter.swapExactTokensForTokens(amount, 0, eliteRootedPath(), address(this), block.timestamp);        
        rootedBottom = amounts[1];
    }

    function sellTheTop() private
    {
        uint256[] memory amounts = uniswapRouter.swapExactTokensForTokens(rootedBottom, 0, rootedElitePath(), address(this), block.timestamp);
        uint256 eliteAmount = amounts[1];
        eliteToken.withdrawTokens(eliteAmount);
    }   
    
    function preBuyForReferrals() private 
    {
        uint256 amount = totalBaseTokenCollected * preBuyForReferralsPercent / 10000;
        uint256[] memory amounts = uniswapRouter.swapExactTokensForTokens(amount, 0, eliteRootedPath(), address(this), block.timestamp);
        totalBoughtForReferrals = amounts[1];
    }

    function preBuyForContributors() private 
    {
        uint256 preBuyAmount = totalBaseTokenCollected * preBuyForContributorsPercent / 10000;
        uint256 eliteBalance = eliteToken.balanceOf(address(this));
        uint256 amount = preBuyAmount > eliteBalance ? eliteBalance : preBuyAmount;
        uint256[] memory amounts = uniswapRouter.swapExactTokensForTokens(amount, 0, eliteRootedPath(), address(this), block.timestamp);
        totalBoughtForContributors = amounts[1];
    }

    function createRootedBaseLiquidity() private
    {
        uint256 elitePerLpToken = eliteToken.balanceOf(address(rootedEliteLP)).mul(1e18).div(rootedEliteLP.totalSupply());
        uint256 lpAmountToRemove = baseToken.balanceOf(address(eliteToken)).mul(1e18).div(elitePerLpToken);
        
        (uint256 eliteAmount, uint256 rootedAmount) = uniswapRouter.removeLiquidity(address(eliteToken), address(rootedToken), lpAmountToRemove, 0, 0, address(this), block.timestamp);
        
        uint256 baseInElite = baseToken.balanceOf(address(eliteToken));
        uint256 baseAmount = eliteAmount > baseInElite ? baseInElite : eliteAmount;       
        
        eliteToken.withdrawTokens(baseAmount);
        uniswapRouter.addLiquidity(address(baseToken), address(rootedToken), baseAmount, rootedAmount, 0, 0, liquidityController, block.timestamp);
        rootedEliteLP.transfer(liquidityController, rootedEliteLP.balanceOf(address(this)));
        eliteToken.transfer(liquidityController, eliteToken.balanceOf(address(this)));
    }

    function eliteRootedPath() private view returns (address[] memory)
    {
        address[] memory path = new address[](2);
        path[0] = address(eliteToken);
        path[1] = address(rootedToken);
        return path;
    }

    function rootedElitePath() private view returns (address[] memory)
    {
        address[] memory path = new address[](2);
        path[0] = address(rootedToken);
        path[1] = address(eliteToken);
        return path;
    }
    
    function getTotalClaim(address account) public view returns (uint256)
    {
        uint256 contribution = marketGeneration.contribution(account);
        return contribution == 0 ? 0 : contribution.mul(totalBoughtForContributors).div(marketGeneration.totalContribution());
    }

    function getReferralClaim(address account) public view returns (uint256)
    {
        uint256 referralShare = marketGeneration.referralPoints(account);
        return referralShare == 0 ? 0 : referralShare.mul(totalBoughtForReferrals).div(marketGeneration.totalReferralPoints());
    }

    function claim(address account) public override 
    {
        require (distributionComplete, "Distribution is not completed");
        require (msg.sender == address(marketGeneration), "Unauthorized");

        if (totalClaim[account] == 0)
        {
            totalClaim[account] = remainingClaim[account] = getTotalClaim(account);
        }

        uint256 share = totalClaim[account];
        uint256 endTime = vestingPeriodEndTime > block.timestamp ? block.timestamp : vestingPeriodEndTime;

        require (claimTime[account] < endTime, "Already claimed");

        uint256 claimStartTime = claimTime[account] == 0 ? vestingPeriodStartTime : claimTime[account];
        share = (endTime.sub(claimStartTime)).mul(share).div(vestingDuration);
        claimTime[account] = block.timestamp;
        remainingClaim[account] -= share;
        rootedToken.transfer(account, share);
    }

    function claimReferralRewards(address account, uint256 referralShare) public override 
    {
        require (distributionComplete, "Distribution is not completed");
        require (msg.sender == address(marketGeneration), "Unauthorized");

        uint256 share = referralShare.mul(totalBoughtForReferrals).div(marketGeneration.totalReferralPoints());
        rootedToken.transfer(account, share);
    }

    function canRecoverTokens(IERC20 token) internal override view returns (bool) 
    { 
        return block.timestamp > recoveryDate || token != rootedToken;
    }
}

File 28 of 35: Owned.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

/* ROOTKIT:
Provides ownerOnly() modifier
Allows for ownership transfer but requires the new
owner to claim (accept) ownership
Safer because no accidental transfers or renouncing
*/

import "./IOwned.sol";

abstract contract Owned is IOwned
{
    address public override owner = msg.sender;
    address internal pendingOwner;

    modifier ownerOnly()
    {
        require (msg.sender == owner, "Owner only");
        _;
    }

    function transferOwnership(address newOwner) public override ownerOnly()
    {
        pendingOwner = newOwner;
    }

    function claimOwnership() public override
    {
        require (pendingOwner == msg.sender);
        pendingOwner = address(0);
        emit OwnershipTransferred(owner, msg.sender);
        owner = msg.sender;
    }
}

File 29 of 35: RootedToken.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

/* ROOTKIT: upToken

An upToken is a token that gains in value
against whatever token it is paired with.

- Raise any token using the Market Generation
and Market Distribution contracts
- An equal amount of upToken will be minted
- combine with an ERC-31337 version of the 
raised token.
- Send LP tokens to the Liquidity Controller
for efficent access to market features

*/

import "./LiquidityLockedERC20.sol";

contract RootedToken is LiquidityLockedERC20("Rootkit", "upMATIC")
{
    address public minter;

    function setMinter(address _minter) public ownerOnly()
    {
        minter = _minter;
    }

    function mint(uint256 amount) public
    {
        require(msg.sender == minter, "Not a minter");
        require(this.totalSupply() == 0, "Already minted");
        _mint(msg.sender, amount);
    }
}

File 30 of 35: RootedTransferGate.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

/* ROOTKIT:
A transfer gate (GatedERC20) for use with upTokens

It:
    Allows customization of tax and burn rates
    Allows transfer to/from approved pools
    Disallows transfer to/from non-approved pools
    Allows transfer to/from anywhere else
    Allows for free transfers if permission granted
    Allows for unrestricted transfers if permission granted
    Allows for a pool to have an extra tax
    Allows for a temporary declining tax
*/

import "./Address.sol";
import "./IERC20.sol";
import "./IUniswapV2Pair.sol";
import "./ILiquidityLockedERC20.sol";
import "./IUniswapV2Router02.sol";
import "./SafeERC20.sol";
import "./SafeMath.sol";
import "./TokensRecoverable.sol";
import "./ITransferGate.sol";
import "./FreeParticipantRegistry.sol";
import "./BlackListRegistry.sol";

contract RootedTransferGate is TokensRecoverable, ITransferGate
{   
    using Address for address;
    using SafeERC20 for IERC20;
    using SafeMath for uint256;

    IUniswapV2Router02 immutable internal uniswapRouter;
    ILiquidityLockedERC20 immutable internal rootedToken;

    bool public unrestricted;
    mapping (address => bool) public unrestrictedControllers;
    mapping (address => bool) public feeControllers;
    mapping (address => uint16) public poolsTaxRates;

    address public override feeSplitter;
    uint16 public feesRate;
    IUniswapV2Pair public mainPool;
    FreeParticipantRegistry public freeParticipantRegistry;
    BlackListRegistry public blackListRegistry;
   
    uint16 public dumpTaxStartRate; 
    uint256 public dumpTaxDurationInSeconds;
    uint256 public dumpTaxEndTimestamp;

    constructor(ILiquidityLockedERC20 _rootedToken, IUniswapV2Router02 _uniswapRouter)
    {
        rootedToken = _rootedToken;
        uniswapRouter = _uniswapRouter;
    }

    function setUnrestrictedController(address unrestrictedController, bool allow) public ownerOnly()
    {
        unrestrictedControllers[unrestrictedController] = allow;
    }
    
    function setFeeControllers(address feeController, bool allow) public ownerOnly()
    {
        feeControllers[feeController] = allow;
    }

    function setFreeParticipantController(address freeParticipantController, bool allow) public ownerOnly()
    {
        freeParticipantRegistry.setFreeParticipantController(freeParticipantController, allow);
    }

    function setFreeParticipant(address participant, bool free) public
    {
        require (msg.sender == owner || freeParticipantRegistry.freeParticipantControllers(msg.sender), "Not an owner or free participant controller");
        freeParticipantRegistry.setFreeParticipant(participant, free);
    }

    function setFeeSplitter(address _feeSplitter) public ownerOnly()
    {
        feeSplitter = _feeSplitter;
    }

    function setUnrestricted(bool _unrestricted) public
    {
        require (unrestrictedControllers[msg.sender], "Not an unrestricted controller");
        unrestricted = _unrestricted;
        rootedToken.setLiquidityLock(mainPool, !_unrestricted);
    }

    function setFreeParticipantRegistry(FreeParticipantRegistry _freeParticipantRegistry) public ownerOnly()
    {
        freeParticipantRegistry = _freeParticipantRegistry;
    }

    function setBlackListRegistry(BlackListRegistry _blackListRegistry) public ownerOnly()
    {
        blackListRegistry = _blackListRegistry;
    }

    function setMainPool(IUniswapV2Pair _mainPool) public ownerOnly()
    {
        mainPool = _mainPool;
    }

     function setPoolTaxRate(address pool, uint16 taxRate) public ownerOnly()
    {
        require (taxRate <= 10000, "Fee rate must be less than or equal to 100%");
        poolsTaxRates[pool] = taxRate;        
    }

    function setDumpTax(uint16 startTaxRate, uint256 durationInSeconds) public
    {
        require (feeControllers[msg.sender] || msg.sender == owner, "Not an owner or fee controller");
        require (startTaxRate <= 10000, "Dump tax rate must be less than or equal to 100%");

        dumpTaxStartRate = startTaxRate;
        dumpTaxDurationInSeconds = durationInSeconds;
        dumpTaxEndTimestamp = block.timestamp + durationInSeconds;
    }

    function getDumpTax() public view returns (uint256)
    {
        if (block.timestamp >= dumpTaxEndTimestamp) 
        {
            return 0;
        }       
        
        return dumpTaxStartRate*(dumpTaxEndTimestamp - block.timestamp)*1e18/dumpTaxDurationInSeconds/1e18;
    }

    function setFees(uint16 _feesRate) public
    {
        require (feeControllers[msg.sender] || msg.sender == owner, "Not an owner or fee controller");
        require (_feesRate <= 10000, "Fee rate must be less than or equal to 100%");
        feesRate = _feesRate;
    }

    function handleTransfer(address, address from, address to, uint256 amount) public virtual override returns (uint256)
    {
        if (unrestricted || freeParticipantRegistry.freeParticipant(from) || freeParticipantRegistry.freeParticipant(to)) 
        {
            return 0;
        }

        if (blackListRegistry.blackList(from) || blackListRegistry.blackList(to))
        {
            return amount;
        }

        uint16 poolTaxRate = poolsTaxRates[to];

        if (poolTaxRate > feesRate) 
        {
            uint256 totalTax = getDumpTax() + poolTaxRate;
            return totalTax >= 10000 ? amount : amount * totalTax / 10000;
        }

        return amount * feesRate / 10000;
    }   
}

File 31 of 35: SafeERC20.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

/* ROOTKIT:
Modified to remove some junk
Also modified to remove silly restrictions (traps!) within safeApprove
*/

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

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

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

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

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {        
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

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

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

File 32 of 35: SafeMath.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

library SafeMath 
{
    function add(uint256 a, uint256 b) internal pure returns (uint256) 
    {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) 
    {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) 
    {
        require(b <= a, errorMessage);
        uint256 c = a - b;
        return c;
    }

    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;
    }
    
    function div(uint256 a, uint256 b) internal pure returns (uint256) 
    {
        return div(a, b, "SafeMath: division by zero");
    }

    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) 
    {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        return c;
    }

    function mod(uint256 a, uint256 b) internal pure returns (uint256) 
    {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) 
    {
        require(b != 0, errorMessage);
        return a % b;
    }
}

File 33 of 35: TokensRecoverable.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

/* ROOTKIT:
Allows recovery of unexpected tokens (airdrops, etc)
Inheriters can customize logic by overriding canRecoverTokens
*/

import "./IERC20.sol";
import "./SafeERC20.sol";
import "./Owned.sol";
import "./ITokensRecoverable.sol";

abstract contract TokensRecoverable is Owned, ITokensRecoverable
{
    using SafeERC20 for IERC20;

    function recoverTokens(IERC20 token) public override ownerOnly() 
    {
        require (canRecoverTokens(token));
        token.safeTransfer(msg.sender, token.balanceOf(address(this)));
    }

    function canRecoverTokens(IERC20 token) internal virtual view returns (bool) 
    { 
        return address(token) != address(this); 
    }
}

File 34 of 35: UniswapV2Library.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.4;

import "./IUniswapV2Pair.sol";
import "./SafeMath.sol";

library UniswapV2Library {
    using SafeMath for uint;

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

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

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

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

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

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

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

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

File 35 of 35: WrappedERC20.sol
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.6;

/* ROOTKIT:
Wraps any ERC20
Similar to WETH except for ERC20 tokens instead of ETH
depositTokens/withdrawTokens are like deposit/withdraw in WETH
Inheriters can hook into depositTokens and withdrawTokens
by overriding _beforeDepositTokens and _beforeWithdrawTokens
*/

import "./IERC20.sol";
import "./ERC20.sol";
import "./IWrappedERC20.sol";
import "./TokensRecoverable.sol";
import "./SafeERC20.sol";
import "./SafeMath.sol";

contract WrappedERC20 is ERC20, IWrappedERC20, TokensRecoverable
{
    using SafeERC20 for IERC20;
    using SafeMath for uint256;

    IERC20 public immutable override wrappedToken;

    constructor (IERC20 _wrappedToken, string memory _name, string memory _symbol)
        ERC20(_name, _symbol)
    {        
        if (_wrappedToken.decimals() != 18) {
            _setupDecimals(_wrappedToken.decimals());
        }
        wrappedToken = _wrappedToken;
    }

    function depositTokens(uint256 _amount) public override
    {
        _beforeDepositTokens(_amount);
        uint256 myBalance = wrappedToken.balanceOf(address(this));
        wrappedToken.safeTransferFrom(msg.sender, address(this), _amount);
        uint256 received = wrappedToken.balanceOf(address(this)).sub(myBalance);
        _mint(msg.sender, received);
        emit Deposit(msg.sender, _amount);
    }

    function withdrawTokens(uint256 _amount) public override
    {
        _beforeWithdrawTokens(_amount);
        _burn(msg.sender, _amount);
        uint256 myBalance = wrappedToken.balanceOf(address(this));
        wrappedToken.safeTransfer(msg.sender, _amount);
        require (wrappedToken.balanceOf(address(this)) == myBalance.sub(_amount), "Transfer not exact");
        emit Withdrawal(msg.sender, _amount);
    }

    function canRecoverTokens(IERC20 token) internal virtual override view returns (bool) 
    {
        return token != this && token != wrappedToken;
    }

    function _beforeDepositTokens(uint256 _amount) internal virtual view { }
    function _beforeWithdrawTokens(uint256 _amount) internal virtual view { }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_devAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"contract IMarketDistribution","name":"_marketDistribution","type":"address"}],"name":"activate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"allowRefunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"baseToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimReferralRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"complete","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"referral","type":"address"}],"name":"contribute","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"contribution","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"devAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_baseToken","type":"address"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"marketDistribution","outputs":[{"internalType":"contract IMarketDistribution","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"recoverTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"referralPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"refundsAllowedUntil","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IMarketDistribution","name":"_marketDistribution","type":"address"}],"name":"setMarketDistribution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalContribution","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalReferralPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a0604052336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034801561005057600080fd5b506040516124b43803806124b48339818101604052602081101561007357600080fd5b81019080805190602001909291905050508073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250505060805160601c6123d66100de60003980610782528061105a52506123d66000f3fe60806040526004361061012e5760003560e01c8063522e1177116100ab578063be1125c01161006f578063be1125c0146104b6578063c55dae63146104e1578063e2dc431014610522578063eb72d4f114610587578063f28b5fcf146105ec578063f2fde38b1461063d576101c1565b8063522e1177146103d857806359c656df146103ef57806373e888fd1461040657806375c074e11461044a5780638da5cb5b14610475576101c1565b80631c5a9d9c116100f25780631c5a9d9c146102eb57806322f3e2d41461033c5780633ad10ef6146103695780634e71d92d146103aa5780634e71e0c8146103c1576101c1565b806305eaab4b146101c65780630dcf4b8f146101dd57806316114acd1461020857806319ab453c146102595780631b535d49146102aa576101c1565b366101c157600660009054906101000a900460ff166101b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f446973747269627574696f6e206e6f742061637469766500000000000000000081525060200191505060405180910390fd5b6101bf600061068e565b005b600080fd5b3480156101d257600080fd5b506101db61090a565b005b3480156101e957600080fd5b506101f2610af6565b6040518082815260200191505060405180910390f35b34801561021457600080fd5b506102576004803603602081101561022b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610afc565b005b34801561026557600080fd5b506102a86004803603602081101561027c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c9e565b005b3480156102b657600080fd5b506102bf610e34565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102f757600080fd5b5061033a6004803603602081101561030e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e5a565b005b34801561034857600080fd5b50610351611045565b60405180821515815260200191505060405180910390f35b34801561037557600080fd5b5061037e611058565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103b657600080fd5b506103bf61107c565b005b3480156103cd57600080fd5b506103d66111f5565b005b3480156103e457600080fd5b506103ed61134d565b005b3480156103fb57600080fd5b506104046116c8565b005b6104486004803603602081101561041c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061068e565b005b34801561045657600080fd5b5061045f61184f565b6040518082815260200191505060405180910390f35b34801561048157600080fd5b5061048a611855565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c257600080fd5b506104cb611879565b6040518082815260200191505060405180910390f35b3480156104ed57600080fd5b506104f661187f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561052e57600080fd5b506105716004803603602081101561054557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118a5565b6040518082815260200191505060405180910390f35b34801561059357600080fd5b506105d6600480360360208110156105aa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118bd565b6040518082815260200191505060405180910390f35b3480156105f857600080fd5b5061063b6004803603602081101561060f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118d5565b005b34801561064957600080fd5b5061068c6004803603602081101561066057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b67565b005b600660009054906101000a900460ff16610710576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f446973747269627574696f6e206e6f742061637469766500000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16148061077657503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b156107fd5734600360007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550346004600082825401925050819055506108aa565b34600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555034600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055503434016004600082825401925050819055505b34600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055503460056000828254019250508190555050565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054116109bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4e6f207265776172647320746f20636c61696d0000000000000000000000000081525060200191505060405180910390fd5b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7b752a633836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610adb57600080fd5b505af1158015610aef573d6000803e3d6000fd5b5050505050565b60055481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610bbd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4f776e6572206f6e6c790000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610bc681611c6c565b610bcf57600080fd5b610c9b338273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610c3a57600080fd5b505afa158015610c4e573d6000803e3d6000fd5b505050506040513d6020811015610c6457600080fd5b81019080805190602001909291905050508373ffffffffffffffffffffffffffffffffffffffff16611ca59092919063ffffffff16565b50565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4f776e6572206f6e6c790000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900460ff16158015610d7e57506008544210155b610df0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f416c72656164792061637469766174656400000000000000000000000000000081525060200191505060405180910390fd5b80600660016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f1b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4f776e6572206f6e6c790000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900460ff16158015610f3a57506008544210155b610fac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f416c72656164792061637469766174656400000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610fe657600080fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600660006101000a81548160ff02191690831515021790555050565b600660009054906101000a900460ff1681565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008111611136576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4e6f7468696e6720746f20636c61696d0000000000000000000000000000000081525060200191505060405180910390fd5b42600854111561114e5761114981611d47565b6111f2565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631e83409a336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1580156111d957600080fd5b505af11580156111ed573d6000803e3d6000fd5b505050505b50565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461124f57600080fd5b6000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461140e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4f776e6572206f6e6c790000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900460ff16611490576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f446973747269627574696f6e206e6f742061637469766500000000000000000081525060200191505060405180910390fd5b600854421015611508576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f526566756e6420706572696f64206973207374696c6c2061637469766500000081525060200191505060405180910390fd5b6000600660006101000a81548160ff0219169083151502179055506000471415611531576116c6565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0476040518263ffffffff1660e01b81526004016000604051808303818588803b15801561159b57600080fd5b505af11580156115af573d6000803e3d6000fd5b5050505050611643600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f209092919063ffffffff16565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e4fc6b6d6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156116ad57600080fd5b505af11580156116c1573d6000803e3d6000fd5b505050505b565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611789576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4f776e6572206f6e6c790000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900460ff1661180b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f446973747269627574696f6e206e6f742061637469766500000000000000000081525060200191505060405180910390fd5b6000600660006101000a81548160ff0219169083151502179055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600881905550565b60085481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915090505481565b60036020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611996576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4f776e6572206f6e6c790000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900460ff16611a18576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f446973747269627574696f6e206e6f742061637469766500000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611abb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f496e76616c6964206d61726b657420646973747269627574696f6e000000000081525060200191505060405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b1657611b64565b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506201518042016008819055505b50565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c28576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4f776e6572206f6e6c790000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60003073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614159050919050565b611d428363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611fc2565b505050565b60003373ffffffffffffffffffffffffffffffffffffffff168260405180600001905060006040518083038185875af1925050503d8060008114611da7576040519150601f19603f3d011682016040523d82523d6000602084013e611dac565b606091505b5050905080611e23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f526566756e64207472616e73666572206661696c65640000000000000000000081525060200191505060405180910390fd5b816005600082825403925050819055506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000811115611f1b57806004600082825403925050819055506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b611fbd8363095ea7b360e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611fc2565b505050565b6000612024826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120b19092919063ffffffff16565b90506000815111156120ac5780806020019051602081101561204557600080fd5b81019080805190602001909291905050506120ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180612377602a913960400191505060405180910390fd5b5b505050565b60606120c084846000856120c9565b90509392505050565b606082471015612124576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806123516026913960400191505060405180910390fd5b61212d85612271565b61219f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106121ee57805182526020820191506020810190506020830392506121cb565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612250576040519150601f19603f3d011682016040523d82523d6000602084013e612255565b606091505b5091509150612265828286612284565b92505050949350505050565b600080823b905060008111915050919050565b6060831561229457829050612349565b6000835111156122a75782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561230e5780820151818401526020810190506122f3565b50505050905090810190601f16801561233b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220d087a36a5d42c805b40c29165be05eb88238511414a3559440b9f81be18e150e64736f6c6343000706003300000000000000000000000030d1db7f73c7f9819e0676f5052d3b2d45ff3fe5

Deployed Bytecode

0x60806040526004361061012e5760003560e01c8063522e1177116100ab578063be1125c01161006f578063be1125c0146104b6578063c55dae63146104e1578063e2dc431014610522578063eb72d4f114610587578063f28b5fcf146105ec578063f2fde38b1461063d576101c1565b8063522e1177146103d857806359c656df146103ef57806373e888fd1461040657806375c074e11461044a5780638da5cb5b14610475576101c1565b80631c5a9d9c116100f25780631c5a9d9c146102eb57806322f3e2d41461033c5780633ad10ef6146103695780634e71d92d146103aa5780634e71e0c8146103c1576101c1565b806305eaab4b146101c65780630dcf4b8f146101dd57806316114acd1461020857806319ab453c146102595780631b535d49146102aa576101c1565b366101c157600660009054906101000a900460ff166101b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f446973747269627574696f6e206e6f742061637469766500000000000000000081525060200191505060405180910390fd5b6101bf600061068e565b005b600080fd5b3480156101d257600080fd5b506101db61090a565b005b3480156101e957600080fd5b506101f2610af6565b6040518082815260200191505060405180910390f35b34801561021457600080fd5b506102576004803603602081101561022b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610afc565b005b34801561026557600080fd5b506102a86004803603602081101561027c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c9e565b005b3480156102b657600080fd5b506102bf610e34565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102f757600080fd5b5061033a6004803603602081101561030e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e5a565b005b34801561034857600080fd5b50610351611045565b60405180821515815260200191505060405180910390f35b34801561037557600080fd5b5061037e611058565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103b657600080fd5b506103bf61107c565b005b3480156103cd57600080fd5b506103d66111f5565b005b3480156103e457600080fd5b506103ed61134d565b005b3480156103fb57600080fd5b506104046116c8565b005b6104486004803603602081101561041c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061068e565b005b34801561045657600080fd5b5061045f61184f565b6040518082815260200191505060405180910390f35b34801561048157600080fd5b5061048a611855565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c257600080fd5b506104cb611879565b6040518082815260200191505060405180910390f35b3480156104ed57600080fd5b506104f661187f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561052e57600080fd5b506105716004803603602081101561054557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118a5565b6040518082815260200191505060405180910390f35b34801561059357600080fd5b506105d6600480360360208110156105aa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118bd565b6040518082815260200191505060405180910390f35b3480156105f857600080fd5b5061063b6004803603602081101561060f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118d5565b005b34801561064957600080fd5b5061068c6004803603602081101561066057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b67565b005b600660009054906101000a900460ff16610710576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f446973747269627574696f6e206e6f742061637469766500000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16148061077657503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b156107fd5734600360007f00000000000000000000000030d1db7f73c7f9819e0676f5052d3b2d45ff3fe573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550346004600082825401925050819055506108aa565b34600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555034600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055503434016004600082825401925050819055505b34600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055503460056000828254019250508190555050565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054116109bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4e6f207265776172647320746f20636c61696d0000000000000000000000000081525060200191505060405180910390fd5b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e7b752a633836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610adb57600080fd5b505af1158015610aef573d6000803e3d6000fd5b5050505050565b60055481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610bbd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4f776e6572206f6e6c790000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610bc681611c6c565b610bcf57600080fd5b610c9b338273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610c3a57600080fd5b505afa158015610c4e573d6000803e3d6000fd5b505050506040513d6020811015610c6457600080fd5b81019080805190602001909291905050508373ffffffffffffffffffffffffffffffffffffffff16611ca59092919063ffffffff16565b50565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4f776e6572206f6e6c790000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900460ff16158015610d7e57506008544210155b610df0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f416c72656164792061637469766174656400000000000000000000000000000081525060200191505060405180910390fd5b80600660016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f1b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4f776e6572206f6e6c790000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900460ff16158015610f3a57506008544210155b610fac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f416c72656164792061637469766174656400000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610fe657600080fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600660006101000a81548160ff02191690831515021790555050565b600660009054906101000a900460ff1681565b7f00000000000000000000000030d1db7f73c7f9819e0676f5052d3b2d45ff3fe581565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008111611136576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4e6f7468696e6720746f20636c61696d0000000000000000000000000000000081525060200191505060405180910390fd5b42600854111561114e5761114981611d47565b6111f2565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631e83409a336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1580156111d957600080fd5b505af11580156111ed573d6000803e3d6000fd5b505050505b50565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461124f57600080fd5b6000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461140e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4f776e6572206f6e6c790000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900460ff16611490576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f446973747269627574696f6e206e6f742061637469766500000000000000000081525060200191505060405180910390fd5b600854421015611508576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f526566756e6420706572696f64206973207374696c6c2061637469766500000081525060200191505060405180910390fd5b6000600660006101000a81548160ff0219169083151502179055506000471415611531576116c6565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0476040518263ffffffff1660e01b81526004016000604051808303818588803b15801561159b57600080fd5b505af11580156115af573d6000803e3d6000fd5b5050505050611643600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f209092919063ffffffff16565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e4fc6b6d6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156116ad57600080fd5b505af11580156116c1573d6000803e3d6000fd5b505050505b565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611789576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4f776e6572206f6e6c790000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900460ff1661180b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f446973747269627574696f6e206e6f742061637469766500000000000000000081525060200191505060405180910390fd5b6000600660006101000a81548160ff0219169083151502179055507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600881905550565b60085481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915090505481565b60036020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611996576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4f776e6572206f6e6c790000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900460ff16611a18576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f446973747269627574696f6e206e6f742061637469766500000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611abb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f496e76616c6964206d61726b657420646973747269627574696f6e000000000081525060200191505060405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b1657611b64565b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506201518042016008819055505b50565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c28576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4f776e6572206f6e6c790000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60003073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614159050919050565b611d428363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611fc2565b505050565b60003373ffffffffffffffffffffffffffffffffffffffff168260405180600001905060006040518083038185875af1925050503d8060008114611da7576040519150601f19603f3d011682016040523d82523d6000602084013e611dac565b606091505b5050905080611e23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f526566756e64207472616e73666572206661696c65640000000000000000000081525060200191505060405180910390fd5b816005600082825403925050819055506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000811115611f1b57806004600082825403925050819055506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b611fbd8363095ea7b360e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611fc2565b505050565b6000612024826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166120b19092919063ffffffff16565b90506000815111156120ac5780806020019051602081101561204557600080fd5b81019080805190602001909291905050506120ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180612377602a913960400191505060405180910390fd5b5b505050565b60606120c084846000856120c9565b90509392505050565b606082471015612124576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806123516026913960400191505060405180910390fd5b61212d85612271565b61219f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106121ee57805182526020820191506020810190506020830392506121cb565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612250576040519150601f19603f3d011682016040523d82523d6000602084013e612255565b606091505b5091509150612265828286612284565b92505050949350505050565b600080823b905060008111915050919050565b6060831561229457829050612349565b6000835111156122a75782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561230e5780820151818401526020810190506122f3565b50505050905090810190601f16801561233b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220d087a36a5d42c805b40c29165be05eb88238511414a3559440b9f81be18e150e64736f6c63430007060033

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

00000000000000000000000030d1db7f73c7f9819e0676f5052d3b2d45ff3fe5

-----Decoded View---------------
Arg [0] : _devAddress (address): 0x30d1db7f73C7f9819e0676F5052D3B2D45FF3Fe5

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000030d1db7f73c7f9819e0676f5052d3b2d45ff3fe5


Deployed Bytecode Sourcemap

281:4164:26:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;985:8;;;;;;;;;;;976:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4412:22:::1;4431:1;4412:10;:22::i;:::-;281:4164:::0;;;;;3482:305;;;;;;;;;;;;;:::i;:::-;;603:41;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;428:196:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1049:191:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;758:45;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;1248:332;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;699:20;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;651:35;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;3129:345;;;;;;;;;;;;;:::i;:::-;;653:222:27;;;;;;;;;;;;;:::i;:::-;;2074:429:26;;;;;;;;;;;;;:::i;:::-;;2511:136;;;;;;;;;;;;;:::i;:::-;;3795:557;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;810:34;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;330:42:27;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;553:43:26;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;728:23;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;423:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;487:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1588:478;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;525:120:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;3795:557:26;985:8;;;;;;;;;;;976:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3898:1:::1;3878:22;;:8;:22;;;:48;;;;3916:10;3904:22;;:8;:22;;;3878:48;3874:380;;;3983:9;3953:14;:26;3968:10;3953:26;;;;;;;;;;;;;;;;:39;;;;;;;;;;;4030:9;4007:19;;:32;;;;;;;;;;;3874:380;;;4121:9;4091:14;:26;4106:10;4091:26;;;;;;;;;;;;;;;;:39;;;;;;;;;;;4173:9;4145:14;:24;4160:8;4145:24;;;;;;;;;;;;;;;;:37;;;;;;;;;;;4232:9;4220;:21;4197:19;;:45;;;;;;;;;;;3874:380;4294:9;4266:12;:24;4279:10;4266:24;;;;;;;;;;;;;;;;:37;;;;;;;;;;;4335:9;4314:17;;:30;;;;;;;;;;;3795:557:::0;:::o;3482:305::-;3575:1;3546:14;:26;3561:10;3546:26;;;;;;;;;;;;;;;;:30;3537:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3621:16;3640:14;:26;3655:10;3640:26;;;;;;;;;;;;;;;;3621:45;;3706:1;3677:14;:26;3692:10;3677:26;;;;;;;;;;;;;;;:30;;;;3718:18;;;;;;;;;;;:39;;;3758:10;3770:8;3718:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3482:305;:::o;603:41::-;;;;:::o;428:196:32:-;477:5:27;;;;;;;;;;463:19;;:10;:19;;;454:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;519:23:32::1;536:5;519:16;:23::i;:::-;510:33;;;::::0;::::1;;554:62;573:10;585:5;:15;;;609:4;585:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;554:5;:18;;;;:62;;;;;:::i;:::-;428:196:::0;:::o;1049:191:26:-;477:5:27;;;;;;;;;;463:19;;:10;:19;;;454:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1127:8:26::1;;;;;;;;;;;1126:9;:51;;;;;1158:19;;1139:15;:38;;1126:51;1117:82;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;1222:10;1210:9;;:22;;;;;;;;;;;;;;;;;;1049:191:::0;:::o;758:45::-;;;;;;;;;;;;;:::o;1248:332::-;477:5:27;;;;;;;;;;463:19;;:10;:19;;;454:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1352:8:26::1;;;;;;;;;;;1351:9;:51;;;;;1383:19;;1364:15;:38;;1351:51;1342:82;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;1492:1;1452:42;;1460:19;1452:42;;;;1443:52;;;::::0;::::1;;1527:19;1506:18;;:40;;;;;;;;;;;;;;;;;;1568:4;1557:8;;:15;;;;;;;;;;;;;;;;;;1248:332:::0;:::o;699:20::-;;;;;;;;;;;;;:::o;651:35::-;;;:::o;3129:345::-;3170:14;3187:12;:24;3200:10;3187:24;;;;;;;;;;;;;;;;3170:41;;3242:1;3233:6;:10;3224:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3311:15;3289:19;;:37;3285:182;;;3353:14;3360:6;3353;:14::i;:::-;3285:182;;;3419:18;;;;;;;;;;;:24;;;3444:10;3419:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3285:182;3129:345;:::o;653:222:27:-;736:10;720:26;;:12;;;;;;;;;;;:26;;;711:36;;;;;;781:1;758:12;;:25;;;;;;;;;;;;;;;;;;827:10;799:39;;820:5;;;;;;;;;;799:39;;;;;;;;;;;;857:10;849:5;;:18;;;;;;;;;;;;;;;;;;653:222::o;2074:429:26:-;477:5:27;;;;;;;;;;463:19;;:10;:19;;;454:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;985:8:26::1;;;;;;;;;;;976:45;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;2166:19:::2;;2147:15;:38;;2138:81;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;2241:5;2230:8;;:16;;;;;;;;;;;;;;;;;;2286:1;2261:21;:26;2257:43;;;2291:7;;2257:43;2324:9;;;;;;;;;;;2310:33;;;2352:21;2310:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;2388:63;2418:18;;;;;;;;;;;2447:2;2388:9;;;;;;;;;;;:21;;;;:63;;;;;:::i;:::-;2464:18;;;;;;;;;;;:29;;;:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;1032:1;2074:429::o:0;2511:136::-;477:5:27;;;;;;;;;;463:19;;:10;:19;;;454:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;985:8:26::1;;;;;;;;;;;976:45;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;2590:5:::2;2579:8;;:16;;;;;;;;;;;;;;;;;;2636:2;2606:19;:33;;;;2511:136::o:0;810:34::-;;;;:::o;330:42:27:-;;;;;;;;;;;;:::o;553:43:26:-;;;;:::o;728:23::-;;;;;;;;;;;;;:::o;423:57::-;;;;;;;;;;;;;;;;;:::o;487:59::-;;;;;;;;;;;;;;;;;:::o;1588:478::-;477:5:27;;;;;;;;;;463:19;;:10;:19;;;454:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;985:8:26::1;;;;;;;;;;;976:45;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;1753:1:::2;1713:42;;1721:19;1713:42;;;;1704:83;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;1825:18;;;;;;;;;;;1802:41;;:19;:41;;;1798:58;;;1847:7;;1798:58;1887:19;1866:18;;:40;;;;;;;;;;;;;;;;;;2053:5;2035:15;:23;2013:19;:45;;;;1032:1;1588:478:::0;:::o;525:120:27:-;477:5;;;;;;;;;;463:19;;:10;:19;;;454:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;629:8:::1;614:12;;:23;;;;;;;;;;;;;;;;;;525:120:::0;:::o;632:142:32:-;703:4;760;734:31;;742:5;734:31;;;;727:38;;632:142;;;:::o;829:177:30:-;912:86;932:5;962:23;;;987:2;991:5;939:58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;912:19;:86::i;:::-;829:177;;;:::o;2655:466:26:-;2712:12;2729:10;:15;;2753:6;2729:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2711:54;;;2785:7;2776:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2865:6;2844:17;;:27;;;;;;;;;;;2909:1;2882:12;:24;2895:10;2882:24;;;;;;;;;;;;;;;:28;;;;2923:17;2943:14;:26;2958:10;2943:26;;;;;;;;;;;;;;;;2923:46;;2998:1;2986:9;:13;2982:132;;;3048:9;3025:19;;:32;;;;;;;;;;;3101:1;3072:14;:26;3087:10;3072:26;;;;;;;;;;;;;;;:30;;;;2982:132;2655:466;;;:::o;1488:193:30:-;1583:90;1603:5;1633:22;;;1657:7;1666:5;1610:62;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1583:19;:90::i;:::-;1488:193;;;:::o;2072:761::-;2496:23;2522:69;2550:4;2522:69;;;;;;;;;;;;;;;;;2530:5;2522:27;;;;:69;;;;;:::i;:::-;2496:95;;2626:1;2606:10;:17;:21;2602:224;;;2748:10;2737:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2729:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2602:224;2072:761;;;:::o;3671:195:0:-;3774:12;3806:52;3828:6;3836:4;3842:1;3845:12;3806:21;:52::i;:::-;3799:59;;3671:195;;;;;:::o;4723:530::-;4850:12;4908:5;4883:21;:30;;4875:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4975:18;4986:6;4975:10;:18::i;:::-;4967:60;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5101:12;5115:23;5142:6;:11;;5162:5;5170:4;5142:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5100:75;;;;5193:52;5211:7;5220:10;5232:12;5193:17;:52::i;:::-;5186:59;;;;4723:530;;;;;;:::o;753:422::-;813:4;1021:12;1132:7;1120:20;1112:28;;1166:1;1159:4;:8;1152:15;;;753:422;;;:::o;7263:742::-;7378:12;7407:7;7403:595;;;7438:10;7431:17;;;;7403:595;7572:1;7552:10;:17;:21;7548:439;;;7815:10;7809:17;7876:15;7863:10;7859:2;7855:19;7848:44;7763:148;7958:12;7951:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7263:742;;;;;;:::o

Swarm Source

ipfs://d087a36a5d42c805b40c29165be05eb88238511414a3559440b9f81be18e150e

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.