Contract 0xb7881F5142245531C3fB938a37b5D2489EFd2C01 1

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x1b7dd21cf54539acb78dcbe742e64a56ed98e91bad3ac3dc15c4e245b5ca5546Deposit133006102021-12-08 16:22:221 min ago0xb5741ea8e6f274750224042755ce83cb03e06dbf IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.00156136
0x4835c668e08185bfc828aba908cb5002053625607de719646fb8a908f518f19cDeposit133006082021-12-08 16:22:161 min ago0x23a6a94c91d722e982c06eed77fedf3a2a1fe313 IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.00544574
0xaca5a4798dbce7790d87d514879f101bb2564d33f5af378ba6338fee917c5cebDeposit133006052021-12-08 16:22:072 mins ago0xf076df63cad8fbcdadf0270df21a384b074a9bfa IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.005668645
0x2c4c10d6e71a539c211fc8d2e222ca8adcbe49b9ebde1e71bec9f7bbfd5e1476Deposit133005872021-12-08 16:21:133 mins ago0x216b1438a83dea629932ce1cd9c31e8c2c6bfb20 IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.00544493
0x0627551d8c830a20b9d8e99060496bdd4b82ff45569e3e7a261b0231b19172e7Deposit133005852021-12-08 16:21:073 mins ago0xe0c8a920512f50f0391f786a3e0f7898e3ce5a81 IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.00156136
0x0f81bc93f4402746e87ccaec908356d593905cbdcc049272f7db6e6e110aa6e8Withdraw133005802021-12-08 16:20:503 mins ago0xa6f201c3c69fa5328e64e4e8a3e8d259b6e0a219 IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.006512025
0xaf7a7dc852c807fdde0c47e23e3807210c56994f8df47e8e25f6c8b0a27b1bfdDeposit133004752021-12-08 16:14:549 mins ago0x856c1b5b51fb36268917813046691ccf0d49d72e IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.005468055
0x44aaf5b0dc342221ac27eb0ec1506839c22d1dede8235c58ea2ec6196fe278d8Deposit133004612021-12-08 16:14:1210 mins ago0x65cabe1ced057d5d718ca17f60346550975075a8 IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.005597415
0x210a88b33aaa520e8689cd0758e9ea9ebb2563bc8af4e1dd1fb73940180bbe11Deposit133004072021-12-08 16:11:3012 mins ago0x7e49659d21b7e212d7c98434f35f70ba2854438f IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.006438705
0xde5c88b04026b5a9cc2e59f205e0e2524fd818172738cd377ec64c9ff8eb7a9aDeposit133003912021-12-08 16:10:4213 mins ago0x83efb588a8370cf1ca760146e53cae5e06215161 IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.005596580115
0x19bd24f8e384e7168c9a588b66fedad759ecb981e70c83871158563b0ef235cfDeposit133003412021-12-08 16:08:1116 mins ago0xd94fa2d0854bc71655a007b17ae748628e58fdf5 IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.0046436418
0x172516cc7c79c4b5acdc6ef2a53c4bcef6b6c9788bd77b632427686f3889249aDeposit133003302021-12-08 16:07:3816 mins ago0xdc5fba8344160d29b71347ac7af4725aa4cdffc3 IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.00544574
0xe8770c594149d53e9779457d9a5da556d5f6fbda3332203eb7996b29b8ba544aDeposit133002952021-12-08 16:05:5318 mins ago0x96953d43f62f4cdb07fc13c036498c2d9bc62e0a IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.005514125
0x315de7b391855a3990b3060c0263f78fddcd2e0f9024608f60f2dd1f5154e861Withdraw133002852021-12-08 16:05:2318 mins ago0x2ebc117ed3e51802446389ec3964c1cffb8e979f IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.00627976
0xe1148d03d6e467c1290863fc851d9a31a813c850480fe1d4eb36e4046dafd677Deposit133002852021-12-08 16:05:2318 mins ago0xbd91b1da931b87e4fafa35e63df8f063bbbd3e2c IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.005596580115
0xbc263b4b367d9651367f4310fc8a39e31cb5892d57d6c1ca03584ff48709cdd7Deposit133002832021-12-08 16:05:1718 mins ago0x158e8b23e27442ee5abccdb57561953b29033876 IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.0046436418
0x154357695a95cbbfa364efc4b454a23d5a436bee225acd0363d6db8c51a181a4Withdraw133002702021-12-08 16:04:3819 mins ago0x83efb588a8370cf1ca760146e53cae5e06215161 IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.00556771131
0x4be545661a8e898563c5689c77bf6c58066f486c7d20d5eae15392beace780d7Deposit133002512021-12-08 16:03:4120 mins ago0xcbfb06bc845acd0936ceb671407561a441cfcbd8 IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.00156136
0x8cca045489a054d390c9625d7074a5de5bf66ddb5b6bf0af20b29d62777a94d4Deposit133002402021-12-08 16:03:0821 mins ago0x4733da8988c4d93a8209fb8c8f2a12075493032e IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.00552151
0xb558db32d5141e5975f65456595f7cfebafcbabd206beb349d486f1a6a610d1eDeposit133002152021-12-08 16:01:5322 mins ago0xa2d36f11e2225d1b89146f443350e825f15b8b68 IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.006588225
0x8dfe6c5e8494204affe4affb7910b6e88daf22db6d48a378d00991394be349f5Deposit133002092021-12-08 16:01:3522 mins ago0x835232c2167f160342264caf0365e64c418e44af IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.005596644375
0x79f748fbbe7d41db390889806e18d8ecb73a2b9fe661489b7ebe4535b20debdfDeposit133002072021-12-08 16:01:2922 mins ago0x3000078da12a11431385cfeaf0c9bad7155ad7f2 IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.004163125
0x5acf22d75f1694166b48bc787581b7cad114b5d9090fe0dd7aecd90c01efc59cDeposit133001922021-12-08 16:00:4423 mins ago0xc65f71a1cb1d4bc8a13a7e21c06367848436a490 IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.00692034
0x394d28fdba817b4eff2054e110f72c22f04bfad1723c30ecf6340f200cfaf32aDeposit133001802021-12-08 16:00:0824 mins ago0x51e4fba5bfdbb385a03dd522450f99d4b1a09663 IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.006438645
0x214dcf4d39aa8e03ddd0a336acaf7b57cf9caba38581dd119a443904faadd34aDeposit133001792021-12-08 16:00:0524 mins ago0x5d1b37644943f93f7728c27ea23e73d9c49dff9f IN  0xb7881f5142245531c3fb938a37b5d2489efd2c010 BNB0.007511265
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MarsFarmV2

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 14 : MarsFarmV2.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "./interfaces/IVestingMaster.sol";
import "./interfaces/IMarsFarmV2.sol";
import "./interfaces/IStrategy.sol";
import "./refs/CoreRef.sol";

