Contract 0x679df49198614623b6266e559d4abc8bf29f1568

 
Txn Hash
Block
From
To
Value
0xbb35faaf0563e8cf996bb8f38ccee8728beef4888d12e5727375096c3fc37a4c115915702021-01-05 1:29:0562 days 18 hrs ago0x8c3f85499eb95c5a878f816d79e16107ab8e61e8 IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.00889308639125.01
0x8e659cfe548a8d0a9c2ffb713831f0c311dbb8ba7f89bd60d800965fa6a64033114872062020-12-20 1:24:1078 days 18 hrs ago0x0739abe5b3be2bc326b6aa57e0482fe3e6dedd4c IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.00175535487924.675000765
0x2db82894444f38056234ed73aa50fb5a91d31eff4ee1e7ebbd6767f0dd1f4861114205642020-12-09 19:32:3589 days 3 mins ago0x7a528ffa3f602f99fb020645414c1fc103460cd9 IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.00341409648
0xf2c14e2eeaa2750499c67aaadde19bbcbefe6c187f34ba57d259c8657e183561114100792020-12-08 4:52:3590 days 14 hrs ago0xdfa9ca535efd2bf62680e5b271d160c1a3ef1d63 IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.00291719141
0xefb4d211f0457e6d33ad228f620c2f447b58f156d4423d898f9544b76326f2a0114088362020-12-08 0:16:3090 days 19 hrs ago0x001b8fd08545cc8fa3734a6e53652c61724df224 IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.00291719141
0xc2a146b3acd04fedb3f23e6b7cec7ec1094d0578b36f5de1583e1050b4cbe0fc114088232020-12-08 0:12:3890 days 19 hrs ago0xf5e8c4ac0b9302ed342549458589adf79648e5b4 IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.00213282638
0x991b988279b71a93e31242860edfa52f2df302bcfc1a48b7b32002ce96ce7183113829762020-12-04 0:45:5794 days 18 hrs ago0xf280ece4809b458ce75e98c088ae2058253b7200 IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.00266014991437.400001604
0xa930e3a2db3468b02a972520de951ffacea67a926d7062a1d711604273f017e3113554272020-11-29 19:12:1599 days 23 mins ago0xdefbf2ff87b09b194b26b05ff4fed7e8ab30743b IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.000881974812.4
0xa2dc45d0aacde914240fdbe0c7397cc29964f9ac4db3284b113adacc60a9fa44113551242020-11-29 18:03:4299 days 1 hr ago0xe2ad14f95a07652c8113719334c5e244343cd7bd IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.000867749412.2
0x48f80c32a8747dc3174e7d6c726df76eb8aff83db80aab54b2a47a9ddbe81ddb113520022020-11-29 6:30:2399 days 13 hrs ago0xf90ef4b40feb4db8dc6bd031d7373bb2659a9592 IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.0028069550
0xd506be415e6bc630edd1e83d291d4c2df700692f189efd2bc824524a5dfaa366113139972020-11-23 10:38:42105 days 8 hrs ago0x44e954f31c90727b6051bf39bea0698044d353ae IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.00342447961
0x6c5da1c42a7528fd604da88063c5793e26ae3335b53eb5c0203cf66bcbe0fff9112696812020-11-16 15:27:23112 days 4 hrs ago0x4e83c43b2356ad45d2a46ba74a210f9ec82d1224 IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.00342383680361.0016
0x778ad15f6c4ad2050d2d28e2cf461c0bce566b1aaedbbd0488b84c0b3ee49466111539992020-10-29 21:02:30129 days 22 hrs ago0x3c3e4e713e333bbc44b36f89912b5d8dfecb725f IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.0011227820
0x5623cbcbf4e46afd6bba9b77b43084d8e101eb26a6b85445baa92d06e3feaa75111326172020-10-26 14:38:47133 days 4 hrs ago0xf97a33c474a59bf4750f74fd9c1e1a596d7a2ab6 IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.00269409648
0xa6e8bf5be8beeaabadfcb1590a876853f8b58801fe101b7e5a344be561a62815111304682020-10-26 6:43:17133 days 12 hrs ago0x3909899a6eb22a59890de400241fb74389a680bd IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.00505001771
0x861676b0e610db89548af211c381b05b0d48ac122e128bf6237d32515fae018d111288452020-10-26 0:29:28133 days 19 hrs ago0x90d51493301e3adc90a6b2426d17be6a5d2d44cc IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.000451564819.2
0x3c81cd1bec41bba2521d02551231a1096b1c7f7f62f3532bdec66a1f50ca8ed1111288432020-10-26 0:29:00133 days 19 hrs ago0x90d51493301e3adc90a6b2426d17be6a5d2d44cc IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.001077638419.2
0xee05e3c93bfe69daeda9d5cc3a3ae6e82afa5af5295cc88afe5959af6576c49b111235442020-10-25 4:59:57134 days 14 hrs ago0xcc2884f4c3b509c5a92cca8ea525c4734e3037dc IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.00184930226
0xd94b0b6c09ee10d6ced6d8851ec1b1cdb66411889eb8c914fff19a94999e41b9111234112020-10-25 4:31:55134 days 15 hrs ago0xcc2884f4c3b509c5a92cca8ea525c4734e3037dc IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.002557971929.7
0x9327563c3172df0041dac1b144c059a56c28aa44ab1d6a124148213209bb2434111033312020-10-22 2:35:15137 days 17 hrs ago0x7a58361afa030b810991a2c273fa5119a39490c1 IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.00448100163
0x221d5aeb0544072e1a6f3effcb8b027c44b38edfd007e7063045911552c42a94110888792020-10-19 21:20:55139 days 22 hrs ago0xdc1c06194759ca0a1821eb9b8359c3aea087a2ce IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.00256100436
0xd7e0e245393e3355ad521f7dc47a2fa039e4216991ea02660ee67537cc917ff1110887312020-10-19 20:48:17139 days 22 hrs ago0xffad5d78dd52eb9538998472a22506bdea0632c3 IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.00177847525
0x4d22fe72c5ec358cdd748e82b5f993dceeb2d04b063356f79fac9adf43d43042110839512020-10-19 3:19:05140 days 16 hrs ago0x1116095e92e404bd7c2d5ec8915fe268c40b52e6 IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.00157155628
0x9d8ed1ed72a04bda3ad1bb33ee486fba29d546876d54101e27b5a7ff549fd6e5110671822020-10-16 13:18:16143 days 6 hrs ago0xffad5d78dd52eb9538998472a22506bdea0632c3 IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.00456536753
0x1177099b27729a67abc012b1d5e0a92d903dd6d65f162378f91d2f88e59f7a98110654562020-10-16 7:04:09143 days 12 hrs ago0xffad5d78dd52eb9538998472a22506bdea0632c3 IN  0x679df49198614623b6266e559d4abc8bf29f15680 Ether0.003357194447.2
[ Download CSV Export 
View more zero value Internal Transactions in Advanced View mode
Loading

Contract Source Code Verified (Similar Match)
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0x8586f84b7ba0c672c41ffd8f5a9c6407f6076f4e

Contract Name:
Festaking

Compiler Version
v0.5.11+commit.c082d0b4

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2019-11-07
*/

// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol

pragma solidity ^0.5.0;

/**
 * @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.
     *
     * > Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an `Approval` event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

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

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

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

// File: openzeppelin-solidity/contracts/math/SafeMath.sol

pragma solidity ^0.5.0;

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

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        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-solidity/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) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, "SafeMath: division by zero");
        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) {
        require(b != 0, "SafeMath: modulo by zero");
        return a % b;
    }
}

// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol

pragma solidity ^0.5.0;



/**
 * @dev Implementation of the `IERC20` interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using `_mint`.
 * For a generic mechanism see `ERC20Mintable`.
 *
 * *For a detailed writeup see our guide [How to implement supply
 * mechanisms](https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226).*
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an `Approval` event is emitted on calls to `transferFrom`.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard `decreaseAllowance` and `increaseAllowance`
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See `IERC20.approve`.
 */
contract ERC20 is IERC20 {
    using SafeMath for uint256;

    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    /**
     * @dev See `IERC20.totalSupply`.
     */
    function totalSupply() public view returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See `IERC20.balanceOf`.
     */
    function balanceOf(address account) public view returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See `IERC20.transfer`.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public returns (bool) {
        _transfer(msg.sender, recipient, amount);
        return true;
    }

    /**
     * @dev See `IERC20.allowance`.
     */
    function allowance(address owner, address spender) public view returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See `IERC20.approve`.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 value) public returns (bool) {
        _approve(msg.sender, spender, value);
        return true;
    }

    /**
     * @dev See `IERC20.transferFrom`.
     *
     * Emits an `Approval` event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of `ERC20`;
     *
     * Requirements:
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `value`.
     * - the caller must have allowance for `sender`'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount));
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to `approve` that can be used as a mitigation for
     * problems described in `IERC20.approve`.
     *
     * Emits an `Approval` event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
        _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to `approve` that can be used as a mitigation for
     * problems described in `IERC20.approve`.
     *
     * Emits an `Approval` event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
        _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to `transfer`, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a `Transfer` event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _balances[sender] = _balances[sender].sub(amount);
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a `Transfer` event with `from` set to the zero address.
     *
     * Requirements
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal {
        require(account != address(0), "ERC20: mint to the zero address");

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

     /**
     * @dev Destoys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a `Transfer` event with `to` set to the zero address.
     *
     * Requirements
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 value) internal {
        require(account != address(0), "ERC20: burn from the zero address");

        _totalSupply = _totalSupply.sub(value);
        _balances[account] = _balances[account].sub(value);
        emit Transfer(account, address(0), value);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
     *
     * This is internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an `Approval` event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 value) internal {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = value;
        emit Approval(owner, spender, value);
    }

    /**
     * @dev Destoys `amount` tokens from `account`.`amount` is then deducted
     * from the caller's allowance.
     *
     * See `_burn` and `_approve`.
     */
    function _burnFrom(address account, uint256 amount) internal {
        _burn(account, amount);
        _approve(account, msg.sender, _allowances[account][msg.sender].sub(amount));
    }
}

