ETH Price: $3,636.87 (-0.36%)
Gas: 6.44 Gwei
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw213897632024-12-12 23:38:5925 days ago1734046739IN
0xf3f1d021...C2C55a7f2
0 ETH0.0022192715.43594968
Withdraw205840252024-08-22 12:04:23138 days ago1724328263IN
0xf3f1d021...C2C55a7f2
0 ETH0.000177971.23789296
Set Allowance Fo...183991622023-10-21 14:04:47443 days ago1697897087IN
0xf3f1d021...C2C55a7f2
0 ETH0.000300789.53800162
Withdraw183991472023-10-21 14:01:47443 days ago1697896907IN
0xf3f1d021...C2C55a7f2
0 ETH0.001354119.41919687
Set Allowance Fo...170053722023-04-08 18:14:35639 days ago1680977675IN
0xf3f1d021...C2C55a7f2
0 ETH0.000891831.03537385
Set Allowance Fo...170053552023-04-08 18:11:11639 days ago1680977471IN
0xf3f1d021...C2C55a7f2
0 ETH0.0030608462.93504883
Withdraw166190582023-02-13 9:51:59694 days ago1676281919IN
0xf3f1d021...C2C55a7f2
0 ETH0.0006610623.23039511
Withdraw166190572023-02-13 9:51:47694 days ago1676281907IN
0xf3f1d021...C2C55a7f2
0 ETH0.003430123.857772
Withdraw164521722023-01-21 2:23:59717 days ago1674267839IN
0xf3f1d021...C2C55a7f2
0 ETH0.0004960817.43296878
Withdraw164521692023-01-21 2:23:23717 days ago1674267803IN
0xf3f1d021...C2C55a7f2
0 ETH0.0022281317.58966776
Set Allowance Fo...156386932022-09-29 11:26:11831 days ago1664450771IN
0xf3f1d021...C2C55a7f2
0 ETH0.000580211.92981309
Withdraw156386692022-09-29 11:21:11831 days ago1664450471IN
0xf3f1d021...C2C55a7f2
0 ETH0.001391059.67616328
Withdraw153207912022-08-11 12:44:34880 days ago1660221874IN
0xf3f1d021...C2C55a7f2
0 ETH0.0020903425.62729366
Withdraw152915272022-08-06 22:50:01884 days ago1659826201IN
0xf3f1d021...C2C55a7f2
0 ETH0.00067858.31836522
Set Allowance Fo...152915182022-08-06 22:48:03884 days ago1659826083IN
0xf3f1d021...C2C55a7f2
0 ETH0.000239677.60017014
Withdraw145094032022-04-02 22:23:461010 days ago1648938226IN
0xf3f1d021...C2C55a7f2
0 ETH0.0060305773.93402321
Deposit144989512022-04-01 7:19:011012 days ago1648797541IN
0xf3f1d021...C2C55a7f2
0 ETH0.005110950.05828064
Withdraw144495912022-03-24 14:41:211019 days ago1648132881IN
0xf3f1d021...C2C55a7f2
0 ETH0.0061170142.5498673
Withdraw143787252022-03-13 14:00:171030 days ago1647180017IN
0xf3f1d021...C2C55a7f2
0 ETH0.0049826934.6595603
Set Allowance Fo...143622012022-03-10 23:55:301033 days ago1646956530IN
0xf3f1d021...C2C55a7f2
0 ETH0.0006269121.81706594
Set Allowance Fo...143621862022-03-10 23:51:451033 days ago1646956305IN
0xf3f1d021...C2C55a7f2
0 ETH0.0005881918.65218148
Withdraw143480702022-03-08 19:36:091035 days ago1646768169IN
0xf3f1d021...C2C55a7f2
0 ETH0.0028221434.60424916
Withdraw143441552022-03-08 4:50:551036 days ago1646715055IN
0xf3f1d021...C2C55a7f2
0 ETH0.0047211937.2742501
Withdraw141766972022-02-10 6:21:571062 days ago1644474117IN
0xf3f1d021...C2C55a7f2
0 ETH0.002497244.84032527
Withdraw141584392022-02-07 10:37:181065 days ago1644230238IN
0xf3f1d021...C2C55a7f2
0 ETH0.0072000650.08358882
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LPStaking

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 18 : LPStaking.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;


import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./Rena.sol";
import "./interfaces/IClaim.sol";

