Contract 0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f1 3

 

Contract Overview

Balance:
0 BNB

BNB Value:
$0.00

Token:
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xba0a1387971fe8928b0a59c72f5563a8a84a91744dbaf626b008dff09727f616Deposit112189832021-09-25 9:47:379 mins ago0xa576cb6c74256117c806f444670609129805764d IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.00021799
0xd0b374764e229aeb085589cadc9f6af53d236d0c3eba151f6782ebfefcdc1f5fDeposit112187502021-09-25 9:35:5821 mins ago0xa576cb6c74256117c806f444670609129805764d IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.00021799
0x705298832f0145631269c8c642bc685931a12fd2fe55e51b8281dae88a3d4f67Deposit112187302021-09-25 9:34:5822 mins ago0xa576cb6c74256117c806f444670609129805764d IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.00021799
0xf32a907b58592ee01a62d1a4f68b6456e53ab186ec4e909d5f3d19ad84eea68cEmergency Withdr...112181802021-09-25 9:07:2849 mins ago0xa7ec8355839482fb42dc3144975533417d8e0f05 IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.000227735
0xe40e852a60f499eb5904a30630727af7341345cb7e2362f755faf112c5079b32Emergency Withdr...112181652021-09-25 9:06:4350 mins ago0xa7ec8355839482fb42dc3144975533417d8e0f05 IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.000227735
0xcef407bdeb50b6a685dd895789e9d5be9f20885561b61997936f89cae76eaafcEmergency Withdr...112181482021-09-25 9:05:5251 mins ago0xa7ec8355839482fb42dc3144975533417d8e0f05 IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.000227735
0x92308c7f1d776197cd30727c797ec1d9c88593fef88017900b79e421340245ffEmergency Withdr...112130662021-09-25 4:50:155 hrs 7 mins ago0x47cc40d7305957450020fbd1ea92502d5ba559d1 IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.000227735
0xfaa2b9bafb8f6dfe559b3441879f37e6c577408102e50b918be7c473a343786cEmergency Withdr...112116392021-09-25 3:38:346 hrs 18 mins ago0x1cb50e394331ed0ba24325b0d7b98ca384dadb4b IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.0002278
0x1031083e7e9907355f7f9e58a61784d65091dba14e96f5dbcfd25cc6e37230ceEmergency Withdr...112116212021-09-25 3:37:406 hrs 19 mins ago0x1cb50e394331ed0ba24325b0d7b98ca384dadb4b IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.000227735
0x112cb5aa948f02353f32b8c1937852be75a28b0b79e83c7603e8a2c055e92fc0Deposit112116032021-09-25 3:36:466 hrs 20 mins ago0x1cb50e394331ed0ba24325b0d7b98ca384dadb4b IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.00021799
0x44d001e7cbb23f9424448b4534117933665da77b4c041b380afe48a6e08fe0dbDeposit112115872021-09-25 3:35:566 hrs 21 mins ago0x1cb50e394331ed0ba24325b0d7b98ca384dadb4b IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.00021799
0xce18b5d48ebd6c813911c7b54730fe0ed85dd7142400a666a6d0c57bf3f8539cEmergency Withdr...112103122021-09-25 2:31:517 hrs 25 mins ago0x1c4271685b043e374b72a8db7531c68133c3b01d IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.00015391
0x91b0228f207f305824a027edb53b4de97f3e6faf8bbaf21b5a7dfaa90a013402Emergency Withdr...111986352021-09-24 16:45:0117 hrs 12 mins ago0xd077212c4067214bbee21786321588af06afcc85 IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.0001528
0x61de5808b1b5725ecd6ae8946efabf02f188e4fabcb9cf591429d25436b370e5Emergency Withdr...111971302021-09-24 15:29:4618 hrs 27 mins ago0xafb0833621e3cf339d439ef578a0f9936385156c IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.000261845
0x30f4d2687757706bc00c5c2073c0e184bedc708a85ea77c0eb310e21d6d17112Emergency Withdr...111962622021-09-24 14:46:2219 hrs 10 mins ago0x77464a935a30f83bf000c4277ec5d75efa292c6a IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.000227735
0x2a8254483e371804f0b46a9927f492de89a0bf85a1aa6b50ba846eea9f244a1cEmergency Withdr...111959702021-09-24 14:31:4619 hrs 25 mins ago0x7f3c138ef4a893e82c3f07cdda2a20a63b928dea IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.000227735
0x60129d905afd7e78cadb8b87279de4b180a69f3408857dc0ce4b066a1400389aEmergency Withdr...111850872021-09-24 5:25:471 day 4 hrs ago0x9df57f613f8e8bbd0b379382bf319dee2fd4d526 IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.000227735
0x841ab3af594c8e336b2d72f86589155614cb2e6c9ceb284a2331b2f4e07a385fEmergency Withdr...111822032021-09-24 3:01:341 day 6 hrs ago0x28b5faca4bb46828b08680a9646954b241c29e1a IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.000261845
0x008582248ce330e3db3f28cac76ecd74e0cd19bcc130ba036a25fb29cdebf0dbEmergency Withdr...111808152021-09-24 1:52:101 day 8 hrs ago0xc5e45b3c0442d51f2d875ca0248a2399206bae57 IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.000227735
0xa11579c01fb7a9f0c777284a08887adb219afc317d90c385d8aec3340ede5899Emergency Withdr...111784222021-09-23 23:51:481 day 10 hrs ago0x6060520bbd65d9f7aceb19fb13854e0148db3bcc IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.0001528
0xe167d8dafdccd44477216b0e81b271233a2b90e779ce8a0c72a8154d19496ca1Deposit111784152021-09-23 23:51:271 day 10 hrs ago0x6060520bbd65d9f7aceb19fb13854e0148db3bcc IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.00021828
0xa183f4b75819a148cac7f0e3493db3d1c1a59bedc3898eb6040f42a11924c21fEmergency Withdr...111771332021-09-23 22:47:191 day 11 hrs ago0x2da663ae1c97d8efcae4cc95090da102a3c3841f IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.000261845
0x6bafd211024aeba2df455bba08233e453ece21257af815634c2b65719e0c541eDeposit111770372021-09-23 22:42:311 day 11 hrs ago0x2da663ae1c97d8efcae4cc95090da102a3c3841f IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.00021996
0xd65f6a388c6f346dc390f4f9eac16fb6d60c09123252e614b07a96e835ea06e5Emergency Withdr...111730812021-09-23 19:24:411 day 14 hrs ago0xf1d6e639f690af41495284f28f5167a010a0f601 IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.000227735
0x5e1b07413e2e5059c530875a4f7f7c2d60eb72973fac7cbe1169f9ebe4502fa3Deposit111730692021-09-23 19:24:051 day 14 hrs ago0xf1d6e639f690af41495284f28f5167a010a0f601 IN  0xe43b7c5c4c2df51306cceb7cbc4b2fcc038874f10 BNB0.00021799
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Cafeteria

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 8 : Cafeteria.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