// File: contracts/Festaking.sol

pragma solidity ^0.5.8;



contract Festaking {
    using SafeMath for uint256;

    mapping (address => uint256) private _stakes;

    string public name;
    address  public tokenAddress;
    uint public stakingStarts;
    uint public stakingEnds;
    uint public withdrawStarts;
    uint public withdrawEnds;
    uint256 public stakedTotal;
    uint256 public stakingCap;
    uint256 public totalReward;
    uint256 public earlyWithdrawReward;
    uint256 public rewardBalance;
    uint256 public stakedBalance;

    ERC20 public ERC20Interface;
    event Staked(address indexed token, address indexed staker_, uint256 requestedAmount_, uint256 stakedAmount_);
    event PaidOut(address indexed token, address indexed staker_, uint256 amount_, uint256 reward_);
    event Refunded(address indexed token, address indexed staker_, uint256 amount_);

    /**
     */
    constructor (string memory name_,
        address tokenAddress_,
        uint stakingStarts_,
        uint stakingEnds_,
        uint withdrawStarts_,
        uint withdrawEnds_,
        uint256 stakingCap_) public {
        name = name_;
        require(tokenAddress_ != address(0), "Festaking: 0 address");
        tokenAddress = tokenAddress_;

        require(stakingStarts_ > 0, "Festaking: zero staking start time");
        if (stakingStarts_ < now) {
            stakingStarts = now;
        } else {
            stakingStarts = stakingStarts_;
        }

        require(stakingEnds_ > stakingStarts, "Festaking: staking end must be after staking starts");
        stakingEnds = stakingEnds_;

        require(withdrawStarts_ >= stakingEnds, "Festaking: withdrawStarts must be after staking ends");
        withdrawStarts = withdrawStarts_;

        require(withdrawEnds_ > withdrawStarts, "Festaking: withdrawEnds must be after withdraw starts");
        withdrawEnds = withdrawEnds_;

        require(stakingCap_ > 0, "Festaking: stakingCap must be positive");
        stakingCap = stakingCap_;
    }

    function addReward(uint256 rewardAmount, uint256 withdrawableAmount)
    public
    _before(withdrawStarts)
    _hasAllowance(msg.sender, rewardAmount)
    returns (bool) {
        require(rewardAmount > 0, "Festaking: reward must be positive");
        require(withdrawableAmount >= 0, "Festaking: withdrawable amount cannot be negative");
        require(withdrawableAmount <= rewardAmount, "Festaking: withdrawable amount must be less than or equal to the reward amount");
        address from = msg.sender;
        if (!_payMe(from, rewardAmount)) {
            return false;
        }

        totalReward = totalReward.add(rewardAmount);
        rewardBalance = totalReward;
        earlyWithdrawReward = earlyWithdrawReward.add(withdrawableAmount);
        return true;
    }

    function stakeOf(address account) public view returns (uint256) {
        return _stakes[account];
    }

    /**
    * Requirements:
    * - `amount` Amount to be staked
    */
    function stake(uint256 amount)
    public
    _positive(amount)
    _realAddress(msg.sender)
    returns (bool) {
        address from = msg.sender;
        return _stake(from, amount);
    }

    function withdraw(uint256 amount)
    public
    _after(withdrawStarts)
    _positive(amount)
    _realAddress(msg.sender)
    returns (bool) {
        address from = msg.sender;
        require(amount <= _stakes[from], "Festaking: not enough balance");
        if (now < withdrawEnds) {
            return _withdrawEarly(from, amount);
        } else {
            return _withdrawAfterClose(from, amount);
        }
    }

    function _withdrawEarly(address from, uint256 amount)
    private
    _realAddress(from)
    returns (bool) {
        // This is the formula to calculate reward:
        // r = (earlyWithdrawReward / stakedTotal) * (now - stakingEnds) / (withdrawEnds - stakingEnds)
        // w = (1+r) * a
        uint256 denom = (withdrawEnds.sub(stakingEnds)).mul(stakedTotal);
        uint256 reward = (
        ( (now.sub(stakingEnds)).mul(earlyWithdrawReward) ).mul(amount)
        ).div(denom);
        uint256 payOut = amount.add(reward);
        rewardBalance = rewardBalance.sub(reward);
        stakedBalance = stakedBalance.sub(amount);
        _stakes[from] = _stakes[from].sub(amount);
        if (_payDirect(from, payOut)) {
            emit PaidOut(tokenAddress, from, amount, reward);
            return true;
        }
        return false;
    }

    function _withdrawAfterClose(address from, uint256 amount)
    private
    _realAddress(from)
    returns (bool) {
        uint256 reward = (rewardBalance.mul(amount)).div(stakedBalance);
        uint256 payOut = amount.add(reward);
        _stakes[from] = _stakes[from].sub(amount);
        if (_payDirect(from, payOut)) {
            emit PaidOut(tokenAddress, from, amount, reward);
            return true;
        }
        return false;
    }

    function _stake(address staker, uint256 amount)
    private
    _after(stakingStarts)
    _before(stakingEnds)
    _positive(amount)
    _hasAllowance(staker, amount)
    returns (bool) {
        // check the remaining amount to be staked
        uint256 remaining = amount;
        if (remaining > (stakingCap.sub(stakedBalance))) {
            remaining = stakingCap.sub(stakedBalance);
        }
        // These requires are not necessary, because it will never happen, but won't hurt to double check
        // this is because stakedTotal and stakedBalance are only modified in this method during the staking period
        require(remaining > 0, "Festaking: Staking cap is filled");
        require((remaining + stakedTotal) <= stakingCap, "Festaking: this will increase staking amount pass the cap");
        if (!_payMe(staker, remaining)) {
            return false;
        }
        emit Staked(tokenAddress, staker, amount, remaining);

        if (remaining < amount) {
            // Return the unstaked amount to sender (from allowance)
            uint256 refund = amount.sub(remaining);
            if (_payTo(staker, staker, refund)) {
                emit Refunded(tokenAddress, staker, refund);
            }
        }

        // Transfer is completed
        stakedBalance = stakedBalance.add(remaining);
        stakedTotal = stakedTotal.add(remaining);
        _stakes[staker] = _stakes[staker].add(remaining);
        return true;
    }

    function _payMe(address payer, uint256 amount)
    private
    returns (bool) {
        return _payTo(payer, address(this), amount);
    }

    function _payTo(address allower, address receiver, uint256 amount)
    _hasAllowance(allower, amount)
    private
    returns (bool) {
        // Request to transfer amount from the contract to receiver.
        // contract does not own the funds, so the allower must have added allowance to the contract
        // Allower is the original owner.
        ERC20Interface = ERC20(tokenAddress);
        return ERC20Interface.transferFrom(allower, receiver, amount);
    }

    function _payDirect(address to, uint256 amount)
    private
    _positive(amount)
    returns (bool) {
        ERC20Interface = ERC20(tokenAddress);
        return ERC20Interface.transfer(to, amount);
    }

    modifier _realAddress(address addr) {
        require(addr != address(0), "Festaking: zero address");
        _;
    }

    modifier _positive(uint256 amount) {
        require(amount >= 0, "Festaking: negative amount");
        _;
    }

    modifier _after(uint eventTime) {
        require(now >= eventTime, "Festaking: bad timing for the request");
        _;
    }

    modifier _before(uint eventTime) {
        require(now < eventTime, "Festaking: bad timing for the request");
        _;
    }

    modifier _hasAllowance(address allower, uint256 amount) {
        // Make sure the allower has provided the right allowance.
        ERC20Interface = ERC20(tokenAddress);
        uint256 ourAllowance = ERC20Interface.allowance(allower, address(this));
        require(amount <= ourAllowance, "Festaking: Make sure to add enough allowance");
        _;
    }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ERC20Interface","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"withdrawStarts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"earlyWithdrawReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"stakeOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"stakingCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"stakedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"stakingStarts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"rewardAmount","type":"uint256"},{"internalType":"uint256","name":"withdrawableAmount","type":"uint256"}],"name":"addReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"tokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"rewardBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"stakingEnds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"stakedTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"withdrawEnds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"address","name":"tokenAddress_","type":"address"},{"internalType":"uint256","name":"stakingStarts_","type":"uint256"},{"internalType":"uint256","name":"stakingEnds_","type":"uint256"},{"internalType":"uint256","name":"withdrawStarts_","type":"uint256"},{"internalType":"uint256","name":"withdrawEnds_","type":"uint256"},{"internalType":"uint256","name":"stakingCap_","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"staker_","type":"address"},{"indexed":false,"internalType":"uint256","name":"requestedAmount_","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stakedAmount_","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"staker_","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount_","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reward_","type":"uint256"}],"name":"PaidOut","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"staker_","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"Refunded","type":"event"}]

