Contract 0x4076CC26EFeE47825917D0feC3A79d0bB9a6bB5c

 

Contract Overview

Balance:
0 BNB

BNB Value:
$0.00

Token:
Txn Hash
Block
From
To
Value [Txn Fee]
0x2b075e5cb19249a8dc34e6be85405584fea485f59b3016d4e3c9707ca4dc671884690002021-06-20 19:06:051 min ago0x72b223de2f773c814465c4a8f2ef9faae702cfb3 IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.000688
0xc6acb2d0dcddf97ce3e04531a1a628031f4906bb421c6fa9ea8fd98f9f2947cc84689982021-06-20 19:05:591 min ago0xd26fc3d5d67f4a6c966040e516ef5b668feddad1 IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00075796
0x0abde48b7a0abde942977e793e1a2a16a23cce6947ca0d6d2d066836b0b8dbc684689962021-06-20 19:05:531 min ago0x7489d731404163cfae20ebaea667759cf5fa9aae IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.000838
0xe6e2f1d77fb5d59012f2fd5236d3a5dc129642295933ed5007041147bc17157f84689872021-06-20 19:05:262 mins ago0x7489d731404163cfae20ebaea667759cf5fa9aae IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00064996
0x9d0785fd7b052884582d94a511afa39726d055f6f4d2eb99b74dc832ac113faf84689862021-06-20 19:05:232 mins ago0x1e199b548938f22e81175555987094a119feee74 IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00075796
0x8f11457e3960facf547c927112096e5e8774c038ea8b92d3d12b1c0f9d20f93a84689852021-06-20 19:05:202 mins ago0x98e12cc8a2263c34dcd05753ec767eaf42ce88f7 IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00064996
0x20b88398ac35f7a6dbd96ed768e1568fe71e150010210f52546b84f28dd86f1284689772021-06-20 19:04:562 mins ago0x98e12cc8a2263c34dcd05753ec767eaf42ce88f7 IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00067662
0xd95eb8e279628985b48db83d0fac5ba9c9db7688a81ab20dcb4617e6688b072784689612021-06-20 19:04:083 mins ago0xec90ca384ba1ccb3cd490f4c8d5dfaaf8c33fc1b IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00064996
0xa69cdf5785e29cc6c4847c4edf29079c2baa23c8f90157629a00c4256467ab5484689582021-06-20 19:03:593 mins ago0x2f573a409666730ded9c02a843abc13c2b357e00 IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.000838
0x807d073825f2fec07b504e1ea60ac359f4abe6069c12d4e883ddaefb0229517f84689522021-06-20 19:03:414 mins ago0xc5db47b3ef4a87be35efd6244f19d913855d816f IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.000838
0x6b8d38fa66f76fba4747350b62144519216d0208cee9843e07f8dab494a69ac084689512021-06-20 19:03:384 mins ago0x2f573a409666730ded9c02a843abc13c2b357e00 IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00088961
0x6aeb65faaa9a7eeaa4c4728d756922fc8a6d6c2acbba50a8f3c45fa902134c8b84689472021-06-20 19:03:264 mins ago0xc5db47b3ef4a87be35efd6244f19d913855d816f IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00064996
0x46180cf323cb8a04804bc22761aec729c05dad677b46785ab17c73a8511646fc84689422021-06-20 19:03:114 mins ago0x8fa379c7aa9275ac750915c33035896c86a0ea95 IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00072496
0xd373aee3e4a781b14a5cbd401f33792f2107624b42fadcaddb010f7da5c21bae84689132021-06-20 19:01:446 mins ago0x72b223de2f773c814465c4a8f2ef9faae702cfb3 IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00064996
0x803ec91c192ebca9a359dee7f5cf959b1d25797eaf0580b38e6924f2b284924384688922021-06-20 19:00:417 mins ago0xc5856daea18889ed2a37c9d81cb58c2ad6c7e45c IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00068296
0xb364958cfbc7c92c27d121ccfe12d08a44cca7d89ae2afa960275334018eb14b84688882021-06-20 19:00:297 mins ago0x71bc184e532641ab28ac9f455e7745295fb6cd0b IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.000754115
0xeb789806a234dfe097beaf3b96d64db6f2f0e1840441275fbc969e80b5ac1aa884688832021-06-20 19:00:147 mins ago0xb01ea75e8eed3a073b39567c8e9b2c392b273531 IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00081461
0x3d8440e13c0243a7298c27ef3a4ae0974e7dbfb41baaf1c88b66116b694ce50f84688742021-06-20 18:59:477 mins ago0xad4489f64a8be791294116d3e99d2721c7f0a72a IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00068296
0x72db1a7dc1c20276351eadeebd04c9909b4a99aebc49cdea88cf375fc4d2849d84688712021-06-20 18:59:388 mins ago0x71bc184e532641ab28ac9f455e7745295fb6cd0b IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00064996
0xad73007bb27cff0bdfd5308d1a05dcc7cd046ebc5dd2260f40bce250da6575a384688662021-06-20 18:59:238 mins ago0xc6dfbc377edf99ac5aeec317c020b1e8d6afedd1 IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00120259
0x670d5b010dc7919354636037d606b50246c3f6926b7fc05907a26db9e6d0159084688532021-06-20 18:58:449 mins ago0x7908d029635511b0bd6ea6e6e421aae1f412d351 IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00083296
0x5cde0e57a529787737fbc5a05f62c118f8c4f24391f70f42b58bdbe0596324cb84688372021-06-20 18:57:569 mins ago0xdd3c319667c0e3c43c187981b1e8f9e63a249f50 IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00102907
0x8c42c3ab1558da456d77ac7653d019c498425c5f238f9ee02be56bf8773a54e084688342021-06-20 18:57:479 mins ago0x693a10f33974fda182e34d0d179c5247874897a3 IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00072496
0xac86b9fabf4444c3d22baafb1c26611d8cdfd55b47fb87f0cf0025b18edf639d84688332021-06-20 18:57:4410 mins ago0x2866036dd29418c5ee9df2d9f938107c76e4df33 IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00102907
0xaef78f74a494ad14d147733631c5da61d4f127b156e9be6ad20ec0fefa1ced3284688322021-06-20 18:57:4110 mins ago0xdd3c319667c0e3c43c187981b1e8f9e63a249f50 IN  0x4076cc26efee47825917d0fec3a79d0bb9a6bb5c0 BNB0.00064996
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MultiFeeDistribution

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at BscScan.com on 2021-03-23
*/

// SPDX-License-Identifier: NONE

pragma solidity 0.7.6;
pragma abicoder v2;



// Part: Address

// Part: OpenZeppelin/[email protected]/Address

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

// Part: Context

