Contract 0xAa6E14e99E3b7B71ca163AA82384Ed68F9067Dd7

 

Contract Overview

Balance:
0 ETH

ETH Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x56f38131c3055ebc7afd38b52b2a4593617f1d6049df8b284186a384cda57f1bWithdraw102464492022-04-21 8:51:2673 days 17 hrs ago0xb5756860abc0f14b02bc2df9251e37a13b51b060 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000288727665 ETH
0xa1a938c63d9bc9e2df94ad69c54acf8ba3a3679d7f5bb5dd0372daf344d93891Claim All Reward...102464022022-04-21 8:50:4573 days 17 hrs ago0xb5756860abc0f14b02bc2df9251e37a13b51b060 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000276719144 ETH
0x6aed9ddfcd2d67b7993780be890b6cce99aa0f8fd895296d491cee84d6531a0cWithdraw81878942022-03-20 6:20:14105 days 20 hrs ago0xde55c0eb78040cd4b77b554ce6a525f190b0b351 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000220754623 ETH
0x498b409353c6ac52e0649b8dae01176b6d09f5416a62aa53ff576d1b897d5152Withdraw78161772022-03-12 22:22:27113 days 3 hrs ago0xf3bae84dd0f35252f9de0c7d7d836e78e43c0196 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000161443626 ETH
0xd066361f54acf667f6b41a0559f9371f0785a85d4fd8ccf78150f701b0064a31Withdraw74628622022-03-06 10:50:37119 days 15 hrs ago0xc6302894cd030601d5e1f65c8f504c83d5361279 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000174218248 ETH
0x23e6b5ee23c5223c6e3b54cde563016ef7ae8729bf0e98a3a57022bb141aae17Claim All Reward...74628522022-03-06 10:50:37119 days 15 hrs ago0xc6302894cd030601d5e1f65c8f504c83d5361279 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000149444914 ETH
0x4f7b7c4b84be61a1065e6451679d39c50c9d448fc0e480b95424c947ad04cd96Claim All Reward...71600802022-03-01 9:07:41124 days 17 hrs ago0xf66257823682ac8ee6a6082e844bdcfa368a10f6 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000289325206 ETH
0xec4c7c65d8017f2cdb9e3d4fc2a3c28fb48781cf2c6a5e16107180e886538badWithdraw71600172022-03-01 9:05:45124 days 17 hrs ago0xf66257823682ac8ee6a6082e844bdcfa368a10f6 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000364427651 ETH
0xfcef4744d9e2d10b61cb9ab8136fa9e53f299ee1e33ebddb0697e82552b913faClaim All Reward...71598812022-03-01 9:02:33124 days 17 hrs ago0x2f1932594797bae5c9c376d6d73226ffcc4ec73b IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000258544298 ETH
0x982bed67d77335d86df3dd4792f4bb7d155c69b59d7750261b53caef142201ffWithdraw71597752022-03-01 8:59:53124 days 17 hrs ago0x2f1932594797bae5c9c376d6d73226ffcc4ec73b IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000364433639 ETH
0x31518e4f96bdabae300f9df7b6e4745d68399a68c93dcfad04a660224b1b1ccfWithdraw71269802022-02-28 20:17:50125 days 6 hrs ago0x3750a58f96cc192ce18117c15db7acaef36a0d7b IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000259123332 ETH
0x781f13dc6f90af3432735a5813c60e5de0ae78a6fa730d02033f2de0c1223fa4Claim All Reward...71269032022-02-28 20:17:50125 days 6 hrs ago0x3750a58f96cc192ce18117c15db7acaef36a0d7b IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000224309733 ETH
0x953d4235051bc328a395b5228c33f6b2c432e2459bfd6b87d67c071fcaa9fbfeClaim All Reward...70423722022-02-27 16:30:47126 days 9 hrs ago0x985c3e701e7cd13a1ff3e099f98698e75d52b432 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000211728567 ETH
0x6b9e7f75796f66e671715f9f733ee3aa83aacc03ba73f48b7b6149a90aa88314Withdraw70422952022-02-27 16:29:20126 days 9 hrs ago0x985c3e701e7cd13a1ff3e099f98698e75d52b432 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000267423759 ETH
0x03cd9c720669c38f930b3493fe31f4de487017eb2de343694e7fd7337ba73b39Withdraw70277272022-02-27 11:58:08126 days 14 hrs ago0x666b965c0e8730c8274cccd1bb295c1558714321 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000212708136 ETH
0xfeb292239cad91d1a4ab21b376558febbb3f6d6800b086a63c0eeb0a7f250d0fClaim All Reward...70276002022-02-27 11:54:02126 days 14 hrs ago0x666b965c0e8730c8274cccd1bb295c1558714321 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000226313214 ETH
0x4c298cd582b13796482fc2513458e95afbaf3517a87c4454382f4fb4c4806602Claim All Reward...70035862022-02-27 3:33:23126 days 22 hrs ago0x4357cb9d55e54b02cc34c2d5722301301f835366 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000261183089 ETH
0x619d3479746f6979a1ba4b59d4e479ffe7340f693fd872b6351949fcc8946f65Withdraw70035612022-02-27 3:33:23126 days 22 hrs ago0x4357cb9d55e54b02cc34c2d5722301301f835366 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000332557099 ETH
0xc6bf9b66b432c65216265e9f592d64aacf416c311ba25a20b94f4a45dde83620Withdraw69704202022-02-26 19:20:05127 days 7 hrs ago0x705f8f0eaac561aabb1d5d8f4d0dab36d5a62e86 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000269097735 ETH
0xf6ce6da6695072c76eee13f2bf6719bce14423d9369b6ea655b20f71c86bf363Claim All Reward...69703992022-02-26 19:19:31127 days 7 hrs ago0x705f8f0eaac561aabb1d5d8f4d0dab36d5a62e86 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000281532927 ETH
0x144e754d0973ff58db3d2febb354c65ff0485b775a4f064bf031549d42b35dc0Claim All Reward...69470202022-02-26 11:03:25127 days 15 hrs ago0xbfef9cb0e0bfc34087af07cbad4312a0f64b817b IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000262700094 ETH
0x4c5577c1e114402a8bb0f545174ac936689e17141b1371c5f4b1f76f108aa634Withdraw69469552022-02-26 11:02:22127 days 15 hrs ago0xbfef9cb0e0bfc34087af07cbad4312a0f64b817b IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000331103041 ETH
0xba2b26e0aa7e22cb0e539f62a95e63c33a1e20d42074313d04a40397d9e6f049Withdraw69457562022-02-26 10:29:29127 days 15 hrs ago0x0d55757e68fb363392745e1ec8b3074316cef775 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000284214569 ETH
0x88141e1995e123e86a7f2bfd0ed7b5da8eae089d34fb6814e3d75d0e9daaa429Claim All Reward...69457422022-02-26 10:29:29127 days 15 hrs ago0x0d55757e68fb363392745e1ec8b3074316cef775 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000299799491 ETH
0x756eb6ca374ad1935b49a3e3acef3558f5daaaf6f8e4e44bed4d6631f175a19fClaim All Reward...69283512022-02-26 3:30:48127 days 22 hrs ago0x4357cb9d55e54b02cc34c2d5722301301f835366 IN 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH0.000293821707 ETH
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x56f38131c3055ebc7afd38b52b2a4593617f1d6049df8b284186a384cda57f1b102464492022-04-21 8:51:2673 days 17 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd7 0xd0751f77d36adaba0067a151a8cf11475880c8740 ETH
0x56f38131c3055ebc7afd38b52b2a4593617f1d6049df8b284186a384cda57f1b102464492022-04-21 8:51:2673 days 17 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70x9340e3296121507318874ce9c04afb4492af02840 ETH
0xa1a938c63d9bc9e2df94ad69c54acf8ba3a3679d7f5bb5dd0372daf344d93891102464022022-04-21 8:50:4573 days 17 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd7 0x92c05e37d789e4452feac1991d0988c7a17009b60 ETH
0xa1a938c63d9bc9e2df94ad69c54acf8ba3a3679d7f5bb5dd0372daf344d93891102464022022-04-21 8:50:4573 days 17 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd7 0x4cbf708c121702567ffc93d2bc6414b9ae2a97d30 ETH
0x6aed9ddfcd2d67b7993780be890b6cce99aa0f8fd895296d491cee84d6531a0c81878942022-03-20 6:20:14105 days 20 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd7 0xd0751f77d36adaba0067a151a8cf11475880c8740 ETH
0x6aed9ddfcd2d67b7993780be890b6cce99aa0f8fd895296d491cee84d6531a0c81878942022-03-20 6:20:14105 days 20 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70x9340e3296121507318874ce9c04afb4492af02840 ETH
0x498b409353c6ac52e0649b8dae01176b6d09f5416a62aa53ff576d1b897d515278161772022-03-12 22:22:27113 days 3 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd7 0xd0751f77d36adaba0067a151a8cf11475880c8740 ETH
0x498b409353c6ac52e0649b8dae01176b6d09f5416a62aa53ff576d1b897d515278161772022-03-12 22:22:27113 days 3 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70x9340e3296121507318874ce9c04afb4492af02840 ETH
0x2c37e1fbd4fa2f107dc269df2e7b3c7ec008aa490b5e691c0c8dd1528f90f9d276030072022-03-09 0:07:47117 days 2 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd7 0xd0751f77d36adaba0067a151a8cf11475880c8740 ETH
0x2c37e1fbd4fa2f107dc269df2e7b3c7ec008aa490b5e691c0c8dd1528f90f9d276030072022-03-09 0:07:47117 days 2 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd7 0xd0751f77d36adaba0067a151a8cf11475880c8740 ETH
0x2c37e1fbd4fa2f107dc269df2e7b3c7ec008aa490b5e691c0c8dd1528f90f9d276030072022-03-09 0:07:47117 days 2 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd7 0xd0751f77d36adaba0067a151a8cf11475880c8740 ETH
0x2c37e1fbd4fa2f107dc269df2e7b3c7ec008aa490b5e691c0c8dd1528f90f9d276030072022-03-09 0:07:47117 days 2 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd7 0xd0751f77d36adaba0067a151a8cf11475880c8740 ETH
0x2c37e1fbd4fa2f107dc269df2e7b3c7ec008aa490b5e691c0c8dd1528f90f9d276030072022-03-09 0:07:47117 days 2 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70x9340e3296121507318874ce9c04afb4492af02840 ETH
0x2c37e1fbd4fa2f107dc269df2e7b3c7ec008aa490b5e691c0c8dd1528f90f9d276030072022-03-09 0:07:47117 days 2 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70x9340e3296121507318874ce9c04afb4492af02840 ETH
0x2c37e1fbd4fa2f107dc269df2e7b3c7ec008aa490b5e691c0c8dd1528f90f9d276030072022-03-09 0:07:47117 days 2 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70x9340e3296121507318874ce9c04afb4492af02840 ETH
0x2c37e1fbd4fa2f107dc269df2e7b3c7ec008aa490b5e691c0c8dd1528f90f9d276030072022-03-09 0:07:47117 days 2 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70x9340e3296121507318874ce9c04afb4492af02840 ETH
0x2c37e1fbd4fa2f107dc269df2e7b3c7ec008aa490b5e691c0c8dd1528f90f9d276030072022-03-09 0:07:47117 days 2 hrs ago 0x98b441cc64f31af2b23b4b1c1b86f466aea06fa70xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH
0x2c37e1fbd4fa2f107dc269df2e7b3c7ec008aa490b5e691c0c8dd1528f90f9d276030072022-03-09 0:07:47117 days 2 hrs ago 0x98b441cc64f31af2b23b4b1c1b86f466aea06fa70xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH
0x2c37e1fbd4fa2f107dc269df2e7b3c7ec008aa490b5e691c0c8dd1528f90f9d276030072022-03-09 0:07:47117 days 2 hrs ago 0x98b441cc64f31af2b23b4b1c1b86f466aea06fa70xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH
0x2c37e1fbd4fa2f107dc269df2e7b3c7ec008aa490b5e691c0c8dd1528f90f9d276030072022-03-09 0:07:47117 days 2 hrs ago 0x98b441cc64f31af2b23b4b1c1b86f466aea06fa70xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH
0xeb005534c4488af54ae75a670110e86abb3de12aab051ef6cd5cbada25a4323f76027232022-03-08 23:59:01117 days 2 hrs ago 0x98b441cc64f31af2b23b4b1c1b86f466aea06fa70xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH
0x436124f5ab3f0acb7da2d5d3076a7777eb3e8308666afcb23347204f7449415476026862022-03-08 23:57:44117 days 2 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd7 0xd0751f77d36adaba0067a151a8cf11475880c8740 ETH
0x436124f5ab3f0acb7da2d5d3076a7777eb3e8308666afcb23347204f7449415476026862022-03-08 23:57:44117 days 2 hrs ago 0xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70x9340e3296121507318874ce9c04afb4492af02840 ETH
0x436124f5ab3f0acb7da2d5d3076a7777eb3e8308666afcb23347204f7449415476026862022-03-08 23:57:44117 days 2 hrs ago 0x98b441cc64f31af2b23b4b1c1b86f466aea06fa70xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH
0x436124f5ab3f0acb7da2d5d3076a7777eb3e8308666afcb23347204f7449415476026862022-03-08 23:57:44117 days 2 hrs ago 0x98b441cc64f31af2b23b4b1c1b86f466aea06fa70xaa6e14e99e3b7b71ca163aa82384ed68f9067dd70 ETH
[ Download CSV Export 
Loading

Minimal Proxy Contract for 0xe91067189c71db0696bd6fbc14535cb159f98b5c

Contract Name:
ERC20Mine

Compiler Version
v0.6.9+commit.3e3065ac

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Apache-2.0 license
Decompile ByteCode

Contract Source Code (Solidity)

Similar Contracts
/**
 *Submitted for verification at Arbiscan on 2021-08-30
*/

// File: contracts/intf/IERC20.sol

// This is a file copied from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;

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

    function decimals() external view returns (uint8);

    function name() external view returns (string memory);

    function symbol() external view returns (string memory);

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

// File: contracts/lib/SafeMath.sol

/**
 * @title SafeMath
 * @author DODO Breeder
 *
 * @notice Math operations with safety checks that revert on error
 */
library SafeMath {
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "MUL_ERROR");

        return c;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "DIVIDING_ERROR");
        return a / b;
    }

    function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 quotient = div(a, b);
        uint256 remainder = a - quotient * b;
        if (remainder > 0) {
            return quotient + 1;
        } else {
            return quotient;
        }
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SUB_ERROR");
        return a - b;
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "ADD_ERROR");
        return c;
    }

    function sqrt(uint256 x) internal pure returns (uint256 y) {
        uint256 z = x / 2 + 1;
        y = x;
        while (z < y) {
            y = z;
            z = (x / z + z) / 2;
        }
    }
}