contract MarsFarmV2 is IMarsFarmV2, ReentrancyGuard, CoreRef {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    address public immutable override tokenAddress;
    uint256 public immutable override startBlock;
    uint256 public override tokenPerBlock;
    uint256 public override endBlock;

    PoolInfo[] public override poolInfo;
    mapping(uint256 => mapping(address => UserInfo)) public override userInfo;
    uint256 public override totalAllocPoint = 0;

    IVestingMaster public override vestingMaster;
    mapping(IERC20 => bool) public override poolExistence;

    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 UpdateEmissionRate(address indexed user, uint256 tokenPerBlock);
    event UpdateEndBlock(address indexed user, uint256 endBlock);

    constructor(
        address _core,
        address _vestingMaster,
        address _token,
        uint256 _tokenPerBlock,
        uint256 _startBlock,
        uint256 _endBlock
    ) public CoreRef(_core) {
        require(
            _token != address(0),
            "MarsFarmV2::constructor: Zero address"
        );
        require(
            _startBlock < _endBlock,
            "MarsFarmV2::constructor: End less than start"
        );
        vestingMaster = IVestingMaster(_vestingMaster);
        tokenAddress = _token;
        tokenPerBlock = _tokenPerBlock;
        startBlock = _startBlock;
        endBlock = _endBlock;
    }

    modifier nonDuplicated(IERC20 _want) {
        require(
            !poolExistence[_want],
            "MarsFarmV2::nonDuplicated: Duplicated"
        );
        _;
    }

    modifier validatePid(uint256 _pid) {
        require(
            _pid < poolInfo.length,
            "MarsFarmV2::validatePid: Not exist"
        );
        _;
    }

    function setVestingMaster(address _vestingMaster) public override onlyGovernor {
        vestingMaster = IVestingMaster(_vestingMaster);
    }

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

    function add(
        uint256 _allocPoint,
        IERC20 _want,
        bool _withUpdate,
        address _strat
    )
        public
        override
        onlyGuardianOrGovernor
        nonDuplicated(_want)
    {
        require(
            block.number < endBlock,
            "MarsFarmV2::add: Exceed endblock"
        );

        if (_withUpdate) {
            massUpdatePools();
        }
        uint256 lastRewardBlock =
            block.number > startBlock ? block.number : startBlock;
        totalAllocPoint = totalAllocPoint.add(_allocPoint);
        poolInfo.push(
            PoolInfo({
                want: _want,
                allocPoint: _allocPoint,
                lastRewardBlock: lastRewardBlock,
                accTokenPerShare: 0,
                strat: _strat
            })
        );
        poolExistence[_want] = true;
    }

    function set(
        uint256 _pid,
        uint256 _allocPoint,
        bool _withUpdate
    )
        public
        override
        onlyGuardianOrGovernor
        validatePid(_pid)
    {
        if (_withUpdate) {
            massUpdatePools();
        }
        totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(
            _allocPoint
        );
        poolInfo[_pid].allocPoint = _allocPoint;
    }

    function getMultiplier(uint256 _from, uint256 _to)
        public
        override
        pure
        returns (uint256)
    {
        return _to.sub(_from);
    }

    function getTokenReward(uint256 _pid)
        internal
        view
        returns (uint256 tokenReward)
    {
        PoolInfo storage pool = poolInfo[_pid];
        require(
            pool.lastRewardBlock < block.number,
            "MarsFarmV2::getTokenReward: Must less than block number"
        );
        uint256 multiplier = getMultiplier(
            pool.lastRewardBlock,
            block.number >= endBlock ? endBlock : block.number
        );
        tokenReward = multiplier.mul(tokenPerBlock).mul(pool.allocPoint).div(
            totalAllocPoint
        );
    }

    function pendingToken(uint256 _pid, address _user)
        public
        override
        view
        validatePid(_pid)
        returns (uint256)
    {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accTokenPerShare = pool.accTokenPerShare;
        uint256 sharesTotal = IStrategy(pool.strat).sharesTotal();
        if (block.number > pool.lastRewardBlock && sharesTotal != 0) {
            uint256 tokenReward = getTokenReward(_pid);
            accTokenPerShare = accTokenPerShare.add(
                tokenReward.mul(1e12).div(sharesTotal)
            );
        }
        return user.shares.mul(accTokenPerShare).div(1e12).sub(user.rewardDebt);
    }

    function stakedWantTokens(uint256 _pid, address _user)
        external
        override
        view
        returns (uint256)
    {
        return userInfo[_pid][_user].shares;
    }

    function massUpdatePools() public override {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            updatePool(pid);
        }
    }

    function updatePool(uint256 _pid) public override validatePid(_pid) {
        PoolInfo storage pool = poolInfo[_pid];
        if (block.number <= pool.lastRewardBlock) {
            return;
        }
        if (pool.lastRewardBlock >= endBlock) {
            return;
        }
        uint256 lastRewardBlock = block.number >= endBlock ? endBlock : block.number;
        uint256 sharesTotal = IStrategy(pool.strat).sharesTotal();
        if (sharesTotal == 0 || pool.allocPoint == 0) {
            pool.lastRewardBlock = lastRewardBlock;
            return;
        }
        uint256 tokenReward = getTokenReward(_pid);
        pool.accTokenPerShare = pool.accTokenPerShare.add(
            tokenReward.mul(1e12).div(sharesTotal)
        );
        pool.lastRewardBlock = lastRewardBlock;
    }

    function deposit(uint256 _pid, uint256 _wantAmt)
        public
        override
        validatePid(_pid)
        nonReentrant
    {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        updatePool(_pid);
        if (user.shares > 0) {
            uint256 pending =
                user.shares.mul(pool.accTokenPerShare).div(1e12).sub(
                    user.rewardDebt
                );
            if (pending > 0) {
                uint256 locked;
                if (address(vestingMaster) != address(0)) {
                    locked = pending
                        .div(vestingMaster.lockedPeriodAmount().add(1))
                        .mul(vestingMaster.lockedPeriodAmount());
                }
                safeTokenTransfer(msg.sender, pending.sub(locked));
                if (locked > 0) {
                    uint256 actualAmount = safeTokenTransfer(
                        address(vestingMaster),
                        locked
                    );
                    vestingMaster.lock(msg.sender, actualAmount);
                }
            }
        }
        if (_wantAmt > 0) {
            pool.want.safeTransferFrom(
                address(msg.sender),
                address(this),
                _wantAmt
            );

            pool.want.safeIncreaseAllowance(pool.strat, _wantAmt);
            uint256 sharesAdded = IStrategy(pool.strat).deposit(_wantAmt);
            user.shares = user.shares.add(sharesAdded);
        }
        user.rewardDebt = user.shares.mul(pool.accTokenPerShare).div(1e12);
        emit Deposit(msg.sender, _pid, _wantAmt);
    }

    function withdraw(uint256 _pid, uint256 _wantAmt)
        public
        override
        validatePid(_pid)
        nonReentrant
    {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        updatePool(_pid);
        if (user.shares > 0) {
            uint256 pending =
                user.shares.mul(pool.accTokenPerShare).div(1e12).sub(
                    user.rewardDebt
                );
            if (pending > 0) {
                uint256 locked;
                if (address(vestingMaster) != address(0)) {
                    locked = pending
                        .div(vestingMaster.lockedPeriodAmount().add(1))
                        .mul(vestingMaster.lockedPeriodAmount());
                }
                safeTokenTransfer(msg.sender, pending.sub(locked));
                if (locked > 0) {
                    uint256 actualAmount = safeTokenTransfer(
                        address(vestingMaster),
                        locked
                    );
                    vestingMaster.lock(msg.sender, actualAmount);
                }
            }
        }

        if (_wantAmt > user.shares) {
            _wantAmt = user.shares;
        }
        if (_wantAmt > 0) {
            uint256 realAmt = IStrategy(pool.strat).withdraw(_wantAmt);
            if (realAmt > user.shares) {
                user.shares = 0;
                realAmt = user.shares;
            } else {
                user.shares = user.shares.sub(realAmt);
            }

            _wantAmt = realAmt;
            pool.want.safeTransfer(address(msg.sender), _wantAmt);
        }
        user.rewardDebt = user.shares.mul(pool.accTokenPerShare).div(1e12);
        emit Withdraw(msg.sender, _pid, _wantAmt);
    }

    function withdrawAll(uint256 _pid) public override {
        withdraw(_pid, uint256(-1));
    }

    function emergencyWithdraw(uint256 _pid)
        public
        override
        validatePid(_pid)
        nonReentrant
    {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        uint256 realAmt = IStrategy(pool.strat).withdraw(user.shares);
        if (realAmt > user.shares) {
            realAmt = user.shares;
        }
        user.shares = 0;
        user.rewardDebt = 0;
        pool.want.safeTransfer(address(msg.sender), realAmt);
        emit EmergencyWithdraw(msg.sender, _pid, realAmt);
    }

    function safeTokenTransfer(address _to, uint256 _amount)
        internal
        returns (uint256)
    {
        uint256 balance = IERC20(tokenAddress).balanceOf(address(this));
        uint256 amount;
        if (_amount > balance) {
            amount = balance;
        } else {
            amount = _amount;
        }

        require(
            IERC20(tokenAddress).transfer(_to, amount),
            "MarsFarmV2::safeTokenTransfer: Transfer failed"
        );
        return amount;
    }

    function updateTokenPerBlock(uint256 _tokenPerBlock)
        public
        override
        onlyGuardianOrGovernor
    {
        massUpdatePools();
        tokenPerBlock = _tokenPerBlock;
        emit UpdateEmissionRate(msg.sender, _tokenPerBlock);
    }

    function updateEndBlock(uint256 _endBlock)
        public
        override
        onlyGuardianOrGovernor
    {
        require(_endBlock > startBlock, "MarsFarmV2::updateEndBlock: Less");
        for (uint256 pid = 0; pid < poolInfo.length; ++pid) {
            require(
                _endBlock > poolInfo[pid].lastRewardBlock,
                "MarsFarmV2::updateEndBlock: Less"
            );
        }
        massUpdatePools();
        endBlock = _endBlock;
        emit UpdateEndBlock(msg.sender, _endBlock);
    }

    function sharesTotal(uint256 _pid)
        public
        override
        view
        validatePid(_pid)
        returns (uint256)
    {
        return IStrategy(poolInfo[_pid].strat).sharesTotal();
    }
}

