ETH Price: $3,417.55 (+3.18%)

Contract

0xE05DE631122d95eF347f6fCA85d1bB149Fcc6Df2
 
Transaction Hash
Method
Block
From
To
Withdraw210026592024-10-19 22:39:1134 days ago1729377551IN
0xE05DE631...49Fcc6Df2
0 ETH0.000994877.00848744
Deposit209757842024-10-16 4:38:1138 days ago1729053491IN
0xE05DE631...49Fcc6Df2
0 ETH0.001550911.97307163
Withdraw209745402024-10-16 0:27:4738 days ago1729038467IN
0xE05DE631...49Fcc6Df2
0 ETH0.0011314410.70391087
Withdraw209723792024-10-15 17:12:5938 days ago1729012379IN
0xE05DE631...49Fcc6Df2
0 ETH0.0033514524.92660701
Withdraw207831232024-09-19 7:23:3565 days ago1726730615IN
0xE05DE631...49Fcc6Df2
0 ETH0.0015275314.45104859
Deposit207831192024-09-19 7:22:4765 days ago1726730567IN
0xE05DE631...49Fcc6Df2
0 ETH0.0017111214.39447896
Deposit207358502024-09-12 16:53:4771 days ago1726160027IN
0xE05DE631...49Fcc6Df2
0 ETH0.000438974.6506367
Deposit207184222024-09-10 6:27:2374 days ago1725949643IN
0xE05DE631...49Fcc6Df2
0 ETH0.000178611.76888958
Withdraw207122942024-09-09 9:55:2375 days ago1725875723IN
0xE05DE631...49Fcc6Df2
0 ETH0.000475124.49483461
Deposit206698982024-09-03 11:57:3581 days ago1725364655IN
0xE05DE631...49Fcc6Df2
0 ETH0.000384362.88705813
Emergency Withdr...206124912024-08-26 11:33:2389 days ago1724672003IN
0xE05DE631...49Fcc6Df2
0 ETH0.00017422.80227825
Deposit205981582024-08-24 11:28:1191 days ago1724498891IN
0xE05DE631...49Fcc6Df2
0 ETH0.00012090.9081464
Withdraw205081492024-08-11 21:46:59103 days ago1723412819IN
0xE05DE631...49Fcc6Df2
0 ETH0.00012121.14649692
Deposit205081482024-08-11 21:46:47103 days ago1723412807IN
0xE05DE631...49Fcc6Df2
0 ETH0.000136391.14736689
Withdraw203182702024-07-16 9:47:11130 days ago1721123231IN
0xE05DE631...49Fcc6Df2
0 ETH0.000810436.49113681
Withdraw202699952024-07-09 16:01:35137 days ago1720540895IN
0xE05DE631...49Fcc6Df2
0 ETH0.0010779410.19772733
Deposit202699842024-07-09 15:59:23137 days ago1720540763IN
0xE05DE631...49Fcc6Df2
0 ETH0.001010959.93334462
Deposit200642502024-06-10 21:55:47165 days ago1718056547IN
0xE05DE631...49Fcc6Df2
0 ETH0.0014079110.98968621
Withdraw200641072024-06-10 21:26:35165 days ago1718054795IN
0xE05DE631...49Fcc6Df2
0 ETH0.0014473613.69258063
Deposit200550452024-06-09 15:04:47167 days ago1717945487IN
0xE05DE631...49Fcc6Df2
0 ETH0.0037461828.44224453
Withdraw200020912024-06-02 5:36:47174 days ago1717306607IN
0xE05DE631...49Fcc6Df2
0 ETH0.00044774.23542958
Deposit200008922024-06-02 1:35:35174 days ago1717292135IN
0xE05DE631...49Fcc6Df2
0 ETH0.000586114.52480539
Withdraw199896272024-05-31 11:50:23176 days ago1717156223IN
0xE05DE631...49Fcc6Df2
0 ETH0.00095229.00721181
Deposit199896202024-05-31 11:48:59176 days ago1717156139IN
0xE05DE631...49Fcc6Df2
0 ETH0.001053128.85914606
Withdraw199064412024-05-19 20:43:11187 days ago1716151391IN
0xE05DE631...49Fcc6Df2
0 ETH0.00018822.77689714
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MasterChef

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 7 : MasterChef.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.4;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

import "../interfaces/IReservoir.sol";

/**
 * @title MasterChef
 */