// File: contracts/lib/SafeERC20.sol


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

    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));
    }

    /**
     * @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

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

// File: contracts/lib/DecimalMath.sol

/**
 * @title DecimalMath
 * @author DODO Breeder
 *
 * @notice Functions for fixed point number with 18 decimals
 */
library DecimalMath {
    using SafeMath for uint256;

    uint256 internal constant ONE = 10**18;
    uint256 internal constant ONE2 = 10**36;

    function mulFloor(uint256 target, uint256 d) internal pure returns (uint256) {
        return target.mul(d) / (10**18);
    }

    function mulCeil(uint256 target, uint256 d) internal pure returns (uint256) {
        return target.mul(d).divCeil(10**18);
    }

    function divFloor(uint256 target, uint256 d) internal pure returns (uint256) {
        return target.mul(10**18).div(d);
    }

    function divCeil(uint256 target, uint256 d) internal pure returns (uint256) {
        return target.mul(10**18).divCeil(d);
    }

    function reciprocalFloor(uint256 target) internal pure returns (uint256) {
        return uint256(10**36).div(target);
    }

    function reciprocalCeil(uint256 target) internal pure returns (uint256) {
        return uint256(10**36).divCeil(target);
    }
}

// File: contracts/lib/InitializableOwnable.sol

/**
 * @title Ownable
 * @author DODO Breeder
 *
 * @notice Ownership related functions
 */