60806040523480156200001157600080fd5b506040516200274038038062002740833981810160405260e08110156200003757600080fd5b81019080805160405193929190846401000000008211156200005857600080fd5b838201915060208201858111156200006f57600080fd5b82518660018202830111640100000000821117156200008d57600080fd5b8083526020830192505050908051906020019080838360005b83811015620000c3578082015181840152602081019050620000a6565b50505050905090810190601f168015620000f15780820380516001836020036101000a031916815260200191505b5060405260200180519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919050505086600190805190602001906200014f92919062000447565b50600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415620001f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f46657374616b696e673a2030206164647265737300000000000000000000000081525060200191505060405180910390fd5b85600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000851162000290576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806200271e6022913960400191505060405180910390fd5b42851015620002a65742600381905550620002ae565b846003819055505b60035484116200030a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806200265c6033913960400191505060405180910390fd5b836004819055506004548310156200036e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180620026ea6034913960400191505060405180910390fd5b826005819055506005548211620003d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260358152602001806200268f6035913960400191505060405180910390fd5b816006819055506000811162000433576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180620026c46026913960400191505060405180910390fd5b8060088190555050505050505050620004f6565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200048a57805160ff1916838001178555620004bb565b82800160010185558215620004bb579182015b82811115620004ba5782518255916020019190600101906200049d565b5b509050620004ca9190620004ce565b5090565b620004f391905b80821115620004ef576000816000905550600101620004d5565b5090565b90565b61215680620005066000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c80636d68c7d4116100a2578063a694fc3a11610071578063a694fc3a146103c9578063aa5c3ab41461040f578063b410e2a11461042d578063d66692a71461044b578063eacebf61146104695761010b565b80636d68c7d4146102f3578063750142e61461031157806375c93bb91461032f5780639d76ea581461037f5761010b565b80633f7fd60a116100de5780633f7fd60a14610241578063426233601461025f57806344c370d3146102b75780635b9f0016146102d55761010b565b806306fdde03146101105780631bbc4b831461019357806321b13cdf146101dd5780632e1a7d4d146101fb575b600080fd5b610118610487565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015857808201518184015260208101905061013d565b50505050905090810190601f1680156101855780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61019b610525565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101e561054b565b6040518082815260200191505060405180910390f35b6102276004803603602081101561021157600080fd5b8101908080359060200190929190505050610551565b604051808215151515815260200191505060405180910390f35b6102496107b6565b6040518082815260200191505060405180910390f35b6102a16004803603602081101561027557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107bc565b6040518082815260200191505060405180910390f35b6102bf610804565b6040518082815260200191505060405180910390f35b6102dd61080a565b6040518082815260200191505060405180910390f35b6102fb610810565b6040518082815260200191505060405180910390f35b610319610816565b6040518082815260200191505060405180910390f35b6103656004803603604081101561034557600080fd5b81019080803590602001909291908035906020019092919050505061081c565b604051808215151515815260200191505060405180910390f35b610387610bc1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103f5600480360360208110156103df57600080fd5b8101908080359060200190929190505050610be7565b604051808215151515815260200191505060405180910390f35b610417610d1e565b6040518082815260200191505060405180910390f35b610435610d24565b6040518082815260200191505060405180910390f35b610453610d2a565b6040518082815260200191505060405180910390f35b610471610d30565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561051d5780601f106104f25761010080835404028352916020019161051d565b820191906000526020600020905b81548152906001019060200180831161050057829003601f168201915b505050505081565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b6000600554804210156105af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806120336025913960400191505060405180910390fd5b826000811015610627576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f46657374616b696e673a206e6567617469766520616d6f756e7400000000000081525060200191505060405180910390fd5b33600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156106cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f46657374616b696e673a207a65726f206164647265737300000000000000000081525060200191505060405180910390fd5b60003390506000808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054861115610784576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f46657374616b696e673a206e6f7420656e6f7567682062616c616e636500000081525060200191505060405180910390fd5b6006544210156107a0576107988187610d36565b9450506107ae565b6107aa8187610ff5565b9450505b505050919050565b600a5481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60085481565b600c5481565b60035481565b60095481565b6000600554804210610879576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806120336025913960400191505060405180910390fd5b3384600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156109b357600080fd5b505afa1580156109c7573d6000803e3d6000fd5b505050506040513d60208110156109dd57600080fd5b8101908080519060200190929190505050905080821115610a49576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180611fd6602c913960400191505060405180910390fd5b60008711610aa2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806120c76022913960400191505060405180910390fd5b6000861015610afc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001806120026031913960400191505060405180910390fd5b86861115610b55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604e815260200180612079604e913960600191505060405180910390fd5b6000339050610b648189611229565b610b72576000955050610bb7565b610b878860095461123e90919063ffffffff16565b600981905550600954600b81905550610bab87600a5461123e90919063ffffffff16565b600a8190555060019550505b5050505092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000816000811015610c61576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f46657374616b696e673a206e6567617469766520616d6f756e7400000000000081525060200191505060405180910390fd5b33600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610d05576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f46657374616b696e673a207a65726f206164647265737300000000000000000081525060200191505060405180910390fd5b6000339050610d1481866112c6565b9350505050919050565b600b5481565b60045481565b60075481565b60065481565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610ddc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f46657374616b696e673a207a65726f206164647265737300000000000000000081525060200191505060405180910390fd5b6000610e09600754610dfb60045460065461191490919063ffffffff16565b61199d90919063ffffffff16565b90506000610e5a82610e4c87610e3e600a54610e306004544261191490919063ffffffff16565b61199d90919063ffffffff16565b61199d90919063ffffffff16565b611a2390919063ffffffff16565b90506000610e71828761123e90919063ffffffff16565b9050610e8882600b5461191490919063ffffffff16565b600b81905550610ea386600c5461191490919063ffffffff16565b600c81905550610efa866000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461191490919063ffffffff16565b6000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f468782611ab2565b15610fe6578673ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f85ab59351da11b79336de7647172267c33bf533ee87d9d292441c2672177159b8885604051808381526020018281526020019250505060405180910390a360019450505050610fee565b600094505050505b5092915050565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561109b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f46657374616b696e673a207a65726f206164647265737300000000000000000081525060200191505060405180910390fd5b60006110c6600c546110b886600b5461199d90919063ffffffff16565b611a2390919063ffffffff16565b905060006110dd828661123e90919063ffffffff16565b9050611130856000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461191490919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061117c8682611ab2565b1561121b578573ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f85ab59351da11b79336de7647172267c33bf533ee87d9d292441c2672177159b8785604051808381526020018281526020019250505060405180910390a3600193505050611222565b6000935050505b5092915050565b6000611236833084611c7c565b905092915050565b6000808284019050838110156112bc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600060035480421015611324576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806120336025913960400191505060405180910390fd5b60045480421061137f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806120336025913960400191505060405180910390fd5b8360008110156113f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f46657374616b696e673a206e6567617469766520616d6f756e7400000000000081525060200191505060405180910390fd5b8585600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561153157600080fd5b505afa158015611545573d6000803e3d6000fd5b505050506040513d602081101561155b57600080fd5b81019080805190602001909291905050509050808211156115c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180611fd6602c913960400191505060405180910390fd5b60008890506115e3600c5460085461191490919063ffffffff16565b81111561160457611601600c5460085461191490919063ffffffff16565b90505b6000811161167a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f46657374616b696e673a205374616b696e67206361702069732066696c6c656481525060200191505060405180910390fd5b600854600754820111156116d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260398152602001806120e96039913960400191505060405180910390fd5b6116e38a82611229565b6116f1576000975050611908565b8973ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6c86f3fd5118b3aa8bb4f389a617046de0a3d3d477de1a1673d227f802f616dc8b84604051808381526020018281526020019250505060405180910390a38881101561183957600061179d828b61191490919063ffffffff16565b90506117aa8b8c83611c7c565b15611837578a73ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fec1e5ed733e00f1a00915d56caef57b4f52312dde4f9b3165f213319a0da156b836040518082815260200191505060405180910390a35b505b61184e81600c5461123e90919063ffffffff16565b600c819055506118698160075461123e90919063ffffffff16565b6007819055506118c0816000808d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461123e90919063ffffffff16565b6000808c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019750505b50505050505092915050565b60008282111561198c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000808314156119b05760009050611a1d565b60008284029050828482816119c157fe5b0414611a18576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806120586021913960400191505060405180910390fd5b809150505b92915050565b6000808211611a9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b6000828481611aa557fe5b0490508091505092915050565b6000816000811015611b2c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f46657374616b696e673a206e6567617469766520616d6f756e7400000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611c3857600080fd5b505af1158015611c4c573d6000803e3d6000fd5b505050506040513d6020811015611c6257600080fd5b810190808051906020019092919050505091505092915050565b60008382600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015611db857600080fd5b505afa158015611dcc573d6000803e3d6000fd5b505050506040513d6020811015611de257600080fd5b8101908080519060200190929190505050905080821115611e4e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180611fd6602c913960400191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8888886040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611f8e57600080fd5b505af1158015611fa2573d6000803e3d6000fd5b505050506040513d6020811015611fb857600080fd5b81019080805190602001909291905050509350505050939250505056fe46657374616b696e673a204d616b65207375726520746f2061646420656e6f75676820616c6c6f77616e636546657374616b696e673a20776974686472617761626c6520616d6f756e742063616e6e6f74206265206e6567617469766546657374616b696e673a206261642074696d696e6720666f72207468652072657175657374536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7746657374616b696e673a20776974686472617761626c6520616d6f756e74206d757374206265206c657373207468616e206f7220657175616c20746f207468652072657761726420616d6f756e7446657374616b696e673a20726577617264206d75737420626520706f73697469766546657374616b696e673a20746869732077696c6c20696e637265617365207374616b696e6720616d6f756e7420706173732074686520636170a265627a7a723158200341d8ff3f6912f76659d2b6aa9b0cb965c6035f57c7a3bf0c52dd629113a88a64736f6c634300050b003246657374616b696e673a207374616b696e6720656e64206d757374206265206166746572207374616b696e672073746172747346657374616b696e673a207769746864726177456e6473206d7573742062652061667465722077697468647261772073746172747346657374616b696e673a207374616b696e67436170206d75737420626520706f73697469766546657374616b696e673a207769746864726177537461727473206d757374206265206166746572207374616b696e6720656e647346657374616b696e673a207a65726f207374616b696e672073746172742074696d6500000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000e5caef4af8780e59df925470b050fb23c43ca68c000000000000000000000000000000000000000000000000000000005dc38a65000000000000000000000000000000000000000000000000000000005dc38e4d000000000000000000000000000000000000000000000000000000005dc38e4d000000000000000000000000000000000000000000000000000000005dc3961d00000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000000000c54657374616b696e673030300000000000000000000000000000000000000000