// Have fun reading it. Hopefully it's bug-free. God bless.
// CoreVault Fork
contract LPStaking is Ownable {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    // Info of each user.
    struct UserInfo {
        uint256 amount; // How many  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 RENAs
        // entitled to a user but is pending to be distributed is:
        //
        //   pending reward = (user.amount * pool.accRENAPerShare) - user.rewardDebt
        //
        // Whenever a user deposits or withdraws  tokens to a pool. Here's what happens:
        //   1. The pool's `accRENAPerShare` (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 token; // Address of  token contract.
        uint256 allocPoint; // How many allocation points assigned to this pool. RENAs to distribute per block.
        uint256 accRewardPerShare; // Accumulated reward per share, times 1e12. See below.
        bool withdrawable; // Is this pool withdrawable?
        
    }
    mapping(uint256 => mapping(address => mapping(address => uint256))) allowance;

    Rena public rena;

    // Dev address.
    address public devaddr;

    // Info of each pool.
    PoolInfo[] public poolInfo;
    // Info of each user that stakes  tokens.
    mapping(uint256 => mapping(address => UserInfo)) public userInfo;
    // Total allocation points. Must be the sum of all allocation points in all pools.
    uint256 public totalAllocPoint;

    //// pending rewards awaiting anyone to massUpdate
    uint256 public pendingRewards;

    uint256 public contractStartBlock;
    uint256 public epochCalculationStartBlock;
    uint256 public cumulativeRewardsSinceStart;
    uint256 public rewardsInThisEpoch;

    uint public epoch;

    // Returns fees generated since start of this contract
    function averageFeesPerBlockSinceStart() external view returns (uint averagePerBlock) {
        averagePerBlock = cumulativeRewardsSinceStart.add(rewardsInThisEpoch).div(block.number.sub(contractStartBlock));
    }        

    // Returns averge fees in this epoch
    function averageFeesPerBlockEpoch() external view returns (uint256 averagePerBlock) {
        averagePerBlock = rewardsInThisEpoch.div(block.number.sub(epochCalculationStartBlock));
    }

    // For easy graphing historical epoch rewards
    mapping(uint => uint256) public epochRewards;

    //Starts a new calculation epoch
    // Because averge since start will not be accurate
    function startNewEpoch() public {
        require(epochCalculationStartBlock + 50000 < block.number, "New epoch not ready yet"); // About a week
        epochRewards[epoch] = rewardsInThisEpoch;
        cumulativeRewardsSinceStart = cumulativeRewardsSinceStart.add(rewardsInThisEpoch);
        rewardsInThisEpoch = 0;
        epochCalculationStartBlock = block.number;
        ++epoch;
    }

    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event Claim(address indexed user, uint256 indexed pid);
    event EmergencyWithdraw(
        address indexed user,
        uint256 indexed pid,
        uint256 amount
    );
    event Approval(address indexed owner, address indexed spender, uint256 _pid, uint256 value);


    function initialize(
        address _rena
    ) public {
        require(address(rena) == address(0), "Only once");
        DEV_FEE = 200; // 2%
        rena = Rena(_rena);
        devaddr = msg.sender;
        contractStartBlock = block.number;
        _superAdmin = msg.sender;
    }

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

    // Add a new token pool. Can only be called by the owner. 
    // Note contract owner is meant to be a governance contract allowing RENA governance consensus
    function addPool(
        uint256 _allocPoint,
        IERC20 _token,
        bool _withUpdate,
        bool _withdrawable
    ) public onlyOwner {
        if (_withUpdate) {
            massUpdatePools();
        }

        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            require(poolInfo[pid].token != _token,"Error pool already added");
        }

        totalAllocPoint = totalAllocPoint.add(_allocPoint);

        poolInfo.push(
            PoolInfo({
                token: _token,
                allocPoint: _allocPoint,
                accRewardPerShare: 0,
                withdrawable : _withdrawable
            })
        );
    }

    
    // Update the given pool's Rena allocation point. Can only be called by the owner.
        // Note contract owner is meant to be a governance contract allowing RENA governance consensus
    function set(
        uint256 _pid,
        uint256 _allocPoint,
        bool _withUpdate
    ) public onlyOwner {
        if (_withUpdate) {
            massUpdatePools();
        }
        
        totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(
            _allocPoint
        );
        poolInfo[_pid].allocPoint = _allocPoint;
    }

    // Update the given pool's ability to withdraw tokens
    // Note contract owner is meant to be a governance contract allowing RENA governance consensus
    function setPoolWithdrawable(
        uint256 _pid,
        bool _withdrawable
    ) public onlyOwner {
        poolInfo[_pid].withdrawable = _withdrawable;
    }

    // Sets the dev fee for this contract
    // Note contract owner is meant to be a governance contract allowing RENA governance consensus
    uint16 DEV_FEE;
    function setDevFee(uint16 _DEV_FEE) public onlyOwner {
        require(_DEV_FEE <= 1000, 'Dev fee clamped at 10%');
        DEV_FEE = _DEV_FEE;
    }
    uint256 pending_DEV_rewards;


    // View function to see pending RENAs on frontend.
    function pendingrena(uint256 _pid, address _user)
        public
        view
        returns (uint256)
    {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accRewardPerShare = pool.accRewardPerShare;

        return user.amount.mul(accRewardPerShare).div(1e12).sub(user.rewardDebt);
    }
    function poolAmount(uint256 _pid, address _user) public view returns (uint256) {
        return userInfo[_pid][_user].amount;
    }

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

        pendingRewards = pendingRewards.sub(allRewards);
    }

    // ----
    // Function that adds pending rewards, called by the Rena token.
    // ----
    uint256 private renaBalance;
    function addPendingRewards() public {
        uint256 newRewards = rena.balanceOf(address(this)).sub(renaBalance);
        
        if(newRewards > 0) {
            renaBalance = rena.balanceOf(address(this)); // If there is no change the balance didn't change
            pendingRewards = pendingRewards.add(newRewards);
            rewardsInThisEpoch = rewardsInThisEpoch.add(newRewards);
        }
    }

    // Update reward variables of the given pool to be up-to-date.
    function updatePool(uint256 _pid) internal returns (uint256 renaRewardWhole) {
        PoolInfo storage pool = poolInfo[_pid];

        uint256 tokenSupply = pool.token.balanceOf(address(this));
        if (tokenSupply == 0) { // avoids division by 0 errors
            return 0;
        }
        renaRewardWhole = pendingRewards // Multiplies pending rewards by allocation point of this pool and then total allocation
            .mul(pool.allocPoint)        // getting the percent of total pending rewards this pool should get
            .div(totalAllocPoint);       // we can do this because pools are only mass updated
        uint256 renaRewardFee = renaRewardWhole.mul(DEV_FEE).div(10000);
        uint256 renaRewardToDistribute = renaRewardWhole.sub(renaRewardFee);

        pending_DEV_rewards = pending_DEV_rewards.add(renaRewardFee);

        pool.accRewardPerShare = pool.accRewardPerShare.add(
            renaRewardToDistribute.mul(1e12).div(tokenSupply)
        );

    }

    // Deposit  tokens to RenaVault for rena allocation.
    function deposit(uint256 _pid, uint256 _amount) public {

        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];

        massUpdatePools();
        
        // Transfer pending tokens
        // to user
        updateAndPayOutPending(_pid, msg.sender);
        //Transfer in the amounts from user
        // save gas
        if(_amount > 0) {
            pool.token.safeTransferFrom(address(msg.sender), address(this), _amount);
            user.amount = user.amount.add(_amount);
        }


        user.rewardDebt = user.amount.mul(pool.accRewardPerShare).div(1e12);
        emit Deposit(msg.sender, _pid, _amount);
    }

    // Test coverage
    // [ ] Does user get the deposited amounts?
    // [ ] Does user that its deposited for update correcty?
    // [ ] Does the depositor get their tokens decreased
    function depositFor(address depositFor_, uint256 _pid, uint256 _amount) public {
        // requires no allowances
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][depositFor_];

        massUpdatePools();
        
        // Transfer pending tokens
        // to user
        updateAndPayOutPending(_pid, depositFor_); // Update the balances of person that amount is being deposited for

        if(_amount > 0) {
            pool.token.safeTransferFrom(address(msg.sender), address(this), _amount);
            user.amount = user.amount.add(_amount); // This is depositedFor address
        }

        user.rewardDebt = user.amount.mul(pool.accRewardPerShare).div(1e12); /// This is deposited for address
        emit Deposit(depositFor_, _pid, _amount);

    }

    // Test coverage
    // [ ] Does allowance update correctly?
    function setAllowanceForPoolToken(address spender, uint256 _pid, uint256 value) public {
        require(_pid < poolInfo.length, "pool doesnt exist");
        allowance[_pid][msg.sender][spender] = value;
        emit Approval(msg.sender, spender, _pid, value);
    }

    function hasAllowanceForPoolToken(address spender, uint256 _pid, uint256 value, address _user) external view returns(bool) {
        require(_pid < poolInfo.length, "pool doesnt exist");
        return allowance[_pid][_user][spender] >= value;
    }

    // Test coverage
    // [ ] Does allowance decrease?
    // [ ] Do you need allowance
    // [ ] Withdraws to correct address
    function withdrawFrom(address owner, uint256 _pid, uint256 _amount) public  {
        require(_pid < poolInfo.length, "pool doesnt exist");
        require(allowance[_pid][owner][msg.sender] >= _amount, "withdraw: insufficient allowance");
        allowance[_pid][owner][msg.sender] = allowance[_pid][owner][msg.sender].sub(_amount);
        _withdraw(_pid, _amount, owner, msg.sender);

    }

    function withdrawFromTo(address owner, uint256 _pid, uint256 _amount, address _to) public  {
        require(_pid < poolInfo.length, "pool doesnt exist");
        require(allowance[_pid][owner][msg.sender] >= _amount, "withdraw: insufficient allowance");
        allowance[_pid][owner][msg.sender] = allowance[_pid][owner][msg.sender].sub(_amount);
        _withdraw(_pid, _amount, owner, _to);
    }    

    // Withdraw  tokens from RenaVault.
    function claim(address _from, uint256 _pid) external {
        require(msg.sender == rena.claim(), "Only Claim can claim");
        PoolInfo storage pool = poolInfo[_pid];
        require(pool.withdrawable, "Withdrawing from this pool is disabled");
        UserInfo storage user = userInfo[_pid][_from];
        require(user.amount > 0, "withdraw: not good");

        massUpdatePools();
        updateAndPayOutPending(_pid, _from); // Update balances of from this is not withdrawal but claiming RENA farmed
        user.rewardDebt = user.amount.mul(pool.accRewardPerShare).div(1e12);

        emit Claim(_from, _pid);
    }

    function withdraw(uint256 _pid, uint256 _amount) public {
        _withdraw(_pid, _amount, msg.sender, msg.sender);
    }

    // Low level withdraw function
    function _withdraw(uint256 _pid, uint256 _amount, address from, address to) internal {
        PoolInfo storage pool = poolInfo[_pid];
        require(pool.withdrawable, "Withdrawing from this pool is disabled");
        UserInfo storage user = userInfo[_pid][from];
        require(user.amount >= _amount, "withdraw: not good");
        massUpdatePools();
        updateAndPayOutPending(_pid, from); // Update balances of from this is not withdrawal but claiming RENA farmed

        if(_amount > 0) {
            user.amount = user.amount.sub(_amount);
            pool.token.safeTransfer(address(to), _amount);
        }
        user.rewardDebt = user.amount.mul(pool.accRewardPerShare).div(1e12);

        emit Withdraw(to, _pid, _amount);
    }

    function updateAndPayOutPending(uint256 _pid, address _from) internal {
        uint256 pending_ = pendingrena(_pid, _from);

        if(pending_ > 0) {
            safeClaimTransfer(_from, pending_);
        }

    }

    // function that lets owner/governance contract
    // approve allowance for any token inside this contract
    // This means all future UNI like airdrops are covered
    // And at the same time allows us to give allowance to strategy contracts.
    // Upcoming cYFI etc vaults strategy contracts will  se this function to manage and farm yield on value locked
    function setStrategyContractOrDistributionContractAllowance(address tokenAddress, uint256 _amount, address contractAddress) public onlySuperAdmin {
        require(isContract(contractAddress), "Recipent is not a smart contract, BAD");
        IERC20(tokenAddress).approve(contractAddress, _amount);
    }

    function isContract(address addr) public view returns (bool) {
        uint size;
        assembly { size := extcodesize(addr) }
        return size > 0;
    }

    // Withdraw without caring about rewards. EMERGENCY ONLY.
    // !Caution this will remove all your pending rewards!
    function emergencyWithdraw(uint256 _pid) public {
        PoolInfo storage pool = poolInfo[_pid];
        require(pool.withdrawable, "Withdrawing from this pool is disabled");
        UserInfo storage user = userInfo[_pid][msg.sender];
        pool.token.safeTransfer(address(msg.sender), user.amount);
        emit EmergencyWithdraw(msg.sender, _pid, user.amount);
        user.amount = 0;
        user.rewardDebt = 0;
        // No mass update dont update pending rewards
    }
    function safeClaimTransfer(address _to, uint256 _amount) internal {
        uint256 renaBal = rena.balanceOf(address(this));
        if (_amount > renaBal) {
            rena.transfer(rena.claim(), renaBal);
            IClaim(rena.claim()).setClaim( _to, renaBal);
            renaBalance = rena.balanceOf(address(this));
        } else {
            rena.transfer(rena.claim(), _amount);
            IClaim(rena.claim()).setClaim( _to, _amount);
            renaBalance = rena.balanceOf(address(this));
        }
        //Avoids possible recursion loop
        // proxy?
        transferDevFee();
    }
    // Safe Rena transfer function, just in case if rounding error causes pool to not have enough RENAs.
    function safeRenaTransfer(address _to, uint256 _amount) internal {

        uint256 renaBal = rena.balanceOf(address(this));

        if (_amount > renaBal) {
            rena.transfer(_to, renaBal);
            renaBalance = rena.balanceOf(address(this));
        } else {
            rena.transfer(_to, _amount);
            renaBalance = rena.balanceOf(address(this));
        }
        //Avoids possible recursion loop
        // proxy?
        transferDevFee();
    }


    function transferDevFee() public {
        if(pending_DEV_rewards == 0) return;
        uint256 renaBal = rena.balanceOf(address(this));
        if (pending_DEV_rewards > renaBal) {
            rena.transfer(devaddr, renaBal);
            renaBalance = rena.balanceOf(address(this));
        } else {
            rena.transfer(devaddr, pending_DEV_rewards);
            renaBalance = rena.balanceOf(address(this));
        }
        pending_DEV_rewards = 0;
    }

    // Update dev address by the previous dev.
    function setDevFeeReciever(address _devaddr) public onlyOwner {
        devaddr = _devaddr;
    }

    address private _superAdmin;

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



    /**
     * @dev Returns the address of the current super admin
     */
    function superAdmin() public view returns (address) {
        return _superAdmin;
    }

    /**
     * @dev Throws if called by any account other than the superAdmin
     */
    modifier onlySuperAdmin() {
        require(_superAdmin == _msgSender(), "Super admin : caller is not super admin.");
        _;
    }

    // Assisns super admint to address 0, making it unreachable forever
    function burnSuperAdmin() public virtual onlySuperAdmin {
        emit SuperAdminTransfered(_superAdmin, address(0));
        _superAdmin = address(0);
    }

    // Super admin can transfer its powers to another address
    function newSuperAdmin(address newOwner) public virtual onlySuperAdmin {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit SuperAdminTransfered(_superAdmin, newOwner);
        _superAdmin = newOwner;
    }
}