contract MasterChef is Ownable {
    using SafeERC20 for IERC20;

    // Info of each user.
    struct UserInfo {
        uint256 amount;     // How many LP tokens the user has provided.
        uint256 rewardDebt; // Reward debt. See explanation below.
        //
        // We do some fancy math here. Basically, any point in time, the amount of rewardTokens
        // entitled to a user but is pending to be distributed is:
        //
        //   pending reward = (user.amount * pool.accRewardPerShare) - user.rewardDebt
        //
        // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens:
        //   1. The pool's `accRewardPerShare` (and `lastRewardBlock`) gets updated.
        //   2. User receives the pending reward sent to his/her address.
        //   3. User's `amount` gets updated.
        //   4. User's `rewardDebt` gets updated.
    }

    // Info of each pool.
    struct PoolInfo {
        IERC20 lpToken;             // Address of LP token contract.
        uint256 allocPoint;         // How many allocation points assigned to this pool. rewardTokens to distribute per block.
        uint256 lastRewardBlock;    // Last block number that rewardTokens distribution occurs.
        uint256 accRewardPerShare;  // Accumulated rewardTokens per share, times 1e18. See below.
    }

    // The REWARD TOKEN!
    IERC20 public rewardToken;
    // rewardTokens created per block.
    uint256 public rewardPerBlock;

    // Info of each pool.
    PoolInfo[] public poolInfo;
    // Info of each user that stakes LP tokens.
    mapping(uint256 => mapping(address => UserInfo)) public userInfo;
    // Total allocation points. Must be the sum of all allocation points in all pools.
    uint256 public totalAllocPoint = 0;
    // The block number when rewardToken mining starts.
    uint256 public startBlock;

    // Token reservoir.
    IReservoir public rewardReservoir;

    // Checking already added LP tokens.
    mapping(address => bool) private lpTokens;

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

    event SetRewardReservoir(address reservoir); // Set reward reservoir event.
    event SetRewardPerBlock(uint256 rewardPerBlock); // Set rewardPerBlock event.

    constructor(
        IERC20 _rewardToken,
        IReservoir _rewardReservoir,
        uint256 _rewardPerBlock,
        uint256 _startBlock
    ) {
        require(address(_rewardToken) != address(0), "MasterChef: rewardToken cannot be zero address");

        rewardToken = _rewardToken;
        rewardReservoir = _rewardReservoir;
        rewardPerBlock = _rewardPerBlock;
        startBlock = _startBlock;
    }


    // ** EXTERNAL VIEW functions **

    function poolLength() external view returns (uint256) {
        return poolInfo.length;
    }

    // View function to see pending rewardTokens on frontend.
    function pendingReward(uint256 _pid, address _user) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accRewardPerShare = pool.accRewardPerShare;
        uint256 lpSupply = pool.lpToken.balanceOf(address(this));
        if (block.number > pool.lastRewardBlock && lpSupply != 0) {
            uint256 multiplier = _getMultiplier(pool.lastRewardBlock, block.number);
            uint256 tokenReward = multiplier * rewardPerBlock * pool.allocPoint / totalAllocPoint;
            tokenReward = _availableReward(tokenReward); // amount available on rewardReservoir
            accRewardPerShare = accRewardPerShare + (tokenReward * 1e18 / lpSupply);
        }
        return (user.amount * accRewardPerShare / 1e18) - user.rewardDebt;
    }


    // ** POOL PUBLIC functions **

    // Update reward variables for all pools. Be careful of gas spending!
    function massUpdatePools() public {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            updatePool(pid);
        }
    }

    // Update reward variables of the given pool to be up-to-date.
    function updatePool(uint256 _pid) public {
        PoolInfo storage pool = poolInfo[_pid];
        if (block.number <= pool.lastRewardBlock) {
            return;
        }
        uint256 lpSupply = pool.lpToken.balanceOf(address(this));
        if (lpSupply == 0) {
            pool.lastRewardBlock = block.number;
            return;
        }
        uint256 multiplier = _getMultiplier(pool.lastRewardBlock, block.number);
        uint256 tokenReward = multiplier * rewardPerBlock * pool.allocPoint / totalAllocPoint;
        tokenReward = rewardReservoir.drip(tokenReward); // transfer tokens from rewardReservoir
        pool.accRewardPerShare = pool.accRewardPerShare + (tokenReward * 1e18 / lpSupply);
        pool.lastRewardBlock = block.number;
    }


    // ** USER EXTERNAL functions **

    // Deposit LP tokens to MasterChef for rewardToken allocation.
    function deposit(uint256 _pid, uint256 _amount) external {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        updatePool(_pid);
        if (user.amount > 0) {
            uint256 pending = (user.amount * pool.accRewardPerShare / 1e18) - user.rewardDebt;
            if (pending > 0) {
                _safeRewardTransfer(msg.sender, pending);
            }
        }
        if (_amount > 0) {
            pool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount);
            user.amount += _amount;
        }
        user.rewardDebt = user.amount * pool.accRewardPerShare / 1e18;
        emit Deposit(msg.sender, _pid, _amount);
    }

    // Withdraw LP tokens from MasterChef.
    function withdraw(uint256 _pid, uint256 _amount) external {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        require(user.amount >= _amount, "MasterChef: amount exceeds balance");
        updatePool(_pid);
        uint256 pending = (user.amount * pool.accRewardPerShare / 1e18) - user.rewardDebt;
        if (pending > 0) {
            _safeRewardTransfer(msg.sender, pending);
        }
        if (_amount > 0) {
            user.amount -= _amount;
            pool.lpToken.safeTransfer(address(msg.sender), _amount);
        }
        user.rewardDebt = user.amount * pool.accRewardPerShare / 1e18;
        emit Withdraw(msg.sender, _pid, _amount);
    }

    // Withdraw without caring about rewards. EMERGENCY ONLY.
    function emergencyWithdraw(uint256 _pid) external {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        uint256 amount = user.amount;
        user.amount = 0;
        user.rewardDebt = 0;
        pool.lpToken.safeTransfer(address(msg.sender), amount);
        emit EmergencyWithdraw(msg.sender, _pid, amount);
    }


    // ** ONLY OWNER functions **

    // Add a new lp to the pool. Can only be called by the owner.
    function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) external onlyOwner {
        // Trying to add the same LP token more than once.
        require(!lpTokens[address(_lpToken)], "MasterChef: LP token has already been added");
        lpTokens[address(_lpToken)] = true;

        // Trying to add rewardToken as LP token.
        require(address(_lpToken) != address(rewardToken), "MasterChef: reward token cannot be LP token");

        if (_withUpdate) {
            massUpdatePools();
        }
        uint256 lastRewardBlock = (block.number > startBlock) ? block.number : startBlock;
        totalAllocPoint += _allocPoint;
        poolInfo.push(PoolInfo({
            lpToken: _lpToken,
            allocPoint: _allocPoint,
            lastRewardBlock: lastRewardBlock,
            accRewardPerShare: 0
        }));
    }

    // Update the given pool's rewardToken allocation point. Can only be called by the owner.
    function set(uint256 _pid, uint256 _allocPoint, bool _withUpdate) external onlyOwner {
        if (_withUpdate) {
            massUpdatePools();
        }
        totalAllocPoint = totalAllocPoint - poolInfo[_pid].allocPoint + _allocPoint;
        require(totalAllocPoint > 0, "MasterChef: totalAllocPoint cannot be zero");

        poolInfo[_pid].allocPoint = _allocPoint;
    }

    // Set reward per block. Can only be called by the owner.
    function setRewardPerBlock(uint256 _rewardPerBlock, bool _withUpdate) external onlyOwner {
        if (_withUpdate) {
            massUpdatePools();
        }
        rewardPerBlock = _rewardPerBlock;
        emit SetRewardPerBlock(_rewardPerBlock);
    }

    // Set rewardReservoir. Can only be called by the owner.
    function setRewardReservoir(IReservoir _rewardReservoir) external onlyOwner {
        rewardReservoir = _rewardReservoir;
        emit SetRewardReservoir(address(_rewardReservoir));
    }


    // ** INTERNAL functions **

    // Return reward multiplier over the given _from to _to block.
    function _getMultiplier(uint256 _from, uint256 _to) internal pure returns (uint256) {
        return (_to - _from);
    }

    // Return available reward on rewardReservoir.
    function _availableReward(uint256 _requestedTokens) internal view returns (uint256) {
        uint256 reservoirBalance = rewardToken.balanceOf(address(rewardReservoir));
        return (_requestedTokens > reservoirBalance) ? reservoirBalance : _requestedTokens;
    }

    // Safe rewardToken transfer function, just in case if rounding error causes pool to not have enough rewardTokens.
    function _safeRewardTransfer(address _to, uint256 _amount) internal {
        uint256 rewardBal = rewardToken.balanceOf(address(this));
        if (_amount > rewardBal) {
            rewardToken.safeTransfer(_to, rewardBal);
        } else {
            rewardToken.safeTransfer(_to, _amount);
        }
    }
}