Deployed ByteCode Sourcemap

14695:8260:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;14695:8260:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14809:18;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;14809:18:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15206:27;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;14931:26;;;:::i;:::-;;;;;;;;;;;;;;;;;;;17915:436;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;17915:436:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;15093:34;;;:::i;:::-;;;;;;;;;;;;;;;;;;;17519:106;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;17519:106:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;15028:25;;;:::i;:::-;;;;;;;;;;;;;;;;;;;15169:28;;;:::i;:::-;;;;;;;;;;;;;;;;;;;14869:25;;;:::i;:::-;;;;;;;;;;;;;;;;;;;15060:26;;;:::i;:::-;;;;;;;;;;;;;;;;;;;16712:799;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;16712:799:0;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;14834:28;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;17709:198;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;17709:198:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;15134:28;;;:::i;:::-;;;;;;;;;;;;;;;;;;;14901:23;;;:::i;:::-;;;;;;;;;;;;;;;;;;;14995:26;;;:::i;:::-;;;;;;;;;;;;;;;;;;;14964:24;;;:::i;:::-;;;;;;;;;;;;;;;;;;;14809:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;15206:27::-;;;;;;;;;;;;;:::o;14931:26::-;;;;:::o;17915:436::-;18056:4;17973:14;;22373:9;22366:3;:16;;22358:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18004:6;22255:1;22245:6;:11;;22237:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18030:10;22133:1;22117:18;;:4;:18;;;;22109:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18073:12;18088:10;18073:25;;18127:7;:13;18135:4;18127:13;;;;;;;;;;;;;;;;18117:6;:23;;18109:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18195:12;;18189:3;:18;18185:159;;;18231:28;18246:4;18252:6;18231:14;:28::i;:::-;18224:35;;;;;18185:159;18299:33;18319:4;18325:6;18299:19;:33::i;:::-;18292:40;;;22174:1;22298;22435;17915:436;;;;:::o;15093:34::-;;;;:::o;17519:106::-;17574:7;17601;:16;17609:7;17601:16;;;;;;;;;;;;;;;;17594:23;;17519:106;;;:::o;15028:25::-;;;;:::o;15169:28::-;;;;:::o;14869:25::-;;;;:::o;15060:26::-;;;;:::o;16712:799::-;16881:4;16806:14;;22510:9;22504:3;:15;22496:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16841:10;16853:12;22747;;;;;;;;;;;22724:14;;:36;;;;;;;;;;;;;;;;;;22771:20;22794:14;;;;;;;;;;;:24;;;22819:7;22836:4;22794:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;22794:48:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;22794:48:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;22794:48:0;;;;;;;;;;;;;;;;22771:71;;22871:12;22861:6;:22;;22853:79;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16921:1;16906:12;:16;16898:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17002:1;16980:18;:23;;16972:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17098:12;17076:18;:34;;17068:125;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17204:12;17219:10;17204:25;;17245:26;17252:4;17258:12;17245:6;:26::i;:::-;17240:72;;17295:5;17288:12;;;;;17240:72;17338:29;17354:12;17338:11;;:15;;:29;;;;:::i;:::-;17324:11;:43;;;;17394:11;;17378:13;:27;;;;17438:43;17462:18;17438:19;;:23;;:43;;;;:::i;:::-;17416:19;:65;;;;17499:4;17492:11;;;22943:1;22572;;;16712:799;;;;;:::o;14834:28::-;;;;;;;;;;;;;:::o;17709:198::-;17819:4;17767:6;22255:1;22245:6;:11;;22237:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17793:10;22133:1;22117:18;;:4;:18;;;;22109:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17836:12;17851:10;17836:25;;17879:20;17886:4;17892:6;17879;:20::i;:::-;17872:27;;;22298:1;17709:198;;;;:::o;15134:28::-;;;;:::o;14901:23::-;;;;:::o;14995:26::-;;;;:::o;14964:24::-;;;;:::o;18359:868::-;18464:4;18444;22133:1;22117:18;;:4;:18;;;;22109:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18665:13;18681:48;18717:11;;18682:29;18699:11;;18682:12;;:16;;:29;;;;:::i;:::-;18681:35;;:48;;;;:::i;:::-;18665:64;;18740:14;18757:96;18847:5;18768:63;18824:6;18770:47;18797:19;;18771:20;18779:11;;18771:3;:7;;:20;;;;:::i;:::-;18770:26;;:47;;;;:::i;:::-;18768:55;;:63;;;;:::i;:::-;18757:89;;:96;;;;:::i;:::-;18740:113;;18864:14;18881:18;18892:6;18881;:10;;:18;;;;:::i;:::-;18864:35;;18926:25;18944:6;18926:13;;:17;;:25;;;;:::i;:::-;18910:13;:41;;;;18978:25;18996:6;18978:13;;:17;;:25;;;;:::i;:::-;18962:13;:41;;;;19030:25;19048:6;19030:7;:13;19038:4;19030:13;;;;;;;;;;;;;;;;:17;;:25;;;;:::i;:::-;19014:7;:13;19022:4;19014:13;;;;;;;;;;;;;;;:41;;;;19070:24;19081:4;19087:6;19070:10;:24::i;:::-;19066:131;;;19138:4;19116:43;;19124:12;;;;;;;;;;;19116:43;;;19144:6;19152;19116:43;;;;;;;;;;;;;;;;;;;;;;;;19181:4;19174:11;;;;;;;19066:131;19214:5;19207:12;;;;;22174:1;18359:868;;;;;:::o;19235:460::-;19345:4;19325;22133:1;22117:18;;:4;:18;;;;22109:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19362:14;19379:46;19411:13;;19380:25;19398:6;19380:13;;:17;;:25;;;;:::i;:::-;19379:31;;:46;;;;:::i;:::-;19362:63;;19436:14;19453:18;19464:6;19453;:10;;:18;;;;:::i;:::-;19436:35;;19498:25;19516:6;19498:7;:13;19506:4;19498:13;;;;;;;;;;;;;;;;:17;;:25;;;;:::i;:::-;19482:7;:13;19490:4;19482:13;;;;;;;;;;;;;;;:41;;;;19538:24;19549:4;19555:6;19538:10;:24::i;:::-;19534:131;;;19606:4;19584:43;;19592:12;;;;;;;;;;;19584:43;;;19612:6;19620;19584:43;;;;;;;;;;;;;;;;;;;;;;;;19649:4;19642:11;;;;;;19534:131;19682:5;19675:12;;;;22174:1;19235:460;;;;;:::o;21206:142::-;21280:4;21304:36;21311:5;21326:4;21333:6;21304;:36::i;:::-;21297:43;;21206:142;;;;:::o;3800:181::-;3858:7;3878:9;3894:1;3890;:5;3878:17;;3919:1;3914;:6;;3906:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3972:1;3965:8;;;3800:181;;;;:::o;19703:1495::-;19889:4;19776:13;;22373:9;22366:3;:16;;22358:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19804:11;;22510:9;22504:3;:15;22496:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19832:6;22255:1;22245:6;:11;;22237:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19859:6;19867;22747:12;;;;;;;;;;;22724:14;;:36;;;;;;;;;;;;;;;;;;22771:20;22794:14;;;;;;;;;;;:24;;;22819:7;22836:4;22794:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;22794:48:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;22794:48:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;22794:48:0;;;;;;;;;;;;;;;;22771:71;;22871:12;22861:6;:22;;22853:79;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19958:17;19978:6;19958:26;;20012:29;20027:13;;20012:10;;:14;;:29;;;;:::i;:::-;19999:9;:43;19995:117;;;20071:29;20086:13;;20071:10;;:14;;:29;;;;:::i;:::-;20059:41;;19995:117;20366:1;20354:9;:13;20346:58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20452:10;;20436:11;;20424:9;:23;20423:39;;20415:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20540:25;20547:6;20555:9;20540:6;:25::i;:::-;20535:71;;20589:5;20582:12;;;;;20535:71;20642:6;20621:47;;20628:12;;;;;;;;;;;20621:47;;;20650:6;20658:9;20621:47;;;;;;;;;;;;;;;;;;;;;;;;20697:6;20685:9;:18;20681:287;;;20790:14;20807:21;20818:9;20807:6;:10;;:21;;;;:::i;:::-;20790:38;;20847:30;20854:6;20862;20870;20847;:30::i;:::-;20843:114;;;20926:6;20903:38;;20912:12;;;;;;;;;;;20903:38;;;20934:6;20903:38;;;;;;;;;;;;;;;;;;20843:114;20681:287;;21030:28;21048:9;21030:13;;:17;;:28;;;;:::i;:::-;21014:13;:44;;;;21083:26;21099:9;21083:11;;:15;;:26;;;;:::i;:::-;21069:11;:40;;;;21138:30;21158:9;21138:7;:15;21146:6;21138:15;;;;;;;;;;;;;;;;:19;;:30;;;;:::i;:::-;21120:7;:15;21128:6;21120:15;;;;;;;;;;;;;;;:48;;;;21186:4;21179:11;;;22943:1;22298;;;22572;22435;19703:1495;;;;;:::o;4256:184::-;4314:7;4347:1;4342;:6;;4334:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4394:9;4410:1;4406;:5;4394:17;;4431:1;4424:8;;;4256:184;;;;:::o;4691:470::-;4749:7;4998:1;4993;:6;4989:47;;;5023:1;5016:8;;;;4989:47;5048:9;5064:1;5060;:5;5048:17;;5093:1;5088;5084;:5;;;;;;:10;5076:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5152:1;5145:8;;;4691:470;;;;;:::o;5629:333::-;5687:7;5786:1;5782;:5;5774:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5829:9;5845:1;5841;:5;;;;;;5829:17;;5953:1;5946:8;;;5629:333;;;;:::o;21842:212::-;21940:4;21918:6;22255:1;22245:6;:11;;22237:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21980:12;;;;;;;;;;;21957:14;;:36;;;;;;;;;;;;;;;;;;22011:14;;;;;;;;;;;:23;;;22035:2;22039:6;22011:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;22011:35:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;22011:35:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;22011:35:0;;;;;;;;;;;;;;;;22004:42;;21842:212;;;;;:::o;21356:478::-;21486:4;21442:7;21451:6;22747:12;;;;;;;;;;;22724:14;;:36;;;;;;;;;;;;;;;;;;22771:20;22794:14;;;;;;;;;;;:24;;;22819:7;22836:4;22794:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;22794:48:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;22794:48:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;22794:48:0;;;;;;;;;;;;;;;;22771:71;;22871:12;22861:6;:22;;22853:79;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21741:12;;;;;;;;;;;21718:14;;:36;;;;;;;;;;;;;;;;;;21772:14;;;;;;;;;;;:27;;;21800:7;21809:8;21819:6;21772:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;21772:54:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;21772:54:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;21772:54:0;;;;;;;;;;;;;;;;21765:61;;21356:478;;;;;;;;:::o

Swarm Source

bzzr://0341d8ff3f6912f76659d2b6aa9b0cb965c6035f57c7a3bf0c52dd629113a88a
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.