File 2 of 18 : 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 3 of 18 : 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 18 : 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 5 of 18 : 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 6 of 18 : Rena.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/ReentrancyGuard.sol';
import './dependencies/uniswap-v2-periphery/contracts/dependencies/uniswap-v2-core/contracts/interfaces/IUniswapV2Pair.sol';
import './dependencies/uniswap-v2-periphery/contracts/dependencies/uniswap-v2-core/contracts/interfaces/IUniswapV2Factory.sol';
import './dependencies/uniswap-v2-periphery/contracts/interfaces/IUniswapV2Router02.sol';

import './interfaces/IRebalancer.sol';
import './interfaces/ILPStaking.sol';

contract Rena is ERC20("Rena", "RENA"), Ownable, ReentrancyGuard {
    using SafeMath for uint256;

    //Needed Addresses
    address public WETH;
    address public renaRouter;
    address public uniRouter;
    address public uniFactory;
    address public uniPair;
    address public renaFactory;

    address payable public treasury;

    //Objects
    address payable public rebalancer;
    address public feeDistributor;
    address public claim;
    address public lpStaking;

    //Fee Divisors
    uint16 public feeDivisor;
    uint16 public callerRewardDivisor;
    uint16 public rebalancerDivisor;

    //Map toggles
    mapping(address => bool) feeless;

    //Overflow protected
    uint256 public minimumRebalanceAmount;
    uint256 public lastRebalance;
    uint256 public rebalanceInterval;

    constructor (
        address renaRouter_,
        address uniRouter_,
        uint256 minimumReblanceAmount_,
        uint256 rebalanceInterval_
        ) {
        treasury = msg.sender;

        feeDivisor = 100;
        callerRewardDivisor = 40;
        rebalancerDivisor = 200;

        minimumRebalanceAmount = minimumReblanceAmount_;

        renaRouter = renaRouter_;
        uniRouter = uniRouter_;
        WETH = IUniswapV2Router02(uniRouter).WETH();
        uniFactory = IUniswapV2Router02(uniRouter).factory();
        uniPair = IUniswapV2Factory(uniFactory).createPair(address(this), WETH);
        
        feeless[address(this)] = true;
        feeless[msg.sender] = true;

        lastRebalance = block.timestamp;
        rebalanceInterval = rebalanceInterval_;

        _mint(msg.sender, 11000000 * 1e18);
    }


    function _transfer(address from, address to, uint256 amount) internal override {
        if(feeDivisor > 0 && feeless[from] == false && feeless[to] == false) {
            uint256 feeAmount = amount.div(feeDivisor);
            super._transfer(from, address(feeDistributor), feeAmount);
            super._transfer(from, to, amount.sub(feeAmount));
        }
        else {
            super._transfer(from, to, amount);
        }
    }

    function toggleFeeless(address addr_) external onlyOwner {
        feeless[addr_] = !feeless[addr_];
    }

    function changeRebalanceInterval(uint256 interval_) external onlyOwner {
        rebalanceInterval = interval_;
    }


    function changeFeeDivisor(uint16 feeDivisor_) external onlyOwner {
        require(feeDivisor_ >= 10, "Must not be greater than 10% total fee");
        feeDivisor = feeDivisor_;
    }

    function changeCallerRewardDivisor(uint16 callerRewardDivisor_) external onlyOwner {
        require(callerRewardDivisor_ >= 10, "Must not be greater than 10% total");
        callerRewardDivisor = callerRewardDivisor_;
    }
    
    function changeMinRebalancerAmount(uint256 minimumRebalanceAmount_) external onlyOwner {
        require(minimumRebalanceAmount_ >= 1, "Must be greater than 1");
        minimumRebalanceAmount = minimumRebalanceAmount_;
    }

    function changeRebalalncerDivisor(uint16 rebalancerDivisor_) external onlyOwner {
        require(rebalancerDivisor_ >= 10, "Must not be greater than 10% total");
        rebalancerDivisor = rebalancerDivisor_;
    }

    function setUniRouter(address uniRouter_) external onlyOwner {
        uniRouter = uniRouter_;
        uniFactory = IUniswapV2Router02(uniRouter).factory();
        WETH = IUniswapV2Router02(uniRouter).WETH();
        uniPair = IUniswapV2Factory(uniFactory).getPair(WETH, address(this));
        if( uniPair == address(0))
            uniPair = IUniswapV2Factory(uniFactory).createPair(address(this), WETH);
    }

    function setRenaRouter(address renaRouter_) external onlyOwner {
        renaRouter = renaRouter_;
        renaFactory = IUniswapV2Router02(renaRouter).factory();
        feeless[renaRouter_] = true;
    }
    

    function setRebalancer(address payable rebalancer_) external onlyOwner {
        rebalancer = rebalancer_;
        feeless[rebalancer_] = true;
    }

    function setClaim(address claim_) external onlyOwner {
        claim = claim_;
        feeless[claim_] = true;
    }

    function setlpStaking(address lpStaking_) external onlyOwner {
        lpStaking = lpStaking_;
        feeless[lpStaking_] = true;
    }

    function setFeeDistributor(address payable feeDistributor_) external onlyOwner {
        feeDistributor = feeDistributor_;
        feeless[feeDistributor_] = true;
    }

    function rebalance() external nonReentrant {
        require(balanceOf(msg.sender) > minimumRebalanceAmount, "You aren't part of the syndicate");
        require(block.timestamp > lastRebalance + rebalanceInterval, "Too Soon");
        lastRebalance = block.timestamp;

        IRebalancer(rebalancer).rebalance(callerRewardDivisor, rebalancerDivisor);
    }
}

File 7 of 18 : IClaim.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

interface IClaim {
    function claim(uint256 requested_) external payable;
    function setClaim(address _from, uint256 _amount) external;
}

File 8 of 18 : 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 18 : 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 18 : 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 { }
}

File 11 of 18 : 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 12 of 18 : IUniswapV2Pair.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

import "./IUniswapV2ERC20.sol";

interface IUniswapV2Pair is IUniswapV2ERC20 {
    // event Approval(address indexed owner, address indexed spender, uint value);
    // event Transfer(address indexed from, address indexed to, uint value);

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Sync(uint112 reserve0, uint112 reserve1);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );

    // function name() external pure returns (string memory);
    // function symbol() external pure returns (string memory);
    // function decimals() external pure returns (uint8);
    // function totalSupply() external view returns (uint);
    // function balanceOf(address owner) external view returns (uint);
    // function allowance(address owner, address spender) external view returns (uint);

    // function approve(address spender, uint value) external returns (bool);
    // function transfer(address to, uint value) external returns (bool);
    // function transferFrom(address from, address to, uint value) external returns (bool);

    // function DOMAIN_SEPARATOR() external view returns (bytes32);
    // function PERMIT_TYPEHASH() external pure returns (bytes32);
    // function nonces(address owner) external view returns (uint);

    // function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}

File 13 of 18 : IUniswapV2Factory.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