File 2 of 14 : ICore.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.12;

interface ICore {
    function isGovernor(address _address) external view returns (bool);

    function isGuardian(address _address) external view returns (bool);

    function hasRole(bytes32 role, address account) external view returns (bool);
}

File 3 of 14 : IMarsFarmV2.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./IVestingMaster.sol";

interface IMarsFarmV2 {

    struct UserInfo {
        uint256 shares;
        uint256 rewardDebt;
    }

    struct PoolInfo {
        IERC20 want;
        uint256 allocPoint;
        uint256 lastRewardBlock;
        uint256 accTokenPerShare;
        address strat;
    }

    function tokenAddress() external view returns (address);

    function startBlock() external view returns (uint256);

    function tokenPerBlock() external view returns (uint256);

    function endBlock() external view returns (uint256);

    function poolInfo(uint256 _pid) external view returns (
        IERC20 want,
        uint256 allocPoint,
        uint256 lastRewardBlock,
        uint256 accTokenPerShare,
        address strat
    );

    function userInfo(uint256 _pid, address _account) external view returns (
        uint256 shares,
        uint256 rewardDebt
    );

    function totalAllocPoint() external view returns (uint256);

    function vestingMaster() external view returns (IVestingMaster);

    function poolExistence(IERC20 _lpToken) external view returns (bool);