import "./libs/IBEP20.sol";
import "./libs/SafeBEP20.sol";
import "./libs/SafeMath.sol";
import "./libs/Ownable.sol";
import "./libs/ReentrancyGuard.sol";

interface IMintableERC20 is IBEP20 {
    function mint(address _to, uint256 _amount) external;
}

// Cafeteria is the master of Coupon. He can make Coupon and he is a fair guy.
//
// Note that it's ownable and the owner wields tremendous power. The ownership
// will be transferred to a governance smart contract once Coupon is sufficiently
// distributed and the community can show to govern itself.
//
// Have fun reading it. Hopefully it's bug-free. God bless.
contract Cafeteria is Ownable, ReentrancyGuard {
    using SafeMath for uint256;
    using SafeBEP20 for IBEP20;

    // Info of each user.
    struct UserInfo {
        uint256 amount;         // How many LP tokens the user has provided.
        uint256 rewardDebt;     // Reward debt. See explanation below.
        uint256 lockedReward;
        //
        // We do some fancy math here. Basically, any point in time, the amount of COUPONs
        // entitled to a user but is pending to be distributed is:
        //
        //   pending reward = (user.amount * pool.accCouponPerShare) - user.rewardDebt
        //
        // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens:
        //   1. The pool's `accCouponPerShare` (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 {
        IBEP20 lpToken;           // Address of LP token contract.
        uint256 allocPoint;       // How many allocation points assigned to this pool. COUPONs to distribute per block.
        uint256 lastRewardBlock;  // Last block number that COUPONs distribution occurs.
        uint256 accCouponPerShare;   // Accumulated COUPONs per share, times 1e12. See below.
        uint16 depositFeeBP;      // Deposit fee in basis points
        bool withdrawFee100;      // Deposit fee in basis points
    }

    // The Coupon TOKEN!
    IMintableERC20 public coupon;
    // Dev address.
    address public devaddr;
    // Coupon tokens created per block.
    uint256 public couponPerBlock;
    // Bonus multiplier for early coupon makers.
    uint256 public constant BONUS_MULTIPLIER = 1;
    // Deposit Fee address
    address public feeAddress;

    // 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 Coupon mining starts.
    uint256 public startBlock;

    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 SetFeeAddress(address indexed user, address indexed newAddress);
    event SetDevAddress(address indexed user, address indexed newAddress);
    event UpdateEmissionRate(address indexed user, uint256 goosePerBlock);

    constructor(
        address _coupon,
        address _devaddr,
        address _feeAddress,
        uint256 _couponPerBlock,
        uint256 _startBlock
    ) public {
        coupon = IMintableERC20(_coupon);
        devaddr = _devaddr;
        feeAddress = _feeAddress;
        couponPerBlock = _couponPerBlock;
        startBlock = _startBlock;
    }

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

    mapping (IBEP20 => bool) public poolExistence;
    modifier nonDuplicated(IBEP20 _lpToken) {
        require(poolExistence[_lpToken] == false, "duplicated");
        _;
    }

    // Add a new lp to the pool. Can only be called by the owner.
    function add(uint256 _allocPoint, IBEP20 _lpToken, uint16 _depositFeeBP, bool _withdrawFee100, bool _withUpdate) public onlyOwner nonDuplicated(_lpToken) {
        require(_depositFeeBP <= 10000, "invalid deposit fee basis points");
        if (_withUpdate) {
            massUpdatePools();
        }
        uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock;
        totalAllocPoint = totalAllocPoint.add(_allocPoint);
        poolExistence[_lpToken] = true;
        poolInfo.push(PoolInfo({
            lpToken: _lpToken,
            allocPoint: _allocPoint,
            lastRewardBlock: lastRewardBlock,
            accCouponPerShare: 0,
            depositFeeBP: _depositFeeBP,
            withdrawFee100: _withdrawFee100
        }));
    }

    // Update the given pool's Coupon allocation point and deposit fee. Can only be called by the owner.
    function set(uint256 _pid, uint256 _allocPoint, uint16 _depositFeeBP, bool _withUpdate) public onlyOwner {
        require(_depositFeeBP <= 10000, "invalid deposit fee basis points");

        if (_withUpdate) {
            massUpdatePools();
        }

        totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint);
        poolInfo[_pid].allocPoint = _allocPoint;
        poolInfo[_pid].depositFeeBP = _depositFeeBP;

        // For emergency fix of 100% withdrawal fee
        if (_allocPoint == 0) {
            poolExistence[poolInfo[_pid].lpToken] = false;
        } else {
            poolExistence[poolInfo[_pid].lpToken] = true;
        }
    }

    // Return reward multiplier over the given _from to _to block.
    function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) {
        return _to.sub(_from).mul(BONUS_MULTIPLIER);
    }

    // View function to see pending COUPONs on frontend.
    function pendingCoupon(uint256 _pid, address _user) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accCouponPerShare = pool.accCouponPerShare;
        uint256 lpSupply = pool.lpToken.balanceOf(address(this));
        if (block.number > pool.lastRewardBlock && lpSupply != 0) {
            uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
            uint256 couponReward = multiplier.mul(couponPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
            accCouponPerShare = accCouponPerShare.add(couponReward.mul(1e12).div(lpSupply));
        }
        return user.amount.mul(accCouponPerShare).div(1e12).sub(user.rewardDebt) + user.lockedReward;
    }

    // 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.allocPoint == 0) {
            pool.lastRewardBlock = block.number;
            return;
        }
        uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
        uint256 couponReward = multiplier.mul(couponPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
        coupon.mint(devaddr, couponReward.div(10));
        coupon.mint(address(this), couponReward);
        pool.accCouponPerShare = pool.accCouponPerShare.add(couponReward.mul(1e12).div(lpSupply));
        pool.lastRewardBlock = block.number;
    }

    // Deposit LP tokens to Cafeteria for Coupon allocation.
    function deposit(uint256 _pid, uint256 _amount) public nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        updatePool(_pid);

        uint256 pending = user.amount.mul(pool.accCouponPerShare).div(1e12).sub(user.rewardDebt) + user.lockedReward;
        if (pending > 0) {
            if (_amount == 0 || !pool.withdrawFee100) {
                safeCouponTransfer(msg.sender, pending);
                user.lockedReward = 0;
            } else {
                user.lockedReward = pending;
            }
        }

        if (_amount > 0) {
            pool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount);
            if (pool.depositFeeBP > 0){
                uint256 depositFee = _amount.mul(pool.depositFeeBP).div(10000);
                pool.lpToken.safeTransfer(feeAddress, depositFee);
                user.amount = user.amount.add(_amount).sub(depositFee);
            } else {
                user.amount = user.amount.add(_amount);
            }
        } else if (pool.withdrawFee100){
            pool.lpToken.safeTransfer(feeAddress, user.amount);
            user.amount = 0;
        }
        user.rewardDebt = user.amount.mul(pool.accCouponPerShare).div(1e12);
        emit Deposit(msg.sender, _pid, _amount);
    }

    // Withdraw LP tokens from Cafeteria.
    function withdraw(uint256 _pid, uint256 _amount) public nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        require(user.amount >= _amount, "invalid amount");
        require(!pool.withdrawFee100, "harvest only");
        updatePool(_pid);
        uint256 pending = user.amount.mul(pool.accCouponPerShare).div(1e12).sub(user.rewardDebt) + user.lockedReward;
        if (pending > 0) {
            safeCouponTransfer(msg.sender, pending);
            user.lockedReward = 0;
        }
        if (_amount > 0) {
            user.amount = user.amount.sub(_amount);
            pool.lpToken.safeTransfer(address(msg.sender), _amount);
        }
        user.rewardDebt = user.amount.mul(pool.accCouponPerShare).div(1e12);
        emit Withdraw(msg.sender, _pid, _amount);
    }

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

    // Safe coupon transfer function, just in case if rounding error causes pool to not have enough COUPONs.
    function safeCouponTransfer(address _to, uint256 _amount) internal {
        uint256 couponBal = coupon.balanceOf(address(this));
        bool transferSuccess = false;
        if (_amount > couponBal) {
            transferSuccess = coupon.transfer(_to, couponBal);
        } else {
            transferSuccess = coupon.transfer(_to, _amount);
        }
        require(transferSuccess, "transfer failed");
    }

    // Update dev address by the previous dev.
    function dev(address _devaddr) public {
        require(msg.sender == devaddr, "dev: wut?");
        devaddr = _devaddr;
        emit SetDevAddress(msg.sender, _devaddr);
    }

    function setFeeAddress(address _feeAddress) public {
        require(msg.sender == feeAddress, "nope");
        feeAddress = _feeAddress;
        emit SetFeeAddress(msg.sender, _feeAddress);
    }

    // Foodcourt has to add hidden dummy pools inorder to alter the emission, here we make it simple and transparent to all.
    function updateEmissionRate(uint256 _couponPerBlock) public onlyOwner {
        massUpdatePools();
        couponPerBlock = _couponPerBlock;
        emit UpdateEmissionRate(msg.sender, _couponPerBlock);
    }
}

