ETH Price: $2,752.63 (+4.86%)

Contract

0x2A941559Be456CF42a95C459a31765A2BfadC16D
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Get Reward204560802024-08-04 15:26:4719 days ago1722785207IN
0x2A941559...2BfadC16D
0 ETH0.000581419.14973317
Withdraw204559072024-08-04 14:51:5919 days ago1722783119IN
0x2A941559...2BfadC16D
0 ETH0.000561296.25421355
Get Reward204337842024-08-01 12:45:5922 days ago1722516359IN
0x2A941559...2BfadC16D
0 ETH0.000487347.33580786
Withdraw202116522024-07-01 12:25:1153 days ago1719836711IN
0x2A941559...2BfadC16D
0 ETH0.00038695.38419862
Get Reward202116022024-07-01 12:14:5953 days ago1719836099IN
0x2A941559...2BfadC16D
0 ETH0.000319044.80248108
Withdraw201697142024-06-25 15:52:4759 days ago1719330767IN
0x2A941559...2BfadC16D
0 ETH0.000566498.44767627
Get Reward201697102024-06-25 15:51:5959 days ago1719330719IN
0x2A941559...2BfadC16D
0 ETH0.000608838.61549728
Withdraw201256222024-06-19 11:55:2365 days ago1718798123IN
0x2A941559...2BfadC16D
0 ETH0.000331044.93662336
Get Reward201256202024-06-19 11:54:5965 days ago1718798099IN
0x2A941559...2BfadC16D
0 ETH0.000301044.53147755
Withdraw201189412024-06-18 13:28:5966 days ago1718717339IN
0x2A941559...2BfadC16D
0 ETH0.0011923817.78114306
Get Reward201189192024-06-18 13:24:3566 days ago1718717075IN
0x2A941559...2BfadC16D
0 ETH0.0007861311.8333657
Withdraw201131872024-06-17 18:07:1167 days ago1718647631IN
0x2A941559...2BfadC16D
0 ETH0.0010177615.17442548
Withdraw201051642024-06-16 15:10:4768 days ago1718550647IN
0x2A941559...2BfadC16D
0 ETH0.000415034.62322482
Withdraw200966282024-06-15 10:34:4769 days ago1718447687IN
0x2A941559...2BfadC16D
0 ETH0.000268293.69310677
Withdraw195578352024-04-01 1:49:59144 days ago1711936199IN
0x2A941559...2BfadC16D
0 ETH0.0012863919.18648634
Get Reward195578182024-04-01 1:46:35144 days ago1711935995IN
0x2A941559...2BfadC16D
0 ETH0.0012375518.62837657
Withdraw195488422024-03-30 19:28:47146 days ago1711826927IN
0x2A941559...2BfadC16D
0 ETH0.0016319122.4562055
Get Reward194646792024-03-18 22:35:59157 days ago1710801359IN
0x2A941559...2BfadC16D
0 ETH0.0022659231.41713467
Get Reward193684422024-03-05 10:43:23171 days ago1709635403IN
0x2A941559...2BfadC16D
0 ETH0.004215258.48603739
Get Reward192744992024-02-21 7:17:47184 days ago1708499867IN
0x2A941559...2BfadC16D
0 ETH0.0020914229.01860642
Stake192744932024-02-21 7:16:35184 days ago1708499795IN
0x2A941559...2BfadC16D
0 ETH0.0031878230.98252544
Get Reward192657072024-02-20 1:41:35185 days ago1708393295IN
0x2A941559...2BfadC16D
0 ETH0.0020995423.54483887
Stake191206652024-01-30 16:58:11206 days ago1706633891IN
0x2A941559...2BfadC16D
0 ETH0.0044510337.9878774
Get Reward189311982024-01-04 3:09:59232 days ago1704337799IN
0x2A941559...2BfadC16D
0 ETH0.0009440217.66410575
Get Reward189311752024-01-04 3:05:23232 days ago1704337523IN
0x2A941559...2BfadC16D
0 ETH0.0010209919.10440039
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ENBGovernance

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-10-20
*/

pragma solidity ^0.5.0;


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

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

/**
 * @dev Interface of the ERC20 standard as defined in the EIP. Does not include
 * the optional functions; to access them see {ERC20Detailed}.
 */
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);
}

/**
 * @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) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @dev Converts an `address` into `address payable`. Note that this is
     * simply a type cast: the actual underlying value is not changed.
     *
     * _Available since v2.4.0._
     */
    function toPayable(address account) internal pure returns (address payable) {
        return address(uint160(account));
    }

    /**
     * @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].
     *
     * _Available since v2.4.0._
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

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

    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.

        // A Solidity high level call has three parts:
        //  1. The target address is checked to verify it contains contract code
        //  2. The call itself is made, and success asserted
        //  3. The return value is decoded, which in turn checks the size of the returned data.
        // solhint-disable-next-line max-line-length
        require(address(token).isContract(), "SafeERC20: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(success, "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");
        }
    }
}

/**
 * @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].
 *
 * _Since v2.5.0:_ this module is now much more gas efficient, given net gas
 * metering changes introduced in the Istanbul hardfork.
 */