contract InitializableOwnable {
    address public _OWNER_;
    address public _NEW_OWNER_;
    bool internal _INITIALIZED_;

    // ============ Events ============

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

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

    // ============ Modifiers ============

    modifier notInitialized() {
        require(!_INITIALIZED_, "DODO_INITIALIZED");
        _;
    }

    modifier onlyOwner() {
        require(msg.sender == _OWNER_, "NOT_OWNER");
        _;
    }

    // ============ Functions ============

    function initOwner(address newOwner) public notInitialized {
        _INITIALIZED_ = true;
        _OWNER_ = newOwner;
    }

    function transferOwnership(address newOwner) public onlyOwner {
        emit OwnershipTransferPrepared(_OWNER_, newOwner);
        _NEW_OWNER_ = newOwner;
    }

    function claimOwnership() public {
        require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
        emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
        _OWNER_ = _NEW_OWNER_;
        _NEW_OWNER_ = address(0);
    }
}

// File: contracts/lib/Ownable.sol

/**
 * @title Ownable
 * @author DODO Breeder
 *
 * @notice Ownership related functions
 */
contract Ownable {
    address public _OWNER_;
    address public _NEW_OWNER_;

    // ============ Events ============

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

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

    // ============ Modifiers ============

    modifier onlyOwner() {
        require(msg.sender == _OWNER_, "NOT_OWNER");
        _;
    }

    // ============ Functions ============

    constructor() internal {
        _OWNER_ = msg.sender;
        emit OwnershipTransferred(address(0), _OWNER_);
    }

    function transferOwnership(address newOwner) external virtual onlyOwner {
        emit OwnershipTransferPrepared(_OWNER_, newOwner);
        _NEW_OWNER_ = newOwner;
    }

    function claimOwnership() external {
        require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
        emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
        _OWNER_ = _NEW_OWNER_;
        _NEW_OWNER_ = address(0);
    }
}