File 2 of 8 : IBEP20.sol
pragma solidity >=0.6.4;

interface IBEP20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the token decimals.
     */
    function decimals() external view returns (uint8);

    /**
     * @dev Returns the token symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the token name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the bep token owner.
     */
    function getOwner() external view returns (address);

    /**
     * @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 8 : SafeBEP20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IBEP20.sol";
import "./SafeMath.sol";
import "./Address.sol";

/**
 * @title SafeBEP20
 * @dev Wrappers around BEP20 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 SafeBEP20 for IBEP20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeBEP20 {
    using SafeMath for uint256;
    using Address for address;

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

    function safeTransferFrom(IBEP20 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
     * {IBEP20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IBEP20 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),
            "SafeBEP20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

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

    function safeDecreaseAllowance(IBEP20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeBEP20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IBEP20 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, "SafeBEP20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeBEP20: BEP20 operation did not succeed");
        }
    }
}

File 4 of 8 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

File 5 of 8 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(_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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

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

File 6 of 8 : ReentrancyGuard.sol
pragma solidity >=0.6.0 <0.8.0;


/**
 * @title Helps contracts guard against reentrancy attacks.
 * @author Remco Bloemen <[email protected]π.com>, Eenae <[email protected]>
 * @dev If you mark a function `nonReentrant`, you should also
 * mark it `external`.
 */
