Contract 0x23ffb3687d3800fddde75e7e604392fea15c8757

 

Contract Overview

Balance:
0 ETH

ETH Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x7284805779ae9110d84da6d23ea4358b2f5d1e81f180d4c82102533f9fb6a82fWithdraw348290842022-11-03 0:33:1036 days 21 hrs ago0xfa1f780a446e9cdb4c51b031686bcf8b02f8ed7c IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.00002685
0x4e4eca23be40706fe2fe69e12322269afd76b5869b56f36ee5713e41dd3df9aaDeposit348284872022-11-03 0:29:2436 days 22 hrs ago0xfa1f780a446e9cdb4c51b031686bcf8b02f8ed7c IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.00002975
0xf339a340bfe0eb2774b81d9b327d8f9c9d58a2d4331200b844f1588efd508a40Withdraw102438292022-04-21 7:58:22232 days 14 hrs ago0x963e464c78d5d2a16a2563a96fe85c637f9d1c41 IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000281992074 ETH
0x1cc16a4899ced871ca2e49bd6b0e4dff25aa910d3ade8c15f6dd070b35e27102Claim All Reward...102438152022-04-21 7:58:22232 days 14 hrs ago0x963e464c78d5d2a16a2563a96fe85c637f9d1c41 IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000271810299 ETH
0x1fe6abb03241206058df615c4f61a960920616e51e04df6f72b3205f45b1c459Withdraw101220562022-04-19 21:30:19234 days 1 hr ago0x84754a7103308ddf8baca5072d165773353e1055 IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000204618837 ETH
0x9edb299fe4f05e04785e19e395a3e77b47336fae8defbecd32a7dd16db0c844fClaim All Reward...101220202022-04-19 21:30:19234 days 1 hr ago0x84754a7103308ddf8baca5072d165773353e1055 IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000195589572 ETH
0x5c7660d01d641ee9cae7a22050572d3a36e33b8bd2a6bcb780c2af7854e76e65Withdraw97700372022-04-14 2:58:16239 days 19 hrs ago0xd6f82502f20647dd8d78dffb6ad7f8d8193d5e29 IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000252234391 ETH
0xc208e69045981613c1601027bcdad2c74d7b24738992702cba45bdb037ac212aClaim All Reward...86916272022-03-27 12:36:41257 days 9 hrs ago0x9b616ac1d31f17be9b23560d93699ca7732e2808 IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000142111519 ETH
0xefe3bfbda1b97a07287c5d6a24f3f3ba131073740cb661d10c7aaf9530bb0777Claim All Reward...86241272022-03-26 5:58:15258 days 16 hrs ago0xeddc40555769e0a4d6e00ff55b9d37cd6ed8c3ce IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000233147168 ETH
0x93ba75d2d1bade5f852e80f367cff686ffb6a461e6759dc8fa6d1fb61bd0c9f0Withdraw86241122022-03-26 5:58:15258 days 16 hrs ago0xeddc40555769e0a4d6e00ff55b9d37cd6ed8c3ce IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.0002709823 ETH
0x40670e04f5ce3c38edc55cf0a6e48766269e59bb7e3881622081ee0600a3c795Withdraw85184702022-03-24 19:29:36260 days 3 hrs ago0x06864f65c07c3468724d7c770bba695e818f8d71 IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000204056832 ETH
0xfe69cd626bfd395da9cf15e29839811c824e528203830b437e7b60c774bc9a63Withdraw79525372022-03-15 19:00:49269 days 3 hrs ago0xdcfa2df4d2f469f4c204b703391378731d16bc88 IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000161317521 ETH
0x1d32b71b8bc958b284572421718e01737ce0cb8a7aa796b3e82d7db83a39f00cClaim All Reward...79525132022-03-15 19:00:15269 days 3 hrs ago0xdcfa2df4d2f469f4c204b703391378731d16bc88 IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.00013713146 ETH
0xd86df1d57b4a3624851f73e90bc020c382354b924bb981dd21211fda025adb07Claim All Reward...78842272022-03-14 11:07:10270 days 11 hrs ago0x06864f65c07c3468724d7c770bba695e818f8d71 IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000110721265 ETH
0x005fa3de9010c19b889705f46b31576c95893c82ca605d568b436ccbda02e1c0Withdraw78449092022-03-13 15:03:21271 days 7 hrs ago0x9b85ba0fc6d69e3965cefc60e6eded1034856233 IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000117423412 ETH
0x5af9494ca4f6cdf8c16f5c3b276a330bcd1e6a2631ecf13c0000d82eee653759Claim All Reward...78446742022-03-13 14:57:48271 days 7 hrs ago0x9b85ba0fc6d69e3965cefc60e6eded1034856233 IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000099965669 ETH
0x2bac36b0fa4872df32a3713814723b6829aab9ac81f5022e7eaa6e9c2cc0f4e5Withdraw73837462022-03-04 1:41:01280 days 20 hrs ago0xf168f06d30ec3374c6e023791d1d7026a8639e60 IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000254697556 ETH
0x1d14aa9fce1c506fa6d2a3735ec0d8f9a5801ef7f3170cae219f7abcb0829258Claim All Reward...73837132022-03-04 1:40:03280 days 20 hrs ago0xf168f06d30ec3374c6e023791d1d7026a8639e60 IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000215625087 ETH
0x2422f4e63dece67d38f10b4df2b21799eb8eb439ee01875a1e0931850dde7a42Claim All Reward...71641732022-03-01 10:39:56283 days 11 hrs ago0x714d08732743b670b5c1154190c7856ffac32dca IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000277186036 ETH
0xff1500322d6d7d04fb504e3134917d79cfc24a5134732e92564393ed69d7f9b5Withdraw71641622022-03-01 10:39:56283 days 11 hrs ago0x714d08732743b670b5c1154190c7856ffac32dca IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000324054162 ETH
0x5a94b323210253486affd479d8d467f54efb24647591515c8299f23782c7b593Claim All Reward...71562822022-03-01 7:35:45283 days 14 hrs ago0x87afaa198117496bce792b6a5de3b33ba7cac73f IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.00025430444 ETH
0xd394134404577e7d605e2436e434d193465cc6c25d9027413c0650ec2ebce239Withdraw71562342022-03-01 7:34:13283 days 14 hrs ago0x87afaa198117496bce792b6a5de3b33ba7cac73f IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000330242114 ETH
0x5deb6e661b893ee1e9a195751c58806524684b6ecea5fcbea645cae91f8cde6fWithdraw71413182022-03-01 2:26:35283 days 20 hrs ago0x949666ee5d1be779801e4a02e90f1a2d9cb1835b IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000302448151 ETH
0x4fbd28434b73acb063fa6c18b2005c141491e59860f3e9fac3c3c4a0ab5555a7Claim All Reward...71413082022-03-01 2:26:35283 days 20 hrs ago0x949666ee5d1be779801e4a02e90f1a2d9cb1835b IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.00028913043 ETH
0xb56ffee30ebf45ca2cf7195910666917fc8f9604e9e99ecd3a2c40c6bb6e8490Claim All Reward...71171092022-02-28 16:59:19284 days 5 hrs ago0x77693ff03fd85f9181e5e577b8cabfddac00880a IN 0x23ffb3687d3800fddde75e7e604392fea15c87570 ETH0.000200633036 ETH
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xfb141fbcb5d2bcea8cdbf1c9b2381a6bf4197d5327d32acf70d16378b8a371a5404937012022-11-23 8:45:1816 days 13 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c87570x65e17c52128396443d4a9a61eacf0970f05f8a200 ETH
0xfb141fbcb5d2bcea8cdbf1c9b2381a6bf4197d5327d32acf70d16378b8a371a5404937012022-11-23 8:45:1816 days 13 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c8757 0xe91067189c71db0696bd6fbc14535cb159f98b5c0 ETH
0xfb141fbcb5d2bcea8cdbf1c9b2381a6bf4197d5327d32acf70d16378b8a371a5404937012022-11-23 8:45:1816 days 13 hrs ago 0x3145a934038a6ae7dbd842d3955b701660e3b9580x23ffb3687d3800fddde75e7e604392fea15c87570 ETH
0xfb141fbcb5d2bcea8cdbf1c9b2381a6bf4197d5327d32acf70d16378b8a371a5404937012022-11-23 8:45:1816 days 13 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c8757 0xe91067189c71db0696bd6fbc14535cb159f98b5c0 ETH
0xfb141fbcb5d2bcea8cdbf1c9b2381a6bf4197d5327d32acf70d16378b8a371a5404937012022-11-23 8:45:1816 days 13 hrs ago 0x3145a934038a6ae7dbd842d3955b701660e3b9580x23ffb3687d3800fddde75e7e604392fea15c87570 ETH
0xd02fc7a709abf504e7387c3440fa2f896f93c99fcd4dbc3cf989cd98c93bd64d351758402022-11-04 10:17:0435 days 12 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c87570x65e17c52128396443d4a9a61eacf0970f05f8a200 ETH
0xd02fc7a709abf504e7387c3440fa2f896f93c99fcd4dbc3cf989cd98c93bd64d351758402022-11-04 10:17:0435 days 12 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c8757 0xe91067189c71db0696bd6fbc14535cb159f98b5c0 ETH
0xd02fc7a709abf504e7387c3440fa2f896f93c99fcd4dbc3cf989cd98c93bd64d351758402022-11-04 10:17:0435 days 12 hrs ago 0x3145a934038a6ae7dbd842d3955b701660e3b9580x23ffb3687d3800fddde75e7e604392fea15c87570 ETH
0xd02fc7a709abf504e7387c3440fa2f896f93c99fcd4dbc3cf989cd98c93bd64d351758402022-11-04 10:17:0435 days 12 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c8757 0xe91067189c71db0696bd6fbc14535cb159f98b5c0 ETH
0xd02fc7a709abf504e7387c3440fa2f896f93c99fcd4dbc3cf989cd98c93bd64d351758402022-11-04 10:17:0435 days 12 hrs ago 0x3145a934038a6ae7dbd842d3955b701660e3b9580x23ffb3687d3800fddde75e7e604392fea15c87570 ETH
0x30c4e96c68ba25d90acf97406f0e1d42ce8d9321e259b15c040ac469c2448cd6350089632022-11-03 16:38:4436 days 5 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c87570x65e17c52128396443d4a9a61eacf0970f05f8a200 ETH
0x30c4e96c68ba25d90acf97406f0e1d42ce8d9321e259b15c040ac469c2448cd6350089632022-11-03 16:38:4436 days 5 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c8757 0xe91067189c71db0696bd6fbc14535cb159f98b5c0 ETH
0x30c4e96c68ba25d90acf97406f0e1d42ce8d9321e259b15c040ac469c2448cd6350089632022-11-03 16:38:4436 days 5 hrs ago 0x3145a934038a6ae7dbd842d3955b701660e3b9580x23ffb3687d3800fddde75e7e604392fea15c87570 ETH
0x30c4e96c68ba25d90acf97406f0e1d42ce8d9321e259b15c040ac469c2448cd6350089632022-11-03 16:38:4436 days 5 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c8757 0xe91067189c71db0696bd6fbc14535cb159f98b5c0 ETH
0x30c4e96c68ba25d90acf97406f0e1d42ce8d9321e259b15c040ac469c2448cd6350089632022-11-03 16:38:4436 days 5 hrs ago 0x3145a934038a6ae7dbd842d3955b701660e3b9580x23ffb3687d3800fddde75e7e604392fea15c87570 ETH
0x7284805779ae9110d84da6d23ea4358b2f5d1e81f180d4c82102533f9fb6a82f348290842022-11-03 0:33:1036 days 21 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c87570x65e17c52128396443d4a9a61eacf0970f05f8a200 ETH
0x7284805779ae9110d84da6d23ea4358b2f5d1e81f180d4c82102533f9fb6a82f348290842022-11-03 0:33:1036 days 21 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c8757 0xe91067189c71db0696bd6fbc14535cb159f98b5c0 ETH
0x4e4eca23be40706fe2fe69e12322269afd76b5869b56f36ee5713e41dd3df9aa348284872022-11-03 0:29:2436 days 22 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c87570x65e17c52128396443d4a9a61eacf0970f05f8a200 ETH
0x4e4eca23be40706fe2fe69e12322269afd76b5869b56f36ee5713e41dd3df9aa348284872022-11-03 0:29:2436 days 22 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c87570x65e17c52128396443d4a9a61eacf0970f05f8a200 ETH
0x4e4eca23be40706fe2fe69e12322269afd76b5869b56f36ee5713e41dd3df9aa348284872022-11-03 0:29:2436 days 22 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c87570x65e17c52128396443d4a9a61eacf0970f05f8a200 ETH
0x4e4eca23be40706fe2fe69e12322269afd76b5869b56f36ee5713e41dd3df9aa348284872022-11-03 0:29:2436 days 22 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c8757 0xe91067189c71db0696bd6fbc14535cb159f98b5c0 ETH
0x4f6e3bc31a6166f9a4686db86e355c4698cb9acf41d95d6d4feec98925a114cc337858392022-10-30 4:44:5540 days 17 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c87570x65e17c52128396443d4a9a61eacf0970f05f8a200 ETH
0x4f6e3bc31a6166f9a4686db86e355c4698cb9acf41d95d6d4feec98925a114cc337858392022-10-30 4:44:5540 days 17 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c8757 0xe91067189c71db0696bd6fbc14535cb159f98b5c0 ETH
0x4f6e3bc31a6166f9a4686db86e355c4698cb9acf41d95d6d4feec98925a114cc337858392022-10-30 4:44:5540 days 17 hrs ago 0x3145a934038a6ae7dbd842d3955b701660e3b9580x23ffb3687d3800fddde75e7e604392fea15c87570 ETH
0x4f6e3bc31a6166f9a4686db86e355c4698cb9acf41d95d6d4feec98925a114cc337858392022-10-30 4:44:5540 days 17 hrs ago 0x23ffb3687d3800fddde75e7e604392fea15c8757 0xe91067189c71db0696bd6fbc14535cb159f98b5c0 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
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.