// File: contracts/DODOToken/DODOMineV2/RewardVault.sol


interface IRewardVault {
    function reward(address to, uint256 amount) external;
    function withdrawLeftOver(address to, uint256 amount) external; 
}

contract RewardVault is Ownable {
    using SafeERC20 for IERC20;

    address public rewardToken;

    constructor(address _rewardToken) public {
        rewardToken = _rewardToken;
    }

    function reward(address to, uint256 amount) external onlyOwner {
        IERC20(rewardToken).safeTransfer(to, amount);
    }

    function withdrawLeftOver(address to,uint256 amount) external onlyOwner {
        uint256 leftover = IERC20(rewardToken).balanceOf(address(this));
        require(amount <= leftover, "VAULT_NOT_ENOUGH");
        IERC20(rewardToken).safeTransfer(to, amount);
    }
}

// File: contracts/DODOToken/DODOMineV2/BaseMine.sol


contract BaseMine is InitializableOwnable {
    using SafeERC20 for IERC20;
    using SafeMath for uint256;

    // ============ Storage ============

    struct RewardTokenInfo {
        address rewardToken;
        uint256 startBlock;
        uint256 endBlock;
        address rewardVault;
        uint256 rewardPerBlock;
        uint256 accRewardPerShare;
        uint256 lastRewardBlock;
        mapping(address => uint256) userRewardPerSharePaid;
        mapping(address => uint256) userRewards;
    }

    RewardTokenInfo[] public rewardTokenInfos;

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

    // ============ Event =============

    event Claim(uint256 indexed i, address indexed user, uint256 reward);
    event UpdateReward(uint256 indexed i, uint256 rewardPerBlock);
    event UpdateEndBlock(uint256 indexed i, uint256 endBlock);
    event NewRewardToken(uint256 indexed i, address rewardToken);
    event RemoveRewardToken(address rewardToken);
    event WithdrawLeftOver(address owner, uint256 i);

    // ============ View  ============

    function getPendingReward(address user, uint256 i) public view returns (uint256) {
        require(i<rewardTokenInfos.length, "DODOMineV2: REWARD_ID_NOT_FOUND");
        RewardTokenInfo storage rt = rewardTokenInfos[i];
        uint256 accRewardPerShare = rt.accRewardPerShare;
        if (rt.lastRewardBlock != block.number) {
            accRewardPerShare = _getAccRewardPerShare(i);
        }
        return
            DecimalMath.mulFloor(
                balanceOf(user), 
                accRewardPerShare.sub(rt.userRewardPerSharePaid[user])
            ).add(rt.userRewards[user]);
    }

    function getPendingRewardByToken(address user, address rewardToken) external view returns (uint256) {
        return getPendingReward(user, getIdByRewardToken(rewardToken));
    }

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

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

    function getRewardTokenById(uint256 i) external view returns (address) {
        require(i<rewardTokenInfos.length, "DODOMineV2: REWARD_ID_NOT_FOUND");
        RewardTokenInfo memory rt = rewardTokenInfos[i];
        return rt.rewardToken;
    }

    function getIdByRewardToken(address rewardToken) public view returns(uint256) {
        uint256 len = rewardTokenInfos.length;
        for (uint256 i = 0; i < len; i++) {
            if (rewardToken == rewardTokenInfos[i].rewardToken) {
                return i;
            }
        }
        require(false, "DODOMineV2: TOKEN_NOT_FOUND");
    }

    function getRewardNum() external view returns(uint256) {
        return rewardTokenInfos.length;
    }

    // ============ Claim ============

    function claimReward(uint256 i) public {
        require(i<rewardTokenInfos.length, "DODOMineV2: REWARD_ID_NOT_FOUND");
        _updateReward(msg.sender, i);
        RewardTokenInfo storage rt = rewardTokenInfos[i];
        uint256 reward = rt.userRewards[msg.sender];
        if (reward > 0) {
            rt.userRewards[msg.sender] = 0;
            IRewardVault(rt.rewardVault).reward(msg.sender, reward);
            emit Claim(i, msg.sender, reward);
        }
    }

    function claimAllRewards() external {
        uint256 len = rewardTokenInfos.length;
        for (uint256 i = 0; i < len; i++) {
            claimReward(i);
        }
    }

    // =============== Ownable  ================

    function addRewardToken(
        address rewardToken,
        uint256 rewardPerBlock,
        uint256 startBlock,
        uint256 endBlock
    ) external onlyOwner {
        require(rewardToken != address(0), "DODOMineV2: TOKEN_INVALID");
        require(startBlock > block.number, "DODOMineV2: START_BLOCK_INVALID");
        require(endBlock > startBlock, "DODOMineV2: DURATION_INVALID");

        uint256 len = rewardTokenInfos.length;
        for (uint256 i = 0; i < len; i++) {
            require(
                rewardToken != rewardTokenInfos[i].rewardToken,
                "DODOMineV2: TOKEN_ALREADY_ADDED"
            );
        }

        RewardTokenInfo storage rt = rewardTokenInfos.push();
        rt.rewardToken = rewardToken;
        rt.startBlock = startBlock;
        rt.endBlock = endBlock;
        rt.rewardPerBlock = rewardPerBlock;
        rt.rewardVault = address(new RewardVault(rewardToken));

        emit NewRewardToken(len, rewardToken);
    }

    function removeRewardToken(address rewardToken) external onlyOwner {
        uint256 len = rewardTokenInfos.length;
        for (uint256 i = 0; i < len; i++) {
            if (rewardToken == rewardTokenInfos[i].rewardToken) {
                if(i != len - 1) {
                    rewardTokenInfos[i] = rewardTokenInfos[len - 1];
                }
                rewardTokenInfos.pop();
                emit RemoveRewardToken(rewardToken);
                break;
            }
        }
    }

    function setEndBlock(uint256 i, uint256 newEndBlock)
        external
        onlyOwner
    {
        require(i < rewardTokenInfos.length, "DODOMineV2: REWARD_ID_NOT_FOUND");
        _updateReward(address(0), i);
        RewardTokenInfo storage rt = rewardTokenInfos[i];

        require(block.number < newEndBlock, "DODOMineV2: END_BLOCK_INVALID");
        require(block.number > rt.startBlock, "DODOMineV2: NOT_START");
        require(block.number < rt.endBlock, "DODOMineV2: ALREADY_CLOSE");

        rt.endBlock = newEndBlock;
        emit UpdateEndBlock(i, newEndBlock);
    }

    function setReward(uint256 i, uint256 newRewardPerBlock)
        external
        onlyOwner
    {
        require(i < rewardTokenInfos.length, "DODOMineV2: REWARD_ID_NOT_FOUND");
        _updateReward(address(0), i);
        RewardTokenInfo storage rt = rewardTokenInfos[i];
        
        require(block.number < rt.endBlock, "DODOMineV2: ALREADY_CLOSE");

        rt.rewardPerBlock = newRewardPerBlock;
        emit UpdateReward(i, newRewardPerBlock);
    }

    function withdrawLeftOver(uint256 i, uint256 amount) external onlyOwner {
        require(i < rewardTokenInfos.length, "DODOMineV2: REWARD_ID_NOT_FOUND");
        
        RewardTokenInfo storage rt = rewardTokenInfos[i];
        require(block.number > rt.endBlock, "DODOMineV2: MINING_NOT_FINISHED");

        IRewardVault(rt.rewardVault).withdrawLeftOver(msg.sender,amount);

        emit WithdrawLeftOver(msg.sender, i);
    }


    // ============ Internal  ============

    function _updateReward(address user, uint256 i) internal {
        RewardTokenInfo storage rt = rewardTokenInfos[i];
        if (rt.lastRewardBlock != block.number){
            rt.accRewardPerShare = _getAccRewardPerShare(i);
            rt.lastRewardBlock = block.number;
        }
        if (user != address(0)) {
            rt.userRewards[user] = getPendingReward(user, i);
            rt.userRewardPerSharePaid[user] = rt.accRewardPerShare;
        }
    }

    function _updateAllReward(address user) internal {
        uint256 len = rewardTokenInfos.length;
        for (uint256 i = 0; i < len; i++) {
            _updateReward(user, i);
        }
    }

    function _getUnrewardBlockNum(uint256 i) internal view returns (uint256) {
        RewardTokenInfo memory rt = rewardTokenInfos[i];
        if (block.number < rt.startBlock || rt.lastRewardBlock > rt.endBlock) {
            return 0;
        }
        uint256 start = rt.lastRewardBlock < rt.startBlock ? rt.startBlock : rt.lastRewardBlock;
        uint256 end = rt.endBlock < block.number ? rt.endBlock : block.number;
        return end.sub(start);
    }

    function _getAccRewardPerShare(uint256 i) internal view returns (uint256) {
        RewardTokenInfo memory rt = rewardTokenInfos[i];
        if (totalSupply() == 0) {
            return rt.accRewardPerShare;
        }
        return
            rt.accRewardPerShare.add(
                DecimalMath.divFloor(_getUnrewardBlockNum(i).mul(rt.rewardPerBlock), totalSupply())
            );
    }

}