contract ReentrancyGuard {

  /// @dev counter to allow mutex lock with only one SSTORE operation
  uint256 private _guardCounter = 1;

  /**
   * @dev Prevents a contract from calling itself, directly or indirectly.
   * If you mark a function `nonReentrant`, you should also
   * mark it `external`. Calling one `nonReentrant` function from
   * another is not supported. Instead, you can implement a
   * `private` function doing the actual work, and an `external`
   * wrapper marked as `nonReentrant`.
   */
  modifier nonReentrant() {
    _guardCounter += 1;
    uint256 localCounter = _guardCounter;
    _;
    require(localCounter == _guardCounter);
  }

}

File 7 of 8 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <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;
        // solhint-disable-next-line no-inline-assembly
        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");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 8 of 8 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_coupon","type":"address"},{"internalType":"address","name":"_devaddr","type":"address"},{"internalType":"address","name":"_feeAddress","type":"address"},{"internalType":"uint256","name":"_couponPerBlock","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":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetDevAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetFeeAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"goosePerBlock","type":"uint256"}],"name":"UpdateEmissionRate","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":[],"name":"BONUS_MULTIPLIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IBEP20","name":"_lpToken","type":"address"},{"internalType":"uint16","name":"_depositFeeBP","type":"uint16"},{"internalType":"bool","name":"_withdrawFee100","type":"bool"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"coupon","outputs":[{"internalType":"contract IMintableERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"couponPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_devaddr","type":"address"}],"name":"dev","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"devaddr","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_from","type":"uint256"},{"internalType":"uint256","name":"_to","type":"uint256"}],"name":"getMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"pendingCoupon","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IBEP20","name":"","type":"address"}],"name":"poolExistence","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IBEP20","name":"lpToken","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accCouponPerShare","type":"uint256"},{"internalType":"uint16","name":"depositFeeBP","type":"uint16"},{"internalType":"bool","name":"withdrawFee100","type":"bool"}],"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":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"uint16","name":"_depositFeeBP","type":"uint16"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeAddress","type":"address"}],"name":"setFeeAddress","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":"_couponPerBlock","type":"uint256"}],"name":"updateEmissionRate","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"},{"internalType":"uint256","name":"lockedReward","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"}]