    function poolLength() external view returns (uint256);

    function setVestingMaster(address _vestingMaster) external;

    function add(
        uint256 _allocPoint,
        IERC20 _want,
        bool _withUpdate,
        address _strat
    ) external;

    function set(
        uint256 _pid,
        uint256 _allocPoint,
        bool _withUpdate
    ) external;

    function getMultiplier(uint256 _from, uint256 _to) external pure returns (uint256);

    function pendingToken(uint256 _pid, address _user)
        external
        view
        returns (uint256);

    function stakedWantTokens(uint256 _pid, address _user)
        external
        view
        returns (uint256);

    function massUpdatePools() external;

    function updatePool(uint256 _pid) external;

    function deposit(uint256 _pid, uint256 _wantAmt) external;

    function withdraw(uint256 _pid, uint256 _wantAmt) external;

    function withdrawAll(uint256 _pid) external;

    function emergencyWithdraw(uint256 _pid) external;

    function updateTokenPerBlock(uint256 _tokenPerBlock) external;

    function updateEndBlock(uint256 _endBlock) external;

    function sharesTotal(uint256 _pid) external view returns (uint256);
}

File 4 of 14 : IStrategy.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

interface IStrategy {
    // Sum of all shares of users to wantLockedTotal
    function sharesTotal() external view returns (uint256);

    // Main want token compounding function
    function earn() external;

    // Transfer want tokens marsFarm -> strategy
    function deposit(uint256 _wantAmt)
        external
        returns (uint256);

    // Transfer want tokens strategy -> marsFarm
    function withdraw(uint256 _wantAmt)
        external
        returns (uint256);
}

File 5 of 14 : IVestingMaster.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IVestingMaster {
    struct LockedReward {
        uint256 locked;
        uint256 timestamp;
    }
    // ----------- Events -----------

    event Lock(address indexed user, uint256 amount);
    event Claim(address indexed user, uint256 amount);

    // ----------- Farms only State changing api -----------

    function lock(address, uint256) external;

    // ----------- state changing API -----------

    function claim() external;

    // ----------- Getters -----------

    function period() external view returns (uint256);

    function lockedPeriodAmount() external view returns (uint256);

    function vestingToken() external view returns (IERC20);

    function userLockedRewards(address account, uint256 idx)
        external
        view
        returns (uint256, uint256);

    function totalLockedRewards() external view returns (uint256);

    function getVestingAmount() external view returns (uint256, uint256);
}

File 6 of 14 : CoreRef.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

import "../interfaces/ICore.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/utils/Address.sol";

abstract contract CoreRef is Pausable {
    bytes32 public constant FARMS_ROLE =
        keccak256("FARMS_ROLE");

    event CoreUpdate(address indexed _core);

    ICore private _core;

    constructor(address core_) public {
        _core = ICore(core_);
    }

    modifier onlyGovernor() {
        require(
            _core.isGovernor(msg.sender),
            "CoreRef::onlyGovernor: Caller is not a governor"
        );
        _;
    }

    modifier onlyGuardianOrGovernor() {
        require(
            _core.isGovernor(msg.sender) || _core.isGuardian(msg.sender),
            "CoreRef::onlyGuardianOrGovernor: Caller is not a guardian or governor"
        );
        _;
    }

    modifier onlyFarms() {
        require(
            _core.hasRole(FARMS_ROLE, msg.sender),
            "xxx::xxx: Caller is not a farms"
        );
        _;
    }


    /// @notice Set new Core reference address
    /// @param core_ The new core address
    function setCore(address core_) external onlyGovernor {
        _core = ICore(core_);
        emit CoreUpdate(core_);
    }

    /// @notice Set pausable methods to paused
    function pause() public onlyGuardianOrGovernor {
        _pause();
    }

    /// @notice Set pausable methods to unpaused
    function unpause() public onlyGuardianOrGovernor {
        _unpause();
    }

    /// @notice Address of the Core contract referenced
    /// @return ICore implementation address
    function core() public view returns (ICore) {
        return _core;
    }

}

