Contract 0xd90A8878a2277879600AA2cba0CADC7E1a11354D 3

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xb5f5d2fb1d054979963bf94f18fc5af514b9b11fe1bf827794bdc0836f0efe3dDeposit118413802021-10-17 4:22:145 mins ago0x16f7d8390d678a56425b163f1a35c6888a9c7a40 IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00072655
0x31b973b1cec0e461fe511a3e3d1b3c4e671e70bbfa454fadc27cd07a9eebaa97Deposit118411662021-10-17 4:11:3216 mins ago0x16f7d8390d678a56425b163f1a35c6888a9c7a40 IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00074613
0xf30a7500f723c8343151bcaa5105b1b5bdd709fd6215ae78c82e46998979920fDeposit118409772021-10-17 4:02:0525 mins ago0x739f8f8ddcaa28a14535d519da7f22c7bd28330a IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00074613
0xa4afa8cdd0178220816a06a9742fe649eb8b42c5f2c85d39b04e813fa2607d66Deposit118407182021-10-17 3:49:0838 mins ago0xa133207e507becac021403bf36ca1789526ac32c IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00074613
0x64bd3dae720a226865b1516d8a08daebdddeab8fea00c730393287d1042673e6Deposit118404472021-10-17 3:35:3552 mins ago0x8d0d8f12bbb5e75030fb6c3ce0e7048d0ef10a5c IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00074613
0x3c2e3137507b61a1d421c984e1491004f7c75b32ebb54eef3b39f4c320f6f9d2Deposit118397312021-10-17 2:59:471 hr 28 mins ago0xef6efd4e5dba0644f847ed42c2def66f7948ba27 IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00067113
0x8bfd6c941ec5e909e554e5445890b7260b95a341decb60ac566c980f4cf888dbDeposit118391132021-10-17 2:28:531 hr 59 mins ago0xc4df2aa5f905c503c2a7904762a763dc28eced45 IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00067113
0xcbf9f021b0b2c90092795a336d86ae0dee9e3879286856c300e54c62f16eee65Deposit118390932021-10-17 2:27:532 hrs ago0xc02b570eb8d4add3261d354d771029f529803e4d IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00074613
0x19bfe0dbc2ad9989789110ae863bd2f210b37b9647eeb845d88614d7ebab9789Deposit118390122021-10-17 2:23:502 hrs 4 mins ago0xb901bb291fb3ef79137038655f2406ebe33f0635 IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00074613
0x70b6b63e33bfb2cd21e9823ad25344707e254dd47d7299620f64666db4404b30Withdraw118388242021-10-17 2:14:262 hrs 13 mins ago0x40bd85f6f535fabc8235587b093ec6866845c8b6 IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.0012515778
0x567ef587921406decdc3b22779a47eb00c67bf140a3808e7b97457563eb7e74aWithdraw118387972021-10-17 2:13:052 hrs 14 mins ago0x40bd85f6f535fabc8235587b093ec6866845c8b6 IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.0007953264
0x753939791b07e199afe9f462c53b9c329df191e1ff347ddf1943add947c1fb65Deposit118387932021-10-17 2:12:532 hrs 15 mins ago0x40bd85f6f535fabc8235587b093ec6866845c8b6 IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.0009848916
0xa9aff79e405e4b617706b7cee347d526c7879e96e673d875902b2790a4546848Deposit118383562021-10-17 1:51:022 hrs 36 mins ago0x12b2ca6fcd41d772593bb1a7e5b336672b719740 IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00074613
0x8dde52c19fb5db0325387a04cd55399f6d4578cc3925d715e59df62b18e37800Deposit118382222021-10-17 1:44:202 hrs 43 mins ago0x116d6bab14649780397bab9fc8da1fd42342ae11 IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00084786
0x26f51c2c259be1326166219d9e61f69207bc4406b35762a422f7bda12d384f56Deposit118380522021-10-17 1:35:502 hrs 52 mins ago0xdbed6afa1278fb67a7ed6328c936a22c4ffec950 IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00074613
0x157f497d807b86eb0147d9c4778e3596c41ce3eaf39b3b1c116c41ad63aafbb8Deposit118373222021-10-17 0:59:203 hrs 28 mins ago0xb8a39f0faebe01ce3e1ef0ce0d26a30abdc5e562 IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00067113
0xe8d607fb4a4ab5cea52ef3231963cbc7456c446413ed7e82a1bcf2405797aec3Deposit118372122021-10-17 0:53:503 hrs 34 mins ago0xe58ca51f1722e06d9aa229099beed0fb1acc135d IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00067113
0xa9743d8a3aac5e507c27595b5880869e8ac8da0bb453488f8727bb6a10a301c3Deposit118368962021-10-17 0:38:023 hrs 49 mins ago0x5d63310a36bd871441e4bc2c8e63ee3ba74c6ffc IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00067113
0xd4d1d7823c76403a16ec4ce3b700934b83a7239471ba3a4ebe024883a353763cDeposit118368552021-10-17 0:35:593 hrs 51 mins ago0x6cf1161d8c8277949897d98370d88b5707b5eca1 IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00084786
0x9043e62e5cce1b70086636fc78a6cfde8ad41f199c3b87f72e4c5356bba7be55Deposit118366752021-10-17 0:26:594 hrs ago0xb1bef9a8e19ca89ef2a23b327b8742835b79d73b IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00080155
0x7c45a2cf6fe3760fc575fafe2258371a71d6b806601697ae036d7758263ed854Deposit118365192021-10-17 0:19:114 hrs 8 mins ago0xb1bef9a8e19ca89ef2a23b327b8742835b79d73b IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00067113
0xddd410d1df67ffac62240fa220bfd4109a6e83c9ece7efdec15b8b3adc849762Deposit118361072021-10-16 23:58:354 hrs 29 mins ago0x55e4318e4710fd55997f8b52e2aed48701400788 IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00074613
0x02f0201240922bf36995fbf57a8a127676b50f1a34ae4d93f99afc794176ac7aDeposit118360102021-10-16 23:53:444 hrs 34 mins ago0x9d06536cf28970c05751de56c2a0534d6b057447 IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00067113
0x5271aa967bb79e1f4a893ade1cd2800c6f7dab683243e6dda266f7556a7d4022Deposit118359962021-10-16 23:53:024 hrs 34 mins ago0x9d06536cf28970c05751de56c2a0534d6b057447 IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00067113
0x187df1ebc3f196f3bb8fccd5f263bf8832f99ee23c91bd5b79d39c1f0cf5be4fDeposit118356862021-10-16 23:37:324 hrs 50 mins ago0x18cd9718b0df0fbaea450cc973c3d9afeecdc07a IN  0xd90a8878a2277879600aa2cba0cadc7e1a11354d0 BNB0.00074613
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FeedFarm