608060405260018055600060085534801561001957600080fd5b506040516120b33803806120b3833981810160405260a081101561003c57600080fd5b5080516020820151604083015160608401516080909401519293919290919060006100656100fb565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600280546001600160a01b03199081166001600160a01b0397881617909155600380548216958716959095179094556005805490941692909416919091179091556004556009556100ff565b3390565b611fa58061010e6000396000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c806386e7603e116100ee57806393f1a40b11610097578063d963842211610071578063d963842214610434578063dc9464b914610469578063e2bbb158146104af578063f2fde38b146104d2576101ae565b806393f1a40b146103a8578063cbd258b5146103f2578063d49e77cd1461042c576101ae565b80638d88a90e116100c85780638d88a90e146103575780638da5cb5b1461037d5780638dbb1e3a14610385576101ae565b806386e7603e146102fd5780638705fcd4146103295780638aa285501461034f576101ae565b806348cd4cb11161015b57806355c013451161013557806355c01345146102dd578063630b5ba1146102e5578063715018a6146102ed5780637635ed3c146102f5576101ae565b806348cd4cb11461029b57806351eb05a6146102a35780635312ea8e146102c0576101ae565b806317caf6f11161018c57806317caf6f11461024c5780634127535814610254578063441a3e7014610278576101ae565b8063081e3eda146101b35780630ba84cd2146101cd5780631526fe27146101ec575b600080fd5b6101bb6104f8565b60408051918252519081900360200190f35b6101ea600480360360208110156101e357600080fd5b50356104fe565b005b6102096004803603602081101561020257600080fd5b50356105ae565b604080516001600160a01b039097168752602087019590955285850193909352606085019190915261ffff166080840152151560a0830152519081900360c00190f35b6101bb610605565b61025c61060b565b604080516001600160a01b039092168252519081900360200190f35b6101ea6004803603604081101561028e57600080fd5b508035906020013561061a565b6101bb61080e565b6101ea600480360360208110156102b957600080fd5b5035610814565b6101ea600480360360208110156102d657600080fd5b5035610a63565b61025c610b22565b6101ea610b31565b6101ea610b50565b6101bb610c04565b6101bb6004803603604081101561031357600080fd5b50803590602001356001600160a01b0316610c0a565b6101ea6004803603602081101561033f57600080fd5b50356001600160a01b0316610d70565b6101bb610e1d565b6101ea6004803603602081101561036d57600080fd5b50356001600160a01b0316610e22565b61025c610ecd565b6101bb6004803603604081101561039b57600080fd5b5080359060200135610edc565b6103d4600480360360408110156103be57600080fd5b50803590602001356001600160a01b0316610ef4565b60408051938452602084019290925282820152519081900360600190f35b6104186004803603602081101561040857600080fd5b50356001600160a01b0316610f20565b604080519115158252519081900360200190f35b61025c610f35565b6101ea6004803603608081101561044a57600080fd5b5080359060208101359061ffff60408201351690606001351515610f44565b6101ea600480360360a081101561047f57600080fd5b508035906001600160a01b036020820135169061ffff604082013516906060810135151590608001351515611163565b6101ea600480360360408110156104c557600080fd5b508035906020013561143b565b6101ea600480360360208110156104e857600080fd5b50356001600160a01b0316611635565b60065490565b61050661173f565b6000546001600160a01b03908116911614610568576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b610570610b31565b600481905560408051828152905133917fe2492e003bbe8afa53088b406f0c1cb5d9e280370fc72a74cf116ffd343c4053919081900360200190a250565b600681815481106105bb57fe5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b0390931694509092909161ffff81169062010000900460ff1686565b60085481565b6005546001600160a01b031681565b6001805481019081905560068054600091908590811061063657fe5b6000918252602080832087845260078252604080852033865290925292208054600590920290920192508411156106b4576040805162461bcd60e51b815260206004820152600e60248201527f696e76616c696420616d6f756e74000000000000000000000000000000000000604482015290519081900360640190fd5b600482015462010000900460ff1615610714576040805162461bcd60e51b815260206004820152600c60248201527f68617276657374206f6e6c790000000000000000000000000000000000000000604482015290519081900360640190fd5b61071d85610814565b6000816002015461075c836001015461075664e8d4a510006107508860030154886000015461174390919063ffffffff16565b9061179c565b906117de565b01905080156107775761076f3382611820565b600060028301555b84156107a157815461078990866117de565b825582546107a1906001600160a01b03163387611a03565b600383015482546107bc9164e8d4a510009161075091611743565b6001830155604080518681529051879133917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a3505050600154811461080957600080fd5b505050565b60095481565b60006006828154811061082357fe5b90600052602060002090600502019050806002015443116108445750610a60565b8054604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561088e57600080fd5b505afa1580156108a2573d6000803e3d6000fd5b505050506040513d60208110156108b857600080fd5b505190508015806108cb57506001820154155b156108dd575043600290910155610a60565b60006108ed836002015443610edc565b9050600061091a60085461075086600101546109146004548761174390919063ffffffff16565b90611743565b6002546003549192506001600160a01b03908116916340c10f19911661094184600a61179c565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561098757600080fd5b505af115801561099b573d6000803e3d6000fd5b5050600254604080517f40c10f190000000000000000000000000000000000000000000000000000000081523060048201526024810186905290516001600160a01b0390921693506340c10f19925060448082019260009290919082900301818387803b158015610a0b57600080fd5b505af1158015610a1f573d6000803e3d6000fd5b50505050610a4d610a428461075064e8d4a510008561174390919063ffffffff16565b600386015490611a6a565b6003850155505043600290920191909155505b50565b60018054810190819055600680546000919084908110610a7f57fe5b60009182526020808320868452600782526040808520338087529352842080548582556001820186905560028201959095556005909302018054909450919291610ad6916001600160a01b03919091169083611a03565b604080518281529051869133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959181900360200190a35050506001548114610b1e57600080fd5b5050565b6002546001600160a01b031681565b60065460005b81811015610b1e57610b4881610814565b600101610b37565b610b5861173f565b6000546001600160a01b03908116911614610bba576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60045481565b60008060068481548110610c1a57fe5b600091825260208083208784526007825260408085206001600160a01b0389811687529084528186206005959095029092016003810154815483516370a0823160e01b815230600482015293519298509596909590949316926370a082319260248082019391829003018186803b158015610c9457600080fd5b505afa158015610ca8573d6000803e3d6000fd5b505050506040513d6020811015610cbe57600080fd5b5051600285015490915043118015610cd557508015155b15610d35576000610cea856002015443610edc565b90506000610d1160085461075088600101546109146004548761174390919063ffffffff16565b9050610d30610d29846107508464e8d4a51000611743565b8590611a6a565b935050505b8260020154610d62846001015461075664e8d4a5100061075087896000015461174390919063ffffffff16565b019450505050505b92915050565b6005546001600160a01b03163314610dd1576040805162461bcd60e51b8152602060048083019190915260248201527f6e6f706500000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600580546001600160a01b0319166001600160a01b03831690811790915560405133907fd44190acf9d04bdb5d3a1aafff7e6dee8b40b93dfb8c5d3f0eea4b9f4539c3f790600090a350565b600181565b6003546001600160a01b03163314610e81576040805162461bcd60e51b815260206004820152600960248201527f6465763a207775743f0000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b03831690811790915560405133907f618c54559e94f1499a808aad71ee8729f8e74e8c48e979616328ce493a1a52e790600090a350565b6000546001600160a01b031690565b6000610eed600161091484866117de565b9392505050565b600760209081526000928352604080842090915290825290208054600182015460029092015490919083565b600a6020526000908152604090205460ff1681565b6003546001600160a01b031681565b610f4c61173f565b6000546001600160a01b03908116911614610fae576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6127108261ffff161115611009576040805162461bcd60e51b815260206004820181905260248201527f696e76616c6964206465706f7369742066656520626173697320706f696e7473604482015290519081900360640190fd5b801561101757611017610b31565b6110548361104e6006878154811061102b57fe5b9060005260206000209060050201600101546008546117de90919063ffffffff16565b90611a6a565b600881905550826006858154811061106857fe5b906000526020600020906005020160010181905550816006858154811061108b57fe5b906000526020600020906005020160040160006101000a81548161ffff021916908361ffff1602179055508260001415611110576000600a6000600687815481106110d257fe5b60009182526020808320600592909202909101546001600160a01b031683528201929092526040019020805460ff191691151591909117905561115d565b6001600a60006006878154811061112357fe5b60009182526020808320600592909202909101546001600160a01b031683528201929092526040019020805460ff19169115159190911790555b50505050565b61116b61173f565b6000546001600160a01b039081169116146111cd576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0384166000908152600a6020526040902054849060ff161561123d576040805162461bcd60e51b815260206004820152600a60248201527f6475706c69636174656400000000000000000000000000000000000000000000604482015290519081900360640190fd5b6127108461ffff161115611298576040805162461bcd60e51b815260206004820181905260248201527f696e76616c6964206465706f7369742066656520626173697320706f696e7473604482015290519081900360640190fd5b81156112a6576112a6610b31565b600060095443116112b9576009546112bb565b435b6008549091506112cb9088611a6a565b6008556001600160a01b039586166000818152600a60209081526040808320805460ff19166001908117909155815160c0810183529485529184019a8b5283019384526060830182815261ffff9889166080850190815297151560a08501908152600680549384018155909352925160059091027ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f8101805492909a166001600160a01b03199092169190911790985597517ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d4088015590517ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d41870155517ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d428601555050517ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d43909201805493511515620100000262ff0000199390921661ffff199094169390931791909116179055565b6001805481019081905560068054600091908590811061145757fe5b6000918252602080832087845260078252604080852033865290925292206005909102909101915061148885610814565b600081600201546114bb836001015461075664e8d4a510006107508860030154886000015461174390919063ffffffff16565b01905080156114ff578415806114dc5750600483015462010000900460ff16155b156114f7576114eb3382611820565b600060028301556114ff565b600282018190555b841561159657825461151c906001600160a01b0316333088611ac4565b600483015461ffff1615611582576004830154600090611549906127109061075090899061ffff16611743565b6005548554919250611568916001600160a01b03908116911683611a03565b825461157a9082906107569089611a6a565b835550611591565b815461158e9086611a6a565b82555b6115cd565b600483015462010000900460ff16156115cd57600554825484546115c8926001600160a01b0391821692911690611a03565b600082555b600383015482546115e89164e8d4a510009161075091611743565b6001830155604080518681529051879133917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a3505050600154811461080957600080fd5b61163d61173f565b6000546001600160a01b0390811691161461169f576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166116e45760405162461bcd60e51b8152600401808060200182810382526026815260200180611f036026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b60008261175257506000610d6a565b8282028284828161175f57fe5b0414610eed5760405162461bcd60e51b8152600401808060200182810382526021815260200180611f4f6021913960400191505060405180910390fd5b6000610eed83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b4c565b6000610eed83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bee565b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561186b57600080fd5b505afa15801561187f573d6000803e3d6000fd5b505050506040513d602081101561189557600080fd5b5051905060008183111561192c576002546040805163a9059cbb60e01b81526001600160a01b038781166004830152602482018690529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156118f957600080fd5b505af115801561190d573d6000803e3d6000fd5b505050506040513d602081101561192357600080fd5b505190506119b1565b6002546040805163a9059cbb60e01b81526001600160a01b038781166004830152602482018790529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561198257600080fd5b505af1158015611996573d6000803e3d6000fd5b505050506040513d60208110156119ac57600080fd5b505190505b8061115d576040805162461bcd60e51b815260206004820152600f60248201527f7472616e73666572206661696c65640000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052610809908490611c48565b600082820183811015610eed576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017905261115d908590611c48565b60008183611bd85760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611b9d578181015183820152602001611b85565b50505050905090810190601f168015611bca5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611be457fe5b0495945050505050565b60008184841115611c405760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611b9d578181015183820152602001611b85565b505050900390565b6060611c9d826040518060400160405280602081526020017f5361666542455032303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611cf99092919063ffffffff16565b80519091501561080957808060200190516020811015611cbc57600080fd5b50516108095760405162461bcd60e51b815260040180806020018281038252602a815260200180611ed9602a913960400191505060405180910390fd5b6060611d088484600085611d10565b949350505050565b606082471015611d515760405162461bcd60e51b8152600401808060200182810382526026815260200180611f296026913960400191505060405180910390fd5b611d5a85611e6c565b611dab576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310611dea5780518252601f199092019160209182019101611dcb565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611e4c576040519150601f19603f3d011682016040523d82523d6000602084013e611e51565b606091505b5091509150611e61828286611e72565b979650505050505050565b3b151590565b60608315611e81575081610eed565b825115611e915782518084602001fd5b60405162461bcd60e51b8152602060048201818152845160248401528451859391928392604401919085019080838360008315611b9d578181015183820152602001611b8556fe5361666542455032303a204245503230206f7065726174696f6e20646964206e6f7420737563636565644f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220feecd1af8c71854f8976c3feac57e0e9b60ed7f3c0f477d18adb9c29e8abaa8d64736f6c634300060c0033000000000000000000000000084bb94e93891d74579b54ab63ed24c4ef9cd5ef000000000000000000000000f00d60f98e9e2c0de57ef7aab62a087aab69b9df000000000000000000000000f00d60f98e9e2c0de57ef7aab62a087aab69b9df0000000000000000000000000000000000000000000000022b1c8c1227a0000000000000000000000000000000000000000000000000000000000000007dbb7f

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