// Part: OpenZeppelin/[email protected]/Context

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

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

// Part: IERC20

// Part: OpenZeppelin/[email protected]/IERC20

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

// Part: Math

// Part: OpenZeppelin/[email protected]/Math

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute
        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
    }
}

// Part: ReentrancyGuard

// Part: OpenZeppelin/[email protected]/ReentrancyGuard

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

// Part: SafeMath

// Part: OpenZeppelin/[email protected]/SafeMath

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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 (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

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

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

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

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

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

// Part: IMintableToken

// Part: IMintableToken

interface IMintableToken is IERC20 {
    function mint(address _receiver, uint256 _amount) external returns (bool);
}

// Part: Ownable

// Part: OpenZeppelin/[email protected]/Ownable

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

// Part: SafeERC20

// Part: OpenZeppelin/[email protected]/SafeERC20

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

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

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

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

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

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

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

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

// File: <stdin>.sol

// File: EpsStaker.sol

// EPS Staking contract for http://ellipsis.finance/
// EPS staked within this contact entitles stakers to a portion of the admin fees generated by Ellipsis' AMM contracts
// Based on SNX MultiRewards by iamdefinitelyahuman - https://github.com/iamdefinitelyahuman/multi-rewards
contract MultiFeeDistribution is ReentrancyGuard, Ownable {

    using SafeMath for uint256;
    using SafeERC20 for IERC20;
    using SafeERC20 for IMintableToken;

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

    struct Reward {
        uint256 periodFinish;
        uint256 rewardRate;
        uint256 lastUpdateTime;
        uint256 rewardPerTokenStored;
    }
    struct Balances {
        uint256 total;
        uint256 unlocked;
        uint256 locked;
        uint256 earned;
    }
    struct LockedBalance {
        uint256 amount;
        uint256 unlockTime;
    }
    struct RewardData {
        address token;
        uint256 amount;
    }

    IMintableToken public stakingToken;
    address[] public rewardTokens;
    mapping(address => Reward) public rewardData;

    // Duration that rewards are streamed over
    uint256 public constant rewardsDuration = 86400 * 7;

    // Duration of lock/earned penalty period
    uint256 public constant lockDuration = rewardsDuration * 13;

    // Addresses approved to call mint
    mapping(address => bool) public minters;
    // reward token -> distributor -> is approved to add rewards
    mapping(address=> mapping(address => bool)) public rewardDistributors;

    // user -> reward token -> amount
    mapping(address => mapping(address => uint256)) public userRewardPerTokenPaid;
    mapping(address => mapping(address => uint256)) public rewards;

    uint256 public totalSupply;
    uint256 public lockedSupply;

    // Private mappings for balance data
    mapping(address => Balances) balances;
    mapping(address => LockedBalance[]) userLocks;
    mapping(address => LockedBalance[]) userEarnings;

    /* ========== CONSTRUCTOR ========== */

    constructor(
        address _stakingToken,
        address[] memory _minters
    ) Ownable() {
        stakingToken = IMintableToken(_stakingToken);
        for (uint i; i < _minters.length; i++) {
            minters[_minters[i]] = true;
        }
        // First reward MUST be the staking token or things will break
        // related to the 50% penalty and distribution to locked balances
        rewardTokens.push(_stakingToken);
        rewardData[_stakingToken].lastUpdateTime = block.timestamp;
    }

    /* ========== ADMIN CONFIGURATION ========== */

    // Add a new reward token to be distributed to stakers
    function addReward(
        address _rewardsToken,
        address _distributor
    )
        public
        onlyOwner
    {
        require(rewardData[_rewardsToken].lastUpdateTime == 0);
        rewardTokens.push(_rewardsToken);
        rewardData[_rewardsToken].lastUpdateTime = block.timestamp;
        rewardDistributors[_rewardsToken][_distributor] = true;
    }

    // Modify approval for an address to call notifyRewardAmount
    function approveRewardDistributor(
        address _rewardsToken,
        address _distributor,
        bool _approved
    ) external onlyOwner {
        require(rewardData[_rewardsToken].lastUpdateTime > 0);
        rewardDistributors[_rewardsToken][_distributor] = _approved;
    }

    /* ========== VIEWS ========== */

    function _rewardPerToken(address _rewardsToken, uint256 _supply) internal view returns (uint256) {
        if (_supply == 0) {
            return rewardData[_rewardsToken].rewardPerTokenStored;
        }
        return
            rewardData[_rewardsToken].rewardPerTokenStored.add(
                lastTimeRewardApplicable(_rewardsToken).sub(
                    rewardData[_rewardsToken].lastUpdateTime).mul(
                        rewardData[_rewardsToken].rewardRate).mul(1e18).div(_supply)
            );
    }

    function _earned(
        address _user,
        address _rewardsToken,
        uint256 _balance,
        uint256 supply
    ) internal view returns (uint256) {
        return _balance.mul(
            _rewardPerToken(_rewardsToken, supply).sub(userRewardPerTokenPaid[_user][_rewardsToken])
        ).div(1e18).add(rewards[_user][_rewardsToken]);
    }

    function lastTimeRewardApplicable(address _rewardsToken) public view returns (uint256) {
        return Math.min(block.timestamp, rewardData[_rewardsToken].periodFinish);
    }

    function rewardPerToken(address _rewardsToken) external view returns (uint256) {
        uint256 supply = _rewardsToken == address(stakingToken) ? lockedSupply : totalSupply;
        return _rewardPerToken(_rewardsToken, supply);

    }

    function getRewardForDuration(address _rewardsToken) external view returns (uint256) {
        return rewardData[_rewardsToken].rewardRate.mul(rewardsDuration);
    }

    // Address and claimable amount of all reward tokens for the given account
    function claimableRewards(address account) external view returns (RewardData[] memory rewards) {
        rewards = new RewardData[](rewardTokens.length);
        for (uint256 i = 0; i < rewards.length; i++) {
            // If i == 0 this is the stakingReward, distribution is based on locked balances
            uint256 balance = i == 0 ? balances[account].locked : balances[account].total;
            uint256 supply = i == 0 ? lockedSupply : totalSupply;
            rewards[i].token = rewardTokens[i];
            rewards[i].amount = _earned(account, rewards[i].token, balance, supply);
        }
        return rewards;
    }

    // Total balance of an account, including unlocked, locked and earned tokens
    function totalBalance(address user) view external returns (uint256 amount) {
        return balances[user].total;
    }

    // Total withdrawable balance for an account to which no penalty is applied
    function unlockedBalance(address user) view external returns (uint256 amount) {
        amount = balances[user].unlocked;
        LockedBalance[] storage earnings = userEarnings[msg.sender];
        for (uint i = 0; i < earnings.length; i++) {
            if (earnings[i].unlockTime > block.timestamp) {
                break;
            }
            amount = amount.add(earnings[i].amount);
        }
        return amount;
    }

    // Information on the "earned" balances of a user
    // Earned balances may be withdrawn immediately for a 50% penalty
    function earnedBalances(
        address user
    ) view external returns (
        uint256 total,
        LockedBalance[] memory earningsData
    ) {
        LockedBalance[] storage earnings = userEarnings[user];
        uint256 idx;
        for (uint i = 0; i < earnings.length; i++) {
            if (earnings[i].unlockTime > block.timestamp) {
                if (idx == 0) {
                    earningsData = new LockedBalance[](earnings.length - i);
                }
                earningsData[idx] = earnings[i];
                idx++;
                total = total.add(earnings[i].amount);
            }
        }
        return (total, earningsData);
    }

    // Information on a user's locked balances
    function lockedBalances(
        address user
    ) view external returns (
        uint256 total,
        uint256 unlockable,
        uint256 locked,
        LockedBalance[] memory lockData
    ) {
        LockedBalance[] storage locks = userLocks[user];
        uint256 idx;
        for (uint i = 0; i < locks.length; i++) {
            if (locks[i].unlockTime > block.timestamp) {
                if (idx == 0) {
                    lockData = new LockedBalance[](locks.length - i);
                }
                lockData[idx] = locks[i];
                idx++;
                locked = locked.add(locks[i].amount);
            } else {
                unlockable = unlockable.add(locks[i].amount);
            }
        }
        return (balances[user].locked, unlockable, locked, lockData);
    }

    // Final balance received and penalty balance paid by user upon calling exit
    function withdrawableBalance(
        address user
    ) view public returns (
        uint256 amount,
        uint256 penaltyAmount
    ) {
        Balances storage bal = balances[user];
        if (bal.earned > 0) {
            uint256 amountWithoutPenalty;
            uint256 length = userEarnings[user].length;
            for (uint i = 0; i < length; i++) {
                uint256 earnedAmount = userEarnings[user][i].amount;
                if (earnedAmount == 0) continue;
                if (userEarnings[user][i].unlockTime > block.timestamp) {
                    break;
                }
                amountWithoutPenalty = amountWithoutPenalty.add(earnedAmount);
            }

            penaltyAmount = bal.earned.sub(amountWithoutPenalty).div(2);
        }
        amount = bal.unlocked.add(bal.earned).sub(penaltyAmount);
        return (amount, penaltyAmount);
    }

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

    // Stake tokens to receive rewards
    // Locked tokens cannot be withdrawn for lockDuration and are eligible to receive stakingReward rewards
    function stake(uint256 amount, bool lock) external nonReentrant updateReward(msg.sender) {
        require(amount > 0, "Cannot stake 0");
        totalSupply = totalSupply.add(amount);
        Balances storage bal = balances[msg.sender];
        bal.total = bal.total.add(amount);
        if (lock) {
            lockedSupply = lockedSupply.add(amount);
            bal.locked = bal.locked.add(amount);
            uint256 unlockTime = block.timestamp.div(rewardsDuration).mul(rewardsDuration).add(lockDuration);
            uint256 idx = userLocks[msg.sender].length;
            if (idx == 0 || userLocks[msg.sender][idx-1].unlockTime < unlockTime) {
                userLocks[msg.sender].push(LockedBalance({amount: amount, unlockTime: unlockTime}));
            } else {
                userLocks[msg.sender][idx-1].amount = userLocks[msg.sender][idx-1].amount.add(amount);
            }
        } else {
            bal.unlocked = bal.unlocked.add(amount);
        }
        stakingToken.safeTransferFrom(msg.sender, address(this), amount);
        emit Staked(msg.sender, amount);
    }

    // Mint new tokens
    // Minted tokens receive rewards normally but incur a 50% penalty when
    // withdrawn before lockDuration has passed.
    function mint(address user, uint256 amount) external updateReward(user) {
        require(minters[msg.sender]);
        totalSupply = totalSupply.add(amount);
        Balances storage bal = balances[user];
        bal.total = bal.total.add(amount);
        bal.earned = bal.earned.add(amount);
        uint256 unlockTime = block.timestamp.div(rewardsDuration).mul(rewardsDuration).add(lockDuration);
        LockedBalance[] storage earnings = userEarnings[user];
        uint256 idx = earnings.length;

        if (idx == 0 || earnings[idx-1].unlockTime < unlockTime) {
            earnings.push(LockedBalance({amount: amount, unlockTime: unlockTime}));
        } else {
            earnings[idx-1].amount = earnings[idx-1].amount.add(amount);
        }
        stakingToken.mint(address(this), amount);
        emit Staked(user, amount);
    }

    // Withdraw staked tokens
    // First withdraws unlocked tokens, then earned tokens. Withdrawing earned tokens
    // incurs a 50% penalty which is distributed based on locked balances.
    function withdraw(uint256 amount) public nonReentrant updateReward(msg.sender) {
        require(amount > 0, "Cannot withdraw 0");
        Balances storage bal = balances[msg.sender];
        uint256 penaltyAmount;

        if (amount <= bal.unlocked) {
            bal.unlocked = bal.unlocked.sub(amount);
        } else {
            uint256 remaining = amount.sub(bal.unlocked);
            require(bal.earned >= remaining, "Insufficient unlocked balance");
            bal.unlocked = 0;
            bal.earned = bal.earned.sub(remaining);
            for (uint i = 0; ; i++) {
                uint256 earnedAmount = userEarnings[msg.sender][i].amount;
                if (earnedAmount == 0) continue;
                if (penaltyAmount == 0 && userEarnings[msg.sender][i].unlockTime > block.timestamp) {
                    penaltyAmount = remaining;
                    require(bal.earned >= remaining, "Insufficient balance after penalty");
                    bal.earned = bal.earned.sub(remaining);
                    if (bal.earned == 0) {
                        delete userEarnings[msg.sender];
                        break;
                    }
                    remaining = remaining.mul(2);
                }
                if (remaining <= earnedAmount) {
                    userEarnings[msg.sender][i].amount = earnedAmount.sub(remaining);
                    break;
                } else {
                    delete userEarnings[msg.sender][i];
                    remaining = remaining.sub(earnedAmount);
                }
            }
        }

        uint256 adjustedAmount = amount.add(penaltyAmount);
        bal.total = bal.total.sub(adjustedAmount);
        totalSupply = totalSupply.sub(adjustedAmount);
        stakingToken.safeTransfer(msg.sender, amount);
        if (penaltyAmount > 0) {
            _notifyReward(address(stakingToken), penaltyAmount);
        }
        emit Withdrawn(msg.sender, amount);
    }

    // Claim all pending staking rewards
    function getReward() public nonReentrant updateReward(msg.sender) {
        for (uint i; i < rewardTokens.length; i++) {
            address _rewardsToken = rewardTokens[i];
            uint256 reward = rewards[msg.sender][_rewardsToken];
            if (reward > 0) {
                rewards[msg.sender][_rewardsToken] = 0;
                IERC20(_rewardsToken).safeTransfer(msg.sender, reward);
                emit RewardPaid(msg.sender, _rewardsToken, reward);
            }
        }
    }

    // Withdraw full unlocked balance and claim pending rewards
    function exit() external updateReward(msg.sender) {
        (uint256 amount, uint256 penaltyAmount) = withdrawableBalance(msg.sender);
        delete userEarnings[msg.sender];
        Balances storage bal = balances[msg.sender];
        bal.total = bal.total.sub(bal.unlocked).sub(bal.earned);
        bal.unlocked = 0;
        bal.earned = 0;

        totalSupply = totalSupply.sub(amount.add(penaltyAmount));
        stakingToken.safeTransfer(msg.sender, amount);
        if (penaltyAmount > 0) {
            _notifyReward(address(stakingToken), penaltyAmount);
        }
        getReward();
    }

    // Withdraw all currently locked tokens where the unlock time has passed
    function withdrawExpiredLocks() external {
        LockedBalance[] storage locks = userLocks[msg.sender];
        Balances storage bal = balances[msg.sender];
        uint256 amount;
        uint256 length = locks.length;
        if (locks[length-1].unlockTime <= block.timestamp) {
            amount = bal.locked;
            delete userLocks[msg.sender];
        } else {
            for (uint i = 0; i < length; i++) {
                if (locks[i].unlockTime > block.timestamp) break;
                amount = amount.add(locks[i].amount);
                delete locks[i];
            }
        }
        bal.locked = bal.locked.sub(amount);
        bal.total = bal.total.sub(amount);
        totalSupply = totalSupply.sub(amount);
        lockedSupply = lockedSupply.sub(amount);
        stakingToken.safeTransfer(msg.sender, amount);
    }

    /* ========== RESTRICTED FUNCTIONS ========== */

    function _notifyReward(address _rewardsToken, uint256 reward) internal {
        if (block.timestamp >= rewardData[_rewardsToken].periodFinish) {
            rewardData[_rewardsToken].rewardRate = reward.div(rewardsDuration);
        } else {
            uint256 remaining = rewardData[_rewardsToken].periodFinish.sub(block.timestamp);
            uint256 leftover = remaining.mul(rewardData[_rewardsToken].rewardRate);
            rewardData[_rewardsToken].rewardRate = reward.add(leftover).div(rewardsDuration);
        }

        rewardData[_rewardsToken].lastUpdateTime = block.timestamp;
        rewardData[_rewardsToken].periodFinish = block.timestamp.add(rewardsDuration);

    }

    function notifyRewardAmount(address _rewardsToken, uint256 reward) external updateReward(address(0)) {
        require(rewardDistributors[_rewardsToken][msg.sender]);
        require(reward > 0, "No reward");
        // handle the transfer of reward tokens via `transferFrom` to reduce the number
        // of transactions required and ensure correctness of the reward amount
        IERC20(_rewardsToken).safeTransferFrom(msg.sender, address(this), reward);
        _notifyReward(_rewardsToken, reward);
        emit RewardAdded(reward);
    }

    // Added to support recovering LP Rewards from other systems such as BAL to be distributed to holders
    function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyOwner {
        require(tokenAddress != address(stakingToken), "Cannot withdraw staking token");
        require(rewardData[tokenAddress].lastUpdateTime == 0, "Cannot withdraw reward token");
        IERC20(tokenAddress).safeTransfer(owner(), tokenAmount);
        emit Recovered(tokenAddress, tokenAmount);
    }

    /* ========== MODIFIERS ========== */

    modifier updateReward(address account) {
        address token = address(stakingToken);
        uint256 balance;
        uint256 supply = lockedSupply;
        rewardData[token].rewardPerTokenStored = _rewardPerToken(token, supply);
        rewardData[token].lastUpdateTime = lastTimeRewardApplicable(token);
        if (account != address(0)) {
            // Special case, use the locked balances and supply for stakingReward rewards
            rewards[account][token] = _earned(account, token, balances[account].locked, supply);
            userRewardPerTokenPaid[account][token] = rewardData[token].rewardPerTokenStored;
            balance = balances[account].total;
        }

        supply = totalSupply;
        for (uint i = 1; i < rewardTokens.length; i++) {
            token = rewardTokens[i];
            rewardData[token].rewardPerTokenStored = _rewardPerToken(token, supply);
            rewardData[token].lastUpdateTime = lastTimeRewardApplicable(token);
            if (account != address(0)) {
                rewards[account][token] = _earned(account, token, balance, supply);
                userRewardPerTokenPaid[account][token] = rewardData[token].rewardPerTokenStored;
            }
        }
        _;
    }

    /* ========== EVENTS ========== */

    event RewardAdded(uint256 reward);
    event Staked(address indexed user, uint256 amount);
    event Withdrawn(address indexed user, uint256 amount);
    event RewardPaid(address indexed user, address indexed rewardsToken, uint256 reward);
    event RewardsDurationUpdated(address token, uint256 newDuration);
    event Recovered(address token, uint256 amount);
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_stakingToken","type":"address"},{"internalType":"address[]","name":"_minters","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Recovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"rewardsToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"newDuration","type":"uint256"}],"name":"RewardsDurationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"address","name":"_rewardsToken","type":"address"},{"internalType":"address","name":"_distributor","type":"address"}],"name":"addReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardsToken","type":"address"},{"internalType":"address","name":"_distributor","type":"address"},{"internalType":"bool","name":"_approved","type":"bool"}],"name":"approveRewardDistributor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"claimableRewards","outputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct MultiFeeDistribution.RewardData[]","name":"rewards","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"earnedBalances","outputs":[{"internalType":"uint256","name":"total","type":"uint256"},{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"unlockTime","type":"uint256"}],"internalType":"struct MultiFeeDistribution.LockedBalance[]","name":"earningsData","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardsToken","type":"address"}],"name":"getRewardForDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardsToken","type":"address"}],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"lockedBalances","outputs":[{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"unlockable","type":"uint256"},{"internalType":"uint256","name":"locked","type":"uint256"},{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"unlockTime","type":"uint256"}],"internalType":"struct MultiFeeDistribution.LockedBalance[]","name":"lockData","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockedSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"minters","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardsToken","type":"address"},{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardData","outputs":[{"internalType":"uint256","name":"periodFinish","type":"uint256"},{"internalType":"uint256","name":"rewardRate","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTime","type":"uint256"},{"internalType":"uint256","name":"rewardPerTokenStored","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"rewardDistributors","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardsToken","type":"address"}],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewardTokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"lock","type":"bool"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingToken","outputs":[{"internalType":"contract IMintableToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"totalBalance","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"unlockedBalance","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawExpiredLocks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"withdrawableBalance","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"penaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b506040516200356638038062003566833981016040819052620000349162000191565b600160009081556200004562000170565b600180546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600280546001600160a01b0319166001600160a01b03841617905560005b81518110156200010957600160056000848481518110620000ce57fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101620000b1565b505060038054600181019091557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b039092166001600160a01b03199092168217905560009081526004602052604090204260029091015562000266565b3390565b80516001600160a01b03811681146200018c57600080fd5b919050565b60008060408385031215620001a4578182fd5b620001af8362000174565b602084810151919350906001600160401b0380821115620001ce578384fd5b818601915086601f830112620001e2578384fd5b815181811115620001ef57fe5b838102604051858282010181811085821117156200020957fe5b604052828152858101935084860182860187018b101562000228578788fd5b8795505b838610156200025557620002408162000174565b8552600195909501949386019386016200022c565b508096505050505050509250929050565b6132f080620002766000396000f3fe608060405234801561001057600080fd5b50600436106101fb5760003560e01c8063715018a61161011a578063bcd11014116100ad578063e70b9e271161007c578063e70b9e271461042c578063e9fad8ee1461043f578063f122977714610447578063f2fde38b1461045a578063f46eccc41461046d576101fb565b8063bcd11014146103d0578063ca5c7b91146103e3578063dc01f60d146103eb578063df3798761461040b576101fb565b80638da5cb5b116100e95780638da5cb5b1461039a578063a01c77bc146103a2578063abe50f19146103aa578063b66503cf146103bd576101fb565b8063715018a61461035757806372f702f31461035f5780637bb7bed1146103745780638980f11f14610387576101fb565b806340b47e1a11610192578063638634ee11610161578063638634ee1461030b5780636724c9101461031e5780636eacd398146103315780637035ab9814610344576101fb565b806340b47e1a146102af57806340c10f19146102c257806348e5d9f8146102d55780635e0fac2e146102f8576101fb565b80632e1a7d4d116101ce5780632e1a7d4d1461026a578063386a95251461027f57806339fc9713146102875780633d18b912146102a7576101fb565b806302b6293814610200578063045544431461022a5780630483a7f61461023f57806318160ddd14610262575b600080fd5b61021361020e366004612be4565b610480565b604051610221929190613228565b60405180910390f35b6102326105bf565b6040516102219190613206565b61025261024d366004612be4565b6105c6565b6040516102219493929190613236565b610232610754565b61027d610278366004612cbb565b61075a565b005b610232610c44565b61029a610295366004612bfe565b610c4b565b6040516102219190612e0c565b61027d610c6b565b61027d6102bd366004612bfe565b610f58565b61027d6102d0366004612c76565b611041565b6102e86102e3366004612be4565b611453565b6040516102219493929190613265565b610232610306366004612be4565b61147a565b610232610319366004612be4565b611512565b61027d61032c366004612c30565b61153c565b61023261033f366004612be4565b6115da565b610232610352366004612bfe565b6115f5565b61027d611612565b61036761169b565b6040516102219190612d63565b610367610382366004612cbb565b6116aa565b61027d610395366004612c76565b6116d4565b6103676117d3565b61027d6117e2565b61027d6103b8366004612cd3565b611922565b61027d6103cb366004612c76565b611d32565b6102326103de366004612be4565b611fbd565b610232611fe6565b6103fe6103f9366004612be4565b611fec565b6040516102219190612db4565b61041e610419366004612be4565b612154565b60405161022192919061320f565b61023261043a366004612bfe565b612278565b61027d612295565b610232610455366004612be4565b612534565b61027d610468366004612be4565b61256d565b61029a61047b366004612be4565b61262e565b6001600160a01b0381166000908152600b60205260408120600381015482919015610592576001600160a01b0384166000908152600d6020526040812054815b8181101561056a576001600160a01b0387166000908152600d602052604081208054839081106104ec57fe5b9060005260206000209060020201600001549050806000141561050f5750610562565b6001600160a01b0388166000908152600d6020526040902080544291908490811061053657fe5b9060005260206000209060020201600101541115610554575061056a565b61055e8482612643565b9350505b6001016104c0565b5061058d600261058784866003015461266890919063ffffffff16565b90612690565b935050505b6105b7826105b18360030154846001015461264390919063ffffffff16565b90612668565b925050915091565b6277f88081565b6001600160a01b0381166000908152600c602052604081208190819060609082805b825481101561072c57428382815481106105fe57fe5b90600052602060002090600202016001015411156106fa578161067457825481900367ffffffffffffffff8111801561063657600080fd5b5060405190808252806020026020018201604052801561067057816020015b61065d612b59565b8152602001906001900390816106555790505b5093505b82818154811061068057fe5b9060005260206000209060020201604051806040016040529081600082015481526020016001820154815250508483815181106106b957fe5b602002602001018190525081806001019250506106f38382815481106106db57fe5b60009182526020909120600290910201548690612643565b9450610724565b61072183828154811061070957fe5b60009182526020909120600290910201548790612643565b95505b6001016105e8565b5050506001600160a01b0385166000908152600b602052604090206002015493509193509193565b60095481565b600260005414156107865760405162461bcd60e51b815260040161077d906131cf565b60405180910390fd5b600260008181559054600a5433926001600160a01b0390921691906107ab83826126c2565b6001600160a01b0384166000908152600460205260409020600301556107d083611512565b6001600160a01b0380851660009081526004602052604090206002019190915584161561087c576001600160a01b0384166000908152600b6020526040902060020154610821908590859084612757565b6001600160a01b0380861660008181526008602090815260408083209489168084529482528083209590955560048152848220600301548383526007825285832094835293815284822093909355908152600b909152205491505b5060095460015b600354811015610968576003818154811061089a57fe5b6000918252602090912001546001600160a01b031693506108bb84836126c2565b6001600160a01b0385166000908152600460205260409020600301556108e084611512565b6001600160a01b038086166000908152600460205260409020600201919091558516156109605761091385858585612757565b6001600160a01b038087166000818152600860209081526040808320948a168084529482528083209590955560048152848220600301549282526007815284822093825292909252919020555b600101610883565b50600085116109895760405162461bcd60e51b815260040161077d90613008565b336000908152600b60205260408120600181015490919087116109bf5760018201546109b59088612668565b6001830155610b94565b60006109d883600101548961266890919063ffffffff16565b905080836003015410156109fe5760405162461bcd60e51b815260040161077d906130e0565b600060018401556003830154610a149082612668565b600384015560005b336000908152600d60205260408120805483908110610a3757fe5b90600052602060002090600202016000015490508060001415610a5a5750610b89565b83158015610a955750336000908152600d60205260409020805442919084908110610a8157fe5b906000526020600020906002020160010154115b15610b07578293508285600301541015610ac15760405162461bcd60e51b815260040161077d90612eef565b6003850154610ad09084612668565b60038601819055610af957336000908152600d60205260408120610af391612b73565b50610b91565b610b048360026127c9565b92505b808311610b4a57610b188184612668565b336000908152600d60205260409020805484908110610b3357fe5b600091825260209091206002909102015550610b91565b336000908152600d60205260409020805483908110610b6557fe5b60009182526020822060029091020181815560010155610b858382612668565b9250505b600101610a1c565b50505b6000610ba08883612643565b8354909150610baf9082612668565b8355600954610bbe9082612668565b600955600254610bd8906001600160a01b0316338a612803565b8115610bf457600254610bf4906001600160a01b03168361285e565b336001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d589604051610c2d9190613206565b60405180910390a250506001600055505050505050565b62093a8081565b600660209081526000928352604080842090915290825290205460ff1681565b60026000541415610c8e5760405162461bcd60e51b815260040161077d906131cf565b600260008181559054600a5433926001600160a01b039092169190610cb383826126c2565b6001600160a01b038416600090815260046020526040902060030155610cd883611512565b6001600160a01b03808516600090815260046020526040902060020191909155841615610d84576001600160a01b0384166000908152600b6020526040902060020154610d29908590859084612757565b6001600160a01b0380861660008181526008602090815260408083209489168084529482528083209590955560048152848220600301548383526007825285832094835293815284822093909355908152600b909152205491505b5060095460015b600354811015610e705760038181548110610da257fe5b6000918252602090912001546001600160a01b03169350610dc384836126c2565b6001600160a01b038516600090815260046020526040902060030155610de884611512565b6001600160a01b03808616600090815260046020526040902060020191909155851615610e6857610e1b85858585612757565b6001600160a01b038087166000818152600860209081526040808320948a168084529482528083209590955560048152848220600301549282526007815284822093825292909252919020555b600101610d8b565b5060005b600354811015610f4c57600060038281548110610e8d57fe5b60009182526020808320909101543383526008825260408084206001600160a01b03909216808552919092529120549091508015610f42573360008181526008602090815260408083206001600160a01b0387168085529252822091909155610ef69183612803565b816001600160a01b0316336001600160a01b03167f540798df468d7b23d11f156fdb954cb19ad414d150722a7b6d55ba369dea792e83604051610f399190613206565b60405180910390a35b5050600101610e74565b50506001600055505050565b610f60612979565b6001600160a01b0316610f716117d3565b6001600160a01b031614610f975760405162461bcd60e51b815260040161077d90613074565b6001600160a01b03821660009081526004602052604090206002015415610fbd57600080fd5b6003805460018082019092557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b0319166001600160a01b039485169081179091556000908152600460209081526040808320426002909101556006825280832094909516825292909252919020805460ff19169091179055565b600254600a5483916001600160a01b03169060009061106083826126c2565b6001600160a01b03841660009081526004602052604090206003015561108583611512565b6001600160a01b03808516600090815260046020526040902060020191909155841615611131576001600160a01b0384166000908152600b60205260409020600201546110d6908590859084612757565b6001600160a01b0380861660008181526008602090815260408083209489168084529482528083209590955560048152848220600301548383526007825285832094835293815284822093909355908152600b909152205491505b5060095460015b60035481101561121d576003818154811061114f57fe5b6000918252602090912001546001600160a01b0316935061117084836126c2565b6001600160a01b03851660009081526004602052604090206003015561119584611512565b6001600160a01b03808616600090815260046020526040902060020191909155851615611215576111c885858585612757565b6001600160a01b038087166000818152600860209081526040808320948a168084529482528083209590955560048152848220600301549282526007815284822093825292909252919020555b600101611138565b503360009081526005602052604090205460ff1661123a57600080fd5b6009546112479086612643565b6009556001600160a01b0386166000908152600b60205260409020805461126e9087612643565b8155600381015461127f9087612643565b600382015560006112aa6277f8806112a462093a8061129e4282612690565b906127c9565b90612643565b6001600160a01b0389166000908152600d602052604090208054919250908015806112f45750828260018303815481106112e057fe5b906000526020600020906002020160010154105b15611336576040805180820190915289815260208082018581528454600181810187556000878152939093209351600290910290930192835551910155611381565b6113608983600184038154811061134957fe5b600091825260209091206002909102015490612643565b82600183038154811061136f57fe5b60009182526020909120600290910201555b6002546040516340c10f1960e01b81526001600160a01b03909116906340c10f19906113b39030908d90600401612d9b565b602060405180830381600087803b1580156113cd57600080fd5b505af11580156113e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114059190612c9f565b50896001600160a01b03167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d8a60405161143f9190613206565b60405180910390a250505050505050505050565b60046020526000908152604090208054600182015460028301546003909301549192909184565b6001600160a01b0381166000908152600b6020908152604080832060010154338452600d909252822090915b815481101561150a57428282815481106114bc57fe5b90600052602060002090600202016001015411156114d95761150a565b6115008282815481106114e857fe5b60009182526020909120600290910201548490612643565b92506001016114a6565b50505b919050565b6001600160a01b03811660009081526004602052604081205461153690429061297d565b92915050565b611544612979565b6001600160a01b03166115556117d3565b6001600160a01b03161461157b5760405162461bcd60e51b815260040161077d90613074565b6001600160a01b0383166000908152600460205260409020600201546115a057600080fd5b6001600160a01b03928316600090815260066020908152604080832094909516825292909252919020805460ff1916911515919091179055565b6001600160a01b03166000908152600b602052604090205490565b600760209081526000928352604080842090915290825290205481565b61161a612979565b6001600160a01b031661162b6117d3565b6001600160a01b0316146116515760405162461bcd60e51b815260040161077d90613074565b6001546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180546001600160a01b0319169055565b6002546001600160a01b031681565b600381815481106116ba57600080fd5b6000918252602090912001546001600160a01b0316905081565b6116dc612979565b6001600160a01b03166116ed6117d3565b6001600160a01b0316146117135760405162461bcd60e51b815260040161077d90613074565b6002546001600160a01b03838116911614156117415760405162461bcd60e51b815260040161077d906130a9565b6001600160a01b0382166000908152600460205260409020600201541561177a5760405162461bcd60e51b815260040161077d90613198565b6117966117856117d3565b6001600160a01b0384169083612803565b7f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa2882826040516117c7929190612d9b565b60405180910390a15050565b6001546001600160a01b031690565b336000908152600c60209081526040808320600b90925282208154919290914284600019830183811061181157fe5b9060005260206000209060020201600101541161184e576002830154336000908152600c602052604081209193506118499190612b73565b6118c3565b60005b818110156118c1574285828154811061186657fe5b9060005260206000209060020201600101541115611883576118c1565b6118928582815481106114e857fe5b92508481815481106118a057fe5b60009182526020822060029091020181815560019081019190915501611851565b505b60028301546118d29083612668565b600284015582546118e39083612668565b83556009546118f29083612668565b600955600a546119029083612668565b600a5560025461191c906001600160a01b03163384612803565b50505050565b600260005414156119455760405162461bcd60e51b815260040161077d906131cf565b600260008181559054600a5433926001600160a01b03909216919061196a83826126c2565b6001600160a01b03841660009081526004602052604090206003015561198f83611512565b6001600160a01b03808516600090815260046020526040902060020191909155841615611a3b576001600160a01b0384166000908152600b60205260409020600201546119e0908590859084612757565b6001600160a01b0380861660008181526008602090815260408083209489168084529482528083209590955560048152848220600301548383526007825285832094835293815284822093909355908152600b909152205491505b5060095460015b600354811015611b275760038181548110611a5957fe5b6000918252602090912001546001600160a01b03169350611a7a84836126c2565b6001600160a01b038516600090815260046020526040902060030155611a9f84611512565b6001600160a01b03808616600090815260046020526040902060020191909155851615611b1f57611ad285858585612757565b6001600160a01b038087166000818152600860209081526040808320948a168084529482528083209590955560048152848220600301549282526007815284822093825292909252919020555b600101611a42565b5060008611611b485760405162461bcd60e51b815260040161077d90612e90565b600954611b559087612643565b600955336000908152600b602052604090208054611b739088612643565b81558515611cb657600a54611b889088612643565b600a556002810154611b9a9088612643565b60028201556000611bb96277f8806112a462093a8061129e4282612690565b336000908152600c6020526040902054909150801580611c0a5750336000908152600c6020526040902080548391906000198401908110611bf657fe5b906000526020600020906002020160010154105b15611c5957336000908152600c6020908152604080832081518083019092528c825281830186815281546001818101845592865293909420915160029093029091019182559151910155611caf565b336000908152600c602052604090208054611c7e918b91600019850190811061134957fe5b336000908152600c6020526040902080546000198401908110611c9d57fe5b60009182526020909120600290910201555b5050611ccb565b6001810154611cc59088612643565b60018201555b600254611ce3906001600160a01b031633308a612993565b336001600160a01b03167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d88604051611d1c9190613206565b60405180910390a2505060016000555050505050565b600254600a546000916001600160a01b0316908290611d5183826126c2565b6001600160a01b038416600090815260046020526040902060030155611d7683611512565b6001600160a01b03808516600090815260046020526040902060020191909155841615611e22576001600160a01b0384166000908152600b6020526040902060020154611dc7908590859084612757565b6001600160a01b0380861660008181526008602090815260408083209489168084529482528083209590955560048152848220600301548383526007825285832094835293815284822093909355908152600b909152205491505b5060095460015b600354811015611f0e5760038181548110611e4057fe5b6000918252602090912001546001600160a01b03169350611e6184836126c2565b6001600160a01b038516600090815260046020526040902060030155611e8684611512565b6001600160a01b03808616600090815260046020526040902060020191909155851615611f0657611eb985858585612757565b6001600160a01b038087166000818152600860209081526040808320948a168084529482528083209590955560048152848220600301549282526007815284822093825292909252919020555b600101611e29565b506001600160a01b038616600090815260066020908152604080832033845290915290205460ff16611f3f57600080fd5b60008511611f5f5760405162461bcd60e51b815260040161077d90612fe5565b611f746001600160a01b038716333088612993565b611f7e868661285e565b7fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d85604051611fad9190613206565b60405180910390a1505050505050565b6001600160a01b0381166000908152600460205260408120600101546115369062093a806127c9565b600a5481565b60035460609067ffffffffffffffff8111801561200857600080fd5b5060405190808252806020026020018201604052801561204257816020015b61202f612b97565b8152602001906001900390816120275790505b50905060005b815181101561214e5760008115612077576001600160a01b0384166000908152600b6020526040902054612094565b6001600160a01b0384166000908152600b60205260409020600201545b9050600082156120a6576009546120aa565b600a545b9050600383815481106120b957fe5b9060005260206000200160009054906101000a90046001600160a01b03168484815181106120e357fe5b6020026020010151600001906001600160a01b031690816001600160a01b03168152505061212a8585858151811061211757fe5b6020026020010151600001518484612757565b84848151811061213657fe5b60209081029190910181015101525050600101612048565b50919050565b6001600160a01b0381166000908152600d6020526040812060609082805b8254811015612270574283828154811061218857fe5b906000526020600020906002020160010154111561226857816121fe57825481900367ffffffffffffffff811180156121c057600080fd5b506040519080825280602002602001820160405280156121fa57816020015b6121e7612b59565b8152602001906001900390816121df5790505b5093505b82818154811061220a57fe5b90600052602060002090600202016040518060400160405290816000820154815260200160018201548152505084838151811061224357fe5b602002602001018190525081806001019250506122658382815481106106db57fe5b94505b600101612172565b505050915091565b600860209081526000928352604080842090915290825290205481565b600254600a5433916001600160a01b0316906000906122b483826126c2565b6001600160a01b0384166000908152600460205260409020600301556122d983611512565b6001600160a01b03808516600090815260046020526040902060020191909155841615612385576001600160a01b0384166000908152600b602052604090206002015461232a908590859084612757565b6001600160a01b0380861660008181526008602090815260408083209489168084529482528083209590955560048152848220600301548383526007825285832094835293815284822093909355908152600b909152205491505b5060095460015b60035481101561247157600381815481106123a357fe5b6000918252602090912001546001600160a01b031693506123c484836126c2565b6001600160a01b0385166000908152600460205260409020600301556123e984611512565b6001600160a01b038086166000908152600460205260409020600201919091558516156124695761241c85858585612757565b6001600160a01b038087166000818152600860209081526040808320948a168084529482528083209590955560048152848220600301549282526007815284822093825292909252919020555b60010161238c565b5060008061247e33610480565b336000908152600d6020526040812092945090925061249d9190612b73565b336000908152600b602052604090206003810154600182015482546124c792916105b19190612668565b815560006001820181905560038201556124ed6124e48484612643565b60095490612668565b600955600254612507906001600160a01b03163385612803565b811561252357600254612523906001600160a01b03168361285e565b61252b610c6b565b50505050505050565b60025460009081906001600160a01b038481169116146125565760095461255a565b600a545b905061256683826126c2565b9392505050565b612575612979565b6001600160a01b03166125866117d3565b6001600160a01b0316146125ac5760405162461bcd60e51b815260040161077d90613074565b6001600160a01b0381166125d25760405162461bcd60e51b815260040161077d90612e4a565b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b60056020526000908152604090205460ff1681565b6000828201838110156125665760405162461bcd60e51b815260040161077d90612eb8565b60008282111561268a5760405162461bcd60e51b815260040161077d90612f31565b50900390565b60008082116126b15760405162461bcd60e51b815260040161077d90612fae565b8183816126ba57fe5b049392505050565b6000816126eb57506001600160a01b038216600090815260046020526040902060030154611536565b6001600160a01b038316600090815260046020526040902060018101546002909101546125669161273591859161058791670de0b6b3a76400009161129e9182906105b18c611512565b6001600160a01b03851660009081526004602052604090206003015490612643565b6001600160a01b0380851660008181526008602090815260408083209488168084529482528083205493835260078252808320948352939052918220546127c091906112a490670de0b6b3a764000090610587906127b9906105b18b8a6126c2565b88906127c9565b95945050505050565b6000826127d857506000611536565b828202828482816127e557fe5b04146125665760405162461bcd60e51b815260040161077d90613033565b6128598363a9059cbb60e01b8484604051602401612822929190612d9b565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526129b4565b505050565b6001600160a01b03821660009081526004602052604090205442106128ab5761288a8162093a80612690565b6001600160a01b03831660009081526004602052604090206001015561292b565b6001600160a01b0382166000908152600460205260408120546128ce9042612668565b6001600160a01b038416600090815260046020526040812060010154919250906128f99083906127c9565b905061290c62093a806105878584612643565b6001600160a01b03851660009081526004602052604090206001015550505b6001600160a01b03821660009081526004602052604090204260029091018190556129599062093a80612643565b6001600160a01b0390921660009081526004602052604090209190915550565b3390565b600081831061298c5781612566565b5090919050565b61191c846323b872dd60e01b85858560405160240161282293929190612d77565b6000612a09826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612a439092919063ffffffff16565b8051909150156128595780806020019051810190612a279190612c9f565b6128595760405162461bcd60e51b815260040161077d9061314e565b6060612a528484600085612a5a565b949350505050565b606082471015612a7c5760405162461bcd60e51b815260040161077d90612f68565b612a8585612b1a565b612aa15760405162461bcd60e51b815260040161077d90613117565b600080866001600160a01b03168587604051612abd9190612d47565b60006040518083038185875af1925050503d8060008114612afa576040519150601f19603f3d011682016040523d82523d6000602084013e612aff565b606091505b5091509150612b0f828286612b20565b979650505050505050565b3b151590565b60608315612b2f575081612566565b825115612b3f5782518084602001fd5b8160405162461bcd60e51b815260040161077d9190612e17565b604051806040016040528060008152602001600081525090565b5080546000825560020290600052602060002090810190612b949190612bae565b50565b604080518082019091526000808252602082015290565b5b80821115612bc95760008082556001820155600201612baf565b5090565b80356001600160a01b038116811461150d57600080fd5b600060208284031215612bf5578081fd5b61256682612bcd565b60008060408385031215612c10578081fd5b612c1983612bcd565b9150612c2760208401612bcd565b90509250929050565b600080600060608486031215612c44578081fd5b612c4d84612bcd565b9250612c5b60208501612bcd565b91506040840135612c6b816132ac565b809150509250925092565b60008060408385031215612c88578182fd5b612c9183612bcd565b946020939093013593505050565b600060208284031215612cb0578081fd5b8151612566816132ac565b600060208284031215612ccc578081fd5b5035919050565b60008060408385031215612ce5578182fd5b823591506020830135612cf7816132ac565b809150509250929050565b6000815180845260208085019450808401835b83811015612d3c578151805188528301518388015260409096019590820190600101612d15565b509495945050505050565b60008251612d59818460208701613280565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b602080825282518282018190526000919060409081850190868401855b82811015612dff57815180516001600160a01b03168552860151868501529284019290850190600101612dd1565b5091979650505050505050565b901515815260200190565b6000602082528251806020840152612e36816040850160208701613280565b601f01601f19169190910160400192915050565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252600e908201526d043616e6e6f74207374616b6520360941b604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526022908201527f496e73756666696369656e742062616c616e63652061667465722070656e616c604082015261747960f01b606082015260800190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b602080825260099082015268139bc81c995dd85c9960ba1b604082015260600190565b602080825260119082015270043616e6e6f74207769746864726177203607c1b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601d908201527f43616e6e6f74207769746864726177207374616b696e6720746f6b656e000000604082015260600190565b6020808252601d908201527f496e73756666696369656e7420756e6c6f636b65642062616c616e6365000000604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601c908201527f43616e6e6f742077697468647261772072657761726420746f6b656e00000000604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b90815260200190565b600083825260406020830152612a526040830184612d02565b918252602082015260400190565b60008582528460208301528360408301526080606083015261325b6080830184612d02565b9695505050505050565b93845260208401929092526040830152606082015260800190565b60005b8381101561329b578181015183820152602001613283565b8381111561191c5750506000910152565b8015158114612b9457600080fdfea26469706673582212201102e54b3e33f87344c6577c62f3a4caaf1a3941fc630c7261116cc3389d948464736f6c63430007060033000000000000000000000000a7f552078dcc247c2684336020c03648500c6d9f00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cce949de564fe60e7f96c85e55177f8b9e4cf61b00000000000000000000000060a8ad8470189033789c1053b0c6f89eb27bca18

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

000000000000000000000000a7f552078dcc247c2684336020c03648500c6d9f00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cce949de564fe60e7f96c85e55177f8b9e4cf61b00000000000000000000000060a8ad8470189033789c1053b0c6f89eb27bca18

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000a7f552078dcc247c2684336020c03648500c6d9f
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [3] : 000000000000000000000000cce949de564fe60e7f96c85e55177f8b9e4cf61b
Arg [4] : 00000000000000000000000060a8ad8470189033789c1053b0c6f89eb27bca18


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.