Compiler Version
v0.7.3+commit.9bfce1f6

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 11 : FeedFarm.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "../token/FeedToken.sol";

contract FeedFarm is Ownable, ReentrancyGuard {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;
    // Info of each user.
    struct UserInfo {
        uint256 amount; // How many LP tokens the user has provided.
        uint256 rewardDebt; // Reward debt. See explanation below.
        //
        // We do some fancy math here. Basically, any point in time, the amount of FEEDs
        // entitled to a user but is pending to be distributed is:
        //
        //   pending reward = (user.amount * pool.accFeedPerShare) - user.rewardDebt
        //
        // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens:
        //   1. The pool's `accFeedPerShare` (and `lastRewardBlock`) gets updated.
        //   2. User receives the pending reward sent to his/her address.
        //   3. User's `amount` gets updated.
        //   4. User's `rewardDebt` gets updated.
    }
    // Info of each pool.
    struct PoolInfo {
        IERC20 lpToken; // Address of LP token contract.
        uint256 allocPoint; // How many allocation points assigned to this pool. FEEDs to distribute per block.
        uint256 lastRewardBlock; // Last block number that FEEDs distribution occurs.
        uint256 accFeedPerShare; // Accumulated FEEDs per share, times 1e12. See below.
        uint16 exitFeeBP; // Exit fee in basis points.
    }
    // The FEED TOKEN!
    FeedToken public feed;
    // Dev address.
    address public devAddr;
    // Insurance fund address.
    address public insAddr;
    // Fee collector address.
    address public feeAddr;
    // FEED tokens created per block.
    uint256 public feedPerBlock;
    // Reduction interval
    uint256 public reductionInterval;

    // Info of each pool.
    PoolInfo[] public poolInfo;
    // Info of each user that stakes LP tokens.
    mapping(uint256 => mapping(address => UserInfo)) public userInfo;
    // Total allocation poitns. Must be the sum of all allocation points in all pools.
    uint256 public totalAllocPoint = 0;
    // Referral Bonus in basis points. Initially set to 2%
    uint256 public refBonusBP = 200;
    // The block number when FEED mining starts.
    uint256 public startBlock;
    // Max Exit Fee: 10%.
    uint16 public constant MAXIMUM_EXIT_FEE_BP = 1000;
    // Max referral commission rate: 10%.
    uint16 public constant MAXIMUM_REFERRAL_BP = 1000;
    // Referral Mapping
    mapping(address => address) public referrers; // account_address -> referrer_address
    mapping(address => uint256) public referredCount; // referrer_address -> num_of_referred
    // Pool Exists Mapper
    mapping(IERC20 => bool) public poolExistence;
    // Pool ID Tracker Mapper
    mapping(IERC20 => uint256) public poolIdForLpAddress;
    // Last reduction block
    uint256 public lastReductionBlock = 0;

    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 Referral(address indexed _referrer, address indexed _user);
    event ReferralPaid(address indexed _user, address indexed _userTo, uint256 _reward);
    event ReferralBonusBpChanged(uint256 _oldBp, uint256 _newBp);
    event EmissionRateUpdated(address indexed caller, uint256 previousAmount, uint256 newAmount);

    constructor(
        FeedToken _feed,
        address _devaddr,
        address _insAddr,
        address _feeAddr,
        uint256 _feedPerBlock,
        uint256 _startBlock,
        uint256 _reductionInterval
    ) public {
        feed = _feed;
        devAddr = _devaddr;
        insAddr = _insAddr;
        feeAddr = _feeAddr;
        feedPerBlock = _feedPerBlock;
        startBlock = _startBlock;
        reductionInterval = _reductionInterval;
    }

    // Get number of pools added.
    function poolLength() external view returns (uint256) {
        return poolInfo.length;
    }

    // Get Pool ID by Token
    function getPoolIdForLpToken(IERC20 _lpToken) external view returns (uint256) {
        require(poolExistence[_lpToken] != false, "Farm: Token does not exists in any pool");
        return poolIdForLpAddress[_lpToken];
    }

    // Modifier to check Duplicate pools
    modifier nonDuplicated(IERC20 _lpToken) {
        require(poolExistence[_lpToken] == false, "Farm: Duplicated pool");
        _;
    }

    // Add a new lp to the pool. Can only be called by the owner.
    // XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
    function add(
        uint256 _allocPoint,
        IERC20 _lpToken,
        uint16 _exitFeeBP,
        bool _withUpdate
    ) public onlyOwner nonDuplicated(_lpToken) {
        require(_exitFeeBP <= MAXIMUM_EXIT_FEE_BP, "Farm(add): invalid exit 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,
                accFeedPerShare: 0,
                exitFeeBP: _exitFeeBP
            })
        );
        poolIdForLpAddress[_lpToken] = poolInfo.length - 1;
    }

    // Update the given pool's FEED allocation point. Can only be called by the owner.
    function set(
        uint256 _pid,
        uint256 _allocPoint,
        uint16 _exitFeeBP,
        bool _withUpdate
    ) public onlyOwner {
        require(_exitFeeBP <= MAXIMUM_EXIT_FEE_BP, "Farm(set): invalid exit fee basis points");
        if (_withUpdate) {
            massUpdatePools();
        }
        totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint);
        poolInfo[_pid].allocPoint = _allocPoint;
        poolInfo[_pid].exitFeeBP = _exitFeeBP;
    }

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

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

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

    // Update reward variables of the given pool to be up-to-date.
    function updatePool(uint256 _pid) public {
        PoolInfo storage pool = poolInfo[_pid];
        if (block.number <= pool.lastRewardBlock) {
            return;
        }
        uint256 lpSupply = pool.lpToken.balanceOf(address(this));
        if (lpSupply == 0) {
            pool.lastRewardBlock = block.number;
            return;
        }
        uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
        uint256 feedTotalCap = feed.cap();
        uint256 feedTotalSupply = feed.totalSupply();
        uint256 remainingFeed = feedTotalCap.sub(feedTotalSupply);
        uint256 feedReward = multiplier.mul(feedPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
        if (remainingFeed < feedReward) {
            feedReward = remainingFeed;
        }
        uint256 devReward = feedReward.div(20); // 5% Feed to Dev Fund
        uint256 insReward = feedReward.div(50); // 2% Feed to Insurance Fund
        uint256 userReward = feedReward.sub(devReward).sub(insReward);
        feed.mintTo(address(this), userReward);
        feed.mintTo(devAddr, devReward);
        feed.mintTo(insAddr, insReward);
        pool.accFeedPerShare = pool.accFeedPerShare.add(userReward.mul(1e12).div(lpSupply));
        pool.lastRewardBlock = block.number;
    }

    // Deposit LP tokens to FeedFarm for FEED allocation.
    function deposit(
        uint256 _pid,
        uint256 _amount,
        address _referrer
    ) public nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        updatePool(_pid);
        if (user.amount > 0) {
            uint256 pending = user.amount.mul(pool.accFeedPerShare).div(1e12).sub(user.rewardDebt);
            if (pending > 0) {
                payReferralCommission(msg.sender, pending);
            }
        }
        if (_amount > 0) {
            setReferral(msg.sender, _referrer);
            pool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount);
            user.amount = user.amount.add(_amount);
        }
        user.rewardDebt = user.amount.mul(pool.accFeedPerShare).div(1e12);
        emit Deposit(msg.sender, _pid, _amount);
    }

    // Withdraw LP tokens from FeedFarm.
    function withdraw(uint256 _pid, uint256 _amount) public nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        require(user.amount >= _amount, "Farm: Withdraw amount is larger than available balance");
        updatePool(_pid);
        uint256 pending = user.amount.mul(pool.accFeedPerShare).div(1e12).sub(user.rewardDebt);
        if (pending > 0) {
            payReferralCommission(msg.sender, pending);
        }
        if (_amount > 0) {
            if (pool.exitFeeBP > 0) {
                uint256 exitFee = _amount.mul(pool.exitFeeBP).div(10000);
                user.amount = user.amount.sub(_amount);
                pool.lpToken.safeTransfer(address(msg.sender), _amount.sub(exitFee));
                pool.lpToken.safeTransfer(feeAddr, exitFee);
            } else {
                user.amount = user.amount.sub(_amount);
                pool.lpToken.safeTransfer(address(msg.sender), _amount);
            }
        }
        user.rewardDebt = user.amount.mul(pool.accFeedPerShare).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];
        pool.lpToken.safeTransfer(address(msg.sender), user.amount);
        emit EmergencyWithdraw(msg.sender, _pid, user.amount);
        user.amount = 0;
        user.rewardDebt = 0;
    }

    // Safe feed transfer function, just in case if rounding error causes pool to not have enough FEEDs.
    function safeFeedTransfer(address _to, uint256 _amount) internal {
        uint256 feedBal = feed.balanceOf(address(this));
        if (_amount > feedBal) {
            feed.transfer(_to, feedBal);
        } else {
            feed.transfer(_to, _amount);
        }
    }

    // Update dev address by the previous dev
    function changeDevAddr(address _devAddr) public {
        require(msg.sender == devAddr, "Farm: Only dev can change dev address");
        devAddr = _devAddr;
    }

    // Update insurance address by previous insurer
    function changeInsAddr(address _insAddr) public {
        require(msg.sender == insAddr, "Farm: Only insurer can change insurance address");
        insAddr = _insAddr;
    }

    // Update fees collector address by previous fees collector
    function changeFeeAddr(address _feeAddr) public {
        require(msg.sender == feeAddr, "Farm: Only fee collector can change fee collector address");
        feeAddr = _feeAddr;
    }

    // Update to emission rate (feedPerBlock)
    function updateEmissionRate(uint256 newEmissionRate) public onlyOwner {
        require(block.number > startBlock, "Farm: Emission rate can only update after mining starts");
        require(block.number >= lastReductionBlock.add(reductionInterval), "Farm: Emission rate in reduction interval");
        massUpdatePools();
        lastReductionBlock = block.number;
        uint256 previousEmissionRate = feedPerBlock;
        feedPerBlock = newEmissionRate;
        emit EmissionRateUpdated(msg.sender, previousEmissionRate, newEmissionRate);
    }

    // Set Referral Address for a user
    function setReferral(address _user, address _referrer) internal {
        if (_referrer == address(_referrer) && referrers[_user] == address(0) && _referrer != address(0) && _referrer != _user) {
            referrers[_user] = _referrer;
            referredCount[_referrer] += 1;
            emit Referral(_user, _referrer);
        }
    }

    // Get Referral Address for a Account
    function getReferral(address _user) public view returns (address) {
        return referrers[_user];
    }

    // Pay referral commission to the referrer who referred this user.
    function payReferralCommission(address _user, uint256 _pending) internal {
        address referrer = getReferral(_user);
        if (referrer != address(0) && referrer != _user && refBonusBP > 0) {
            uint256 refBonusEarned = _pending.mul(refBonusBP).div(10000);
            safeFeedTransfer(referrer, refBonusEarned);
            safeFeedTransfer(_user, _pending.sub(refBonusEarned));
            emit ReferralPaid(_user, referrer, refBonusEarned);
        } else {
            safeFeedTransfer(_user, _pending);
        }
    }

    // Referral Bonus in basis points.
    // Initially set to 2%, this this the ability to increase or decrease the Bonus percentage based on
    // community voting and feedback.
    function updateReferralBonusBp(uint256 _newRefBonusBp) public onlyOwner {
        require(_newRefBonusBp <= MAXIMUM_REFERRAL_BP, "Farm: Referral bonus has reached maxmimum threshold");
        require(_newRefBonusBp != refBonusBP, "Farm: Referral bonus is the same");
        uint256 previousRefBonusBP = refBonusBP;
        refBonusBP = _newRefBonusBp;
        emit ReferralBonusBpChanged(previousRefBonusBP, _newRefBonusBp);
    }
}