000000000000000000000000084bb94e93891d74579b54ab63ed24c4ef9cd5ef000000000000000000000000f00d60f98e9e2c0de57ef7aab62a087aab69b9df000000000000000000000000f00d60f98e9e2c0de57ef7aab62a087aab69b9df0000000000000000000000000000000000000000000000022b1c8c1227a0000000000000000000000000000000000000000000000000000000000000007dbb7f

-----Decoded View---------------
Arg [0] : _coupon (address): 0x084bb94e93891d74579b54ab63ed24c4ef9cd5ef
Arg [1] : _devaddr (address): 0xf00d60f98e9e2c0de57ef7aab62a087aab69b9df
Arg [2] : _feeAddress (address): 0xf00d60f98e9e2c0de57ef7aab62a087aab69b9df
Arg [3] : _couponPerBlock (uint256): 40000000000000000000
Arg [4] : _startBlock (uint256): 8239999

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000084bb94e93891d74579b54ab63ed24c4ef9cd5ef
Arg [1] : 000000000000000000000000f00d60f98e9e2c0de57ef7aab62a087aab69b9df
Arg [2] : 000000000000000000000000f00d60f98e9e2c0de57ef7aab62a087aab69b9df
Arg [3] : 0000000000000000000000000000000000000000000000022b1c8c1227a00000
Arg [4] : 00000000000000000000000000000000000000000000000000000000007dbb7f


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