// File: contracts/DODOToken/DODOMineV2/ERC20Mine.sol


contract ERC20Mine is BaseMine {
    using SafeERC20 for IERC20;
    using SafeMath for uint256;

    // ============ Storage ============

    address public _TOKEN_;

    function init(address owner, address token) external {
        super.initOwner(owner);
        _TOKEN_ = token;
    }

    // ============ Event  ============

    event Deposit(address indexed user, uint256 amount);
    event Withdraw(address indexed user, uint256 amount);

    // ============ Deposit && Withdraw && Exit ============

    function deposit(uint256 amount) external {
        require(amount > 0, "DODOMineV2: CANNOT_DEPOSIT_ZERO");

        _updateAllReward(msg.sender);

        uint256 erc20OriginBalance = IERC20(_TOKEN_).balanceOf(address(this));
        IERC20(_TOKEN_).safeTransferFrom(msg.sender, address(this), amount);
        uint256 actualStakeAmount = IERC20(_TOKEN_).balanceOf(address(this)).sub(erc20OriginBalance);
        
        _totalSupply = _totalSupply.add(actualStakeAmount);
        _balances[msg.sender] = _balances[msg.sender].add(actualStakeAmount);

        emit Deposit(msg.sender, actualStakeAmount);
    }

    function withdraw(uint256 amount) external {
        require(amount > 0, "DODOMineV2: CANNOT_WITHDRAW_ZERO");

        _updateAllReward(msg.sender);
        _totalSupply = _totalSupply.sub(amount);
        _balances[msg.sender] = _balances[msg.sender].sub(amount);
        IERC20(_TOKEN_).safeTransfer(msg.sender, amount);

        emit Withdraw(msg.sender, amount);
    }
}

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"i","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"i","type":"uint256"},{"indexed":false,"internalType":"address","name":"rewardToken","type":"address"}],"name":"NewRewardToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferPrepared","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":false,"internalType":"address","name":"rewardToken","type":"address"}],"name":"RemoveRewardToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"i","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endBlock","type":"uint256"}],"name":"UpdateEndBlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"i","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardPerBlock","type":"uint256"}],"name":"UpdateReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"i","type":"uint256"}],"name":"WithdrawLeftOver","type":"event"},{"inputs":[],"name":"_NEW_OWNER_","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_OWNER_","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_TOKEN_","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"rewardToken","type":"address"},{"internalType":"uint256","name":"rewardPerBlock","type":"uint256"},{"internalType":"uint256","name":"startBlock","type":"uint256"},{"internalType":"uint256","name":"endBlock","type":"uint256"}],"name":"addRewardToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimAllRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"i","type":"uint256"}],"name":"claimReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"rewardToken","type":"address"}],"name":"getIdByRewardToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"i","type":"uint256"}],"name":"getPendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"rewardToken","type":"address"}],"name":"getPendingRewardByToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRewardNum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"i","type":"uint256"}],"name":"getRewardTokenById","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"token","type":"address"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"initOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"rewardToken","type":"address"}],"name":"removeRewardToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewardTokenInfos","outputs":[{"internalType":"address","name":"rewardToken","type":"address"},{"internalType":"uint256","name":"startBlock","type":"uint256"},{"internalType":"uint256","name":"endBlock","type":"uint256"},{"internalType":"address","name":"rewardVault","type":"address"},{"internalType":"uint256","name":"rewardPerBlock","type":"uint256"},{"internalType":"uint256","name":"accRewardPerShare","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"i","type":"uint256"},{"internalType":"uint256","name":"newEndBlock","type":"uint256"}],"name":"setEndBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"i","type":"uint256"},{"internalType":"uint256","name":"newRewardPerBlock","type":"uint256"}],"name":"setReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"i","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawLeftOver","outputs":[],"stateMutability":"nonpayable","type":"function"}]

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