contract ReentrancyGuard {
    bool private _notEntered;

    constructor () internal {
        // Storing an initial 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 percetange 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.
        _notEntered = true;
    }

    /**
     * @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(_notEntered, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _notEntered = false;

        _;

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

/*
 * @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.
 */
contract Context {
    // Empty internal constructor, to prevent people from mistakenly deploying
    // an instance of this contract, which should be used via inheritance.
    constructor () internal { }
    // solhint-disable-previous-line no-empty-blocks

    function _msgSender() internal view returns (address payable) {
        return msg.sender;
    }

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

/**
 * @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.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
contract Ownable is Context {
    address private _owner;

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

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

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

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

    /**
     * @dev Returns true if the caller is the current owner.
     */
    function isOwner() public view returns (bool) {
        return _msgSender() == _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 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 onlyOwner {
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

// Inheritance
// https://docs.synthetix.io/contracts/RewardsDistributionRecipient
contract RewardsDistributionRecipient is Ownable {
    address public rewardsDistribution;

    function notifyRewardAmount(uint256 reward) external;

    modifier onlyRewardsDistribution() {
        require(msg.sender == rewardsDistribution, "Caller is not RewardsDistribution contract");
        _;
    }

    function setRewardsDistribution(address _rewardsDistribution) external onlyOwner {
        rewardsDistribution = _rewardsDistribution;
    }
}

// Inheritance
// https://docs.synthetix.io/contracts/Pausable
contract Pausable is Ownable {
    uint public lastPauseTime;
    bool public paused;

    constructor() internal {
        // This contract is abstract, and thus cannot be instantiated directly
        require(owner() != address(0), "Owner must be set");
        // Paused will be false, and lastPauseTime will be 0 upon initialisation
    }

    /**
     * @notice Change the paused state of the contract
     * @dev Only the contract owner may call this.
     */
    function setPaused(bool _paused) external onlyOwner {
        // Ensure we're actually changing the state before we do anything
        if (_paused == paused) {
            return;
        }

        // Set our paused state.
        paused = _paused;

        // If applicable, set the last pause time.
        if (paused) {
            lastPauseTime = now;
        }

        // Let everyone know that our pause state has changed.
        emit PauseChanged(paused);
    }

    event PauseChanged(bool isPaused);

    modifier notPaused {
        require(!paused, "This action cannot be performed while the contract is paused");
        _;
    }
}

/**
 *Submitted for verification at Etherscan.io on 2020-07-29
*/
/*
   ____            __   __        __   _
  / __/__ __ ___  / /_ / /  ___  / /_ (_)__ __
 _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
     /___/

* Synthetix: YFIRewards.sol
*
* Docs: https://docs.synthetix.io/
*
*
* MIT License
* ===========
*
* Copyright (c) 2020 Synthetix
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/
// Inheritance
contract LPTokenWrapper {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    IERC20 public vote;

    uint256 private _totalSupply;
    mapping(address => uint256) private _balances;

    function totalSupply() public view returns (uint256) {
        return _totalSupply;
    }

    function balanceOf(address account) public view returns (uint256) {
        return _balances[account];
    }

    function stake(uint256 amount) public {
        _totalSupply = _totalSupply.add(amount);
        _balances[msg.sender] = _balances[msg.sender].add(amount);
        vote.safeTransferFrom(msg.sender, address(this), amount);
    }

    function withdraw(uint256 amount) public {
        _totalSupply = _totalSupply.sub(amount);
        _balances[msg.sender] = _balances[msg.sender].sub(amount);
        vote.safeTransfer(msg.sender, amount);
    }
}

interface Executor {
    function execute(uint, uint, uint, uint) external;
}

contract ENBGovernance is LPTokenWrapper, RewardsDistributionRecipient {
    
    /* Fee collection for any other token */
    
    function seize(IERC20 _token, uint amount) external onlyOwner {
        require(_token != token, "reward");
        require(_token != vote, "vote");
        _token.safeTransfer(owner(), amount);
    }
    
    /* Modifications for proposals */
    
    mapping(address => uint) public voteLock; // period that your sake it locked to keep it for voting
    
    struct Proposal {
        uint id;
        address proposer;
        mapping(address => uint) forVotes;
        mapping(address => uint) againstVotes;
        uint totalForVotes;
        uint totalAgainstVotes;
        uint start; // block start;
        uint end; // start + period
        address executor;
        string hash;
        uint totalVotesAvailable;
        uint quorum;
        uint quorumRequired;
        bool open;
    }
    
    mapping (uint => Proposal) public proposals;
    uint public proposalCount;
    uint public period = 17280; // voting period in blocks ~ 17280 3 days for 15s/block
    uint public lock = 17280; // vote lock in blocks ~ 17280 3 days for 15s/block
    uint public minimum = 1e18;
    uint public quorum = 2000;
    bool public config = true;

    constructor(
        IERC20 _rewardsToken,
        IERC20 _voteToken
    ) public {
        token = _rewardsToken;
        vote = _voteToken;
        rewardsDistribution = msg.sender;
    }
    
    function setQuorum(uint _quorum) public onlyOwner {
        quorum = _quorum;
    }
    
    function setMinimum(uint _minimum) public onlyOwner {
        minimum = _minimum;
    }
    
    function setPeriod(uint _period) public onlyOwner {
        period = _period;
    }
    
    function setLock(uint _lock) public onlyOwner {
        lock = _lock;
    }
    
    function initialize(uint id) public {
        require(config == true, "!config");
        config = false;
        proposalCount = id;
    }
    
    event NewProposal(uint id, address creator, uint start, uint duration, address executor);
    event Vote(uint indexed id, address indexed voter, bool vote, uint weight);
    
    function propose(address executor, string memory hash) public {
        require(votesOf(msg.sender) > minimum, "<minimum");
        proposals[proposalCount++] = Proposal({
            id: proposalCount,
            proposer: msg.sender,
            totalForVotes: 0,
            totalAgainstVotes: 0,
            start: block.number,
            end: period.add(block.number),
            executor: executor,
            hash: hash,
            totalVotesAvailable: totalVotes,
            quorum: 0,
            quorumRequired: quorum,
            open: true
        });
        
        emit NewProposal(proposalCount, msg.sender, block.number, period, executor);
        voteLock[msg.sender] = lock.add(block.number);
    }
    
    function execute(uint id) public {
        (uint _for, uint _against, uint _quorum) = getStats(id);
        require(proposals[id].quorumRequired < _quorum, "!quorum");
        require(proposals[id].end < block.number , "!end");
        if (proposals[id].open == true) {
            tallyVotes(id);
        }
        Executor(proposals[id].executor).execute(id, _for, _against, _quorum);
    }
    
    function getStats(uint id) public view returns (uint _for, uint _against, uint _quorum) {
        _for = proposals[id].totalForVotes;
        _against = proposals[id].totalAgainstVotes;
        
        uint _total = _for.add(_against);
        _for = _for.mul(10000).div(_total);
        _against = _against.mul(10000).div(_total);
        
        _quorum = _total.mul(10000).div(proposals[id].totalVotesAvailable);
    }
    
    event ProposalFinished(uint indexed id, uint _for, uint _against, bool quorumReached);
    
    function tallyVotes(uint id) public {
        require(proposals[id].open == true, "!open");
        require(proposals[id].end < block.number, "!end");
        
        (uint _for, uint _against,) = getStats(id);
        bool _quorum = false;
        if (proposals[id].quorum >= proposals[id].quorumRequired) {
            _quorum = true;
        }
        proposals[id].open = false;
        emit ProposalFinished(id, _for, _against, _quorum);
    }
    
    function votesOf(address voter) public view returns (uint) {
        return votes[voter];
    }
    
    uint public totalVotes;
    mapping(address => uint) public votes;
    event RegisterVoter(address voter, uint votes, uint totalVotes);
    event RevokeVoter(address voter, uint votes, uint totalVotes);
    
    function register() public {
        require(voters[msg.sender] == false, "voter");
        voters[msg.sender] = true;
        votes[msg.sender] = balanceOf(msg.sender);
        totalVotes = totalVotes.add(votes[msg.sender]);
        emit RegisterVoter(msg.sender, votes[msg.sender], totalVotes);
    }
    
    
    function revoke() public {
        require(voters[msg.sender] == true, "!voter");
        voters[msg.sender] = false;
        if (totalVotes < votes[msg.sender]) {
            //edge case, should be impossible, but this is defi
            totalVotes = 0;
        } else {
            totalVotes = totalVotes.sub(votes[msg.sender]);
        }
        emit RevokeVoter(msg.sender, votes[msg.sender], totalVotes);
        votes[msg.sender] = 0;
    }
    
    mapping(address => bool) public voters;
    
    function voteFor(uint id) public {
        require(proposals[id].start < block.number , "<start");
        require(proposals[id].end > block.number , ">end");
        
        uint _against = proposals[id].againstVotes[msg.sender];
        if (_against > 0) {
            proposals[id].totalAgainstVotes = proposals[id].totalAgainstVotes.sub(_against);
            proposals[id].againstVotes[msg.sender] = 0;
        }
        
        uint vote = votesOf(msg.sender).sub(proposals[id].forVotes[msg.sender]);
        proposals[id].totalForVotes = proposals[id].totalForVotes.add(vote);
        proposals[id].forVotes[msg.sender] = votesOf(msg.sender);
        
        proposals[id].totalVotesAvailable = totalVotes;
        uint _votes = proposals[id].totalForVotes.add(proposals[id].totalAgainstVotes);
        proposals[id].quorum = _votes.mul(10000).div(totalVotes);
        
        voteLock[msg.sender] = lock.add(block.number);
        
        emit Vote(id, msg.sender, true, vote);
    }
    
    function voteAgainst(uint id) public {
        require(proposals[id].start < block.number , "<start");
        require(proposals[id].end > block.number , ">end");
        
        uint _for = proposals[id].forVotes[msg.sender];
        if (_for > 0) {
            proposals[id].totalForVotes = proposals[id].totalForVotes.sub(_for);
            proposals[id].forVotes[msg.sender] = 0;
        }
        
        uint vote = votesOf(msg.sender).sub(proposals[id].againstVotes[msg.sender]);
        proposals[id].totalAgainstVotes = proposals[id].totalAgainstVotes.add(vote);
        proposals[id].againstVotes[msg.sender] = votesOf(msg.sender);
        
        proposals[id].totalVotesAvailable = totalVotes;
        uint _votes = proposals[id].totalForVotes.add(proposals[id].totalAgainstVotes);
        proposals[id].quorum = _votes.mul(10000).div(totalVotes);
        
        voteLock[msg.sender] = lock.add(block.number);
        
        emit Vote(id, msg.sender, false, vote);
    }
    
    /* Default rewards contract */
    
    IERC20 public token;
    
    uint256 public constant DURATION = 30 days;

    uint256 public periodFinish = 0;
    uint256 public rewardRate = 0;
    uint256 public lastUpdateTime;
    uint256 public rewardPerTokenStored;
    mapping(address => uint256) public userRewardPerTokenPaid;
    mapping(address => uint256) public rewards;

    event RewardAdded(uint256 reward);
    event Staked(address indexed user, uint256 amount);
    event Withdrawn(address indexed user, uint256 amount);
    event RewardPaid(address indexed user, uint256 reward);

    modifier updateReward(address account) {
        rewardPerTokenStored = rewardPerToken();
        lastUpdateTime = lastTimeRewardApplicable();
        if (account != address(0)) {
            rewards[account] = earned(account);
            userRewardPerTokenPaid[account] = rewardPerTokenStored;
        }
        _;
    }

    function lastTimeRewardApplicable() public view returns (uint256) {
        return Math.min(block.timestamp, periodFinish);
    }

    function rewardPerToken() public view returns (uint256) {
        if (totalSupply() == 0) {
            return rewardPerTokenStored;
        }
        return
            rewardPerTokenStored.add(
                lastTimeRewardApplicable()
                    .sub(lastUpdateTime)
                    .mul(rewardRate)
                    .mul(1e18)
                    .div(totalSupply())
            );
    }

    function earned(address account) public view returns (uint256) {
        return
            balanceOf(account)
                .mul(rewardPerToken().sub(userRewardPerTokenPaid[account]))
                .div(1e18)
                .add(rewards[account]);
    }

    // stake visibility is public as overriding LPTokenWrapper's stake() function
    function stake(uint256 amount) public updateReward(msg.sender) {
        require(amount > 0, "Cannot stake 0");
        if (voters[msg.sender] == true) {
            votes[msg.sender] = votes[msg.sender].add(amount);
            totalVotes = totalVotes.add(amount);
        }
        super.stake(amount);
        emit Staked(msg.sender, amount);
    }

    function withdraw(uint256 amount) public updateReward(msg.sender) {
        require(amount > 0, "Cannot withdraw 0");
        if (voters[msg.sender] == true) {
            votes[msg.sender] = votes[msg.sender].sub(amount);
            totalVotes = totalVotes.sub(amount);
        }
        super.withdraw(amount);
        emit Withdrawn(msg.sender, amount);
    }

    function exit() external {
        withdraw(balanceOf(msg.sender));
        getReward();
    }

    function getReward() public updateReward(msg.sender) {
        uint256 reward = earned(msg.sender);
        if (reward > 0) {
            rewards[msg.sender] = 0;
            token.safeTransfer(msg.sender, reward);
            emit RewardPaid(msg.sender, reward);
        }
    }

    function notifyRewardAmount(uint256 reward)
        external
        onlyRewardsDistribution
        updateReward(address(0))
    {
        IERC20(token).safeTransferFrom(msg.sender, address(this), reward);
        if (block.timestamp >= periodFinish) {
            rewardRate = reward.div(DURATION);
        } else {
            uint256 remaining = periodFinish.sub(block.timestamp);
            uint256 leftover = remaining.mul(rewardRate);
            rewardRate = reward.add(leftover).div(DURATION);
        }
        lastUpdateTime = block.timestamp;
        periodFinish = block.timestamp.add(DURATION);
        emit RewardAdded(reward);
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"_rewardsToken","type":"address"},{"internalType":"contract IERC20","name":"_voteToken","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"creator","type":"address"},{"indexed":false,"internalType":"uint256","name":"start","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"},{"indexed":false,"internalType":"address","name":"executor","type":"address"}],"name":"NewProposal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_for","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_against","type":"uint256"},{"indexed":false,"internalType":"bool","name":"quorumReached","type":"bool"}],"name":"ProposalFinished","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"voter","type":"address"},{"indexed":false,"internalType":"uint256","name":"votes","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalVotes","type":"uint256"}],"name":"RegisterVoter","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"voter","type":"address"},{"indexed":false,"internalType":"uint256","name":"votes","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalVotes","type":"uint256"}],"name":"RevokeVoter","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":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","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":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"voter","type":"address"},{"indexed":false,"internalType":"bool","name":"vote","type":"bool"},{"indexed":false,"internalType":"uint256","name":"weight","type":"uint256"}],"name":"Vote","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"},{"constant":true,"inputs":[],"name":"DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"config","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"execute","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"exit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"getReward","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getStats","outputs":[{"internalType":"uint256","name":"_for","type":"uint256"},{"internalType":"uint256","name":"_against","type":"uint256"},{"internalType":"uint256","name":"_quorum","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minimum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"period","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"proposalCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"proposals","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"proposer","type":"address"},{"internalType":"uint256","name":"totalForVotes","type":"uint256"},{"internalType":"uint256","name":"totalAgainstVotes","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"address","name":"executor","type":"address"},{"internalType":"string","name":"hash","type":"string"},{"internalType":"uint256","name":"totalVotesAvailable","type":"uint256"},{"internalType":"uint256","name":"quorum","type":"uint256"},{"internalType":"uint256","name":"quorumRequired","type":"uint256"},{"internalType":"bool","name":"open","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"executor","type":"address"},{"internalType":"string","name":"hash","type":"string"}],"name":"propose","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"quorum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"register","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"revoke","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardPerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardsDistribution","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"seize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_lock","type":"uint256"}],"name":"setLock","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_minimum","type":"uint256"}],"name":"setMinimum","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_period","type":"uint256"}],"name":"setPeriod","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_quorum","type":"uint256"}],"name":"setQuorum","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_rewardsDistribution","type":"address"}],"name":"setRewardsDistribution","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"tallyVotes","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"vote","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"voteAgainst","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"voteFor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"voteLock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"voters","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"votes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"voter","type":"address"}],"name":"votesOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]