File 2 of 7 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 3 of 7 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.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 IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

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

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

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

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

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

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

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

File 4 of 7 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

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

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

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 5 of 7 : IReservoir.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.4;

/**
 * @dev Interface of Reservoir contract.
 */
interface IReservoir {
    function drip(uint256 requestedTokens)
        external
        returns (uint256 sentTokens);
}

File 6 of 7 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 7 of 7 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Context.sol)

pragma solidity ^0.8.0;

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

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"_rewardToken","type":"address"},{"internalType":"contract IReservoir","name":"_rewardReservoir","type":"address"},{"internalType":"uint256","name":"_rewardPerBlock","type":"uint256"},{"internalType":"uint256","name":"_startBlock","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","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":"uint256","name":"rewardPerBlock","type":"uint256"}],"name":"SetRewardPerBlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"reservoir","type":"address"}],"name":"SetRewardReservoir","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IERC20","name":"_lpToken","type":"address"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"lpToken","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accRewardPerShare","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardReservoir","outputs":[{"internalType":"contract IReservoir","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardPerBlock","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"setRewardPerBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IReservoir","name":"_rewardReservoir","type":"address"}],"name":"setRewardReservoir","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","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":"_pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405260006005553480156200001657600080fd5b50604051620018f0380380620018f0833981016040819052620000399162000145565b6200004433620000f5565b6001600160a01b038416620000b65760405162461bcd60e51b815260206004820152602e60248201527f4d6173746572436865663a20726577617264546f6b656e2063616e6e6f74206260448201526d65207a65726f206164647265737360901b606482015260840160405180910390fd5b600180546001600160a01b039586166001600160a01b0319918216179091556007805494909516931692909217909255600291909155600655620001aa565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600080608085870312156200015b578384fd5b8451620001688162000191565b60208601519094506200017b8162000191565b6040860151606090960151949790965092505050565b6001600160a01b0381168114620001a757600080fd5b50565b61173680620001ba6000396000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c806364482f79116100b857806393f1a40b1161007c57806393f1a40b1461026b57806398969e82146102b2578063a6dd10f8146102c5578063e2bbb158146102d8578063f2fde38b146102eb578063f7c618c1146102fe57600080fd5b806364482f7914610223578063715018a61461023657806381505c051461023e5780638ae39cac146102515780638da5cb5b1461025a57600080fd5b8063441a3e70116100ff578063441a3e70146101d957806348cd4cb1146101ec57806351eb05a6146101f55780635312ea8e14610208578063630b5ba11461021b57600080fd5b8063081e3eda1461013c5780630a15e61b146101535780631526fe271461017e57806317caf6f1146101bb5780631eaaa045146101c4575b600080fd5b6003545b6040519081526020015b60405180910390f35b600754610166906001600160a01b031681565b6040516001600160a01b03909116815260200161014a565b61019161018c36600461147c565b610311565b604080516001600160a01b039095168552602085019390935291830152606082015260800161014a565b61014060055481565b6101d76101d23660046114ff565b610355565b005b6101d76101e7366004611540565b6105bb565b61014060065481565b6101d761020336600461147c565b610753565b6101d761021636600461147c565b610922565b6101d76109d0565b6101d7610231366004611561565b6109fb565b6101d7610b1e565b6101d761024c3660046114db565b610b54565b61014060025481565b6000546001600160a01b0316610166565b61029d6102793660046114ac565b60046020908152600092835260408084209091529082529020805460019091015482565b6040805192835260208301919091520161014a565b6101406102c03660046114ac565b610bc8565b6101d76102d3366004611444565b610d65565b6101d76102e6366004611540565b610de3565b6101d76102f9366004611444565b610f1e565b600154610166906001600160a01b031681565b6003818154811061032157600080fd5b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169350919084565b6000546001600160a01b031633146103885760405162461bcd60e51b815260040161037f906115dd565b60405180910390fd5b6001600160a01b03821660009081526008602052604090205460ff16156104055760405162461bcd60e51b815260206004820152602b60248201527f4d6173746572436865663a204c5020746f6b656e2068617320616c726561647960448201526a081899595b88185919195960aa1b606482015260840161037f565b6001600160a01b038083166000818152600860205260409020805460ff191660019081179091555490911614156104925760405162461bcd60e51b815260206004820152602b60248201527f4d6173746572436865663a2072657761726420746f6b656e2063616e6e6f742060448201526a3132902628103a37b5b2b760a91b606482015260840161037f565b80156104a0576104a06109d0565b600060065443116104b3576006546104b5565b435b905083600560008282546104c99190611612565b9091555050604080516080810182526001600160a01b0394851681526020810195865290810191825260006060820181815260038054600181018255925291517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b600490920291820180546001600160a01b031916919096161790945593517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c840155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d8301555090517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e90910155565b6000600383815481106105de57634e487b7160e01b600052603260045260246000fd5b60009182526020808320868452600480835260408086203387529093529190932080549290910290920192508311156106645760405162461bcd60e51b815260206004820152602260248201527f4d6173746572436865663a20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161037f565b61066d84610753565b60008160010154670de0b6b3a764000084600301548460000154610691919061164a565b61069b919061162a565b6106a59190611669565b905080156106b7576106b73382610fb9565b83156106ec57838260000160008282546106d19190611669565b909155505082546106ec906001600160a01b0316338661106e565b60038301548254670de0b6b3a7640000916107069161164a565b610710919061162a565b6001830155604051848152859033907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689060200160405180910390a35050505050565b60006003828154811061077657634e487b7160e01b600052603260045260246000fd5b9060005260206000209060040201905080600201544311610795575050565b80546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b1580156107d857600080fd5b505afa1580156107ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108109190611494565b90508061082257504360029091015550565b60006108328360020154436110d1565b9050600060055484600101546002548461084c919061164a565b610856919061164a565b610860919061162a565b600754604051632c1935bd60e11b8152600481018390529192506001600160a01b0316906358326b7a90602401602060405180830381600087803b1580156108a757600080fd5b505af11580156108bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108df9190611494565b9050826108f482670de0b6b3a764000061164a565b6108fe919061162a565b846003015461090d9190611612565b60038501555050436002909201919091555050565b60006003828154811061094557634e487b7160e01b600052603260045260246000fd5b60009182526020808320858452600480835260408086203380885294528520805486825560018201969096559302018054909450919291610992916001600160a01b03909116908361106e565b604051818152849033907fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae0595906020015b60405180910390a350505050565b60035460005b818110156109f7576109e781610753565b6109f0816116ac565b90506109d6565b5050565b6000546001600160a01b03163314610a255760405162461bcd60e51b815260040161037f906115dd565b8015610a3357610a336109d0565b8160038481548110610a5557634e487b7160e01b600052603260045260246000fd5b906000526020600020906004020160010154600554610a749190611669565b610a7e9190611612565b6005819055610ae25760405162461bcd60e51b815260206004820152602a60248201527f4d6173746572436865663a20746f74616c416c6c6f63506f696e742063616e6e6044820152696f74206265207a65726f60b01b606482015260840161037f565b8160038481548110610b0457634e487b7160e01b600052603260045260246000fd5b906000526020600020906004020160010181905550505050565b6000546001600160a01b03163314610b485760405162461bcd60e51b815260040161037f906115dd565b610b5260006110e4565b565b6000546001600160a01b03163314610b7e5760405162461bcd60e51b815260040161037f906115dd565b8015610b8c57610b8c6109d0565b60028290556040518281527f22c0456177178fec69cb519ce05c0f0b39708187e616a82ceea49f84e19169cd9060200160405180910390a15050565b60008060038481548110610bec57634e487b7160e01b600052603260045260246000fd5b60009182526020808320878452600480835260408086206001600160a01b038a8116885294528086209482029092016003810154815493516370a0823160e01b8152309381019390935290965093949291909116906370a082319060240160206040518083038186803b158015610c6257600080fd5b505afa158015610c76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9a9190611494565b9050836002015443118015610cae57508015155b15610d2a576000610cc38560020154436110d1565b90506000600554866001015460025484610cdd919061164a565b610ce7919061164a565b610cf1919061162a565b9050610cfc81611134565b905082610d1182670de0b6b3a764000061164a565b610d1b919061162a565b610d259085611612565b935050505b60018301548354670de0b6b3a764000090610d4690859061164a565b610d50919061162a565b610d5a9190611669565b979650505050505050565b6000546001600160a01b03163314610d8f5760405162461bcd60e51b815260040161037f906115dd565b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527ff243e62bec804104afe7b2ab78e5e90d349a0e5a420a10589f5a543f3e7ee7fc9060200160405180910390a150565b600060038381548110610e0657634e487b7160e01b600052603260045260246000fd5b60009182526020808320868452600480835260408086203387529093529190932091029091019150610e3784610753565b805415610e8a5760008160010154670de0b6b3a764000084600301548460000154610e62919061164a565b610e6c919061162a565b610e769190611669565b90508015610e8857610e883382610fb9565b505b8215610ec1578154610ea7906001600160a01b03163330866111cc565b82816000016000828254610ebb9190611612565b90915550505b60038201548154670de0b6b3a764000091610edb9161164a565b610ee5919061162a565b6001820155604051838152849033907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15906020016109c2565b6000546001600160a01b03163314610f485760405162461bcd60e51b815260040161037f906115dd565b6001600160a01b038116610fad5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161037f565b610fb6816110e4565b50565b6001546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015610ffd57600080fd5b505afa158015611011573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110359190611494565b90508082111561105b57600154611056906001600160a01b0316848361106e565b505050565b600154611056906001600160a01b031684845b6040516001600160a01b03831660248201526044810182905261105690849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261120a565b60006110dd8383611669565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001546007546040516370a0823160e01b81526001600160a01b039182166004820152600092839216906370a082319060240160206040518083038186803b15801561117f57600080fd5b505afa158015611193573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b79190611494565b90508083116111c657826110dd565b92915050565b6040516001600160a01b03808516602483015283166044820152606481018290526112049085906323b872dd60e01b9060840161109a565b50505050565b600061125f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166112dc9092919063ffffffff16565b805190915015611056578080602001905181019061127d9190611460565b6110565760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161037f565b60606112eb84846000856112f3565b949350505050565b6060824710156113545760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161037f565b843b6113a25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161037f565b600080866001600160a01b031685876040516113be919061158e565b60006040518083038185875af1925050503d80600081146113fb576040519150601f19603f3d011682016040523d82523d6000602084013e611400565b606091505b5091509150610d5a8282866060831561141a5750816110dd565b82511561142a5782518084602001fd5b8160405162461bcd60e51b815260040161037f91906115aa565b600060208284031215611455578081fd5b81356110dd816116dd565b600060208284031215611471578081fd5b81516110dd816116f2565b60006020828403121561148d578081fd5b5035919050565b6000602082840312156114a5578081fd5b5051919050565b600080604083850312156114be578081fd5b8235915060208301356114d0816116dd565b809150509250929050565b600080604083850312156114ed578182fd5b8235915060208301356114d0816116f2565b600080600060608486031215611513578081fd5b833592506020840135611525816116dd565b91506040840135611535816116f2565b809150509250925092565b60008060408385031215611552578182fd5b50508035926020909101359150565b600080600060608486031215611575578283fd5b83359250602084013591506040840135611535816116f2565b600082516115a0818460208701611680565b9190910192915050565b60208152600082518060208401526115c9816040850160208701611680565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115611625576116256116c7565b500190565b60008261164557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611664576116646116c7565b500290565b60008282101561167b5761167b6116c7565b500390565b60005b8381101561169b578181015183820152602001611683565b838111156112045750506000910152565b60006000198214156116c0576116c06116c7565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114610fb657600080fd5b8015158114610fb657600080fdfea2646970667358221220d33c95142656a1a7e82ad37ade53250133b44a617974d5dab59e43ac8a3abbcd64736f6c63430008040033000000000000000000000000d38bb40815d2b0c2d2c866e0c72c5728ffc76dd90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000073a5f283c8414080000000000000000000000000000000000000000000000000000000000d220f8

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101375760003560e01c806364482f79116100b857806393f1a40b1161007c57806393f1a40b1461026b57806398969e82146102b2578063a6dd10f8146102c5578063e2bbb158146102d8578063f2fde38b146102eb578063f7c618c1146102fe57600080fd5b806364482f7914610223578063715018a61461023657806381505c051461023e5780638ae39cac146102515780638da5cb5b1461025a57600080fd5b8063441a3e70116100ff578063441a3e70146101d957806348cd4cb1146101ec57806351eb05a6146101f55780635312ea8e14610208578063630b5ba11461021b57600080fd5b8063081e3eda1461013c5780630a15e61b146101535780631526fe271461017e57806317caf6f1146101bb5780631eaaa045146101c4575b600080fd5b6003545b6040519081526020015b60405180910390f35b600754610166906001600160a01b031681565b6040516001600160a01b03909116815260200161014a565b61019161018c36600461147c565b610311565b604080516001600160a01b039095168552602085019390935291830152606082015260800161014a565b61014060055481565b6101d76101d23660046114ff565b610355565b005b6101d76101e7366004611540565b6105bb565b61014060065481565b6101d761020336600461147c565b610753565b6101d761021636600461147c565b610922565b6101d76109d0565b6101d7610231366004611561565b6109fb565b6101d7610b1e565b6101d761024c3660046114db565b610b54565b61014060025481565b6000546001600160a01b0316610166565b61029d6102793660046114ac565b60046020908152600092835260408084209091529082529020805460019091015482565b6040805192835260208301919091520161014a565b6101406102c03660046114ac565b610bc8565b6101d76102d3366004611444565b610d65565b6101d76102e6366004611540565b610de3565b6101d76102f9366004611444565b610f1e565b600154610166906001600160a01b031681565b6003818154811061032157600080fd5b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169350919084565b6000546001600160a01b031633146103885760405162461bcd60e51b815260040161037f906115dd565b60405180910390fd5b6001600160a01b03821660009081526008602052604090205460ff16156104055760405162461bcd60e51b815260206004820152602b60248201527f4d6173746572436865663a204c5020746f6b656e2068617320616c726561647960448201526a081899595b88185919195960aa1b606482015260840161037f565b6001600160a01b038083166000818152600860205260409020805460ff191660019081179091555490911614156104925760405162461bcd60e51b815260206004820152602b60248201527f4d6173746572436865663a2072657761726420746f6b656e2063616e6e6f742060448201526a3132902628103a37b5b2b760a91b606482015260840161037f565b80156104a0576104a06109d0565b600060065443116104b3576006546104b5565b435b905083600560008282546104c99190611612565b9091555050604080516080810182526001600160a01b0394851681526020810195865290810191825260006060820181815260038054600181018255925291517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b600490920291820180546001600160a01b031916919096161790945593517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c840155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d8301555090517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e90910155565b6000600383815481106105de57634e487b7160e01b600052603260045260246000fd5b60009182526020808320868452600480835260408086203387529093529190932080549290910290920192508311156106645760405162461bcd60e51b815260206004820152602260248201527f4d6173746572436865663a20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161037f565b61066d84610753565b60008160010154670de0b6b3a764000084600301548460000154610691919061164a565b61069b919061162a565b6106a59190611669565b905080156106b7576106b73382610fb9565b83156106ec57838260000160008282546106d19190611669565b909155505082546106ec906001600160a01b0316338661106e565b60038301548254670de0b6b3a7640000916107069161164a565b610710919061162a565b6001830155604051848152859033907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689060200160405180910390a35050505050565b60006003828154811061077657634e487b7160e01b600052603260045260246000fd5b9060005260206000209060040201905080600201544311610795575050565b80546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b1580156107d857600080fd5b505afa1580156107ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108109190611494565b90508061082257504360029091015550565b60006108328360020154436110d1565b9050600060055484600101546002548461084c919061164a565b610856919061164a565b610860919061162a565b600754604051632c1935bd60e11b8152600481018390529192506001600160a01b0316906358326b7a90602401602060405180830381600087803b1580156108a757600080fd5b505af11580156108bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108df9190611494565b9050826108f482670de0b6b3a764000061164a565b6108fe919061162a565b846003015461090d9190611612565b60038501555050436002909201919091555050565b60006003828154811061094557634e487b7160e01b600052603260045260246000fd5b60009182526020808320858452600480835260408086203380885294528520805486825560018201969096559302018054909450919291610992916001600160a01b03909116908361106e565b604051818152849033907fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae0595906020015b60405180910390a350505050565b60035460005b818110156109f7576109e781610753565b6109f0816116ac565b90506109d6565b5050565b6000546001600160a01b03163314610a255760405162461bcd60e51b815260040161037f906115dd565b8015610a3357610a336109d0565b8160038481548110610a5557634e487b7160e01b600052603260045260246000fd5b906000526020600020906004020160010154600554610a749190611669565b610a7e9190611612565b6005819055610ae25760405162461bcd60e51b815260206004820152602a60248201527f4d6173746572436865663a20746f74616c416c6c6f63506f696e742063616e6e6044820152696f74206265207a65726f60b01b606482015260840161037f565b8160038481548110610b0457634e487b7160e01b600052603260045260246000fd5b906000526020600020906004020160010181905550505050565b6000546001600160a01b03163314610b485760405162461bcd60e51b815260040161037f906115dd565b610b5260006110e4565b565b6000546001600160a01b03163314610b7e5760405162461bcd60e51b815260040161037f906115dd565b8015610b8c57610b8c6109d0565b60028290556040518281527f22c0456177178fec69cb519ce05c0f0b39708187e616a82ceea49f84e19169cd9060200160405180910390a15050565b60008060038481548110610bec57634e487b7160e01b600052603260045260246000fd5b60009182526020808320878452600480835260408086206001600160a01b038a8116885294528086209482029092016003810154815493516370a0823160e01b8152309381019390935290965093949291909116906370a082319060240160206040518083038186803b158015610c6257600080fd5b505afa158015610c76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9a9190611494565b9050836002015443118015610cae57508015155b15610d2a576000610cc38560020154436110d1565b90506000600554866001015460025484610cdd919061164a565b610ce7919061164a565b610cf1919061162a565b9050610cfc81611134565b905082610d1182670de0b6b3a764000061164a565b610d1b919061162a565b610d259085611612565b935050505b60018301548354670de0b6b3a764000090610d4690859061164a565b610d50919061162a565b610d5a9190611669565b979650505050505050565b6000546001600160a01b03163314610d8f5760405162461bcd60e51b815260040161037f906115dd565b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527ff243e62bec804104afe7b2ab78e5e90d349a0e5a420a10589f5a543f3e7ee7fc9060200160405180910390a150565b600060038381548110610e0657634e487b7160e01b600052603260045260246000fd5b60009182526020808320868452600480835260408086203387529093529190932091029091019150610e3784610753565b805415610e8a5760008160010154670de0b6b3a764000084600301548460000154610e62919061164a565b610e6c919061162a565b610e769190611669565b90508015610e8857610e883382610fb9565b505b8215610ec1578154610ea7906001600160a01b03163330866111cc565b82816000016000828254610ebb9190611612565b90915550505b60038201548154670de0b6b3a764000091610edb9161164a565b610ee5919061162a565b6001820155604051838152849033907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15906020016109c2565b6000546001600160a01b03163314610f485760405162461bcd60e51b815260040161037f906115dd565b6001600160a01b038116610fad5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161037f565b610fb6816110e4565b50565b6001546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015610ffd57600080fd5b505afa158015611011573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110359190611494565b90508082111561105b57600154611056906001600160a01b0316848361106e565b505050565b600154611056906001600160a01b031684845b6040516001600160a01b03831660248201526044810182905261105690849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261120a565b60006110dd8383611669565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001546007546040516370a0823160e01b81526001600160a01b039182166004820152600092839216906370a082319060240160206040518083038186803b15801561117f57600080fd5b505afa158015611193573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b79190611494565b90508083116111c657826110dd565b92915050565b6040516001600160a01b03808516602483015283166044820152606481018290526112049085906323b872dd60e01b9060840161109a565b50505050565b600061125f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166112dc9092919063ffffffff16565b805190915015611056578080602001905181019061127d9190611460565b6110565760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161037f565b60606112eb84846000856112f3565b949350505050565b6060824710156113545760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161037f565b843b6113a25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161037f565b600080866001600160a01b031685876040516113be919061158e565b60006040518083038185875af1925050503d80600081146113fb576040519150601f19603f3d011682016040523d82523d6000602084013e611400565b606091505b5091509150610d5a8282866060831561141a5750816110dd565b82511561142a5782518084602001fd5b8160405162461bcd60e51b815260040161037f91906115aa565b600060208284031215611455578081fd5b81356110dd816116dd565b600060208284031215611471578081fd5b81516110dd816116f2565b60006020828403121561148d578081fd5b5035919050565b6000602082840312156114a5578081fd5b5051919050565b600080604083850312156114be578081fd5b8235915060208301356114d0816116dd565b809150509250929050565b600080604083850312156114ed578182fd5b8235915060208301356114d0816116f2565b600080600060608486031215611513578081fd5b833592506020840135611525816116dd565b91506040840135611535816116f2565b809150509250925092565b60008060408385031215611552578182fd5b50508035926020909101359150565b600080600060608486031215611575578283fd5b83359250602084013591506040840135611535816116f2565b600082516115a0818460208701611680565b9190910192915050565b60208152600082518060208401526115c9816040850160208701611680565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115611625576116256116c7565b500190565b60008261164557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611664576116646116c7565b500290565b60008282101561167b5761167b6116c7565b500390565b60005b8381101561169b578181015183820152602001611683565b838111156112045750506000910152565b60006000198214156116c0576116c06116c7565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114610fb657600080fd5b8015158114610fb657600080fdfea2646970667358221220d33c95142656a1a7e82ad37ade53250133b44a617974d5dab59e43ac8a3abbcd64736f6c63430008040033

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

000000000000000000000000d38bb40815d2b0c2d2c866e0c72c5728ffc76dd90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000073a5f283c8414080000000000000000000000000000000000000000000000000000000000d220f8

-----Decoded View---------------
Arg [0] : _rewardToken (address): 0xd38BB40815d2B0c2d2c866e0c72c5728ffC76dd9
Arg [1] : _rewardReservoir (address): 0x0000000000000000000000000000000000000000
Arg [2] : _rewardPerBlock (uint256): 520833333333333000
Arg [3] : _startBlock (uint256): 13771000

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000d38bb40815d2b0c2d2c866e0c72c5728ffc76dd9
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 000000000000000000000000000000000000000000000000073a5f283c841408
Arg [3] : 0000000000000000000000000000000000000000000000000000000000d220f8


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.