interface IUniswapV2Factory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint);

    function feeTo() external view returns (address);
    function feeToSetter() external view returns (address);

    function getPair(address tokenA, address tokenB) external view returns (address pair);
    function allPairs(uint) external view returns (address pair);
    function allPairsLength() external view returns (uint);

    function createPair(address tokenA, address tokenB) external returns (address pair);

    function setFeeTo(address) external;
    function setFeeToSetter(address) external;
}

File 14 of 18 : IUniswapV2Router02.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

import './IUniswapV2Router01.sol';

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountETH);
    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}

File 15 of 18 : IRebalancer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

interface IRebalancer {
    function rebalance(uint16 callerRewardDivisor, uint16 rebalanceDivisor) external;
    function refill() payable external;
}

File 16 of 18 : ILPStaking.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

interface ILPStaking {
    function withdrawFromTo(address owner, uint256 _pid, uint256 _amount, address _to) external;
    function claim(address _from, uint256 _pid) external;
    function pendingrena(uint256 pid_, address account_) external view returns(uint256);
    function addPendingRewards() external;
    function massUpdatePools() external;      
}

File 17 of 18 : IUniswapV2ERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

interface IUniswapV2ERC20 {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}

File 18 of 18 : IUniswapV2Router01.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

interface IUniswapV2Router01 {
    function factory() external view returns (address);
    function WETH() external view returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"_pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":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":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"SuperAdminTransfered","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":"addPendingRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"bool","name":"_withUpdate","type":"bool"},{"internalType":"bool","name":"_withdrawable","type":"bool"}],"name":"addPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"averageFeesPerBlockEpoch","outputs":[{"internalType":"uint256","name":"averagePerBlock","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"averageFeesPerBlockSinceStart","outputs":[{"internalType":"uint256","name":"averagePerBlock","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"burnSuperAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractStartBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cumulativeRewardsSinceStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"depositFor_","type":"address"},{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositFor","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":"epoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epochCalculationStartBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"epochRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"hasAllowanceForPoolToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_rena","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isContract","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"newSuperAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingrena","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"poolAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"accRewardPerShare","type":"uint256"},{"internalType":"bool","name":"withdrawable","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rena","outputs":[{"internalType":"contract Rena","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardsInThisEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setAllowanceForPoolToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_DEV_FEE","type":"uint16"}],"name":"setDevFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_devaddr","type":"address"}],"name":"setDevFeeReciever","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"bool","name":"_withdrawable","type":"bool"}],"name":"setPoolWithdrawable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"contractAddress","type":"address"}],"name":"setStrategyContractOrDistributionContractAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startNewEpoch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"superAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"transferDevFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","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"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"withdrawFromTo","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50600061001b61006a565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35061006e565b3390565b612eb0806200007e6000396000f3fe608060405234801561001057600080fd5b50600436106102745760003560e01c806364482f7911610151578063bd4e1963116100c3578063dbe0901f11610087578063dbe0901f146106f4578063e07335aa14610726578063e18cb4fe1461072e578063e2bbb1581461074f578063eded3fda14610772578063f2fde38b1461077a57610274565b8063bd4e196314610680578063c401458814610688578063c4d66de8146106be578063c8ffb873146106e4578063d49e77cd146106ec57610274565b8063934eaa5011610115578063934eaa501461059f57806393f1a40b146105a75780639dbc2d90146105ec578063a676860a146105f4578063aad3ec961461061a578063b42682911461064657610274565b806364482f7914610522578063713827451461054d578063715018a6146105875780638da5cb5b1461058f578063900cf0cf1461059757610274565b8063434339f3116101ea5780635207cc0d116101ae5780635207cc0d1461049c5780635312ea8e146104c15780635d577c18146104de578063608c8d3a146104e6578063630b5ba1146104ee578063637f0e65146104f657610274565b8063434339f31461041a578063441a3e701461042257806349c5468d146104455780634cf5fbf51461044d5780634dc47d341461047f57610274565b806317caf6f11161023c57806317caf6f1146103625780631a745abc1461036a57806329575f6a146103965780632d6754e5146103ba5780633a0967cd146103e05780633aab0a621461041257610274565b806303dec00914610279578063081e3eda146102935780630a0ee0361461029b5780631526fe27146102d95780631627905514610328575b600080fd5b6102816107a0565b60408051918252519081900360200190f35b6102816107c8565b6102d7600480360360808110156102b157600080fd5b508035906001600160a01b036020820135169060408101351515906060013515156107ce565b005b6102f6600480360360208110156102ef57600080fd5b50356109eb565b604080516001600160a01b03909516855260208501939093528383019190915215156060830152519081900360800190f35b61034e6004803603602081101561033e57600080fd5b50356001600160a01b0316610a32565b604080519115158252519081900360200190f35b610281610a3c565b6102816004803603604081101561038057600080fd5b50803590602001356001600160a01b0316610a42565b61039e610ac5565b604080516001600160a01b039092168252519081900360200190f35b6102d7600480360360208110156103d057600080fd5b50356001600160a01b0316610ad4565b6102d7600480360360608110156103f657600080fd5b506001600160a01b038135169060208101359060400135610b58565b6102d7610c99565b6102d7610d2d565b6102d76004803603604081101561043857600080fd5b5080359060200135610fcd565b610281610fdd565b6102d76004803603606081101561046357600080fd5b506001600160a01b038135169060208101359060400135610fe3565b6102816004803603602081101561049557600080fd5b50356110c8565b6102d7600480360360408110156104b257600080fd5b508035906020013515156110da565b6102d7600480360360208110156104d757600080fd5b5035611170565b61028161124f565b610281611255565b6102d761125b565b6102816004803603604081101561050c57600080fd5b50803590602001356001600160a01b031661129c565b6102d76004803603606081101561053857600080fd5b508035906020810135906040013515156112c4565b61034e6004803603608081101561056357600080fd5b506001600160a01b038135811691602081013591604082013591606001351661139f565b6102d7611423565b61039e6114cf565b6102816114de565b6102d76114e4565b6105d3600480360360408110156105bd57600080fd5b50803590602001356001600160a01b0316611582565b6040805192835260208301919091528051918290030190f35b6102816115a6565b6102d76004803603602081101561060a57600080fd5b50356001600160a01b03166115cf565b6102d76004803603604081101561063057600080fd5b506001600160a01b0381351690602001356116c4565b6102d76004803603608081101561065c57600080fd5b506001600160a01b03813581169160208101359160408201359160600135166118ce565b61039e611a09565b6102d76004803603606081101561069e57600080fd5b506001600160a01b03813581169160208101359160409091013516611a18565b6102d7600480360360208110156106d457600080fd5b50356001600160a01b0316611b38565b610281611bcb565b61039e611bd1565b6102d76004803603606081101561070a57600080fd5b506001600160a01b038135169060208101359060400135611be0565b6102d7611c99565b6102d76004803603602081101561074457600080fd5b503561ffff16611dc8565b6102d76004803603604081101561076557600080fd5b5080359060200135611e96565b610281611f68565b6102d76004803603602081101561079057600080fd5b50356001600160a01b0316611f6e565b60006107c36107ba6009544361207090919063ffffffff16565b600b54906120cd565b905090565b60045490565b6107d6612134565b6001600160a01b03166107e76114cf565b6001600160a01b031614610830576040805162461bcd60e51b81526020600482018190526024820152600080516020612e0b833981519152604482015290519081900360640190fd5b811561083e5761083e61125b565b60045460005b818110156108d857846001600160a01b03166004828154811061086357fe5b60009182526020909120600490910201546001600160a01b031614156108d0576040805162461bcd60e51b815260206004820152601860248201527f4572726f7220706f6f6c20616c72656164792061646465640000000000000000604482015290519081900360640190fd5b600101610844565b506006546108e69086612138565b60065550604080516080810182526001600160a01b03948516815260208101958652600091810182815292151560608201908152600480546001810182559381905291517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b9390920292830180546001600160a01b031916929096169190911790945593517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c850155517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d84015550517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19e909101805460ff1916911515919091179055565b600481815481106109fb57600080fd5b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169350919060ff1684565b803b15155b919050565b60065481565b60008060048481548110610a5257fe5b600091825260208083208784526005825260408085206001600160a01b038916865290925292206002600490920290920190810154600183015483549294509091610ab99190610ab39064e8d4a5100090610aad9086612199565b906120cd565b90612070565b93505050505b92915050565b6011546001600160a01b031690565b610adc612134565b6001600160a01b0316610aed6114cf565b6001600160a01b031614610b36576040805162461bcd60e51b81526020600482018190526024820152600080516020612e0b833981519152604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6004548210610ba2576040805162461bcd60e51b81526020600482015260116024820152701c1bdbdb08191bd95cdb9d08195e1a5cdd607a1b604482015290519081900360640190fd5b60008281526001602090815260408083206001600160a01b03871684528252808320338452909152902054811115610c21576040805162461bcd60e51b815260206004820181905260248201527f77697468647261773a20696e73756666696369656e7420616c6c6f77616e6365604482015290519081900360640190fd5b60008281526001602090815260408083206001600160a01b03871684528252808320338452909152902054610c569082612070565b60008381526001602090815260408083206001600160a01b0388168452825280832033808552925290912091909155610c94908390839086906121f2565b505050565b4360095461c3500110610cf3576040805162461bcd60e51b815260206004820152601760248201527f4e65772065706f6368206e6f7420726561647920796574000000000000000000604482015290519081900360640190fd5b600b54600c546000908152600d60205260409020819055600a54610d1691612138565b600a556000600b5543600955600c80546001019055565b600f54610d3957610fcb565b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610d8457600080fd5b505afa158015610d98573d6000803e3d6000fd5b505050506040513d6020811015610dae57600080fd5b5051600f54909150811015610ec1576002546003546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b158015610e1657600080fd5b505af1158015610e2a573d6000803e3d6000fd5b505050506040513d6020811015610e4057600080fd5b5050600254604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015610e8d57600080fd5b505afa158015610ea1573d6000803e3d6000fd5b505050506040513d6020811015610eb757600080fd5b5051601055610fc4565b600254600354600f546040805163a9059cbb60e01b81526001600160a01b039384166004820152602481019290925251919092169163a9059cbb9160448083019260209291908290030181600087803b158015610f1d57600080fd5b505af1158015610f31573d6000803e3d6000fd5b505050506040513d6020811015610f4757600080fd5b5050600254604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015610f9457600080fd5b505afa158015610fa8573d6000803e3d6000fd5b505050506040513d6020811015610fbe57600080fd5b50516010555b506000600f555b565b610fd9828233336121f2565b5050565b60085481565b600060048381548110610ff257fe5b600091825260208083208684526005825260408085206001600160a01b038a16865290925292206004909102909101915061102b61125b565b6110358486612368565b8215611061578154611052906001600160a01b0316333086612386565b805461105e9084612138565b81555b6002820154815461107c9164e8d4a5100091610aad91612199565b600182015560408051848152905185916001600160a01b038816917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a35050505050565b600d6020526000908152604090205481565b6110e2612134565b6001600160a01b03166110f36114cf565b6001600160a01b03161461113c576040805162461bcd60e51b81526020600482018190526024820152600080516020612e0b833981519152604482015290519081900360640190fd5b806004838154811061114a57fe5b60009182526020909120600490910201600301805460ff19169115159190911790555050565b60006004828154811061117f57fe5b60009182526020909120600490910201600381015490915060ff166111d55760405162461bcd60e51b8152600401808060200182810382526026815260200180612e2b6026913960400191505060405180910390fd5b6000828152600560209081526040808320338085529252909120805483549192611208926001600160a01b0316916123e0565b80546040805191825251849133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959181900360200190a360008082556001909101555050565b60095481565b600b5481565b6004546000805b828110156112875761127d61127682612432565b8390612138565b9150600101611262565b506007546112959082612070565b6007555050565b60009182526005602090815260408084206001600160a01b0393909316845291905290205490565b6112cc612134565b6001600160a01b03166112dd6114cf565b6001600160a01b031614611326576040805162461bcd60e51b81526020600482018190526024820152600080516020612e0b833981519152604482015290519081900360640190fd5b80156113345761133461125b565b6113718261136b6004868154811061134857fe5b90600052602060002090600402016001015460065461207090919063ffffffff16565b90612138565b600681905550816004848154811061138557fe5b906000526020600020906004020160010181905550505050565b60045460009084106113ec576040805162461bcd60e51b81526020600482015260116024820152701c1bdbdb08191bd95cdb9d08195e1a5cdd607a1b604482015290519081900360640190fd5b5060009283526001602090815260408085206001600160a01b03938416865282528085209590921684529390935291902054101590565b61142b612134565b6001600160a01b031661143c6114cf565b6001600160a01b031614611485576040805162461bcd60e51b81526020600482018190526024820152600080516020612e0b833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b600c5481565b6114ec612134565b6011546001600160a01b039081169116146115385760405162461bcd60e51b8152600401808060200182810382526028815260200180612dc26028913960400191505060405180910390fd5b6011546040516000916001600160a01b0316907ff564c40f4f45e62a2c1e6c22e8bfb46501f0f71fa1c72e5358903fa1115a4b64908390a3601180546001600160a01b0319169055565b60056020908152600092835260408084209091529082529020805460019091015482565b60006107c36115c06008544361207090919063ffffffff16565b600b54600a54610aad91612138565b6115d7612134565b6011546001600160a01b039081169116146116235760405162461bcd60e51b8152600401808060200182810382526028815260200180612dc26028913960400191505060405180910390fd5b6001600160a01b0381166116685760405162461bcd60e51b8152600401808060200182810382526026815260200180612d516026913960400191505060405180910390fd5b6011546040516001600160a01b038084169216907ff564c40f4f45e62a2c1e6c22e8bfb46501f0f71fa1c72e5358903fa1115a4b6490600090a3601180546001600160a01b0319166001600160a01b0392909216919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316634e71d92d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561171257600080fd5b505afa158015611726573d6000803e3d6000fd5b505050506040513d602081101561173c57600080fd5b50516001600160a01b03163314611791576040805162461bcd60e51b81526020600482015260146024820152734f6e6c7920436c61696d2063616e20636c61696d60601b604482015290519081900360640190fd5b6000600482815481106117a057fe5b60009182526020909120600490910201600381015490915060ff166117f65760405162461bcd60e51b8152600401808060200182810382526026815260200180612e2b6026913960400191505060405180910390fd5b60008281526005602090815260408083206001600160a01b038716845290915290208054611860576040805162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604482015290519081900360640190fd5b61186861125b565b6118728385612368565b6002820154815461188d9164e8d4a5100091610aad91612199565b600182015560405183906001600160a01b038616907f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d490600090a350505050565b6004548310611918576040805162461bcd60e51b81526020600482015260116024820152701c1bdbdb08191bd95cdb9d08195e1a5cdd607a1b604482015290519081900360640190fd5b60008381526001602090815260408083206001600160a01b03881684528252808320338452909152902054821115611997576040805162461bcd60e51b815260206004820181905260248201527f77697468647261773a20696e73756666696369656e7420616c6c6f77616e6365604482015290519081900360640190fd5b60008381526001602090815260408083206001600160a01b038816845282528083203384529091529020546119cc9083612070565b60008481526001602090815260408083206001600160a01b03891684528252808320338452909152902055611a03838386846121f2565b50505050565b6002546001600160a01b031681565b611a20612134565b6011546001600160a01b03908116911614611a6c5760405162461bcd60e51b8152600401808060200182810382526028815260200180612dc26028913960400191505060405180910390fd5b611a7581610a32565b611ab05760405162461bcd60e51b8152600401808060200182810382526025815260200180612d776025913960400191505060405180910390fd5b826001600160a01b031663095ea7b382846040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015611b0757600080fd5b505af1158015611b1b573d6000803e3d6000fd5b505050506040513d6020811015611b3157600080fd5b5050505050565b6002546001600160a01b031615611b82576040805162461bcd60e51b81526020600482015260096024820152684f6e6c79206f6e636560b81b604482015290519081900360640190fd5b600e805461ffff191660c8179055600280546001600160a01b039092166001600160a01b0319928316179055600380548216339081179091554360085560118054909216179055565b600a5481565b6003546001600160a01b031681565b6004548210611c2a576040805162461bcd60e51b81526020600482015260116024820152701c1bdbdb08191bd95cdb9d08195e1a5cdd607a1b604482015290519081900360640190fd5b6000828152600160209081526040808320338085529083528184206001600160a01b038816808652908452938290208590558151868152928301859052815190927fb3fd5071835887567a0671151121894ddccc2842f1d10bedad13e0d17cace9a792908290030190a3505050565b601054600254604080516370a0823160e01b81523060048201529051600093611d229390926001600160a01b03909116916370a0823191602480820192602092909190829003018186803b158015611cf057600080fd5b505afa158015611d04573d6000803e3d6000fd5b505050506040513d6020811015611d1a57600080fd5b505190612070565b90508015611dc557600254604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015611d7557600080fd5b505afa158015611d89573d6000803e3d6000fd5b505050506040513d6020811015611d9f57600080fd5b5051601055600754611db19082612138565b600755600b54611dc19082612138565b600b555b50565b611dd0612134565b6001600160a01b0316611de16114cf565b6001600160a01b031614611e2a576040805162461bcd60e51b81526020600482018190526024820152600080516020612e0b833981519152604482015290519081900360640190fd5b6103e88161ffff161115611e7e576040805162461bcd60e51b81526020600482015260166024820152754465762066656520636c616d7065642061742031302560501b604482015290519081900360640190fd5b600e805461ffff191661ffff92909216919091179055565b600060048381548110611ea557fe5b60009182526020808320868452600582526040808520338652909252922060049091029091019150611ed561125b565b611edf8433612368565b8215611f0b578154611efc906001600160a01b0316333086612386565b8054611f089084612138565b81555b60028201548154611f269164e8d4a5100091610aad91612199565b6001820155604080518481529051859133917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a350505050565b60075481565b611f76612134565b6001600160a01b0316611f876114cf565b6001600160a01b031614611fd0576040805162461bcd60e51b81526020600482018190526024820152600080516020612e0b833981519152604482015290519081900360640190fd5b6001600160a01b0381166120155760405162461bcd60e51b8152600401808060200182810382526026815260200180612d516026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000828211156120c7576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000808211612123576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161212c57fe5b049392505050565b3390565b600082820183811015612192576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6000826121a857506000610abf565b828202828482816121b557fe5b04146121925760405162461bcd60e51b8152600401808060200182810382526021815260200180612dea6021913960400191505060405180910390fd5b60006004858154811061220157fe5b60009182526020909120600490910201600381015490915060ff166122575760405162461bcd60e51b8152600401808060200182810382526026815260200180612e2b6026913960400191505060405180910390fd5b60008581526005602090815260408083206001600160a01b0387168452909152902080548511156122c4576040805162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604482015290519081900360640190fd5b6122cc61125b565b6122d68685612368565b84156123005780546122e89086612070565b81558154612300906001600160a01b031684876123e0565b6002820154815461231b9164e8d4a5100091610aad91612199565b600182015560408051868152905187916001600160a01b038616917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a3505050505050565b60006123748383610a42565b90508015610c9457610c94828261256a565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611a03908590612a89565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610c94908490612a89565b6000806004838154811061244257fe5b600091825260208083206004928302018054604080516370a0823160e01b81523095810195909552519195506001600160a01b0316926370a08231926024808301939192829003018186803b15801561249a57600080fd5b505afa1580156124ae573d6000803e3d6000fd5b505050506040513d60208110156124c457600080fd5b50519050806124d857600092505050610a37565b6124f7600654610aad846001015460075461219990919063ffffffff16565b600e549093506000906125179061271090610aad90879061ffff16612199565b905060006125258583612070565b600f549091506125359083612138565b600f5561255961254e84610aad8464e8d4a51000612199565b600286015490612138565b846002018190555050505050919050565b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156125b557600080fd5b505afa1580156125c9573d6000803e3d6000fd5b505050506040513d60208110156125df57600080fd5b50519050808211156128385760025460408051634e71d92d60e01b815290516001600160a01b039092169163a9059cbb918391634e71d92d91600480820192602092909190829003018186803b15801561263857600080fd5b505afa15801561264c573d6000803e3d6000fd5b505050506040513d602081101561266257600080fd5b5051604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482018590525160448083019260209291908290030181600087803b1580156126b257600080fd5b505af11580156126c6573d6000803e3d6000fd5b505050506040513d60208110156126dc57600080fd5b505060025460408051634e71d92d60e01b815290516001600160a01b0390921691634e71d92d91600480820192602092909190829003018186803b15801561272357600080fd5b505afa158015612737573d6000803e3d6000fd5b505050506040513d602081101561274d57600080fd5b50516040805163030d760f60e51b81526001600160a01b03868116600483015260248201859052915191909216916361aec1e091604480830192600092919082900301818387803b1580156127a157600080fd5b505af11580156127b5573d6000803e3d6000fd5b5050600254604080516370a0823160e01b815230600482015290516001600160a01b0390921693506370a082319250602480820192602092909190829003018186803b15801561280457600080fd5b505afa158015612818573d6000803e3d6000fd5b505050506040513d602081101561282e57600080fd5b5051601055612a81565b60025460408051634e71d92d60e01b815290516001600160a01b039092169163a9059cbb918391634e71d92d91600480820192602092909190829003018186803b15801561288557600080fd5b505afa158015612899573d6000803e3d6000fd5b505050506040513d60208110156128af57600080fd5b5051604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482018690525160448083019260209291908290030181600087803b1580156128ff57600080fd5b505af1158015612913573d6000803e3d6000fd5b505050506040513d602081101561292957600080fd5b505060025460408051634e71d92d60e01b815290516001600160a01b0390921691634e71d92d91600480820192602092909190829003018186803b15801561297057600080fd5b505afa158015612984573d6000803e3d6000fd5b505050506040513d602081101561299a57600080fd5b50516040805163030d760f60e51b81526001600160a01b03868116600483015260248201869052915191909216916361aec1e091604480830192600092919082900301818387803b1580156129ee57600080fd5b505af1158015612a02573d6000803e3d6000fd5b5050600254604080516370a0823160e01b815230600482015290516001600160a01b0390921693506370a082319250602480820192602092909190829003018186803b158015612a5157600080fd5b505afa158015612a65573d6000803e3d6000fd5b505050506040513d6020811015612a7b57600080fd5b50516010555b610c94610d2d565b6000612ade826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612b3a9092919063ffffffff16565b805190915015610c9457808060200190516020811015612afd57600080fd5b5051610c945760405162461bcd60e51b815260040180806020018281038252602a815260200180612e51602a913960400191505060405180910390fd5b6060612b498484600085612b51565b949350505050565b606082471015612b925760405162461bcd60e51b8152600401808060200182810382526026815260200180612d9c6026913960400191505060405180910390fd5b612b9b85610a32565b612bec576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b60208310612c2a5780518252601f199092019160209182019101612c0b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612c8c576040519150601f19603f3d011682016040523d82523d6000602084013e612c91565b606091505b5091509150612ca1828286612cac565b979650505050505050565b60608315612cbb575081612192565b825115612ccb5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d15578181015183820152602001612cfd565b50505050905090810190601f168015612d425780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573735265636970656e74206973206e6f74206120736d61727420636f6e74726163742c20424144416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c53757065722061646d696e203a2063616c6c6572206973206e6f742073757065722061646d696e2e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725769746864726177696e672066726f6d207468697320706f6f6c2069732064697361626c65645361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122022a67b8b6e4cf0a16a0bd4f63a994cd8608019ef4df3f5c15ac2e62bcb83031b64736f6c63430007060033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102745760003560e01c806364482f7911610151578063bd4e1963116100c3578063dbe0901f11610087578063dbe0901f146106f4578063e07335aa14610726578063e18cb4fe1461072e578063e2bbb1581461074f578063eded3fda14610772578063f2fde38b1461077a57610274565b8063bd4e196314610680578063c401458814610688578063c4d66de8146106be578063c8ffb873146106e4578063d49e77cd146106ec57610274565b8063934eaa5011610115578063934eaa501461059f57806393f1a40b146105a75780639dbc2d90146105ec578063a676860a146105f4578063aad3ec961461061a578063b42682911461064657610274565b806364482f7914610522578063713827451461054d578063715018a6146105875780638da5cb5b1461058f578063900cf0cf1461059757610274565b8063434339f3116101ea5780635207cc0d116101ae5780635207cc0d1461049c5780635312ea8e146104c15780635d577c18146104de578063608c8d3a146104e6578063630b5ba1146104ee578063637f0e65146104f657610274565b8063434339f31461041a578063441a3e701461042257806349c5468d146104455780634cf5fbf51461044d5780634dc47d341461047f57610274565b806317caf6f11161023c57806317caf6f1146103625780631a745abc1461036a57806329575f6a146103965780632d6754e5146103ba5780633a0967cd146103e05780633aab0a621461041257610274565b806303dec00914610279578063081e3eda146102935780630a0ee0361461029b5780631526fe27146102d95780631627905514610328575b600080fd5b6102816107a0565b60408051918252519081900360200190f35b6102816107c8565b6102d7600480360360808110156102b157600080fd5b508035906001600160a01b036020820135169060408101351515906060013515156107ce565b005b6102f6600480360360208110156102ef57600080fd5b50356109eb565b604080516001600160a01b03909516855260208501939093528383019190915215156060830152519081900360800190f35b61034e6004803603602081101561033e57600080fd5b50356001600160a01b0316610a32565b604080519115158252519081900360200190f35b610281610a3c565b6102816004803603604081101561038057600080fd5b50803590602001356001600160a01b0316610a42565b61039e610ac5565b604080516001600160a01b039092168252519081900360200190f35b6102d7600480360360208110156103d057600080fd5b50356001600160a01b0316610ad4565b6102d7600480360360608110156103f657600080fd5b506001600160a01b038135169060208101359060400135610b58565b6102d7610c99565b6102d7610d2d565b6102d76004803603604081101561043857600080fd5b5080359060200135610fcd565b610281610fdd565b6102d76004803603606081101561046357600080fd5b506001600160a01b038135169060208101359060400135610fe3565b6102816004803603602081101561049557600080fd5b50356110c8565b6102d7600480360360408110156104b257600080fd5b508035906020013515156110da565b6102d7600480360360208110156104d757600080fd5b5035611170565b61028161124f565b610281611255565b6102d761125b565b6102816004803603604081101561050c57600080fd5b50803590602001356001600160a01b031661129c565b6102d76004803603606081101561053857600080fd5b508035906020810135906040013515156112c4565b61034e6004803603608081101561056357600080fd5b506001600160a01b038135811691602081013591604082013591606001351661139f565b6102d7611423565b61039e6114cf565b6102816114de565b6102d76114e4565b6105d3600480360360408110156105bd57600080fd5b50803590602001356001600160a01b0316611582565b6040805192835260208301919091528051918290030190f35b6102816115a6565b6102d76004803603602081101561060a57600080fd5b50356001600160a01b03166115cf565b6102d76004803603604081101561063057600080fd5b506001600160a01b0381351690602001356116c4565b6102d76004803603608081101561065c57600080fd5b506001600160a01b03813581169160208101359160408201359160600135166118ce565b61039e611a09565b6102d76004803603606081101561069e57600080fd5b506001600160a01b03813581169160208101359160409091013516611a18565b6102d7600480360360208110156106d457600080fd5b50356001600160a01b0316611b38565b610281611bcb565b61039e611bd1565b6102d76004803603606081101561070a57600080fd5b506001600160a01b038135169060208101359060400135611be0565b6102d7611c99565b6102d76004803603602081101561074457600080fd5b503561ffff16611dc8565b6102d76004803603604081101561076557600080fd5b5080359060200135611e96565b610281611f68565b6102d76004803603602081101561079057600080fd5b50356001600160a01b0316611f6e565b60006107c36107ba6009544361207090919063ffffffff16565b600b54906120cd565b905090565b60045490565b6107d6612134565b6001600160a01b03166107e76114cf565b6001600160a01b031614610830576040805162461bcd60e51b81526020600482018190526024820152600080516020612e0b833981519152604482015290519081900360640190fd5b811561083e5761083e61125b565b60045460005b818110156108d857846001600160a01b03166004828154811061086357fe5b60009182526020909120600490910201546001600160a01b031614156108d0576040805162461bcd60e51b815260206004820152601860248201527f4572726f7220706f6f6c20616c72656164792061646465640000000000000000604482015290519081900360640190fd5b600101610844565b506006546108e69086612138565b60065550604080516080810182526001600160a01b03948516815260208101958652600091810182815292151560608201908152600480546001810182559381905291517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b9390920292830180546001600160a01b031916929096169190911790945593517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c850155517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d84015550517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19e909101805460ff1916911515919091179055565b600481815481106109fb57600080fd5b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169350919060ff1684565b803b15155b919050565b60065481565b60008060048481548110610a5257fe5b600091825260208083208784526005825260408085206001600160a01b038916865290925292206002600490920290920190810154600183015483549294509091610ab99190610ab39064e8d4a5100090610aad9086612199565b906120cd565b90612070565b93505050505b92915050565b6011546001600160a01b031690565b610adc612134565b6001600160a01b0316610aed6114cf565b6001600160a01b031614610b36576040805162461bcd60e51b81526020600482018190526024820152600080516020612e0b833981519152604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6004548210610ba2576040805162461bcd60e51b81526020600482015260116024820152701c1bdbdb08191bd95cdb9d08195e1a5cdd607a1b604482015290519081900360640190fd5b60008281526001602090815260408083206001600160a01b03871684528252808320338452909152902054811115610c21576040805162461bcd60e51b815260206004820181905260248201527f77697468647261773a20696e73756666696369656e7420616c6c6f77616e6365604482015290519081900360640190fd5b60008281526001602090815260408083206001600160a01b03871684528252808320338452909152902054610c569082612070565b60008381526001602090815260408083206001600160a01b0388168452825280832033808552925290912091909155610c94908390839086906121f2565b505050565b4360095461c3500110610cf3576040805162461bcd60e51b815260206004820152601760248201527f4e65772065706f6368206e6f7420726561647920796574000000000000000000604482015290519081900360640190fd5b600b54600c546000908152600d60205260409020819055600a54610d1691612138565b600a556000600b5543600955600c80546001019055565b600f54610d3957610fcb565b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610d8457600080fd5b505afa158015610d98573d6000803e3d6000fd5b505050506040513d6020811015610dae57600080fd5b5051600f54909150811015610ec1576002546003546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b158015610e1657600080fd5b505af1158015610e2a573d6000803e3d6000fd5b505050506040513d6020811015610e4057600080fd5b5050600254604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015610e8d57600080fd5b505afa158015610ea1573d6000803e3d6000fd5b505050506040513d6020811015610eb757600080fd5b5051601055610fc4565b600254600354600f546040805163a9059cbb60e01b81526001600160a01b039384166004820152602481019290925251919092169163a9059cbb9160448083019260209291908290030181600087803b158015610f1d57600080fd5b505af1158015610f31573d6000803e3d6000fd5b505050506040513d6020811015610f4757600080fd5b5050600254604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015610f9457600080fd5b505afa158015610fa8573d6000803e3d6000fd5b505050506040513d6020811015610fbe57600080fd5b50516010555b506000600f555b565b610fd9828233336121f2565b5050565b60085481565b600060048381548110610ff257fe5b600091825260208083208684526005825260408085206001600160a01b038a16865290925292206004909102909101915061102b61125b565b6110358486612368565b8215611061578154611052906001600160a01b0316333086612386565b805461105e9084612138565b81555b6002820154815461107c9164e8d4a5100091610aad91612199565b600182015560408051848152905185916001600160a01b038816917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a35050505050565b600d6020526000908152604090205481565b6110e2612134565b6001600160a01b03166110f36114cf565b6001600160a01b03161461113c576040805162461bcd60e51b81526020600482018190526024820152600080516020612e0b833981519152604482015290519081900360640190fd5b806004838154811061114a57fe5b60009182526020909120600490910201600301805460ff19169115159190911790555050565b60006004828154811061117f57fe5b60009182526020909120600490910201600381015490915060ff166111d55760405162461bcd60e51b8152600401808060200182810382526026815260200180612e2b6026913960400191505060405180910390fd5b6000828152600560209081526040808320338085529252909120805483549192611208926001600160a01b0316916123e0565b80546040805191825251849133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959181900360200190a360008082556001909101555050565b60095481565b600b5481565b6004546000805b828110156112875761127d61127682612432565b8390612138565b9150600101611262565b506007546112959082612070565b6007555050565b60009182526005602090815260408084206001600160a01b0393909316845291905290205490565b6112cc612134565b6001600160a01b03166112dd6114cf565b6001600160a01b031614611326576040805162461bcd60e51b81526020600482018190526024820152600080516020612e0b833981519152604482015290519081900360640190fd5b80156113345761133461125b565b6113718261136b6004868154811061134857fe5b90600052602060002090600402016001015460065461207090919063ffffffff16565b90612138565b600681905550816004848154811061138557fe5b906000526020600020906004020160010181905550505050565b60045460009084106113ec576040805162461bcd60e51b81526020600482015260116024820152701c1bdbdb08191bd95cdb9d08195e1a5cdd607a1b604482015290519081900360640190fd5b5060009283526001602090815260408085206001600160a01b03938416865282528085209590921684529390935291902054101590565b61142b612134565b6001600160a01b031661143c6114cf565b6001600160a01b031614611485576040805162461bcd60e51b81526020600482018190526024820152600080516020612e0b833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b600c5481565b6114ec612134565b6011546001600160a01b039081169116146115385760405162461bcd60e51b8152600401808060200182810382526028815260200180612dc26028913960400191505060405180910390fd5b6011546040516000916001600160a01b0316907ff564c40f4f45e62a2c1e6c22e8bfb46501f0f71fa1c72e5358903fa1115a4b64908390a3601180546001600160a01b0319169055565b60056020908152600092835260408084209091529082529020805460019091015482565b60006107c36115c06008544361207090919063ffffffff16565b600b54600a54610aad91612138565b6115d7612134565b6011546001600160a01b039081169116146116235760405162461bcd60e51b8152600401808060200182810382526028815260200180612dc26028913960400191505060405180910390fd5b6001600160a01b0381166116685760405162461bcd60e51b8152600401808060200182810382526026815260200180612d516026913960400191505060405180910390fd5b6011546040516001600160a01b038084169216907ff564c40f4f45e62a2c1e6c22e8bfb46501f0f71fa1c72e5358903fa1115a4b6490600090a3601180546001600160a01b0319166001600160a01b0392909216919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316634e71d92d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561171257600080fd5b505afa158015611726573d6000803e3d6000fd5b505050506040513d602081101561173c57600080fd5b50516001600160a01b03163314611791576040805162461bcd60e51b81526020600482015260146024820152734f6e6c7920436c61696d2063616e20636c61696d60601b604482015290519081900360640190fd5b6000600482815481106117a057fe5b60009182526020909120600490910201600381015490915060ff166117f65760405162461bcd60e51b8152600401808060200182810382526026815260200180612e2b6026913960400191505060405180910390fd5b60008281526005602090815260408083206001600160a01b038716845290915290208054611860576040805162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604482015290519081900360640190fd5b61186861125b565b6118728385612368565b6002820154815461188d9164e8d4a5100091610aad91612199565b600182015560405183906001600160a01b038616907f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d490600090a350505050565b6004548310611918576040805162461bcd60e51b81526020600482015260116024820152701c1bdbdb08191bd95cdb9d08195e1a5cdd607a1b604482015290519081900360640190fd5b60008381526001602090815260408083206001600160a01b03881684528252808320338452909152902054821115611997576040805162461bcd60e51b815260206004820181905260248201527f77697468647261773a20696e73756666696369656e7420616c6c6f77616e6365604482015290519081900360640190fd5b60008381526001602090815260408083206001600160a01b038816845282528083203384529091529020546119cc9083612070565b60008481526001602090815260408083206001600160a01b03891684528252808320338452909152902055611a03838386846121f2565b50505050565b6002546001600160a01b031681565b611a20612134565b6011546001600160a01b03908116911614611a6c5760405162461bcd60e51b8152600401808060200182810382526028815260200180612dc26028913960400191505060405180910390fd5b611a7581610a32565b611ab05760405162461bcd60e51b8152600401808060200182810382526025815260200180612d776025913960400191505060405180910390fd5b826001600160a01b031663095ea7b382846040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015611b0757600080fd5b505af1158015611b1b573d6000803e3d6000fd5b505050506040513d6020811015611b3157600080fd5b5050505050565b6002546001600160a01b031615611b82576040805162461bcd60e51b81526020600482015260096024820152684f6e6c79206f6e636560b81b604482015290519081900360640190fd5b600e805461ffff191660c8179055600280546001600160a01b039092166001600160a01b0319928316179055600380548216339081179091554360085560118054909216179055565b600a5481565b6003546001600160a01b031681565b6004548210611c2a576040805162461bcd60e51b81526020600482015260116024820152701c1bdbdb08191bd95cdb9d08195e1a5cdd607a1b604482015290519081900360640190fd5b6000828152600160209081526040808320338085529083528184206001600160a01b038816808652908452938290208590558151868152928301859052815190927fb3fd5071835887567a0671151121894ddccc2842f1d10bedad13e0d17cace9a792908290030190a3505050565b601054600254604080516370a0823160e01b81523060048201529051600093611d229390926001600160a01b03909116916370a0823191602480820192602092909190829003018186803b158015611cf057600080fd5b505afa158015611d04573d6000803e3d6000fd5b505050506040513d6020811015611d1a57600080fd5b505190612070565b90508015611dc557600254604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015611d7557600080fd5b505afa158015611d89573d6000803e3d6000fd5b505050506040513d6020811015611d9f57600080fd5b5051601055600754611db19082612138565b600755600b54611dc19082612138565b600b555b50565b611dd0612134565b6001600160a01b0316611de16114cf565b6001600160a01b031614611e2a576040805162461bcd60e51b81526020600482018190526024820152600080516020612e0b833981519152604482015290519081900360640190fd5b6103e88161ffff161115611e7e576040805162461bcd60e51b81526020600482015260166024820152754465762066656520636c616d7065642061742031302560501b604482015290519081900360640190fd5b600e805461ffff191661ffff92909216919091179055565b600060048381548110611ea557fe5b60009182526020808320868452600582526040808520338652909252922060049091029091019150611ed561125b565b611edf8433612368565b8215611f0b578154611efc906001600160a01b0316333086612386565b8054611f089084612138565b81555b60028201548154611f269164e8d4a5100091610aad91612199565b6001820155604080518481529051859133917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a350505050565b60075481565b611f76612134565b6001600160a01b0316611f876114cf565b6001600160a01b031614611fd0576040805162461bcd60e51b81526020600482018190526024820152600080516020612e0b833981519152604482015290519081900360640190fd5b6001600160a01b0381166120155760405162461bcd60e51b8152600401808060200182810382526026815260200180612d516026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000828211156120c7576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000808211612123576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161212c57fe5b049392505050565b3390565b600082820183811015612192576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6000826121a857506000610abf565b828202828482816121b557fe5b04146121925760405162461bcd60e51b8152600401808060200182810382526021815260200180612dea6021913960400191505060405180910390fd5b60006004858154811061220157fe5b60009182526020909120600490910201600381015490915060ff166122575760405162461bcd60e51b8152600401808060200182810382526026815260200180612e2b6026913960400191505060405180910390fd5b60008581526005602090815260408083206001600160a01b0387168452909152902080548511156122c4576040805162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604482015290519081900360640190fd5b6122cc61125b565b6122d68685612368565b84156123005780546122e89086612070565b81558154612300906001600160a01b031684876123e0565b6002820154815461231b9164e8d4a5100091610aad91612199565b600182015560408051868152905187916001600160a01b038616917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a3505050505050565b60006123748383610a42565b90508015610c9457610c94828261256a565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611a03908590612a89565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610c94908490612a89565b6000806004838154811061244257fe5b600091825260208083206004928302018054604080516370a0823160e01b81523095810195909552519195506001600160a01b0316926370a08231926024808301939192829003018186803b15801561249a57600080fd5b505afa1580156124ae573d6000803e3d6000fd5b505050506040513d60208110156124c457600080fd5b50519050806124d857600092505050610a37565b6124f7600654610aad846001015460075461219990919063ffffffff16565b600e549093506000906125179061271090610aad90879061ffff16612199565b905060006125258583612070565b600f549091506125359083612138565b600f5561255961254e84610aad8464e8d4a51000612199565b600286015490612138565b846002018190555050505050919050565b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156125b557600080fd5b505afa1580156125c9573d6000803e3d6000fd5b505050506040513d60208110156125df57600080fd5b50519050808211156128385760025460408051634e71d92d60e01b815290516001600160a01b039092169163a9059cbb918391634e71d92d91600480820192602092909190829003018186803b15801561263857600080fd5b505afa15801561264c573d6000803e3d6000fd5b505050506040513d602081101561266257600080fd5b5051604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482018590525160448083019260209291908290030181600087803b1580156126b257600080fd5b505af11580156126c6573d6000803e3d6000fd5b505050506040513d60208110156126dc57600080fd5b505060025460408051634e71d92d60e01b815290516001600160a01b0390921691634e71d92d91600480820192602092909190829003018186803b15801561272357600080fd5b505afa158015612737573d6000803e3d6000fd5b505050506040513d602081101561274d57600080fd5b50516040805163030d760f60e51b81526001600160a01b03868116600483015260248201859052915191909216916361aec1e091604480830192600092919082900301818387803b1580156127a157600080fd5b505af11580156127b5573d6000803e3d6000fd5b5050600254604080516370a0823160e01b815230600482015290516001600160a01b0390921693506370a082319250602480820192602092909190829003018186803b15801561280457600080fd5b505afa158015612818573d6000803e3d6000fd5b505050506040513d602081101561282e57600080fd5b5051601055612a81565b60025460408051634e71d92d60e01b815290516001600160a01b039092169163a9059cbb918391634e71d92d91600480820192602092909190829003018186803b15801561288557600080fd5b505afa158015612899573d6000803e3d6000fd5b505050506040513d60208110156128af57600080fd5b5051604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482018690525160448083019260209291908290030181600087803b1580156128ff57600080fd5b505af1158015612913573d6000803e3d6000fd5b505050506040513d602081101561292957600080fd5b505060025460408051634e71d92d60e01b815290516001600160a01b0390921691634e71d92d91600480820192602092909190829003018186803b15801561297057600080fd5b505afa158015612984573d6000803e3d6000fd5b505050506040513d602081101561299a57600080fd5b50516040805163030d760f60e51b81526001600160a01b03868116600483015260248201869052915191909216916361aec1e091604480830192600092919082900301818387803b1580156129ee57600080fd5b505af1158015612a02573d6000803e3d6000fd5b5050600254604080516370a0823160e01b815230600482015290516001600160a01b0390921693506370a082319250602480820192602092909190829003018186803b158015612a5157600080fd5b505afa158015612a65573d6000803e3d6000fd5b505050506040513d6020811015612a7b57600080fd5b50516010555b610c94610d2d565b6000612ade826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612b3a9092919063ffffffff16565b805190915015610c9457808060200190516020811015612afd57600080fd5b5051610c945760405162461bcd60e51b815260040180806020018281038252602a815260200180612e51602a913960400191505060405180910390fd5b6060612b498484600085612b51565b949350505050565b606082471015612b925760405162461bcd60e51b8152600401808060200182810382526026815260200180612d9c6026913960400191505060405180910390fd5b612b9b85610a32565b612bec576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b60208310612c2a5780518252601f199092019160209182019101612c0b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612c8c576040519150601f19603f3d011682016040523d82523d6000602084013e612c91565b606091505b5091509150612ca1828286612cac565b979650505050505050565b60608315612cbb575081612192565b825115612ccb5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d15578181015183820152602001612cfd565b50505050905090810190601f168015612d425780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573735265636970656e74206973206e6f74206120736d61727420636f6e74726163742c20424144416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c53757065722061646d696e203a2063616c6c6572206973206e6f742073757065722061646d696e2e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725769746864726177696e672066726f6d207468697320706f6f6c2069732064697361626c65645361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122022a67b8b6e4cf0a16a0bd4f63a994cd8608019ef4df3f5c15ac2e62bcb83031b64736f6c63430007060033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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