60806040526143806008819055600955670de0b6b3a7640000600a556107d0600b55600c805460ff191660011790556000601181905560125534801561004457600080fd5b5060405162002a2238038062002a228339818101604052604081101561006957600080fd5b50805160209091015160006100856001600160e01b0361011416565b600380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350601080546001600160a01b039384166001600160a01b0319918216179091556000805492909316918116919091179091556004805490911633179055610118565b3390565b6128fa80620001286000396000f3fe608060405234801561001057600080fd5b50600436106102f05760003560e01c80637b3039651161019d578063d6f0948c116100e9578063ebe2b12b116100a2578063f83d08ba1161007c578063f83d08ba146108b6578063fc0c546a146108be578063fe0d94c1146108c6578063fe4b84df146108e3576102f0565b8063ebe2b12b14610880578063ef78d4fd14610888578063f2fde38b14610890576102f0565b8063d6f0948c14610760578063d8bff5a514610816578063da35c6641461083c578063df136d6514610844578063e9fad8ee1461084c578063eb9253c014610854576102f0565b8063a3ec138d11610156578063c1ba4e5911610130578063c1ba4e5914610716578063c8f33c9114610733578063cd3daf9d1461073b578063d3e1574714610743576102f0565b8063a3ec138d146106cb578063a694fc3a146106f1578063b6549f751461070e576102f0565b80637b3039651461063557806380faa57d1461067057806386a50535146106785780638b876347146106955780638da5cb5b146106bb5780638f32d59b146106c3576102f0565b80633c6b16ab1161025c578063632a9a5211610215578063750e443a116101ef578063750e443a146105ce57806379502c55146105eb57806379ec5d3a146106075780637b0a47ee1461062d576102f0565b8063632a9a521461059857806370a08231146105a0578063715018a6146105c6576102f0565b80633c6b16ab146105045780633d18b912146105215780633fc6df6e146105295780634d318b0e1461054d5780634e27e9161461056a57806352d6804d14610590576102f0565b806318160ddd116102ae57806318160ddd1461048c57806319762143146104945780631aa3a008146104ba5780631be05289146104c25780632e1a7d4d146104ca5780633209e9e6146104e7576102f0565b80628cc262146102f5578063013cf08b1461032d5780630700037d146104375780630d15fd771461045d5780630f3a9f65146104655780631703a01814610484575b600080fd5b61031b6004803603602081101561030b57600080fd5b50356001600160a01b0316610900565b60408051918252519081900360200190f35b61034a6004803603602081101561034357600080fd5b5035610986565b604051808d81526020018c6001600160a01b03166001600160a01b031681526020018b81526020018a8152602001898152602001888152602001876001600160a01b03166001600160a01b031681526020018060200186815260200185815260200184815260200183151515158152602001828103825287818151815260200191508051906020019080838360005b838110156103f15781810151838201526020016103d9565b50505050905090810190601f16801561041e5780820380516001836020036101000a031916815260200191505b509d505050505050505050505050505060405180910390f35b61031b6004803603602081101561044d57600080fd5b50356001600160a01b0316610a7f565b61031b610a91565b6104826004803603602081101561047b57600080fd5b5035610a97565b005b61031b610ae3565b61031b610ae9565b610482600480360360208110156104aa57600080fd5b50356001600160a01b0316610af0565b610482610b59565b61031b610c44565b610482600480360360208110156104e057600080fd5b5035610c4b565b610482600480360360208110156104fd57600080fd5b5035610d96565b6104826004803603602081101561051a57600080fd5b5035610de2565b610482610f6a565b61053161103c565b604080516001600160a01b039092168252519081900360200190f35b6104826004803603602081101561056357600080fd5b503561104b565b61031b6004803603602081101561058057600080fd5b50356001600160a01b0316611186565b61031b611198565b61053161119e565b61031b600480360360208110156105b657600080fd5b50356001600160a01b03166111ad565b6104826111c8565b610482600480360360208110156105e457600080fd5b5035611259565b6105f36114b3565b604080519115158252519081900360200190f35b61031b6004803603602081101561061d57600080fd5b50356001600160a01b03166114bc565b61031b6114d7565b6106526004803603602081101561064b57600080fd5b50356114dd565b60408051938452602084019290925282820152519081900360600190f35b61031b61156d565b6104826004803603602081101561068e57600080fd5b5035611580565b61031b600480360360208110156106ab57600080fd5b50356001600160a01b03166117de565b6105316117f0565b6105f36117ff565b6105f3600480360360208110156106e157600080fd5b50356001600160a01b0316611825565b6104826004803603602081101561070757600080fd5b503561183a565b610482611982565b6104826004803603602081101561072c57600080fd5b5035611a8f565b61031b611adb565b61031b611ae1565b6104826004803603602081101561075957600080fd5b5035611b35565b6104826004803603604081101561077657600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156107a157600080fd5b8201836020820111156107b357600080fd5b803590602001918460018302840111640100000000831117156107d557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611b81945050505050565b61031b6004803603602081101561082c57600080fd5b50356001600160a01b0316611da8565b61031b611dba565b61031b611dc0565b610482611dc6565b6104826004803603604081101561086a57600080fd5b506001600160a01b038135169060200135611de1565b61031b611ee2565b61031b611ee8565b610482600480360360208110156108a657600080fd5b50356001600160a01b0316611eee565b61031b611f41565b610531611f47565b610482600480360360208110156108dc57600080fd5b5035611f56565b610482600480360360208110156108f957600080fd5b50356120ba565b6001600160a01b0381166000908152601660209081526040808320546015909252822054610980919061097490670de0b6b3a7640000906109689061095390610947611ae1565b9063ffffffff61210f16565b61095c886111ad565b9063ffffffff61215816565b9063ffffffff6121b116565b9063ffffffff6121f316565b92915050565b60066020818152600092835260409283902080546001808301546004840154600585015496850154600786015460088701546009880180548c51600261010099831615999099026000190190911697909704601f81018b90048b0288018b01909c528b8752969a6001600160a01b039586169a949994989397929695909116949293830182828015610a595780601f10610a2e57610100808354040283529160200191610a59565b820191906000526020600020905b815481529060010190602001808311610a3c57829003601f168201915b50505050600a830154600b840154600c850154600d909501549394919390925060ff168c565b60166020526000908152604090205481565b600d5481565b610a9f6117ff565b610ade576040805162461bcd60e51b81526020600482018190526024820152600080516020612852833981519152604482015290519081900360640190fd5b600855565b600b5481565b6001545b90565b610af86117ff565b610b37576040805162461bcd60e51b81526020600482018190526024820152600080516020612852833981519152604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b336000908152600f602052604090205460ff1615610ba6576040805162461bcd60e51b81526020600482015260056024820152643b37ba32b960d91b604482015290519081900360640190fd5b336000818152600f60205260409020805460ff19166001179055610bc9906111ad565b336000908152600e60205260409020819055600d54610bed9163ffffffff6121f316565b600d819055336000818152600e6020908152604091829020548251938452908301528181019290925290517f42bd0b21218b5114f60361fe686fe499033f14f22cb728a08cf9df9b4e60f8cc9181900360600190a1565b62278d0081565b33610c54611ae1565b601455610c5f61156d565b6013556001600160a01b03811615610ca657610c7a81610900565b6001600160a01b0382166000908152601660209081526040808320939093556014546015909152919020555b60008211610cef576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b604482015290519081900360640190fd5b336000908152600f602052604090205460ff16151560011415610d5357336000908152600e6020526040902054610d2c908363ffffffff61210f16565b336000908152600e6020526040902055600d54610d4f908363ffffffff61210f16565b600d555b610d5c8261224d565b60408051838152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a25050565b610d9e6117ff565b610ddd576040805162461bcd60e51b81526020600482018190526024820152600080516020612852833981519152604482015290519081900360640190fd5b600a55565b6004546001600160a01b03163314610e2b5760405162461bcd60e51b815260040180806020018281038252602a815260200180612872602a913960400191505060405180910390fd5b6000610e35611ae1565b601455610e4061156d565b6013556001600160a01b03811615610e8757610e5b81610900565b6001600160a01b0382166000908152601660209081526040808320939093556014546015909152919020555b601054610ea5906001600160a01b031633308563ffffffff6122ae16565b6011544210610ec957610ec18262278d0063ffffffff6121b116565b601255610f17565b601154600090610edf904263ffffffff61210f16565b90506000610ef86012548361215890919063ffffffff16565b9050610f1162278d00610968868463ffffffff6121f316565b60125550505b426013819055610f309062278d0063ffffffff6121f316565b6011556040805183815290517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9181900360200190a15050565b33610f73611ae1565b601455610f7e61156d565b6013556001600160a01b03811615610fc557610f9981610900565b6001600160a01b0382166000908152601660209081526040808320939093556014546015909152919020555b6000610fd033610900565b905080156110385733600081815260166020526040812055601054611001916001600160a01b03909116908361230e565b60408051828152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b5050565b6004546001600160a01b031681565b6000818152600660205260409020600d015460ff16151560011461109e576040805162461bcd60e51b815260206004820152600560248201526410b7b832b760d91b604482015290519081900360640190fd5b60008181526006602052604090206007015443116110ec576040805162461bcd60e51b8152602060048083019190915260248201526308595b9960e21b604482015290519081900360640190fd5b6000806110f8836114dd565b506000858152600660205260408120600c810154600b909101549395509193509110611122575060015b600084815260066020908152604091829020600d01805460ff19169055815185815290810184905282151581830152905185917f66ab4d2a1f6db1c01d1d46ab61a9c333b5a4de5e75cc7a68e1495b4badbd009b919081900360600190a250505050565b60056020526000908152604090205481565b600a5481565b6000546001600160a01b031681565b6001600160a01b031660009081526002602052604090205490565b6111d06117ff565b61120f576040805162461bcd60e51b81526020600482018190526024820152600080516020612852833981519152604482015290519081900360640190fd5b6003546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600380546001600160a01b0319169055565b6000818152600660208190526040909120015443116112a8576040805162461bcd60e51b81526020600482015260066024820152650f1cdd185c9d60d21b604482015290519081900360640190fd5b60008181526006602052604090206007015443106112f6576040805162461bcd60e51b815260206004808301919091526024820152630f995b9960e21b604482015290519081900360640190fd5b600081815260066020908152604080832033845260020190915290205480156113635760008281526006602052604090206004015461133b908263ffffffff61210f16565b6000838152600660209081526040808320600481019490945533835260029093019052908120555b600082815260066020908152604080832033808552600390910190925282205461139091610947906114bc565b6000848152600660205260409020600501549091506113b5908263ffffffff6121f316565b6000848152600660205260409020600501556113d0336114bc565b600084815260066020818152604080842033855260038101835290842094909455600d54878452919052600a8301556005820154600490920154909161141c919063ffffffff6121f316565b600d54909150611438906109688361271063ffffffff61215816565b6000858152600660205260409020600b015560095461145d904363ffffffff6121f316565b33600081815260056020908152604080832094909455835191825281018590528251919287927f88d35328232823f54954b6627e9f732371656f6daa40cb1b01b27dc7875a7b479281900390910190a350505050565b600c5460ff1681565b6001600160a01b03166000908152600e602052604090205490565b60125481565b60008181526006602052604081206004810154600590910154909180611509848463ffffffff6121f316565b9050611521816109688661271063ffffffff61215816565b9350611539816109688561271063ffffffff61215816565b6000868152600660205260409020600a0154909350611564906109688361271063ffffffff61215816565b93959294505050565b600061157b42601154612365565b905090565b6000818152600660208190526040909120015443116115cf576040805162461bcd60e51b81526020600482015260066024820152650f1cdd185c9d60d21b604482015290519081900360640190fd5b600081815260066020526040902060070154431061161d576040805162461bcd60e51b815260206004808301919091526024820152630f995b9960e21b604482015290519081900360640190fd5b6000818152600660209081526040808320338452600301909152902054801561168a57600082815260066020526040902060050154611662908263ffffffff61210f16565b6000838152600660209081526040808320600581019490945533835260039093019052908120555b60008281526006602090815260408083203380855260029091019092528220546116b791610947906114bc565b6000848152600660205260409020600401549091506116dc908263ffffffff6121f316565b6000848152600660205260409020600401556116f7336114bc565b600084815260066020818152604080842033855260028101835290842094909455600d54878452919052600a83015560058201546004909201549091611743919063ffffffff6121f316565b600d5490915061175f906109688361271063ffffffff61215816565b6000858152600660205260409020600b0155600954611784904363ffffffff6121f316565b33600081815260056020908152604091829020939093558051600181529283018590528051919287927f88d35328232823f54954b6627e9f732371656f6daa40cb1b01b27dc7875a7b47929181900390910190a350505050565b60156020526000908152604090205481565b6003546001600160a01b031690565b6003546000906001600160a01b031661181661237b565b6001600160a01b031614905090565b600f6020526000908152604090205460ff1681565b33611843611ae1565b60145561184e61156d565b6013556001600160a01b038116156118955761186981610900565b6001600160a01b0382166000908152601660209081526040808320939093556014546015909152919020555b600082116118db576040805162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b604482015290519081900360640190fd5b336000908152600f602052604090205460ff1615156001141561193f57336000908152600e6020526040902054611918908363ffffffff6121f316565b336000908152600e6020526040902055600d5461193b908363ffffffff6121f316565b600d555b6119488261237f565b60408051838152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a25050565b336000908152600f602052604090205460ff1615156001146119d4576040805162461bcd60e51b815260206004820152600660248201526510bb37ba32b960d11b604482015290519081900360640190fd5b336000908152600f60209081526040808320805460ff19169055600e909152902054600d541015611a09576000600d55611a2f565b336000908152600e6020526040902054600d54611a2b9163ffffffff61210f16565b600d555b336000818152600e602090815260409182902054600d5483519485529184015282820152517e330fa0724b41c0d187cfad0aa7ff5fa2ff7e742995886f55fda6f5909914b89181900360600190a1336000908152600e6020526040812055565b611a976117ff565b611ad6576040805162461bcd60e51b81526020600482018190526024820152600080516020612852833981519152604482015290519081900360640190fd5b600b55565b60135481565b6000611aeb610ae9565b611af85750601454610aed565b61157b611b26611b06610ae9565b610968670de0b6b3a764000061095c60125461095c60135461094761156d565b6014549063ffffffff6121f316565b611b3d6117ff565b611b7c576040805162461bcd60e51b81526020600482018190526024820152600080516020612852833981519152604482015290519081900360640190fd5b600955565b600a54611b8d336114bc565b11611bca576040805162461bcd60e51b81526020600482015260086024820152673c6d696e696d756d60c01b604482015290519081900360640190fd5b6040518061018001604052806007548152602001336001600160a01b031681526020016000815260200160008152602001438152602001611c16436008546121f390919063ffffffff16565b81526001600160a01b038085166020808401919091526040808401869052600d5460608086019190915260006080808701829052600b5460a080890191909152600160c098890181905260078054808301825585526006808952948790208b5181558b8901519281018054938b166001600160a01b0319948516179055968b01516004880155948a0151600587015591890151928501929092559087015191830191909155938501516008820180549190941694169390931790915560e08301518051611ce99260098501920190612772565b50610100820151600a820155610120820151600b820155610140820151600c82015561016090910151600d909101805460ff191691151591909117905560075460085460408051928352336020840152438382015260608301919091526001600160a01b0384166080830152517ff3aa81c2323a935a3e72c018c519b8d8b432eeebaa15cbbe5c8305f0f9df6f4d9160a0908290030190a1600954611d94904363ffffffff6121f316565b336000908152600560205260409020555050565b600e6020526000908152604090205481565b60075481565b60145481565b611dd7611dd2336111ad565b610c4b565b611ddf610f6a565b565b611de96117ff565b611e28576040805162461bcd60e51b81526020600482018190526024820152600080516020612852833981519152604482015290519081900360640190fd5b6010546001600160a01b0383811691161415611e74576040805162461bcd60e51b81526020600482015260066024820152651c995dd85c9960d21b604482015290519081900360640190fd5b6000546001600160a01b0383811691161415611ec0576040805162461bcd60e51b81526020600480830191909152602482015263766f746560e01b604482015290519081900360640190fd5b611038611ecb6117f0565b6001600160a01b038416908363ffffffff61230e16565b60115481565b60085481565b611ef66117ff565b611f35576040805162461bcd60e51b81526020600482018190526024820152600080516020612852833981519152604482015290519081900360640190fd5b611f3e816123e1565b50565b60095481565b6010546001600160a01b031681565b6000806000611f64846114dd565b6000878152600660205260409020600c015492955090935091508111611fbb576040805162461bcd60e51b81526020600482015260076024820152662171756f72756d60c81b604482015290519081900360640190fd5b6000848152600660205260409020600701544311612009576040805162461bcd60e51b8152602060048083019190915260248201526308595b9960e21b604482015290519081900360640190fd5b6000848152600660205260409020600d015460ff16151560011415612031576120318461104b565b600084815260066020526040808220600801548151636009bfbd60e11b81526004810188905260248101879052604481018690526064810185905291516001600160a01b039091169263c0137f7a926084808201939182900301818387803b15801561209c57600080fd5b505af11580156120b0573d6000803e3d6000fd5b5050505050505050565b600c5460ff161515600114612100576040805162461bcd60e51b815260206004820152600760248201526621636f6e66696760c81b604482015290519081900360640190fd5b600c805460ff19169055600755565b600061215183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612482565b9392505050565b60008261216757506000610980565b8282028284828161217457fe5b04146121515760405162461bcd60e51b81526004018080602001828103825260218152602001806128316021913960400191505060405180910390fd5b600061215183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612519565b600082820183811015612151576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600154612260908263ffffffff61210f16565b60015533600090815260026020526040902054612283908263ffffffff61210f16565b336000818152600260205260408120929092559054611f3e916001600160a01b03909116908361230e565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261230890859061257e565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261236090849061257e565b505050565b60008183106123745781612151565b5090919050565b3390565b600154612392908263ffffffff6121f316565b600155336000908152600260205260409020546123b5908263ffffffff6121f316565b336000818152600260205260408120929092559054611f3e916001600160a01b039091169030846122ae565b6001600160a01b0381166124265760405162461bcd60e51b815260040180806020018281038252602681526020018061280b6026913960400191505060405180910390fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b600081848411156125115760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124d65781810151838201526020016124be565b50505050905090810190601f1680156125035780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836125685760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156124d65781810151838201526020016124be565b50600083858161257457fe5b0495945050505050565b612590826001600160a01b0316612736565b6125e1576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b6020831061261f5780518252601f199092019160209182019101612600565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612681576040519150601f19603f3d011682016040523d82523d6000602084013e612686565b606091505b5091509150816126dd576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115612308578080602001905160208110156126f957600080fd5b50516123085760405162461bcd60e51b815260040180806020018281038252602a81526020018061289c602a913960400191505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061276a57508115155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106127b357805160ff19168380011785556127e0565b828001600101855582156127e0579182015b828111156127e05782518255916020019190600101906127c5565b506127ec9291506127f0565b5090565b610aed91905b808211156127ec57600081556001016127f656fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657243616c6c6572206973206e6f742052657761726473446973747269627574696f6e20636f6e74726163745361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a72315820516ab6fc52310bdec53a8966fe8000e2128b1d5c4cea7ec8e293aa8db5b2b5ba64736f6c63430005100032000000000000000000000000a6fb1df483b24eeab569e19447e0e107003b9e15000000000000000000000000a6fb1df483b24eeab569e19447e0e107003b9e15

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102f05760003560e01c80637b3039651161019d578063d6f0948c116100e9578063ebe2b12b116100a2578063f83d08ba1161007c578063f83d08ba146108b6578063fc0c546a146108be578063fe0d94c1146108c6578063fe4b84df146108e3576102f0565b8063ebe2b12b14610880578063ef78d4fd14610888578063f2fde38b14610890576102f0565b8063d6f0948c14610760578063d8bff5a514610816578063da35c6641461083c578063df136d6514610844578063e9fad8ee1461084c578063eb9253c014610854576102f0565b8063a3ec138d11610156578063c1ba4e5911610130578063c1ba4e5914610716578063c8f33c9114610733578063cd3daf9d1461073b578063d3e1574714610743576102f0565b8063a3ec138d146106cb578063a694fc3a146106f1578063b6549f751461070e576102f0565b80637b3039651461063557806380faa57d1461067057806386a50535146106785780638b876347146106955780638da5cb5b146106bb5780638f32d59b146106c3576102f0565b80633c6b16ab1161025c578063632a9a5211610215578063750e443a116101ef578063750e443a146105ce57806379502c55146105eb57806379ec5d3a146106075780637b0a47ee1461062d576102f0565b8063632a9a521461059857806370a08231146105a0578063715018a6146105c6576102f0565b80633c6b16ab146105045780633d18b912146105215780633fc6df6e146105295780634d318b0e1461054d5780634e27e9161461056a57806352d6804d14610590576102f0565b806318160ddd116102ae57806318160ddd1461048c57806319762143146104945780631aa3a008146104ba5780631be05289146104c25780632e1a7d4d146104ca5780633209e9e6146104e7576102f0565b80628cc262146102f5578063013cf08b1461032d5780630700037d146104375780630d15fd771461045d5780630f3a9f65146104655780631703a01814610484575b600080fd5b61031b6004803603602081101561030b57600080fd5b50356001600160a01b0316610900565b60408051918252519081900360200190f35b61034a6004803603602081101561034357600080fd5b5035610986565b604051808d81526020018c6001600160a01b03166001600160a01b031681526020018b81526020018a8152602001898152602001888152602001876001600160a01b03166001600160a01b031681526020018060200186815260200185815260200184815260200183151515158152602001828103825287818151815260200191508051906020019080838360005b838110156103f15781810151838201526020016103d9565b50505050905090810190601f16801561041e5780820380516001836020036101000a031916815260200191505b509d505050505050505050505050505060405180910390f35b61031b6004803603602081101561044d57600080fd5b50356001600160a01b0316610a7f565b61031b610a91565b6104826004803603602081101561047b57600080fd5b5035610a97565b005b61031b610ae3565b61031b610ae9565b610482600480360360208110156104aa57600080fd5b50356001600160a01b0316610af0565b610482610b59565b61031b610c44565b610482600480360360208110156104e057600080fd5b5035610c4b565b610482600480360360208110156104fd57600080fd5b5035610d96565b6104826004803603602081101561051a57600080fd5b5035610de2565b610482610f6a565b61053161103c565b604080516001600160a01b039092168252519081900360200190f35b6104826004803603602081101561056357600080fd5b503561104b565b61031b6004803603602081101561058057600080fd5b50356001600160a01b0316611186565b61031b611198565b61053161119e565b61031b600480360360208110156105b657600080fd5b50356001600160a01b03166111ad565b6104826111c8565b610482600480360360208110156105e457600080fd5b5035611259565b6105f36114b3565b604080519115158252519081900360200190f35b61031b6004803603602081101561061d57600080fd5b50356001600160a01b03166114bc565b61031b6114d7565b6106526004803603602081101561064b57600080fd5b50356114dd565b60408051938452602084019290925282820152519081900360600190f35b61031b61156d565b6104826004803603602081101561068e57600080fd5b5035611580565b61031b600480360360208110156106ab57600080fd5b50356001600160a01b03166117de565b6105316117f0565b6105f36117ff565b6105f3600480360360208110156106e157600080fd5b50356001600160a01b0316611825565b6104826004803603602081101561070757600080fd5b503561183a565b610482611982565b6104826004803603602081101561072c57600080fd5b5035611a8f565b61031b611adb565b61031b611ae1565b6104826004803603602081101561075957600080fd5b5035611b35565b6104826004803603604081101561077657600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156107a157600080fd5b8201836020820111156107b357600080fd5b803590602001918460018302840111640100000000831117156107d557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611b81945050505050565b61031b6004803603602081101561082c57600080fd5b50356001600160a01b0316611da8565b61031b611dba565b61031b611dc0565b610482611dc6565b6104826004803603604081101561086a57600080fd5b506001600160a01b038135169060200135611de1565b61031b611ee2565b61031b611ee8565b610482600480360360208110156108a657600080fd5b50356001600160a01b0316611eee565b61031b611f41565b610531611f47565b610482600480360360208110156108dc57600080fd5b5035611f56565b610482600480360360208110156108f957600080fd5b50356120ba565b6001600160a01b0381166000908152601660209081526040808320546015909252822054610980919061097490670de0b6b3a7640000906109689061095390610947611ae1565b9063ffffffff61210f16565b61095c886111ad565b9063ffffffff61215816565b9063ffffffff6121b116565b9063ffffffff6121f316565b92915050565b60066020818152600092835260409283902080546001808301546004840154600585015496850154600786015460088701546009880180548c51600261010099831615999099026000190190911697909704601f81018b90048b0288018b01909c528b8752969a6001600160a01b039586169a949994989397929695909116949293830182828015610a595780601f10610a2e57610100808354040283529160200191610a59565b820191906000526020600020905b815481529060010190602001808311610a3c57829003601f168201915b50505050600a830154600b840154600c850154600d909501549394919390925060ff168c565b60166020526000908152604090205481565b600d5481565b610a9f6117ff565b610ade576040805162461bcd60e51b81526020600482018190526024820152600080516020612852833981519152604482015290519081900360640190fd5b600855565b600b5481565b6001545b90565b610af86117ff565b610b37576040805162461bcd60e51b81526020600482018190526024820152600080516020612852833981519152604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b336000908152600f602052604090205460ff1615610ba6576040805162461bcd60e51b81526020600482015260056024820152643b37ba32b960d91b604482015290519081900360640190fd5b336000818152600f60205260409020805460ff19166001179055610bc9906111ad565b336000908152600e60205260409020819055600d54610bed9163ffffffff6121f316565b600d819055336000818152600e6020908152604091829020548251938452908301528181019290925290517f42bd0b21218b5114f60361fe686fe499033f14f22cb728a08cf9df9b4e60f8cc9181900360600190a1565b62278d0081565b33610c54611ae1565b601455610c5f61156d565b6013556001600160a01b03811615610ca657610c7a81610900565b6001600160a01b0382166000908152601660209081526040808320939093556014546015909152919020555b60008211610cef576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b604482015290519081900360640190fd5b336000908152600f602052604090205460ff16151560011415610d5357336000908152600e6020526040902054610d2c908363ffffffff61210f16565b336000908152600e6020526040902055600d54610d4f908363ffffffff61210f16565b600d555b610d5c8261224d565b60408051838152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a25050565b610d9e6117ff565b610ddd576040805162461bcd60e51b81526020600482018190526024820152600080516020612852833981519152604482015290519081900360640190fd5b600a55565b6004546001600160a01b03163314610e2b5760405162461bcd60e51b815260040180806020018281038252602a815260200180612872602a913960400191505060405180910390fd5b6000610e35611ae1565b601455610e4061156d565b6013556001600160a01b03811615610e8757610e5b81610900565b6001600160a01b0382166000908152601660209081526040808320939093556014546015909152919020555b601054610ea5906001600160a01b031633308563ffffffff6122ae16565b6011544210610ec957610ec18262278d0063ffffffff6121b116565b601255610f17565b601154600090610edf904263ffffffff61210f16565b90506000610ef86012548361215890919063ffffffff16565b9050610f1162278d00610968868463ffffffff6121f316565b60125550505b426013819055610f309062278d0063ffffffff6121f316565b6011556040805183815290517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9181900360200190a15050565b33610f73611ae1565b601455610f7e61156d565b6013556001600160a01b03811615610fc557610f9981610900565b6001600160a01b0382166000908152601660209081526040808320939093556014546015909152919020555b6000610fd033610900565b905080156110385733600081815260166020526040812055601054611001916001600160a01b03909116908361230e565b60408051828152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b5050565b6004546001600160a01b031681565b6000818152600660205260409020600d015460ff16151560011461109e576040805162461bcd60e51b815260206004820152600560248201526410b7b832b760d91b604482015290519081900360640190fd5b60008181526006602052604090206007015443116110ec576040805162461bcd60e51b8152602060048083019190915260248201526308595b9960e21b604482015290519081900360640190fd5b6000806110f8836114dd565b506000858152600660205260408120600c810154600b909101549395509193509110611122575060015b600084815260066020908152604091829020600d01805460ff19169055815185815290810184905282151581830152905185917f66ab4d2a1f6db1c01d1d46ab61a9c333b5a4de5e75cc7a68e1495b4badbd009b919081900360600190a250505050565b60056020526000908152604090205481565b600a5481565b6000546001600160a01b031681565b6001600160a01b031660009081526002602052604090205490565b6111d06117ff565b61120f576040805162461bcd60e51b81526020600482018190526024820152600080516020612852833981519152604482015290519081900360640190fd5b6003546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600380546001600160a01b0319169055565b6000818152600660208190526040909120015443116112a8576040805162461bcd60e51b81526020600482015260066024820152650f1cdd185c9d60d21b604482015290519081900360640190fd5b60008181526006602052604090206007015443106112f6576040805162461bcd60e51b815260206004808301919091526024820152630f995b9960e21b604482015290519081900360640190fd5b600081815260066020908152604080832033845260020190915290205480156113635760008281526006602052604090206004015461133b908263ffffffff61210f16565b6000838152600660209081526040808320600481019490945533835260029093019052908120555b600082815260066020908152604080832033808552600390910190925282205461139091610947906114bc565b6000848152600660205260409020600501549091506113b5908263ffffffff6121f316565b6000848152600660205260409020600501556113d0336114bc565b600084815260066020818152604080842033855260038101835290842094909455600d54878452919052600a8301556005820154600490920154909161141c919063ffffffff6121f316565b600d54909150611438906109688361271063ffffffff61215816565b6000858152600660205260409020600b015560095461145d904363ffffffff6121f316565b33600081815260056020908152604080832094909455835191825281018590528251919287927f88d35328232823f54954b6627e9f732371656f6daa40cb1b01b27dc7875a7b479281900390910190a350505050565b600c5460ff1681565b6001600160a01b03166000908152600e602052604090205490565b60125481565b60008181526006602052604081206004810154600590910154909180611509848463ffffffff6121f316565b9050611521816109688661271063ffffffff61215816565b9350611539816109688561271063ffffffff61215816565b6000868152600660205260409020600a0154909350611564906109688361271063ffffffff61215816565b93959294505050565b600061157b42601154612365565b905090565b6000818152600660208190526040909120015443116115cf576040805162461bcd60e51b81526020600482015260066024820152650f1cdd185c9d60d21b604482015290519081900360640190fd5b600081815260066020526040902060070154431061161d576040805162461bcd60e51b815260206004808301919091526024820152630f995b9960e21b604482015290519081900360640190fd5b6000818152600660209081526040808320338452600301909152902054801561168a57600082815260066020526040902060050154611662908263ffffffff61210f16565b6000838152600660209081526040808320600581019490945533835260039093019052908120555b60008281526006602090815260408083203380855260029091019092528220546116b791610947906114bc565b6000848152600660205260409020600401549091506116dc908263ffffffff6121f316565b6000848152600660205260409020600401556116f7336114bc565b600084815260066020818152604080842033855260028101835290842094909455600d54878452919052600a83015560058201546004909201549091611743919063ffffffff6121f316565b600d5490915061175f906109688361271063ffffffff61215816565b6000858152600660205260409020600b0155600954611784904363ffffffff6121f316565b33600081815260056020908152604091829020939093558051600181529283018590528051919287927f88d35328232823f54954b6627e9f732371656f6daa40cb1b01b27dc7875a7b47929181900390910190a350505050565b60156020526000908152604090205481565b6003546001600160a01b031690565b6003546000906001600160a01b031661181661237b565b6001600160a01b031614905090565b600f6020526000908152604090205460ff1681565b33611843611ae1565b60145561184e61156d565b6013556001600160a01b038116156118955761186981610900565b6001600160a01b0382166000908152601660209081526040808320939093556014546015909152919020555b600082116118db576040805162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b604482015290519081900360640190fd5b336000908152600f602052604090205460ff1615156001141561193f57336000908152600e6020526040902054611918908363ffffffff6121f316565b336000908152600e6020526040902055600d5461193b908363ffffffff6121f316565b600d555b6119488261237f565b60408051838152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a25050565b336000908152600f602052604090205460ff1615156001146119d4576040805162461bcd60e51b815260206004820152600660248201526510bb37ba32b960d11b604482015290519081900360640190fd5b336000908152600f60209081526040808320805460ff19169055600e909152902054600d541015611a09576000600d55611a2f565b336000908152600e6020526040902054600d54611a2b9163ffffffff61210f16565b600d555b336000818152600e602090815260409182902054600d5483519485529184015282820152517e330fa0724b41c0d187cfad0aa7ff5fa2ff7e742995886f55fda6f5909914b89181900360600190a1336000908152600e6020526040812055565b611a976117ff565b611ad6576040805162461bcd60e51b81526020600482018190526024820152600080516020612852833981519152604482015290519081900360640190fd5b600b55565b60135481565b6000611aeb610ae9565b611af85750601454610aed565b61157b611b26611b06610ae9565b610968670de0b6b3a764000061095c60125461095c60135461094761156d565b6014549063ffffffff6121f316565b611b3d6117ff565b611b7c576040805162461bcd60e51b81526020600482018190526024820152600080516020612852833981519152604482015290519081900360640190fd5b600955565b600a54611b8d336114bc565b11611bca576040805162461bcd60e51b81526020600482015260086024820152673c6d696e696d756d60c01b604482015290519081900360640190fd5b6040518061018001604052806007548152602001336001600160a01b031681526020016000815260200160008152602001438152602001611c16436008546121f390919063ffffffff16565b81526001600160a01b038085166020808401919091526040808401869052600d5460608086019190915260006080808701829052600b5460a080890191909152600160c098890181905260078054808301825585526006808952948790208b5181558b8901519281018054938b166001600160a01b0319948516179055968b01516004880155948a0151600587015591890151928501929092559087015191830191909155938501516008820180549190941694169390931790915560e08301518051611ce99260098501920190612772565b50610100820151600a820155610120820151600b820155610140820151600c82015561016090910151600d909101805460ff191691151591909117905560075460085460408051928352336020840152438382015260608301919091526001600160a01b0384166080830152517ff3aa81c2323a935a3e72c018c519b8d8b432eeebaa15cbbe5c8305f0f9df6f4d9160a0908290030190a1600954611d94904363ffffffff6121f316565b336000908152600560205260409020555050565b600e6020526000908152604090205481565b60075481565b60145481565b611dd7611dd2336111ad565b610c4b565b611ddf610f6a565b565b611de96117ff565b611e28576040805162461bcd60e51b81526020600482018190526024820152600080516020612852833981519152604482015290519081900360640190fd5b6010546001600160a01b0383811691161415611e74576040805162461bcd60e51b81526020600482015260066024820152651c995dd85c9960d21b604482015290519081900360640190fd5b6000546001600160a01b0383811691161415611ec0576040805162461bcd60e51b81526020600480830191909152602482015263766f746560e01b604482015290519081900360640190fd5b611038611ecb6117f0565b6001600160a01b038416908363ffffffff61230e16565b60115481565b60085481565b611ef66117ff565b611f35576040805162461bcd60e51b81526020600482018190526024820152600080516020612852833981519152604482015290519081900360640190fd5b611f3e816123e1565b50565b60095481565b6010546001600160a01b031681565b6000806000611f64846114dd565b6000878152600660205260409020600c015492955090935091508111611fbb576040805162461bcd60e51b81526020600482015260076024820152662171756f72756d60c81b604482015290519081900360640190fd5b6000848152600660205260409020600701544311612009576040805162461bcd60e51b8152602060048083019190915260248201526308595b9960e21b604482015290519081900360640190fd5b6000848152600660205260409020600d015460ff16151560011415612031576120318461104b565b600084815260066020526040808220600801548151636009bfbd60e11b81526004810188905260248101879052604481018690526064810185905291516001600160a01b039091169263c0137f7a926084808201939182900301818387803b15801561209c57600080fd5b505af11580156120b0573d6000803e3d6000fd5b5050505050505050565b600c5460ff161515600114612100576040805162461bcd60e51b815260206004820152600760248201526621636f6e66696760c81b604482015290519081900360640190fd5b600c805460ff19169055600755565b600061215183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612482565b9392505050565b60008261216757506000610980565b8282028284828161217457fe5b04146121515760405162461bcd60e51b81526004018080602001828103825260218152602001806128316021913960400191505060405180910390fd5b600061215183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612519565b600082820183811015612151576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600154612260908263ffffffff61210f16565b60015533600090815260026020526040902054612283908263ffffffff61210f16565b336000818152600260205260408120929092559054611f3e916001600160a01b03909116908361230e565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261230890859061257e565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261236090849061257e565b505050565b60008183106123745781612151565b5090919050565b3390565b600154612392908263ffffffff6121f316565b600155336000908152600260205260409020546123b5908263ffffffff6121f316565b336000818152600260205260408120929092559054611f3e916001600160a01b039091169030846122ae565b6001600160a01b0381166124265760405162461bcd60e51b815260040180806020018281038252602681526020018061280b6026913960400191505060405180910390fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b600081848411156125115760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124d65781810151838201526020016124be565b50505050905090810190601f1680156125035780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836125685760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156124d65781810151838201526020016124be565b50600083858161257457fe5b0495945050505050565b612590826001600160a01b0316612736565b6125e1576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b6020831061261f5780518252601f199092019160209182019101612600565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612681576040519150601f19603f3d011682016040523d82523d6000602084013e612686565b606091505b5091509150816126dd576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115612308578080602001905160208110156126f957600080fd5b50516123085760405162461bcd60e51b815260040180806020018281038252602a81526020018061289c602a913960400191505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061276a57508115155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106127b357805160ff19168380011785556127e0565b828001600101855582156127e0579182015b828111156127e05782518255916020019190600101906127c5565b506127ec9291506127f0565b5090565b610aed91905b808211156127ec57600081556001016127f656fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657243616c6c6572206973206e6f742052657761726473446973747269627574696f6e20636f6e74726163745361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a72315820516ab6fc52310bdec53a8966fe8000e2128b1d5c4cea7ec8e293aa8db5b2b5ba64736f6c63430005100032

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

000000000000000000000000a6fb1df483b24eeab569e19447e0e107003b9e15000000000000000000000000a6fb1df483b24eeab569e19447e0e107003b9e15

-----Decoded View---------------
Arg [0] : _rewardsToken (address): 0xa6FB1DF483b24EEAB569e19447E0e107003B9E15
Arg [1] : _voteToken (address): 0xa6FB1DF483b24EEAB569e19447E0e107003B9E15

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000a6fb1df483b24eeab569e19447e0e107003b9e15
Arg [1] : 000000000000000000000000a6fb1df483b24eeab569e19447e0e107003b9e15


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

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ 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.