File 2 of 11 : 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 3 of 11 : 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 4 of 11 : 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 5 of 11 : 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;
    }
}

File 6 of 11 : FeedToken.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Capped.sol";

contract FeedToken is ERC20Capped, Ownable {
    address public treasuryAddress;

    constructor(address _treasury, uint256 _cap) ERC20("Feeder.finance", "FEED") ERC20Capped(_cap) {
        treasuryAddress = _treasury;

        mintTo(treasuryAddress, 31750000 ether);
    }

    /// @notice Creates `_amount` token to `_to`. Must only be called by the owner.
    function mintTo(address _to, uint256 _amount) public onlyOwner {
        _mint(_to, _amount);
    }
}

File 7 of 11 : 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 8 of 11 : 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 9 of 11 : 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 10 of 11 : ERC20Capped.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./ERC20.sol";

/**
 * @dev Extension of {ERC20} that adds a cap to the supply of tokens.
 */
abstract contract ERC20Capped is ERC20 {
    using SafeMath for uint256;

    uint256 private _cap;

    /**
     * @dev Sets the value of the `cap`. This value is immutable, it can only be
     * set once during construction.
     */
    constructor (uint256 cap_) internal {
        require(cap_ > 0, "ERC20Capped: cap is 0");
        _cap = cap_;
    }

    /**
     * @dev Returns the cap on the token's total supply.
     */
    function cap() public view virtual returns (uint256) {
        return _cap;
    }

    /**
     * @dev See {ERC20-_beforeTokenTransfer}.
     *
     * Requirements:
     *
     * - minted tokens must not cause the total supply to go over the cap.
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {
        super._beforeTokenTransfer(from, to, amount);

        if (from == address(0)) { // When minting tokens
            require(totalSupply().add(amount) <= cap(), "ERC20Capped: cap exceeded");
        }
    }
}

File 11 of 11 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../../utils/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20 {
    using SafeMath for uint256;

    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name_, string memory symbol_) public {
        _name = name_;
        _symbol = symbol_;
        _decimals = 18;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
     * called.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return _decimals;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal virtual {
        _decimals = decimals_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract FeedToken","name":"_feed","type":"address"},{"internalType":"address","name":"_devaddr","type":"address"},{"internalType":"address","name":"_insAddr","type":"address"},{"internalType":"address","name":"_feeAddr","type":"address"},{"internalType":"uint256","name":"_feedPerBlock","type":"uint256"},{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256","name":"_reductionInterval","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":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newAmount","type":"uint256"}],"name":"EmissionRateUpdated","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":"_referrer","type":"address"},{"indexed":true,"internalType":"address","name":"_user","type":"address"}],"name":"Referral","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_oldBp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_newBp","type":"uint256"}],"name":"ReferralBonusBpChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_user","type":"address"},{"indexed":true,"internalType":"address","name":"_userTo","type":"address"},{"indexed":false,"internalType":"uint256","name":"_reward","type":"uint256"}],"name":"ReferralPaid","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":"MAXIMUM_EXIT_FEE_BP","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXIMUM_REFERRAL_BP","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IERC20","name":"_lpToken","type":"address"},{"internalType":"uint16","name":"_exitFeeBP","type":"uint16"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_devAddr","type":"address"}],"name":"changeDevAddr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeAddr","type":"address"}],"name":"changeFeeAddr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_insAddr","type":"address"}],"name":"changeInsAddr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_referrer","type":"address"}],"name":"deposit","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":"feeAddr","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feed","outputs":[{"internalType":"contract FeedToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feedPerBlock","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":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_lpToken","type":"address"}],"name":"getPoolIdForLpToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getReferral","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"insAddr","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastReductionBlock","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":"pendingFeed","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":"contract IERC20","name":"","type":"address"}],"name":"poolIdForLpAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"lpToken","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accFeedPerShare","type":"uint256"},{"internalType":"uint16","name":"exitFeeBP","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reductionInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"refBonusBP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"referredCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"referrers","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"_exitFeeBP","type":"uint16"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"set","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":"newEmissionRate","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":"_newRefBonusBp","type":"uint256"}],"name":"updateReferralBonusBp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526000600a5560c8600b55600060115534801561001f57600080fd5b506040516200283038038062002830833981810160405260e081101561004457600080fd5b508051602082015160408301516060840151608085015160a086015160c0909601519495939492939192909190600061007b61012e565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35060018055600280546001600160a01b039889166001600160a01b0319918216179091556003805497891697821697909717909655600480549588169587169590951790945560058054939096169290941691909117909355600692909255600c55600755610132565b3390565b6126ee80620001426000396000f3fe608060405234801561001057600080fd5b50600436106102325760003560e01c8063630b5ba1116101305780639bf62f7e116100b8578063d96384221161007c578063d96384221461061b578063da09c72c14610650578063e3960bd914610658578063ec96462914610660578063f2fde38b1461068657610232565b80639bf62f7e1461058d578063a3bd99ec146105b3578063b1b3ca4514610372578063c0af2e48146105d9578063cbd258b5146105e157610232565b806384e82a33116100ff57806384e82a33146104ad5780638da5cb5b146104eb5780638dbb1e3a146104f35780638dbdbe6d1461051657806393f1a40b1461054857610232565b8063630b5ba11461047857806364ed743b1461048057806366f685ea1461049d578063715018a6146104a557610232565b80633a22df78116101be57806347cd35f11161018257806347cd35f11461040857806348cd4cb1146104105780634a3b68cc1461041857806351eb05a61461043e5780635312ea8e1461045b57610232565b80633a22df78146103725780633b0f0f2f146103915780633f7b06d8146103b7578063436b7868146103dd578063441a3e70146103e557610232565b806317caf6f11161020557806317caf6f1146102ec578063190f39f0146102f457806337a7b7d81461031a57806339851eaf1461033e57806339e7fddc1461036a57610232565b8063081e3eda146102375780630ba84cd2146102515780631526fe271461027057806315acc16f146102c6575b600080fd5b61023f6106ac565b60408051918252519081900360200190f35b61026e6004803603602081101561026757600080fd5b50356106b2565b005b61028d6004803603602081101561028657600080fd5b50356107f3565b604080516001600160a01b039096168652602086019490945284840192909252606084015261ffff166080830152519081900360a00190f35b61026e600480360360208110156102dc57600080fd5b50356001600160a01b031661083f565b61023f6108aa565b61023f6004803603602081101561030a57600080fd5b50356001600160a01b03166108b0565b610322610923565b604080516001600160a01b039092168252519081900360200190f35b61023f6004803603604081101561035457600080fd5b50803590602001356001600160a01b0316610932565b610322610aa4565b61037a610ab3565b6040805161ffff9092168252519081900360200190f35b610322600480360360208110156103a757600080fd5b50356001600160a01b0316610ab9565b61023f600480360360208110156103cd57600080fd5b50356001600160a01b0316610ad7565b610322610ae9565b61026e600480360360408110156103fb57600080fd5b5080359060200135610af8565b61023f610d24565b61023f610d2a565b6103226004803603602081101561042e57600080fd5b50356001600160a01b0316610d30565b61026e6004803603602081101561045457600080fd5b5035610d4b565b61026e6004803603602081101561047157600080fd5b503561110f565b61026e61120c565b61026e6004803603602081101561049657600080fd5b503561122f565b61023f611370565b61026e611376565b61026e600480360360808110156104c357600080fd5b508035906001600160a01b036020820135169061ffff60408201351690606001351515611422565b6103226116ca565b61023f6004803603604081101561050957600080fd5b50803590602001356116d9565b61026e6004803603606081101561052c57600080fd5b50803590602081013590604001356001600160a01b03166116ec565b6105746004803603604081101561055e57600080fd5b50803590602001356001600160a01b031661186d565b6040805192835260208301919091528051918290030190f35b61023f600480360360208110156105a357600080fd5b50356001600160a01b0316611891565b61026e600480360360208110156105c957600080fd5b50356001600160a01b03166118a3565b61023f61190e565b610607600480360360208110156105f757600080fd5b50356001600160a01b0316611914565b604080519115158252519081900360200190f35b61026e6004803603608081101561063157600080fd5b5080359060208101359061ffff60408201351690606001351515611929565b610322611a83565b61023f611a92565b61026e6004803603602081101561067657600080fd5b50356001600160a01b0316611a98565b61026e6004803603602081101561069c57600080fd5b50356001600160a01b0316611b03565b60085490565b6106ba611c05565b6001600160a01b03166106cb6116ca565b6001600160a01b031614610714576040805162461bcd60e51b81526020600482018190526024820152600080516020612587833981519152604482015290519081900360640190fd5b600c5443116107545760405162461bcd60e51b81526004018080602001828103825260378152602001806125a76037913960400191505060405180910390fd5b60075460115461076391611c09565b4310156107a15760405162461bcd60e51b81526004018080602001828103825260298152602001806125186029913960400191505060405180910390fd5b6107a961120c565b4360115560068054908290556040805182815260208101849052815133927feedc6338c9c1ad8f3cd6c90dd09dbe98dbd57e610d3e59a17996d07acb0d9511928290030190a25050565b6008818154811061080057fe5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b0390931694509092909161ffff1685565b6004546001600160a01b031633146108885760405162461bcd60e51b815260040180806020018281038252602f815260200180612611602f913960400191505060405180910390fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b600a5481565b6001600160a01b0381166000908152600f602052604081205460ff166109075760405162461bcd60e51b81526004018080602001828103825260278152602001806126926027913960400191505060405180910390fd5b506001600160a01b031660009081526010602052604090205490565b6002546001600160a01b031681565b6000806008848154811061094257fe5b600091825260208083208784526009825260408085206001600160a01b0389811687529084528186206005959095029092016003810154815483516370a0823160e01b815230600482015293519298509596909590949316926370a082319260248082019391829003018186803b1580156109bc57600080fd5b505afa1580156109d0573d6000803e3d6000fd5b505050506040513d60208110156109e657600080fd5b50516002850154909150431180156109fd57508015155b15610a69576000610a128560020154436116d9565b90506000610a45600a54610a3f8860010154610a3960065487611c6390919063ffffffff16565b90611c63565b90611cbc565b9050610a64610a5d84610a3f8464e8d4a51000611c63565b8590611c09565b935050505b610a978360010154610a9164e8d4a51000610a3f868860000154611c6390919063ffffffff16565b90611d23565b9450505050505b92915050565b6005546001600160a01b031681565b6103e881565b6001600160a01b039081166000908152600d60205260409020541690565b600e6020526000908152604090205481565b6004546001600160a01b031681565b60026001541415610b50576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600181905550600060088381548110610b6757fe5b600091825260208083208684526009825260408085203386529092529220805460059092029092019250831115610bcf5760405162461bcd60e51b81526004018080602001828103825260368152602001806124a96036913960400191505060405180910390fd5b610bd884610d4b565b6000610c068260010154610a9164e8d4a51000610a3f87600301548760000154611c6390919063ffffffff16565b90508015610c1857610c183382611d80565b8315610cc257600483015461ffff1615610c9e576004830154600090610c4b9061271090610a3f90889061ffff16611c63565b8354909150610c5a9086611d23565b8355610c7c33610c6a8784611d23565b86546001600160a01b03169190611e66565b6005548454610c98916001600160a01b03918216911683611e66565b50610cc2565b8154610caa9085611d23565b82558254610cc2906001600160a01b03163386611e66565b60038301548254610cdd9164e8d4a5100091610a3f91611c63565b6001830155604080518581529051869133917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a3505060018055505050565b60065481565b600c5481565b600d602052600090815260409020546001600160a01b031681565b600060088281548110610d5a57fe5b9060005260206000209060050201905080600201544311610d7b575061110c565b8054604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610dc557600080fd5b505afa158015610dd9573d6000803e3d6000fd5b505050506040513d6020811015610def57600080fd5b5051905080610e0557504360029091015561110c565b6000610e158360020154436116d9565b90506000600260009054906101000a90046001600160a01b03166001600160a01b031663355274ea6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e6757600080fd5b505afa158015610e7b573d6000803e3d6000fd5b505050506040513d6020811015610e9157600080fd5b5051600254604080516318160ddd60e01b815290519293506000926001600160a01b03909216916318160ddd91600480820192602092909190829003018186803b158015610ede57600080fd5b505afa158015610ef2573d6000803e3d6000fd5b505050506040513d6020811015610f0857600080fd5b505190506000610f188383611d23565b90506000610f3f600a54610a3f8960010154610a396006548a611c6390919063ffffffff16565b905080821015610f4c5750805b6000610f59826014611cbc565b90506000610f68836032611cbc565b90506000610f7a82610a918686611d23565b600254604080516308934a5f60e31b81523060048201526024810184905290519293506001600160a01b039091169163449a52f89160448082019260009290919082900301818387803b158015610fd057600080fd5b505af1158015610fe4573d6000803e3d6000fd5b5050600254600354604080516308934a5f60e31b81526001600160a01b03928316600482015260248101899052905191909216935063449a52f89250604480830192600092919082900301818387803b15801561104057600080fd5b505af1158015611054573d6000803e3d6000fd5b505060025460048054604080516308934a5f60e31b81526001600160a01b039283169381019390935260248301889052519216935063449a52f8925060448082019260009290919082900301818387803b1580156110b157600080fd5b505af11580156110c5573d6000803e3d6000fd5b505050506110f36110e88a610a3f64e8d4a5100085611c6390919063ffffffff16565b60038c015490611c09565b60038b0155505043600290980197909755505050505050505b50565b60026001541415611167576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260018190555060006008828154811061117e57fe5b600091825260208083208584526009825260408085203380875293529093208054600590930290930180549094506111c3926001600160a01b03919091169190611e66565b80546040805191825251849133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959181900360200190a3600080825560019182015580555050565b60085460005b8181101561122b5761122381610d4b565b600101611212565b5050565b611237611c05565b6001600160a01b03166112486116ca565b6001600160a01b031614611291576040805162461bcd60e51b81526020600482018190526024820152600080516020612587833981519152604482015290519081900360640190fd5b6103e88111156112d25760405162461bcd60e51b81526004018080602001828103825260338152602001806125de6033913960400191505060405180910390fd5b600b54811415611329576040805162461bcd60e51b815260206004820181905260248201527f4661726d3a20526566657272616c20626f6e7573206973207468652073616d65604482015290519081900360640190fd5b600b805490829055604080518281526020810184905281517f3282b692bfebf5f35b198a229212cf532c72099026ab54c4b8665382d1086b3f929181900390910190a15050565b600b5481565b61137e611c05565b6001600160a01b031661138f6116ca565b6001600160a01b0316146113d8576040805162461bcd60e51b81526020600482018190526024820152600080516020612587833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b61142a611c05565b6001600160a01b031661143b6116ca565b6001600160a01b031614611484576040805162461bcd60e51b81526020600482018190526024820152600080516020612587833981519152604482015290519081900360640190fd5b6001600160a01b0383166000908152600f6020526040902054839060ff16156114ec576040805162461bcd60e51b815260206004820152601560248201527411985c9b4e88111d5c1b1a58d85d1959081c1bdbdb605a1b604482015290519081900360640190fd5b6103e861ffff841611156115315760405162461bcd60e51b81526004018080602001828103825260288152602001806126406028913960400191505060405180910390fd5b811561153f5761153f61120c565b6000600c54431161155257600c54611554565b435b600a549091506115649087611c09565b600a556001600160a01b039485166000818152600f602090815260408083208054600160ff199091168117909155815160a0810183528581528084019b8c528083019687526060810185815261ffff9a8b166080830190815260088054948501815580885292517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3600590950294850180546001600160a01b03191691909e1617909c559b517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee483015595517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee582015599517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee68b015597517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee7909901805461ffff1916999097169890981790955590549084526010909552505020600019919091019055565b6000546001600160a01b031690565b60006116e58284611d23565b9392505050565b60026001541415611744576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260018190555060006008848154811061175b57fe5b6000918252602080832087845260098252604080852033865290925292206005909102909101915061178c85610d4b565b8054156117d55760006117c18260010154610a9164e8d4a51000610a3f87600301548760000154611c6390919063ffffffff16565b905080156117d3576117d33382611d80565b505b831561180b576117e53384611eb8565b81546117fc906001600160a01b0316333087611f76565b80546118089085611c09565b81555b600382015481546118269164e8d4a5100091610a3f91611c63565b6001820155604080518581529051869133917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a3505060018055505050565b60096020908152600092835260408084209091529082529020805460019091015482565b60106020526000908152604090205481565b6003546001600160a01b031633146118ec5760405162461bcd60e51b81526004018080602001828103825260258152602001806125626025913960400191505060405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60115481565b600f6020526000908152604090205460ff1681565b611931611c05565b6001600160a01b03166119426116ca565b6001600160a01b03161461198b576040805162461bcd60e51b81526020600482018190526024820152600080516020612587833981519152604482015290519081900360640190fd5b6103e861ffff831611156119d05760405162461bcd60e51b81526004018080602001828103825260288152602001806124816028913960400191505060405180910390fd5b80156119de576119de61120c565b611a1b83611a15600887815481106119f257fe5b906000526020600020906005020160010154600a54611d2390919063ffffffff16565b90611c09565b600a819055508260088581548110611a2f57fe5b9060005260206000209060050201600101819055508160088581548110611a5257fe5b906000526020600020906005020160040160006101000a81548161ffff021916908361ffff16021790555050505050565b6003546001600160a01b031681565b60075481565b6005546001600160a01b03163314611ae15760405162461bcd60e51b81526004018080602001828103825260398152602001806124df6039913960400191505060405180910390fd5b600580546001600160a01b0319166001600160a01b0392909216919091179055565b611b0b611c05565b6001600160a01b0316611b1c6116ca565b6001600160a01b031614611b65576040805162461bcd60e51b81526020600482018190526024820152600080516020612587833981519152604482015290519081900360640190fd5b6001600160a01b038116611baa5760405162461bcd60e51b81526004018080602001828103825260268152602001806124356026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b6000828201838110156116e5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082611c7257506000610a9e565b82820282848281611c7f57fe5b04146116e55760405162461bcd60e51b81526004018080602001828103825260218152602001806125416021913960400191505060405180910390fd5b6000808211611d12576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381611d1b57fe5b049392505050565b600082821115611d7a576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000611d8b83610ab9565b90506001600160a01b03811615801590611db75750826001600160a01b0316816001600160a01b031614155b8015611dc557506000600b54115b15611e57576000611de7612710610a3f600b5486611c6390919063ffffffff16565b9050611df38282611fd6565b611e0684611e018584611d23565b611fd6565b816001600160a01b0316846001600160a01b03167f0a721ab4682ceb61c7e4d264ef879fc419a6d764b136e7d96ef54b2053c75673836040518082815260200191505060405180910390a350611e61565b611e618383611fd6565b505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611e61908490612166565b6001600160a01b038281166000908152600d602052604090205416158015611ee857506001600160a01b03811615155b8015611f065750816001600160a01b0316816001600160a01b031614155b1561122b576001600160a01b038281166000818152600d6020908152604080832080546001600160a01b0319169587169586179055848352600e90915280822080546001019055517f9d05414fb79fac216c15606de5cc06664e91a254e4d5f57664d5f1beaf7fb7ef9190a35050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611fd0908590612166565b50505050565b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561202157600080fd5b505afa158015612035573d6000803e3d6000fd5b505050506040513d602081101561204b57600080fd5b50519050808211156120df576002546040805163a9059cbb60e01b81526001600160a01b038681166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156120ad57600080fd5b505af11580156120c1573d6000803e3d6000fd5b505050506040513d60208110156120d757600080fd5b50611e619050565b6002546040805163a9059cbb60e01b81526001600160a01b038681166004830152602482018690529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561213557600080fd5b505af1158015612149573d6000803e3d6000fd5b505050506040513d602081101561215f57600080fd5b5050505050565b60606121bb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166122179092919063ffffffff16565b805190915015611e61578080602001905160208110156121da57600080fd5b5051611e615760405162461bcd60e51b815260040180806020018281038252602a815260200180612668602a913960400191505060405180910390fd5b6060612226848460008561222e565b949350505050565b60608247101561226f5760405162461bcd60e51b815260040180806020018281038252602681526020018061245b6026913960400191505060405180910390fd5b6122788561238a565b6122c9576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106123085780518252601f1990920191602091820191016122e9565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461236a576040519150601f19603f3d011682016040523d82523d6000602084013e61236f565b606091505b509150915061237f828286612390565b979650505050505050565b3b151590565b6060831561239f5750816116e5565b8251156123af5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123f95781810151838201526020016123e1565b50505050905090810190601f1680156124265780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c4661726d28736574293a20696e76616c696420657869742066656520626173697320706f696e74734661726d3a20576974686472617720616d6f756e74206973206c6172676572207468616e20617661696c61626c652062616c616e63654661726d3a204f6e6c792066656520636f6c6c6563746f722063616e206368616e67652066656520636f6c6c6563746f7220616464726573734661726d3a20456d697373696f6e207261746520696e20726564756374696f6e20696e74657276616c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774661726d3a204f6e6c79206465762063616e206368616e67652064657620616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65724661726d3a20456d697373696f6e20726174652063616e206f6e6c7920757064617465206166746572206d696e696e67207374617274734661726d3a20526566657272616c20626f6e7573206861732072656163686564206d61786d696d756d207468726573686f6c644661726d3a204f6e6c7920696e73757265722063616e206368616e676520696e737572616e636520616464726573734661726d28616464293a20696e76616c696420657869742066656520626173697320706f696e74735361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565644661726d3a20546f6b656e20646f6573206e6f742065786973747320696e20616e7920706f6f6ca264697066735822122047c3310910556a3aee1670050fd9b88dfe4e765d78e412882353657fb8e10f6364736f6c6343000703003300000000000000000000000067d66e8ec1fd25d98b3ccd3b19b7dc4b4b7fc4930000000000000000000000002de4c780fb947805770ee0d93c091ee683ebddb60000000000000000000000003f6e577e0d1af510a1ca8fe061f73eda0c65cda40000000000000000000000007a818e7e0edc038a3b80d4d8e55400b3c3ee8a00000000000000000000000000000000000000000000000001a055690d9db8000000000000000000000000000000000000000000000000000000000000006b29980000000000000000000000000000000000000000000000000000000000031380

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

00000000000000000000000067d66e8ec1fd25d98b3ccd3b19b7dc4b4b7fc4930000000000000000000000002de4c780fb947805770ee0d93c091ee683ebddb60000000000000000000000003f6e577e0d1af510a1ca8fe061f73eda0c65cda40000000000000000000000007a818e7e0edc038a3b80d4d8e55400b3c3ee8a00000000000000000000000000000000000000000000000001a055690d9db8000000000000000000000000000000000000000000000000000000000000006b29980000000000000000000000000000000000000000000000000000000000031380

-----Decoded View---------------
Arg [0] : _feed (address): 0x67d66e8ec1fd25d98b3ccd3b19b7dc4b4b7fc493
Arg [1] : _devaddr (address): 0x2de4c780fb947805770ee0d93c091ee683ebddb6
Arg [2] : _insAddr (address): 0x3f6e577e0d1af510a1ca8fe061f73eda0c65cda4
Arg [3] : _feeAddr (address): 0x7a818e7e0edc038a3b80d4d8e55400b3c3ee8a00
Arg [4] : _feedPerBlock (uint256): 30000000000000000000
Arg [5] : _startBlock (uint256): 7023000
Arg [6] : _reductionInterval (uint256): 201600

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 00000000000000000000000067d66e8ec1fd25d98b3ccd3b19b7dc4b4b7fc493
Arg [1] : 0000000000000000000000002de4c780fb947805770ee0d93c091ee683ebddb6
Arg [2] : 0000000000000000000000003f6e577e0d1af510a1ca8fe061f73eda0c65cda4
Arg [3] : 0000000000000000000000007a818e7e0edc038a3b80d4d8e55400b3c3ee8a00
Arg [4] : 000000000000000000000000000000000000000000000001a055690d9db80000
Arg [5] : 00000000000000000000000000000000000000000000000000000000006b2998
Arg [6] : 0000000000000000000000000000000000000000000000000000000000031380


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.