File 7 of 14 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), 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 {
        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 8 of 14 : 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, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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 (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

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

    /**
     * @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) {
        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, reverting 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) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

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

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * 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);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * 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);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * 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 9 of 14 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 10 of 14 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC20.sol";
import "../../math/SafeMath.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 SafeMath for uint256;
    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'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 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(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: 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(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
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 11 of 14 : 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);
    }

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(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 12 of 14 : 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;
    }
}

File 13 of 14 : Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor () internal {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 14 of 14 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_core","type":"address"},{"internalType":"address","name":"_vestingMaster","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_tokenPerBlock","type":"uint256"},{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256","name":"_endBlock","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_core","type":"address"}],"name":"CoreUpdate","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":"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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenPerBlock","type":"uint256"}],"name":"UpdateEmissionRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"endBlock","type":"uint256"}],"name":"UpdateEndBlock","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":"FARMS_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IERC20","name":"_want","type":"address"},{"internalType":"bool","name":"_withUpdate","type":"bool"},{"internalType":"address","name":"_strat","type":"address"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"core","outputs":[{"internalType":"contract ICore","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_wantAmt","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":"endBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"pure","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","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 IERC20","name":"want","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accTokenPerShare","type":"uint256"},{"internalType":"address","name":"strat","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"address","name":"core_","type":"address"}],"name":"setCore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vestingMaster","type":"address"}],"name":"setVestingMaster","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"sharesTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"stakedWantTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_endBlock","type":"uint256"}],"name":"updateEndBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenPerBlock","type":"uint256"}],"name":"updateTokenPerBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vestingMaster","outputs":[{"internalType":"contract IVestingMaster","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_wantAmt","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c060405260006006553480156200001657600080fd5b5060405162002e5738038062002e57833981810160405260c08110156200003c57600080fd5b508051602082015160408301516060840151608085015160a0909501516001600081905580546001600160a01b03808816610100026001600160a81b03199092169190911790915594959394929391928416620000cb5760405162461bcd60e51b815260040180806020018281038252602581526020018062002e326025913960400191505060405180910390fd5b8082106200010b5760405162461bcd60e51b815260040180806020018281038252602c81526020018062002e06602c913960400191505060405180910390fd5b600780546001600160a01b0319166001600160a01b03968716179055606084901b6001600160601b03191660805260029290925560a081905260039190915591169150612c8162000185600039806106bf5280610df752806114ce52806114f5525080611b44528061242c52806124db5250612c816000f3fe608060405234801561001057600080fd5b50600436106101e45760003560e01c80635f70edcf1161010f578063958e2d31116100a2578063cbd258b511610071578063cbd258b514610517578063da480fb71461053d578063e2bbb1581461055a578063f2f4eb261461057d576101e4565b8063958e2d31146104af5780639d76ea58146104cc578063ae0e597a146104d4578063c2ca2803146104f1576101e4565b806380009630116100de57806380009630146104195780638456cb591461043f5780638dbb1e3a1461044757806393f1a40b1461046a576101e4565b80635f70edcf1461037c578063630b5ba1146103ba57806364482f79146103c25780637b84daec146103ed576101e4565b80633f4ba83a1161018757806348e43af41161015657806348e43af4146102fa57806351eb05a6146103265780635312ea8e146103435780635c975abb14610360576101e4565b80633f4ba83a146102bf5780634198709a146102c7578063441a3e70146102cf57806348cd4cb1146102f2576101e4565b80631526fe27116101c35780631526fe271461022a57806317caf6f11461028b5780631eccdf07146102935780632f217b9a146102b7576101e4565b80626f0231146101e9578063081e3eda14610208578063083c632314610222575b600080fd5b610206600480360360208110156101ff57600080fd5b5035610585565b005b6102106107ff565b60408051918252519081900360200190f35b610210610805565b6102476004803603602081101561024057600080fd5b503561080b565b60405180866001600160a01b03168152602001858152602001848152602001838152602001826001600160a01b031681526020019550505050505060405180910390f35b610210610856565b61029b61085c565b604080516001600160a01b039092168252519081900360200190f35b61021061086b565b61020661088f565b6102106109d1565b610206600480360360408110156102e557600080fd5b50803590602001356109d7565b610210610df5565b6102106004803603604081101561031057600080fd5b50803590602001356001600160a01b0316610e19565b6102066004803603602081101561033c57600080fd5b5035610f8c565b6102066004803603602081101561035957600080fd5b5035611109565b6103686112cb565b604080519115158252519081900360200190f35b6102066004803603608081101561039257600080fd5b508035906001600160a01b0360208201358116916040810135151591606090910135166112d4565b610206611677565b610206600480360360608110156103d857600080fd5b50803590602081013590604001351515611696565b6102106004803603604081101561040357600080fd5b50803590602001356001600160a01b031661188a565b6102066004803603602081101561042f57600080fd5b50356001600160a01b03166118b4565b6102066119bc565b6102106004803603604081101561045d57600080fd5b5080359060200135611afc565b6104966004803603604081101561048057600080fd5b50803590602001356001600160a01b0316611b0f565b6040805192835260208301919091528051918290030190f35b610206600480360360208110156104c557600080fd5b5035611b33565b61029b611b42565b610206600480360360208110156104ea57600080fd5b5035611b66565b6102066004803603602081101561050757600080fd5b50356001600160a01b0316611ce4565b6103686004803603602081101561052d57600080fd5b50356001600160a01b0316611dbc565b6102106004803603602081101561055357600080fd5b5035611dd1565b6102066004803603604081101561057057600080fd5b5080359060200135611eb3565b61029b6121fc565b60015460408051631c86b03760e31b815233600482015290516101009092046001600160a01b03169163e43581b891602480820192602092909190829003018186803b1580156105d457600080fd5b505afa1580156105e8573d6000803e3d6000fd5b505050506040513d60208110156105fe57600080fd5b505180610682575060015460408051630c68ba2160e01b815233600482015290516101009092046001600160a01b031691630c68ba2191602480820192602092909190829003018186803b15801561065557600080fd5b505afa158015610669573d6000803e3d6000fd5b505050506040513d602081101561067f57600080fd5b50515b6106bd5760405162461bcd60e51b8152600401808060200182810382526045815260200180612baf6045913960600191505060405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000008111610731576040805162461bcd60e51b815260206004820181905260248201527f4d6172734661726d56323a3a757064617465456e64426c6f636b3a204c657373604482015290519081900360640190fd5b60005b6004548110156107b8576004818154811061074b57fe5b90600052602060002090600502016002015482116107b0576040805162461bcd60e51b815260206004820181905260248201527f4d6172734661726d56323a3a757064617465456e64426c6f636b3a204c657373604482015290519081900360640190fd5b600101610734565b506107c1611677565b600381905560408051828152905133917f316ee89ca026e5355cff2b64939ee0e5af49bde19b755b42bbde0f5bea039825919081900360200190a250565b60045490565b60035481565b6004818154811061081857fe5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b0393841695509193909290911685565b60065481565b6007546001600160a01b031681565b7f8dccd78a7a788294b7ed33d62f262d18c5ae7202afa10f64e038b0aaa0a3c9ee81565b60015460408051631c86b03760e31b815233600482015290516101009092046001600160a01b03169163e43581b891602480820192602092909190829003018186803b1580156108de57600080fd5b505afa1580156108f2573d6000803e3d6000fd5b505050506040513d602081101561090857600080fd5b50518061098c575060015460408051630c68ba2160e01b815233600482015290516101009092046001600160a01b031691630c68ba2191602480820192602092909190829003018186803b15801561095f57600080fd5b505afa158015610973573d6000803e3d6000fd5b505050506040513d602081101561098957600080fd5b50515b6109c75760405162461bcd60e51b8152600401808060200182810382526045815260200180612baf6045913960600191505060405180910390fd5b6109cf612210565b565b60025481565b60045482908110610a195760405162461bcd60e51b8152600401808060200182810382526022815260200180612ae16022913960400191505060405180910390fd5b60026000541415610a71576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260009081556004805485908110610a8657fe5b60009182526020808320878452600580835260408086203387529093529190932091029091019150610ab785610f8c565b805415610cbf576000610af88260010154610af264e8d4a51000610aec876003015487600001546122b090919063ffffffff16565b90612309565b90612370565b90508015610cbd576007546000906001600160a01b031615610c1857600754604080516302f4bde360e11b81529051610c15926001600160a01b0316916305e97bc6916004808301926020929190829003018186803b158015610b5a57600080fd5b505afa158015610b6e573d6000803e3d6000fd5b505050506040513d6020811015610b8457600080fd5b5051600754604080516302f4bde360e11b81529051610c0f92610c08926001926001600160a01b03909216916305e97bc691600480820192602092909190829003018186803b158015610bd657600080fd5b505afa158015610bea573d6000803e3d6000fd5b505050506040513d6020811015610c0057600080fd5b5051906123cd565b8590612309565b906122b0565b90505b610c2b33610c268484612370565b612427565b508015610cbb57600754600090610c4b906001600160a01b031683612427565b6007546040805163282d3fdf60e01b81523360048201526024810184905290519293506001600160a01b039091169163282d3fdf9160448082019260009290919082900301818387803b158015610ca157600080fd5b505af1158015610cb5573d6000803e3d6000fd5b50505050505b505b505b8054841115610ccd57805493505b8315610d925760048083015460408051632e1a7d4d60e01b8152928301879052516000926001600160a01b0390921691632e1a7d4d91602480830192602092919082900301818787803b158015610d2357600080fd5b505af1158015610d37573d6000803e3d6000fd5b505050506040513d6020811015610d4d57600080fd5b50518254909150811115610d6657506000808255610d75565b8154610d729082612370565b82555b82549094508490610d90906001600160a01b031633836125bf565b505b60038201548154610dad9164e8d4a5100091610aec916122b0565b6001820155604080518581529051869133917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a350506001600055505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60045460009083908110610e5e5760405162461bcd60e51b8152600401808060200182810382526022815260200180612ae16022913960400191505060405180910390fd5b600060048581548110610e6d57fe5b60009182526020808320888452600580835260408086206001600160a01b038b811688529085528187209590920290920160038101546004808301548551632251caaf60e11b8152955193995096979196919591909316936344a3955e938181019391829003018186803b158015610ee457600080fd5b505afa158015610ef8573d6000803e3d6000fd5b505050506040513d6020811015610f0e57600080fd5b5051600285015490915043118015610f2557508015155b15610f58576000610f3589612616565b9050610f54610f4d83610aec8464e8d4a510006122b0565b84906123cd565b9250505b610f808360010154610af264e8d4a51000610aec8688600001546122b090919063ffffffff16565b98975050505050505050565b60045481908110610fce5760405162461bcd60e51b8152600401808060200182810382526022815260200180612ae16022913960400191505060405180910390fd5b600060048381548110610fdd57fe5b9060005260206000209060050201905080600201544311610ffe5750611105565b6003548160020154106110115750611105565b60006003544310156110235743611027565b6003545b905060008260040160009054906101000a90046001600160a01b03166001600160a01b03166344a3955e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561107b57600080fd5b505afa15801561108f573d6000803e3d6000fd5b505050506040513d60208110156110a557600080fd5b505190508015806110b857506001830154155b156110c95750600290910155611105565b60006110d486612616565b90506110f76110ec83610aec8464e8d4a510006122b0565b6003860154906123cd565b600385015550506002909101555b5050565b6004548190811061114b5760405162461bcd60e51b8152600401808060200182810382526022815260200180612ae16022913960400191505060405180910390fd5b600260005414156111a3576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600090815560048054849081106111b857fe5b600091825260208083208684526005808352604080862033875284528086206004929095029092018181015485548451632e1a7d4d60e01b81529384015292519096509394936001600160a01b039290921692632e1a7d4d9260248084019382900301818787803b15801561122c57600080fd5b505af1158015611240573d6000803e3d6000fd5b505050506040513d602081101561125657600080fd5b50518254909150811115611268575080545b600080835560018301558254611288906001600160a01b031633836125bf565b604080518281529051869133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959181900360200190a350506001600055505050565b60015460ff1690565b60015460408051631c86b03760e31b815233600482015290516101009092046001600160a01b03169163e43581b891602480820192602092909190829003018186803b15801561132357600080fd5b505afa158015611337573d6000803e3d6000fd5b505050506040513d602081101561134d57600080fd5b5051806113d1575060015460408051630c68ba2160e01b815233600482015290516101009092046001600160a01b031691630c68ba2191602480820192602092909190829003018186803b1580156113a457600080fd5b505afa1580156113b8573d6000803e3d6000fd5b505050506040513d60208110156113ce57600080fd5b50515b61140c5760405162461bcd60e51b8152600401808060200182810382526045815260200180612baf6045913960600191505060405180910390fd5b6001600160a01b038316600090815260086020526040902054839060ff16156114665760405162461bcd60e51b8152600401808060200182810382526025815260200180612b696025913960400191505060405180910390fd5b60035443106114bc576040805162461bcd60e51b815260206004820181905260248201527f4d6172734661726d56323a3a6164643a2045786365656420656e64626c6f636b604482015290519081900360640190fd5b82156114ca576114ca611677565b60007f00000000000000000000000000000000000000000000000000000000000000004311611519577f000000000000000000000000000000000000000000000000000000000000000061151b565b435b60065490915061152b90876123cd565b6006556040805160a0810182526001600160a01b039687168082526020808301998a52828401948552600060608401818152978a16608085019081526004805460018181018355918452955160059096027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b81018054978e166001600160a01b03199889161790559c517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c8e015596517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d8d015597517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19e8c015596517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19f909a0180549a909916999092169890981790965595835260089094525092909220805460ff1916909117905550565b60045460005b818110156111055761168e81610f8c565b60010161167d565b60015460408051631c86b03760e31b815233600482015290516101009092046001600160a01b03169163e43581b891602480820192602092909190829003018186803b1580156116e557600080fd5b505afa1580156116f9573d6000803e3d6000fd5b505050506040513d602081101561170f57600080fd5b505180611793575060015460408051630c68ba2160e01b815233600482015290516101009092046001600160a01b031691630c68ba2191602480820192602092909190829003018186803b15801561176657600080fd5b505afa15801561177a573d6000803e3d6000fd5b505050506040513d602081101561179057600080fd5b50515b6117ce5760405162461bcd60e51b8152600401808060200182810382526045815260200180612baf6045913960600191505060405180910390fd5b600454839081106118105760405162461bcd60e51b8152600401808060200182810382526022815260200180612ae16022913960400191505060405180910390fd5b811561181e5761181e611677565b61185b836118556004878154811061183257fe5b90600052602060002090600502016001015460065461237090919063ffffffff16565b906123cd565b600681905550826004858154811061186f57fe5b90600052602060002090600502016001018190555050505050565b60008281526005602090815260408083206001600160a01b03851684529091529020545b92915050565b60015460408051631c86b03760e31b815233600482015290516101009092046001600160a01b03169163e43581b891602480820192602092909190829003018186803b15801561190357600080fd5b505afa158015611917573d6000803e3d6000fd5b505050506040513d602081101561192d57600080fd5b505161196a5760405162461bcd60e51b815260040180806020018281038252602f815260200180612b3a602f913960400191505060405180910390fd5b60018054610100600160a81b0319166101006001600160a01b038416908102919091179091556040517fad9400e618eb1344fde53db22397a1b82c765527ecbba3a5c86bcac15090828b90600090a250565b60015460408051631c86b03760e31b815233600482015290516101009092046001600160a01b03169163e43581b891602480820192602092909190829003018186803b158015611a0b57600080fd5b505afa158015611a1f573d6000803e3d6000fd5b505050506040513d6020811015611a3557600080fd5b505180611ab9575060015460408051630c68ba2160e01b815233600482015290516101009092046001600160a01b031691630c68ba2191602480820192602092909190829003018186803b158015611a8c57600080fd5b505afa158015611aa0573d6000803e3d6000fd5b505050506040513d6020811015611ab657600080fd5b50515b611af45760405162461bcd60e51b8152600401808060200182810382526045815260200180612baf6045913960600191505060405180910390fd5b6109cf6126c0565b6000611b088284612370565b9392505050565b60056020908152600092835260408084209091529082529020805460019091015482565b611b3f816000196109d7565b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b60015460408051631c86b03760e31b815233600482015290516101009092046001600160a01b03169163e43581b891602480820192602092909190829003018186803b158015611bb557600080fd5b505afa158015611bc9573d6000803e3d6000fd5b505050506040513d6020811015611bdf57600080fd5b505180611c63575060015460408051630c68ba2160e01b815233600482015290516101009092046001600160a01b031691630c68ba2191602480820192602092909190829003018186803b158015611c3657600080fd5b505afa158015611c4a573d6000803e3d6000fd5b505050506040513d6020811015611c6057600080fd5b50515b611c9e5760405162461bcd60e51b8152600401808060200182810382526045815260200180612baf6045913960600191505060405180910390fd5b611ca6611677565b600281905560408051828152905133917fe2492e003bbe8afa53088b406f0c1cb5d9e280370fc72a74cf116ffd343c4053919081900360200190a250565b60015460408051631c86b03760e31b815233600482015290516101009092046001600160a01b03169163e43581b891602480820192602092909190829003018186803b158015611d3357600080fd5b505afa158015611d47573d6000803e3d6000fd5b505050506040513d6020811015611d5d57600080fd5b5051611d9a5760405162461bcd60e51b815260040180806020018281038252602f815260200180612b3a602f913960400191505060405180910390fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60086020526000908152604090205460ff1681565b60045460009082908110611e165760405162461bcd60e51b8152600401808060200182810382526022815260200180612ae16022913960400191505060405180910390fd5b60048381548110611e2357fe5b906000526020600020906005020160040160009054906101000a90046001600160a01b03166001600160a01b03166344a3955e6040518163ffffffff1660e01b815260040160206040518083038186803b158015611e8057600080fd5b505afa158015611e94573d6000803e3d6000fd5b505050506040513d6020811015611eaa57600080fd5b50519392505050565b60045482908110611ef55760405162461bcd60e51b8152600401808060200182810382526022815260200180612ae16022913960400191505060405180910390fd5b60026000541415611f4d576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260009081556004805485908110611f6257fe5b60009182526020808320878452600580835260408086203387529093529190932091029091019150611f9385610f8c565b8054156120cf576000611fc88260010154610af264e8d4a51000610aec876003015487600001546122b090919063ffffffff16565b905080156120cd576007546000906001600160a01b03161561202d57600754604080516302f4bde360e11b8152905161202a926001600160a01b0316916305e97bc6916004808301926020929190829003018186803b158015610b5a57600080fd5b90505b61203b33610c268484612370565b5080156120cb5760075460009061205b906001600160a01b031683612427565b6007546040805163282d3fdf60e01b81523360048201526024810184905290519293506001600160a01b039091169163282d3fdf9160448082019260009290919082900301818387803b1580156120b157600080fd5b505af11580156120c5573d6000803e3d6000fd5b50505050505b505b505b83156121995781546120ec906001600160a01b0316333087612742565b6004820154825461210a916001600160a01b039182169116866127a2565b6004808301546040805163b6b55f2560e01b8152928301879052516000926001600160a01b039092169163b6b55f2591602480830192602092919082900301818787803b15801561215a57600080fd5b505af115801561216e573d6000803e3d6000fd5b505050506040513d602081101561218457600080fd5b5051825490915061219590826123cd565b8255505b600382015481546121b49164e8d4a5100091610aec916122b0565b6001820155604080518581529051869133917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a350506001600055505050565b60015461010090046001600160a01b031690565b6122186112cb565b612260576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61229361285b565b604080516001600160a01b039092168252519081900360200190a1565b6000826122bf575060006118ae565b828202828482816122cc57fe5b0414611b085760405162461bcd60e51b8152600401808060200182810382526021815260200180612b8e6021913960400191505060405180910390fd5b600080821161235f576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161236857fe5b049392505050565b6000828211156123c7576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082820183811015611b08576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561249757600080fd5b505afa1580156124ab573d6000803e3d6000fd5b505050506040513d60208110156124c157600080fd5b505190506000818411156124d65750806124d9565b50825b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb86836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561255057600080fd5b505af1158015612564573d6000803e3d6000fd5b505050506040513d602081101561257a57600080fd5b50516125b75760405162461bcd60e51b815260040180806020018281038252602e815260200180612c1e602e913960400191505060405180910390fd5b949350505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261261190849061285f565b505050565b6000806004838154811061262657fe5b90600052602060002090600502019050438160020154106126785760405162461bcd60e51b8152600401808060200182810382526037815260200180612b036037913960400191505060405180910390fd5b600061269b82600201546003544310156126925743612696565b6003545b611afc565b90506125b7600654610aec8460010154610c0f600254866122b090919063ffffffff16565b6126c86112cb565b1561270d576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861229361285b565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261279c90859061285f565b50505050565b600061280682856001600160a01b031663dd62ed3e30876040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b158015610bd657600080fd5b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905290915061279c90859061285f565b3390565b60606128b4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166129109092919063ffffffff16565b805190915015612611578080602001905160208110156128d357600080fd5b50516126115760405162461bcd60e51b815260040180806020018281038252602a815260200180612bf4602a913960400191505060405180910390fd5b60606125b784846000858561292485612a36565b612975576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106129b45780518252601f199092019160209182019101612995565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612a16576040519150601f19603f3d011682016040523d82523d6000602084013e612a1b565b606091505b5091509150612a2b828286612a3c565b979650505050505050565b3b151590565b60608315612a4b575081611b08565b825115612a5b5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612aa5578181015183820152602001612a8d565b50505050905090810190601f168015612ad25780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4d6172734661726d56323a3a76616c69646174655069643a204e6f742065786973744d6172734661726d56323a3a676574546f6b656e5265776172643a204d757374206c657373207468616e20626c6f636b206e756d626572436f72655265663a3a6f6e6c79476f7665726e6f723a2043616c6c6572206973206e6f74206120676f7665726e6f724d6172734661726d56323a3a6e6f6e4475706c6963617465643a204475706c696361746564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77436f72655265663a3a6f6e6c79477561726469616e4f72476f7665726e6f723a2043616c6c6572206973206e6f74206120677561726469616e206f7220676f7665726e6f725361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565644d6172734661726d56323a3a73616665546f6b656e5472616e736665723a205472616e73666572206661696c6564a2646970667358221220daeee4838c53eaee36a65fc3fb9e70afc5bb0844c1727c594d55e29e1e89baa464736f6c634300060c00334d6172734661726d56323a3a636f6e7374727563746f723a20456e64206c657373207468616e2073746172744d6172734661726d56323a3a636f6e7374727563746f723a205a65726f206164647265737300000000000000000000000000789cfb69499c65ac9a3a68fb4917c9b4fca2a7000000000000000000000000381facb9282770a5e3ac6c8637096b442039c3db0000000000000000000000007859b01bbf675d67da8cd128a50d155cd881b57600000000000000000000000000000000000000000000000605d27d5df1e600000000000000000000000000000000000000000000000000000000000000a0c61c0000000000000000000000000000000000000000000000000000000001dd2e1c

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

00000000000000000000000000789cfb69499c65ac9a3a68fb4917c9b4fca2a7000000000000000000000000381facb9282770a5e3ac6c8637096b442039c3db0000000000000000000000007859b01bbf675d67da8cd128a50d155cd881b57600000000000000000000000000000000000000000000000605d27d5df1e600000000000000000000000000000000000000000000000000000000000000a0c61c0000000000000000000000000000000000000000000000000000000001dd2e1c

-----Decoded View---------------
Arg [0] : _core (address): 0x00789cfb69499c65ac9a3a68fb4917c9b4fca2a7
Arg [1] : _vestingMaster (address): 0x381facb9282770a5e3ac6c8637096b442039c3db
Arg [2] : _token (address): 0x7859b01bbf675d67da8cd128a50d155cd881b576
Arg [3] : _tokenPerBlock (uint256): 111100000000000000000
Arg [4] : _startBlock (uint256): 10536476
Arg [5] : _endBlock (uint256): 31272476

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 00000000000000000000000000789cfb69499c65ac9a3a68fb4917c9b4fca2a7
Arg [1] : 000000000000000000000000381facb9282770a5e3ac6c8637096b442039c3db
Arg [2] : 0000000000000000000000007859b01bbf675d67da8cd128a50d155cd881b576
Arg [3] : 00000000000000000000000000000000000000000000000605d27d5df1e60000
Arg [4] : 0000000000000000000000000000000000000000000000000000000000a0c61c
Arg [5] : 0000000000000000000000000000000000000000000000000000000001dd2e1c


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.