ETH Price: $2,349.67 (+0.51%)

Contract

0xca7B4dEd875d486D54b371DF38377b5edfb1f434
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw196589932024-04-15 6:00:47150 days ago1713160847IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.004986698.01824026
Withdraw191990072024-02-10 16:52:47215 days ago1707583967IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0161705829.38957733
Withdraw186106812023-11-20 4:41:11297 days ago1700455271IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0539418889.28603023
Deposit184588842023-10-29 22:42:47318 days ago1698619367IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0053695911.30428623
Deposit174599842023-06-11 22:59:47458 days ago1686524387IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.009828613.89362946
Withdraw173467162023-05-27 0:04:59474 days ago1685145899IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0159444125.75031003
Deposit172472102023-05-12 23:27:11488 days ago1683934031IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0221228139.60240808
Withdraw171247102023-04-25 17:18:11506 days ago1682443091IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.031488448.36794678
Withdraw170172862023-04-10 10:43:35521 days ago1681123415IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0117881319.7620328
Withdraw170158282023-04-10 5:47:11521 days ago1681105631IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0137714621.15864654
Deposit170143862023-04-10 0:54:35521 days ago1681088075IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0120611818.72060628
Deposit169939442023-04-07 3:22:59524 days ago1680837779IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0129707922.57815817
Deposit169869032023-04-06 3:14:11525 days ago1680750851IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0188256731.05240566
Deposit169459962023-03-31 8:27:59531 days ago1680251279IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0127047523.28478119
Withdraw168942572023-03-24 2:01:11538 days ago1679623271IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0086479315.2281054
Deposit168878822023-03-23 4:29:59539 days ago1679545799IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0074782911.3650907
Deposit168604972023-03-19 8:11:35543 days ago1679213495IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.007684712.39332532
Deposit168088332023-03-12 1:57:23550 days ago1678586243IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0147610420.07279264
Deposit168085012023-03-12 0:49:59550 days ago1678582199IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0127626319.80257311
Deposit168084952023-03-12 0:48:47550 days ago1678582127IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0145470619.80116302
Deposit167643402023-03-05 19:42:23556 days ago1678045343IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0195412736.41263312
Withdraw167428362023-03-02 19:06:35559 days ago1677783995IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0226580234.24157559
Deposit167387972023-03-02 5:25:47560 days ago1677734747IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0109222620.35280013
Deposit167383362023-03-02 3:52:35560 days ago1677729155IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0037441224.10419496
Deposit167373572023-03-02 0:34:47560 days ago1677717287IN
0xca7B4dEd...edfb1f434
0.00089 ETH0.0136092825.86181155
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
196589932024-04-15 6:00:47150 days ago1713160847
0xca7B4dEd...edfb1f434
0.00089 ETH
191990072024-02-10 16:52:47215 days ago1707583967
0xca7B4dEd...edfb1f434
0.00089 ETH
186106812023-11-20 4:41:11297 days ago1700455271
0xca7B4dEd...edfb1f434
0.00089 ETH
184588842023-10-29 22:42:47318 days ago1698619367
0xca7B4dEd...edfb1f434
0.00089 ETH
174599842023-06-11 22:59:47458 days ago1686524387
0xca7B4dEd...edfb1f434
0.00089 ETH
173467162023-05-27 0:04:59474 days ago1685145899
0xca7B4dEd...edfb1f434
0.00089 ETH
172472102023-05-12 23:27:11488 days ago1683934031
0xca7B4dEd...edfb1f434
0.00089 ETH
171247102023-04-25 17:18:11506 days ago1682443091
0xca7B4dEd...edfb1f434
0.00089 ETH
170172862023-04-10 10:43:35521 days ago1681123415
0xca7B4dEd...edfb1f434
0.00089 ETH
170158282023-04-10 5:47:11521 days ago1681105631
0xca7B4dEd...edfb1f434
0.00089 ETH
170143862023-04-10 0:54:35521 days ago1681088075
0xca7B4dEd...edfb1f434
0.00089 ETH
169939442023-04-07 3:22:59524 days ago1680837779
0xca7B4dEd...edfb1f434
0.00089 ETH
169869032023-04-06 3:14:11525 days ago1680750851
0xca7B4dEd...edfb1f434
0.00089 ETH
169459962023-03-31 8:27:59531 days ago1680251279
0xca7B4dEd...edfb1f434
0.00089 ETH
168942572023-03-24 2:01:11538 days ago1679623271
0xca7B4dEd...edfb1f434
0.00089 ETH
168878822023-03-23 4:29:59539 days ago1679545799
0xca7B4dEd...edfb1f434
0.00089 ETH
168604972023-03-19 8:11:35543 days ago1679213495
0xca7B4dEd...edfb1f434
0.00089 ETH
168088332023-03-12 1:57:23550 days ago1678586243
0xca7B4dEd...edfb1f434
0.00089 ETH
168085012023-03-12 0:49:59550 days ago1678582199
0xca7B4dEd...edfb1f434
0.00089 ETH
168084952023-03-12 0:48:47550 days ago1678582127
0xca7B4dEd...edfb1f434
0.00089 ETH
167643402023-03-05 19:42:23556 days ago1678045343
0xca7B4dEd...edfb1f434
0.00089 ETH
167428362023-03-02 19:06:35559 days ago1677783995
0xca7B4dEd...edfb1f434
0.00089 ETH
167387972023-03-02 5:25:47560 days ago1677734747
0xca7B4dEd...edfb1f434
0.00089 ETH
167383362023-03-02 3:52:35560 days ago1677729155
0xca7B4dEd...edfb1f434
0.00089 ETH
167373572023-03-02 0:34:47560 days ago1677717287
0xca7B4dEd...edfb1f434
0.00089 ETH
View All Internal Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xe5Ae0ca9...4A590478B
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
BrewlabsFarm

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 100 runs

Other Settings:
default evmVersion
File 1 of 11 : BrewlabsFarm.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import "./libs/IUniRouter02.sol";
import "./libs/IWETH.sol";

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

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

    // Info of each pool.
    struct PoolInfo {
        IERC20 lpToken; // Address of LP token contract.
        uint256 allocPoint; // How many allocation points assigned to this pool. brewss to distribute per block.
        uint256 duration;
        uint256 startBlock;
        uint256 bonusEndBlock;
        uint256 lastRewardBlock; // Last block number that brewss distribution occurs.
        uint256 accTokenPerShare; // Accumulated brewss per share, times 1e12. See below.
        uint256 accReflectionPerShare; // Accumulated brewss per share, times 1e12. See below.
        uint256 lastReflectionPerPoint;
        uint16 depositFee; // Deposit fee in basis points
        uint16 withdrawFee; // Deposit fee in basis points
    }

    struct SwapSetting {
        IERC20 lpToken;
        address swapRouter;
        address[] earnedToToken0;
        address[] earnedToToken1;
        address[] reflectionToToken0;
        address[] reflectionToToken1;
        bool enabled;
    }

    // The brews TOKEN!
    IERC20 public brews;
    // Reflection Token
    address public reflectionToken;
    uint256 public accReflectionPerPoint;
    bool public hasDividend;
    bool public autoAdjustableForRewardRate = false;

    // brews tokens created per block.
    uint256 public rewardPerBlock;
    // Bonus muliplier for early brews makers.
    uint256 public constant BONUS_MULTIPLIER = 1;
    uint256 public constant PERCENT_PRECISION = 10000;
    uint256 private constant BLOCKS_PER_DAY = 6426;

    // Deposit Fee address
    address public feeAddress;
    address public treasury = 0x64961Ffd0d84b2355eC2B5d35B0d8D8825A774dc;
    uint256 public performanceFee = 0.00089 ether;
    uint256 public rewardFee = 0;

    // Info of each pool.
    PoolInfo[] public poolInfo;
    SwapSetting[] public swapSettings;
    uint256[] public totalStaked;

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

    uint256 private totalEarned;
    uint256 private totalRewardStaked;
    uint256 private totalReflectionStaked;
    uint256 private totalReflections;
    uint256 private reflectionDebt;

    uint256 private paidRewards;
    uint256 private shouldTotalPaid;

    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event SetPool(
        uint256 pid,
        address indexed lpToken,
        uint256 allocPoint,
        uint256 duration,
        uint256 depositFee,
        uint256 withdrawFee,
        uint256 startBlock,
        uint256 endBlock
    );
    event SetFeeAddress(address indexed user, address indexed newAddress);
    event SetBuyBackWallet(address indexed user, address newAddress);
    event SetPerformanceFee(uint256 fee);
    event SetRewardFee(uint256 fee);
    event SetAutoAdjustableForRewardRate(bool status);
    event UpdateEmissionRate(address indexed user, uint256 rewardPerBlock);

    constructor(IERC20 _brews, address _reflectionToken, uint256 _rewardPerBlock, bool _hasDividend) {
        brews = _brews;
        reflectionToken = _reflectionToken;
        rewardPerBlock = _rewardPerBlock;
        hasDividend = _hasDividend;

        feeAddress = msg.sender;
        startBlock = block.number + 30 * BLOCKS_PER_DAY; // after 30 days
    }

    mapping(IERC20 => bool) public poolExistence;

    modifier nonDuplicated(IERC20 _lpToken) {
        require(poolExistence[_lpToken] == false, "nonDuplicated: duplicated");
        _;
    }

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

    // Add a new lp to the pool. Can only be called by the owner.
    function add(
        uint256 _allocPoint,
        IERC20 _lpToken,
        uint16 _depositFee,
        uint16 _withdrawFee,
        uint256 _duration,
        bool _withUpdate
    ) external onlyOwner nonDuplicated(_lpToken) {
        require(_depositFee <= PERCENT_PRECISION, "add: invalid deposit fee basis points");
        require(_withdrawFee <= PERCENT_PRECISION, "add: invalid withdraw fee basis points");

        if (_withUpdate) {
            massUpdatePools();
        }

        uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock;
        totalAllocPoint = totalAllocPoint + _allocPoint;
        poolExistence[_lpToken] = true;
        poolInfo.push(
            PoolInfo({
                lpToken: _lpToken,
                allocPoint: _allocPoint,
                duration: _duration,
                startBlock: lastRewardBlock,
                bonusEndBlock: lastRewardBlock + _duration * BLOCKS_PER_DAY,
                lastRewardBlock: lastRewardBlock,
                accTokenPerShare: 0,
                accReflectionPerShare: 0,
                lastReflectionPerPoint: 0,
                depositFee: _depositFee,
                withdrawFee: _withdrawFee
            })
        );

        swapSettings.push();
        swapSettings[swapSettings.length - 1].lpToken = _lpToken;

        totalStaked.push(0);
        emit SetPool(
            poolInfo.length - 1,
            address(_lpToken),
            _allocPoint,
            _duration,
            _depositFee,
            _withdrawFee,
            lastRewardBlock,
            lastRewardBlock + _duration * BLOCKS_PER_DAY
            );
    }

    // Update the given pool's brews allocation point and deposit fee. Can only be called by the owner.
    function set(
        uint256 _pid,
        uint256 _allocPoint,
        uint16 _depositFee,
        uint16 _withdrawFee,
        uint256 _duration,
        bool _withUpdate
    ) external onlyOwner {
        require(_depositFee <= PERCENT_PRECISION, "set: invalid deposit fee basis points");
        require(_withdrawFee <= PERCENT_PRECISION, "set: invalid withdraw fee basis points");
        if (poolInfo[_pid].bonusEndBlock > block.number) {
            require(poolInfo[_pid].startBlock + _duration * BLOCKS_PER_DAY > block.number, "set: invalid duration");
        }

        if (_withUpdate) {
            massUpdatePools();
        }

        totalAllocPoint = totalAllocPoint - poolInfo[_pid].allocPoint + _allocPoint;

        poolInfo[_pid].allocPoint = _allocPoint;
        poolInfo[_pid].depositFee = _depositFee;
        poolInfo[_pid].withdrawFee = _withdrawFee;
        poolInfo[_pid].duration = _duration;

        if (poolInfo[_pid].bonusEndBlock < block.number) {
            if (!_withUpdate) updatePool(_pid);

            poolInfo[_pid].startBlock = block.number;
            poolInfo[_pid].bonusEndBlock = block.number + _duration * BLOCKS_PER_DAY;
        } else {
            poolInfo[_pid].bonusEndBlock = poolInfo[_pid].startBlock + _duration * BLOCKS_PER_DAY;
        }
        emit SetPool(
            _pid,
            address(poolInfo[_pid].lpToken),
            _allocPoint,
            _duration,
            _depositFee,
            _withdrawFee,
            poolInfo[_pid].startBlock,
            poolInfo[_pid].bonusEndBlock
            );
    }

    // Update the given pool's compound parameters. Can only be called by the owner.
    function setSwapSetting(
        uint256 _pid,
        address _uniRouter,
        address[] memory _earnedToToken0,
        address[] memory _earnedToToken1,
        address[] memory _reflectionToToken0,
        address[] memory _reflectionToToken1,
        bool _enabled
    ) external onlyOwner {
        SwapSetting storage swapSetting = swapSettings[_pid];

        swapSetting.enabled = _enabled;
        swapSetting.swapRouter = _uniRouter;
        swapSetting.earnedToToken0 = _earnedToToken0;
        swapSetting.earnedToToken1 = _earnedToToken1;
        swapSetting.reflectionToToken0 = _reflectionToToken0;
        swapSetting.reflectionToToken1 = _reflectionToToken1;
    }

    // Return reward multiplier over the given _from to _to block.
    function getMultiplier(uint256 _from, uint256 _to, uint256 _endBlock) public pure returns (uint256) {
        if (_from > _endBlock) return 0;
        if (_to > _endBlock) {
            return (_endBlock - _from) * BONUS_MULTIPLIER;
        }

        return (_to - _from) * BONUS_MULTIPLIER;
    }

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

        uint256 accTokenPerShare = pool.accTokenPerShare;
        uint256 lpSupply = pool.lpToken.balanceOf(address(this));
        if (block.number > pool.lastRewardBlock && lpSupply > 0 && totalAllocPoint > 0) {
            uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number, pool.bonusEndBlock);
            uint256 brewsReward = (multiplier * rewardPerBlock * pool.allocPoint) / totalAllocPoint;
            accTokenPerShare += (brewsReward * 1e12) / lpSupply;
        }
        return (user.amount * accTokenPerShare) / 1e12 - user.rewardDebt;
    }

    function pendingReflections(uint256 _pid, address _user) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];

        uint256 accReflectionPerShare = pool.accReflectionPerShare;
        uint256 lpSupply = pool.lpToken.balanceOf(address(this));
        if (reflectionToken == address(pool.lpToken)) lpSupply = totalReflectionStaked;
        if (block.number > pool.lastRewardBlock && lpSupply > 0 && hasDividend && totalAllocPoint > 0) {
            uint256 reflectionAmt = availableDividendTokens();
            if (reflectionAmt > totalReflections) {
                reflectionAmt -= totalReflections;
            } else {
                reflectionAmt = 0;
            }

            uint256 _accReflectionPerPoint = accReflectionPerPoint + (reflectionAmt * 1e12) / totalAllocPoint;

            accReflectionPerShare = pool.accReflectionPerShare
                + ((pool.allocPoint * (_accReflectionPerPoint - pool.lastReflectionPerPoint)) / lpSupply);
        }
        return (user.amount * accReflectionPerShare) / 1e12 - user.reflectionDebt;
    }

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

    // Update reward variables of the given pool to be up-to-date.
    function updatePool(uint256 _pid) public {
        PoolInfo storage pool = poolInfo[_pid];
        if (block.number <= pool.lastRewardBlock) {
            return;
        }
        uint256 lpSupply = pool.lpToken.balanceOf(address(this));
        if (address(pool.lpToken) == address(brews)) lpSupply = totalRewardStaked;
        if (address(pool.lpToken) == reflectionToken) lpSupply = totalReflectionStaked;
        if (lpSupply == 0 || pool.allocPoint == 0) {
            pool.lastRewardBlock = block.number;
            return;
        }

        uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number, pool.bonusEndBlock);
        uint256 brewsReward = (multiplier * rewardPerBlock * pool.allocPoint) / totalAllocPoint;
        pool.accTokenPerShare += (brewsReward * 1e12) / lpSupply;

        if (hasDividend) {
            uint256 reflectionAmt = availableDividendTokens();
            if (reflectionAmt > totalReflections) {
                reflectionAmt -= totalReflections;
            } else {
                reflectionAmt = 0;
            }

            accReflectionPerPoint += (reflectionAmt * 1e12) / totalAllocPoint;
            pool.accReflectionPerShare +=
                (pool.allocPoint * (accReflectionPerPoint - pool.lastReflectionPerPoint)) / (lpSupply);

            pool.lastReflectionPerPoint = accReflectionPerPoint;

            totalReflections += reflectionAmt;
        }

        pool.lastRewardBlock = block.number;
        shouldTotalPaid = shouldTotalPaid + brewsReward;
    }

    // Deposit LP tokens to BrewlabsFarm for brews allocation.
    function deposit(uint256 _pid, uint256 _amount) external payable nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];

        _transferPerformanceFee();
        massUpdatePools();

        if (user.amount > 0) {
            uint256 pending = (user.amount * pool.accTokenPerShare) / 1e12 - user.rewardDebt;
            if (pending > 0) {
                require(availableRewardTokens() >= pending, "Insufficient reward tokens");
                paidRewards = paidRewards + pending;

                pending = (pending * (PERCENT_PRECISION - rewardFee)) / PERCENT_PRECISION;
                safeTokenTransfer(msg.sender, pending);
                if (totalEarned > pending) {
                    totalEarned = totalEarned - pending;
                } else {
                    totalEarned = 0;
                }
            }

            uint256 pendingReflection = (user.amount * pool.accReflectionPerShare) / 1e12 - user.reflectionDebt;
            if (pendingReflection > 0 && hasDividend) {
                if (address(reflectionToken) == address(0x0)) {
                    payable(msg.sender).transfer(_estimateDividendAmount(pendingReflection));
                } else {
                    IERC20(reflectionToken).safeTransfer(msg.sender, _estimateDividendAmount(pendingReflection));
                }
                totalReflections -= pendingReflection;
            }
        }

        uint256 realAmount = _amount;
        if (_amount > 0) {
            uint256 beforeAmt = pool.lpToken.balanceOf(address(this));
            pool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount);
            uint256 afterAmt = pool.lpToken.balanceOf(address(this));
            uint256 amount = afterAmt - beforeAmt;

            if (pool.depositFee > 0) {
                uint256 depositFee = (amount * pool.depositFee) / PERCENT_PRECISION;
                pool.lpToken.safeTransfer(feeAddress, depositFee);
                user.amount += amount - depositFee;
                realAmount -= depositFee;
            } else {
                user.amount = user.amount + amount;
            }

            _calculateTotalStaked(_pid, pool.lpToken, amount, true);
        }

        user.rewardDebt = (user.amount * pool.accTokenPerShare) / 1e12;
        user.reflectionDebt = (user.amount * pool.accReflectionPerShare) / 1e12;

        emit Deposit(msg.sender, _pid, realAmount);

        if (pool.bonusEndBlock <= block.number) {
            totalAllocPoint = totalAllocPoint - pool.allocPoint;
            pool.allocPoint = 0;
            rewardPerBlock = 0;
            emit UpdateEmissionRate(msg.sender, rewardPerBlock);
        } else if ((rewardFee > 0 && _amount > 0) || autoAdjustableForRewardRate) {
            _updateRewardRate();
        }
    }

    // Withdraw LP tokens from BrewlabsFarm.
    function withdraw(uint256 _pid, uint256 _amount) external payable nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        require(user.amount >= _amount, "withdraw: not good");
        require(_amount > 0, "Amount should be greator than 0");

        _transferPerformanceFee();

        if (pool.bonusEndBlock < block.number) {
            massUpdatePools();

            totalAllocPoint = totalAllocPoint - pool.allocPoint;
            pool.allocPoint = 0;
            rewardPerBlock = 0;
            emit UpdateEmissionRate(msg.sender, rewardPerBlock);
        } else {
            updatePool(_pid);
        }

        uint256 pending = (user.amount * pool.accTokenPerShare) / 1e12 - user.rewardDebt;
        if (pending > 0) {
            require(availableRewardTokens() >= pending, "Insufficient reward tokens");
            paidRewards = paidRewards + pending;

            pending = (pending * (PERCENT_PRECISION - rewardFee)) / PERCENT_PRECISION;
            safeTokenTransfer(msg.sender, pending);
            if (totalEarned > pending) {
                totalEarned = totalEarned - pending;
            } else {
                totalEarned = 0;
            }
        }

        uint256 pendingReflection = (user.amount * pool.accReflectionPerShare) / 1e12 - user.reflectionDebt;
        if (pendingReflection > 0 && hasDividend) {
            if (address(reflectionToken) == address(0x0)) {
                payable(msg.sender).transfer(_estimateDividendAmount(pendingReflection));
            } else {
                IERC20(reflectionToken).safeTransfer(msg.sender, _estimateDividendAmount(pendingReflection));
            }
            totalReflections -= pendingReflection;
        }

        if (_amount > 0) {
            user.amount = user.amount - _amount;
            if (pool.withdrawFee > 0) {
                uint256 withdrawFee = (_amount * pool.withdrawFee) / PERCENT_PRECISION;
                pool.lpToken.safeTransfer(feeAddress, withdrawFee);
                pool.lpToken.safeTransfer(address(msg.sender), _amount - withdrawFee);
            } else {
                pool.lpToken.safeTransfer(address(msg.sender), _amount);
            }

            _calculateTotalStaked(_pid, pool.lpToken, _amount, false);
        }
        user.rewardDebt = (user.amount * pool.accTokenPerShare) / 1e12;
        user.reflectionDebt = (user.amount * pool.accReflectionPerShare) / 1e12;

        emit Withdraw(msg.sender, _pid, _amount);

        if (autoAdjustableForRewardRate) _updateRewardRate();
    }

    function claimReward(uint256 _pid) external payable nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        if (user.amount == 0) return;

        _transferPerformanceFee();
        updatePool(_pid);

        uint256 pending = (user.amount * pool.accTokenPerShare) / 1e12 - user.rewardDebt;
        if (pending > 0) {
            require(availableRewardTokens() >= pending, "Insufficient reward tokens");
            paidRewards = paidRewards + pending;

            pending = (pending * (PERCENT_PRECISION - rewardFee)) / PERCENT_PRECISION;
            safeTokenTransfer(msg.sender, pending);
            if (totalEarned > pending) {
                totalEarned = totalEarned - pending;
            } else {
                totalEarned = 0;
            }
        }
        user.rewardDebt = (user.amount * pool.accTokenPerShare) / 1e12;
    }

    function compoundReward(uint256 _pid) external payable nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        SwapSetting memory swapSetting = swapSettings[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        if (user.amount == 0) return;
        if (!swapSetting.enabled) return;

        _transferPerformanceFee();
        updatePool(_pid);

        uint256 pending = (user.amount * pool.accTokenPerShare) / 1e12 - user.rewardDebt;
        if (pending > 0) {
            require(availableRewardTokens() >= pending, "Insufficient reward tokens");
            paidRewards = paidRewards + pending;

            pending = (pending * (PERCENT_PRECISION - rewardFee)) / PERCENT_PRECISION;
            if (totalEarned > pending) {
                totalEarned = totalEarned - pending;
            } else {
                totalEarned = 0;
            }
        }

        if (address(brews) != address(pool.lpToken)) {
            uint256 tokenAmt = pending / 2;
            uint256 tokenAmt0 = tokenAmt;
            address token0 = address(brews);
            if (swapSetting.earnedToToken0.length > 0) {
                token0 = swapSetting.earnedToToken0[swapSetting.earnedToToken0.length - 1];
                tokenAmt0 = _safeSwap(swapSetting.swapRouter, tokenAmt, swapSetting.earnedToToken0, address(this));
            }
            uint256 tokenAmt1 = tokenAmt;
            address token1 = address(brews);
            if (swapSetting.earnedToToken1.length > 0) {
                token1 = swapSetting.earnedToToken1[swapSetting.earnedToToken1.length - 1];
                tokenAmt1 = _safeSwap(swapSetting.swapRouter, tokenAmt, swapSetting.earnedToToken1, address(this));
            }

            uint256 beforeAmt = pool.lpToken.balanceOf(address(this));
            _addLiquidity(swapSetting.swapRouter, token0, token1, tokenAmt0, tokenAmt1, address(this));
            uint256 afterAmt = pool.lpToken.balanceOf(address(this));

            pending = afterAmt - beforeAmt;
        }

        user.amount = user.amount + pending;
        user.rewardDebt = (user.amount * pool.accTokenPerShare) / 1e12;
        user.reflectionDebt = user.reflectionDebt + (pending * pool.accReflectionPerShare) / 1e12;

        _calculateTotalStaked(_pid, pool.lpToken, pending, true);
        emit Deposit(msg.sender, _pid, pending);
    }

    function claimDividend(uint256 _pid) external payable nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        if (user.amount == 0) return;
        if (!hasDividend) return;

        _transferPerformanceFee();
        updatePool(_pid);

        uint256 pendingReflection = (user.amount * pool.accReflectionPerShare) / 1e12 - user.reflectionDebt;
        if (pendingReflection > 0) {
            if (address(reflectionToken) == address(0x0)) {
                payable(msg.sender).transfer(_estimateDividendAmount(pendingReflection));
            } else {
                IERC20(reflectionToken).safeTransfer(msg.sender, _estimateDividendAmount(pendingReflection));
            }
            totalReflections = totalReflections - pendingReflection;
        }

        user.reflectionDebt = (user.amount * pool.accReflectionPerShare) / 1e12;
    }

    function compoundDividend(uint256 _pid) external payable nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        SwapSetting memory swapSetting = swapSettings[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        if (user.amount == 0) return;
        if (!hasDividend) return;

        _transferPerformanceFee();
        updatePool(_pid);

        uint256 _pending = (user.amount * pool.accReflectionPerShare) / 1e12 - user.reflectionDebt;
        uint256 pending = _estimateDividendAmount(_pending);
        totalReflections = totalReflections - _pending;

        if (reflectionToken != address(pool.lpToken)) {
            if (reflectionToken == address(0x0)) {
                address wethAddress = IUniRouter02(swapSetting.swapRouter).WETH();
                IWETH(wethAddress).deposit{value: pending}();
            }

            uint256 tokenAmt = pending / 2;
            uint256 tokenAmt0 = tokenAmt;
            address token0 = reflectionToken;
            if (swapSetting.reflectionToToken0.length > 0) {
                token0 = swapSetting.reflectionToToken0[swapSetting.reflectionToToken0.length - 1];
                tokenAmt0 = _safeSwap(swapSetting.swapRouter, tokenAmt, swapSetting.reflectionToToken0, address(this));
            }
            uint256 tokenAmt1 = tokenAmt;
            address token1 = reflectionToken;
            if (swapSetting.reflectionToToken1.length > 0) {
                token0 = swapSetting.reflectionToToken1[swapSetting.reflectionToToken1.length - 1];
                tokenAmt1 = _safeSwap(swapSetting.swapRouter, tokenAmt, swapSetting.reflectionToToken1, address(this));
            }

            uint256 beforeAmt = pool.lpToken.balanceOf(address(this));
            _addLiquidity(swapSetting.swapRouter, token0, token1, tokenAmt0, tokenAmt1, address(this));
            uint256 afterAmt = pool.lpToken.balanceOf(address(this));

            pending = afterAmt - beforeAmt;
        }

        user.amount = user.amount + pending;
        user.rewardDebt = user.rewardDebt + (pending * pool.accTokenPerShare) / 1e12;
        user.reflectionDebt = (user.amount * pool.accReflectionPerShare) / 1e12;

        _calculateTotalStaked(_pid, pool.lpToken, pending, true);
        emit Deposit(msg.sender, _pid, pending);
    }

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

        _calculateTotalStaked(_pid, pool.lpToken, amount, false);

        emit EmergencyWithdraw(msg.sender, _pid, amount);
    }

    function _transferPerformanceFee() internal {
        require(msg.value >= performanceFee, "should pay small gas");

        payable(treasury).transfer(performanceFee);
        if (msg.value > performanceFee) {
            payable(msg.sender).transfer(msg.value - performanceFee);
        }
    }

    function _calculateTotalStaked(uint256 _pid, IERC20 _lpToken, uint256 _amount, bool _deposit) internal {
        if (_deposit) {
            totalStaked[_pid] = totalStaked[_pid] + _amount;
            if (address(_lpToken) == address(brews)) {
                totalRewardStaked = totalRewardStaked + _amount;
            }
            if (address(_lpToken) == reflectionToken) {
                totalReflectionStaked = totalReflectionStaked + _amount;
            }
        } else {
            totalStaked[_pid] = totalStaked[_pid] - _amount;
            if (address(_lpToken) == address(brews)) {
                if (totalRewardStaked < _amount) totalRewardStaked = _amount;
                totalRewardStaked = totalRewardStaked - _amount;
            }
            if (address(_lpToken) == reflectionToken) {
                if (totalReflectionStaked < _amount) totalReflectionStaked = _amount;
                totalReflectionStaked = totalReflectionStaked - _amount;
            }
        }
    }

    function _estimateDividendAmount(uint256 amount) internal view returns (uint256) {
        uint256 dTokenBal = availableDividendTokens();
        if (amount > totalReflections) amount = totalReflections;
        if (amount > dTokenBal) amount = dTokenBal;
        return amount;
    }

    /**
     * @notice Available amount of reward token
     */
    function availableRewardTokens() public view returns (uint256) {
        if (address(brews) == reflectionToken && hasDividend) return totalEarned;

        uint256 _amount = brews.balanceOf(address(this));
        return _amount - totalRewardStaked;
    }

    /**
     * @notice Available amount of reflection token
     */
    function availableDividendTokens() public view returns (uint256) {
        if (hasDividend == false) return 0;
        if (address(reflectionToken) == address(0x0)) {
            return address(this).balance;
        }

        uint256 _amount = IERC20(reflectionToken).balanceOf(address(this));
        if (address(reflectionToken) == address(brews)) {
            if (_amount < totalEarned) return 0;
            _amount = _amount - totalEarned;
        }
        return _amount - totalReflectionStaked;
    }

    function insufficientRewards() external view returns (uint256) {
        uint256 adjustedShouldTotalPaid = shouldTotalPaid;
        uint256 remainRewards = availableRewardTokens() + paidRewards;

        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; pid++) {
            PoolInfo memory pool = poolInfo[pid];
            if (startBlock == 0) {
                adjustedShouldTotalPaid +=
                    (rewardPerBlock * pool.allocPoint * pool.duration * BLOCKS_PER_DAY) / totalAllocPoint;
            } else {
                uint256 multiplier = getMultiplier(pool.lastRewardBlock, pool.bonusEndBlock, pool.bonusEndBlock);
                adjustedShouldTotalPaid += (multiplier * rewardPerBlock * pool.allocPoint) / totalAllocPoint;
            }
        }

        if (remainRewards >= adjustedShouldTotalPaid) return 0;

        return adjustedShouldTotalPaid - remainRewards;
    }

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

    function setFeeAddress(address _feeAddress) external onlyOwner {
        feeAddress = _feeAddress;
        emit SetFeeAddress(msg.sender, _feeAddress);
    }

    function setPerformanceFee(uint256 _fee) external {
        require(msg.sender == treasury, "setPerformanceFee: FORBIDDEN");

        performanceFee = _fee;
        emit SetPerformanceFee(_fee);
    }

    function setRewardFee(uint256 _fee) external onlyOwner {
        require(_fee < PERCENT_PRECISION, "setRewardFee: invalid percentage");

        rewardFee = _fee;
        emit SetRewardFee(_fee);
    }

    function setBuyBackWallet(address _addr) external {
        require(msg.sender == treasury, "setBuyBackWallet: FORBIDDEN");
        treasury = _addr;
        emit SetBuyBackWallet(msg.sender, _addr);
    }

    function setAutoAdjustableForRewardRate(bool _status) external onlyOwner {
        autoAdjustableForRewardRate = _status;
        emit SetAutoAdjustableForRewardRate(_status);
    }

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

    function updateStartBlock(uint256 _startBlock) external onlyOwner {
        require(startBlock > block.number, "farm is running now");
        require(_startBlock > block.number, "should be greater than current block");

        startBlock = _startBlock;
        for (uint256 pid = 0; pid < poolInfo.length; pid++) {
            poolInfo[pid].startBlock = startBlock;
            poolInfo[pid].lastRewardBlock = startBlock;
            poolInfo[pid].bonusEndBlock = startBlock + poolInfo[pid].duration * BLOCKS_PER_DAY;
        }
    }

    /**
     * @notice Deposit reward token
     * @dev Only call by owner. Needs to be for deposit of reward token when reflection token is same with reward token.
     */
    function depositRewards(uint256 _amount) external nonReentrant {
        require(_amount > 0);

        uint256 beforeAmt = brews.balanceOf(address(this));
        brews.safeTransferFrom(msg.sender, address(this), _amount);
        uint256 afterAmt = brews.balanceOf(address(this));

        totalEarned = totalEarned + afterAmt - beforeAmt;
    }

    function increaseEmissionRate(uint256 _amount) external onlyOwner {
        require(startBlock > 0, "pool is not started");
        require(_amount > 0, "invalid amount");

        uint256 bonusEndBlock = 0;
        for (uint256 i = 0; i < poolInfo.length; i++) {
            if (bonusEndBlock < poolInfo[i].bonusEndBlock) {
                bonusEndBlock = poolInfo[i].bonusEndBlock;
            }
        }
        require(bonusEndBlock > block.number, "pool was already finished");

        massUpdatePools();

        uint256 beforeAmt = brews.balanceOf(address(this));
        brews.safeTransferFrom(msg.sender, address(this), _amount);
        uint256 afterAmt = brews.balanceOf(address(this));

        totalEarned = totalEarned + afterAmt - beforeAmt;
        _updateRewardRate();
    }

    function _updateRewardRate() internal {
        uint256 bonusEndBlock = 0;
        for (uint256 i = 0; i < poolInfo.length; i++) {
            if (bonusEndBlock < poolInfo[i].bonusEndBlock) {
                bonusEndBlock = poolInfo[i].bonusEndBlock;
            }
        }
        if (bonusEndBlock <= block.number) return;

        uint256 remainRewards = availableRewardTokens() + paidRewards;
        if (remainRewards > shouldTotalPaid) {
            remainRewards = remainRewards - shouldTotalPaid;

            uint256 remainBlocks = bonusEndBlock - block.number;
            rewardPerBlock = remainRewards / remainBlocks;
            emit UpdateEmissionRate(msg.sender, rewardPerBlock);
        }
    }

    function emergencyWithdrawRewards(uint256 _amount) external onlyOwner {
        if (_amount == 0) {
            uint256 amount = brews.balanceOf(address(this));
            safeTokenTransfer(msg.sender, amount);
        } else {
            safeTokenTransfer(msg.sender, _amount);
        }
    }

    function emergencyWithdrawReflections() external onlyOwner {
        if (address(reflectionToken) == address(0x0)) {
            uint256 amount = address(this).balance;
            payable(address(msg.sender)).transfer(amount);
        } else {
            uint256 amount = IERC20(reflectionToken).balanceOf(address(this));
            IERC20(reflectionToken).transfer(msg.sender, amount);
        }
    }

    function transferToHarvest() external onlyOwner {
        if (hasDividend || address(brews) == reflectionToken) return;

        if (reflectionToken == address(0x0)) {
            payable(treasury).transfer(address(this).balance);
        } else {
            uint256 _amount = IERC20(reflectionToken).balanceOf(address(this));
            IERC20(reflectionToken).safeTransfer(treasury, _amount);
        }
    }

    function recoverWrongToken(address _token) external onlyOwner {
        require(
            _token != address(brews) && _token != reflectionToken, "cannot recover reward token or reflection token"
        );
        require(poolExistence[IERC20(_token)] == false, "token is using on pool");

        if (_token == address(0x0)) {
            uint256 amount = address(this).balance;
            payable(address(msg.sender)).transfer(amount);
        } else {
            uint256 amount = IERC20(_token).balanceOf(address(this));
            if (amount > 0) {
                IERC20(_token).transfer(msg.sender, amount);
            }
        }
    }

    function _safeSwap(address _uniRouter, uint256 _amountIn, address[] memory _path, address _to)
        internal
        returns (uint256)
    {
        uint256 beforeAmt = IERC20(_path[_path.length - 1]).balanceOf(address(this));
        IERC20(_path[0]).safeApprove(_uniRouter, _amountIn);
        IUniRouter02(_uniRouter).swapExactTokensForTokensSupportingFeeOnTransferTokens(
            _amountIn, 0, _path, _to, block.timestamp + 600
        );
        uint256 afterAmt = IERC20(_path[_path.length - 1]).balanceOf(address(this));
        return afterAmt - beforeAmt;
    }

    function _addLiquidity(
        address _uniRouter,
        address _token0,
        address _token1,
        uint256 _tokenAmt0,
        uint256 _tokenAmt1,
        address _to
    ) internal returns (uint256 amountA, uint256 amountB, uint256 liquidity) {
        IERC20(_token0).safeIncreaseAllowance(_uniRouter, _tokenAmt0);
        IERC20(_token1).safeIncreaseAllowance(_uniRouter, _tokenAmt1);

        (amountA, amountB, liquidity) = IUniRouter02(_uniRouter).addLiquidity(
            _token0, _token1, _tokenAmt0, _tokenAmt1, 0, 0, _to, block.timestamp + 600
        );

        IERC20(_token0).safeApprove(_uniRouter, uint256(0));
        IERC20(_token1).safeApprove(_uniRouter, uint256(0));
    }

    receive() external payable {}
}

File 2 of 11 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

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

File 3 of 11 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^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() {
        _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 making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

File 4 of 11 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 5 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 6 of 11 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

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

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

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

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

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

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

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

File 7 of 11 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 8 of 11 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

interface IUniRouter01 {
    function factory() external pure returns (address);

    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint256 amountADesired,
        uint256 amountBDesired,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);

    function addLiquidityETH(
        address token,
        uint256 amountTokenDesired,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);

    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountA, uint256 amountB);

    function removeLiquidityETH(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountToken, uint256 amountETH);

    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 amountA, uint256 amountB);

    function removeLiquidityETHWithPermit(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 amountToken, uint256 amountETH);

    function swapExactTokensForTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

    function swapTokensForExactTokens(
        uint256 amountOut,
        uint256 amountInMax,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

    function swapExactETHForTokens(uint256 amountOutMin, address[] calldata path, address to, uint256 deadline)
        external
        payable
        returns (uint256[] memory amounts);

    function swapTokensForExactETH(
        uint256 amountOut,
        uint256 amountInMax,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

    function swapExactTokensForETH(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

    function swapETHForExactTokens(uint256 amountOut, address[] calldata path, address to, uint256 deadline)
        external
        payable
        returns (uint256[] memory amounts);

    function quote(uint256 amountA, uint256 reserveA, uint256 reserveB) external pure returns (uint256 amountB);

    function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut)
        external
        pure
        returns (uint256 amountOut);

    function getAmountIn(uint256 amountOut, uint256 reserveIn, uint256 reserveOut)
        external
        pure
        returns (uint256 amountIn);

    function getAmountsOut(uint256 amountIn, address[] calldata path)
        external
        view
        returns (uint256[] memory amounts);

    function getAmountsIn(uint256 amountOut, address[] calldata path)
        external
        view
        returns (uint256[] memory amounts);
}

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

pragma solidity ^0.8.0;

import "./IUniRouter01.sol";

interface IUniRouter02 is IUniRouter01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountETH);

    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;

    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable;

    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;
}

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

pragma solidity >=0.5.0;

interface IWETH {
    function deposit() external payable;
    function transfer(address to, uint256 value) external returns (bool);
    function withdraw(uint256) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"_brews","type":"address"},{"internalType":"address","name":"_reflectionToken","type":"address"},{"internalType":"uint256","name":"_rewardPerBlock","type":"uint256"},{"internalType":"bool","name":"_hasDividend","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"SetAutoAdjustableForRewardRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetBuyBackWallet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetFeeAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SetPerformanceFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":true,"internalType":"address","name":"lpToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"allocPoint","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"depositFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startBlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endBlock","type":"uint256"}],"name":"SetPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SetRewardFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"rewardPerBlock","type":"uint256"}],"name":"UpdateEmissionRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"BONUS_MULTIPLIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERCENT_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accReflectionPerPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IERC20","name":"_lpToken","type":"address"},{"internalType":"uint16","name":"_depositFee","type":"uint16"},{"internalType":"uint16","name":"_withdrawFee","type":"uint16"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"autoAdjustableForRewardRate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"availableDividendTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"availableRewardTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"brews","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"claimDividend","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"claimReward","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"compoundDividend","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"compoundReward","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyWithdrawReflections","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"emergencyWithdrawRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_from","type":"uint256"},{"internalType":"uint256","name":"_to","type":"uint256"},{"internalType":"uint256","name":"_endBlock","type":"uint256"}],"name":"getMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"hasDividend","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"increaseEmissionRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"insufficientRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingReflections","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"performanceFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"poolExistence","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"lpToken","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"startBlock","type":"uint256"},{"internalType":"uint256","name":"bonusEndBlock","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accTokenPerShare","type":"uint256"},{"internalType":"uint256","name":"accReflectionPerShare","type":"uint256"},{"internalType":"uint256","name":"lastReflectionPerPoint","type":"uint256"},{"internalType":"uint16","name":"depositFee","type":"uint16"},{"internalType":"uint16","name":"withdrawFee","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"recoverWrongToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reflectionToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"uint16","name":"_depositFee","type":"uint16"},{"internalType":"uint16","name":"_withdrawFee","type":"uint16"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_status","type":"bool"}],"name":"setAutoAdjustableForRewardRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"setBuyBackWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeAddress","type":"address"}],"name":"setFeeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setPerformanceFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setRewardFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_uniRouter","type":"address"},{"internalType":"address[]","name":"_earnedToToken0","type":"address[]"},{"internalType":"address[]","name":"_earnedToToken1","type":"address[]"},{"internalType":"address[]","name":"_reflectionToToken0","type":"address[]"},{"internalType":"address[]","name":"_reflectionToToken1","type":"address[]"},{"internalType":"bool","name":"_enabled","type":"bool"}],"name":"setSwapSetting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"swapSettings","outputs":[{"internalType":"contract IERC20","name":"lpToken","type":"address"},{"internalType":"address","name":"swapRouter","type":"address"},{"internalType":"bool","name":"enabled","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"transferToHarvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardPerBlock","type":"uint256"}],"name":"updateEmissionRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startBlock","type":"uint256"}],"name":"updateStartBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"},{"internalType":"uint256","name":"reflectionDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

Deployed Bytecode

0x6080604052600436106102d95760003560e01c80637bafb0291161017b578063a4640b82116100d7578063d18df53c11610085578063d18df53c146108f3578063e2bbb15814610913578063f2fde38b14610926578063f3aeb31d14610946578063f4ef5ed51461095b578063fac2b9ba1461097b578063ffe8e3721461099b57600080fd5b8063a4640b8214610823578063a5bfd0f214610843578063ae169a501461085d578063bb952cd214610870578063bc6a9e0114610883578063cbd258b5146108a3578063cd635cce146108d357600080fd5b80638ae39cac116101345780638ae39cac1461072f5780638b424267146107455780638bdf67f21461075b5780638da5cb5b1461077b57806393f1a40b146107995780639abd3572146107fb5780639f94e2721461080e57600080fd5b80637bafb0291461065c57806384ed19b51461067c5780638705fcd4146106c4578063876ba4b7146106e457806387788782146107045780638aa285501461071a57600080fd5b8063441a3e701161023557806361d027b3116101e357806361d027b3146105a7578063630b5ba1146105c7578063671882b0146105dc5780636c95d09b146105f257806370897b2314610612578063715018a614610632578063766e80981461064757600080fd5b8063441a3e70146104e95780634817517f146104fc57806348cd4cb11461051c57806349f5edde1461053257806351eb05a6146105525780635312ea8e146105725780635dde4a911461059257600080fd5b80631a665955116102925780631a665955146103fa578063249375671461042757806330409c85146104565780634060e25714610476578063412753581461048957806341a2ac70146104a957806341cb8c20146104c957600080fd5b8063015d5238146102e5578063018bcf5c146102fc578063081e3eda1461031c5780630ba84cd2146103405780631526fe271461036057806317caf6f1146103e457600080fd5b366102e057005b600080fd5b3480156102f157600080fd5b506102fa6109b1565b005b34801561030857600080fd5b506102fa610317366004615104565b610ae6565b34801561032857600080fd5b50600b545b6040519081526020015b60405180910390f35b34801561034c57600080fd5b506102fa61035b366004615121565b610d13565b34801561036c57600080fd5b5061038061037b366004615121565b610d4f565b604080516001600160a01b03909c168c5260208c019a909a52988a01979097526060890195909552608088019390935260a087019190915260c086015260e085015261010084015261ffff9081166101208401521661014082015261016001610337565b3480156103f057600080fd5b5061032d600f5481565b34801561040657600080fd5b5060025461041a906001600160a01b031681565b604051610337919061513a565b34801561043357600080fd5b5060055461044690610100900460ff1681565b6040519015158152602001610337565b34801561046257600080fd5b506102fa610471366004615121565b610dcb565b6102fa610484366004615121565b610e63565b34801561049557600080fd5b5060075461041a906001600160a01b031681565b3480156104b557600080fd5b506102fa6104c4366004615121565b61142b565b3480156104d557600080fd5b5061032d6104e4366004615121565b6114c0565b6102fa6104f736600461514e565b6114e1565b34801561050857600080fd5b506102fa61051736600461519b565b611938565b34801561052857600080fd5b5061032d60105481565b34801561053e57600080fd5b506102fa61054d3660046151fe565b611db4565b34801561055e57600080fd5b506102fa61056d366004615121565b61216b565b34801561057e57600080fd5b506102fa61058d366004615121565b6123d2565b34801561059e57600080fd5b5061032d6124a2565b3480156105b357600080fd5b5060085461041a906001600160a01b031681565b3480156105d357600080fd5b506102fa612590565b3480156105e857600080fd5b5061032d60045481565b3480156105fe57600080fd5b506102fa61060d3660046152e4565b6125b9565b34801561061e57600080fd5b506102fa61062d366004615121565b612679565b34801561063e57600080fd5b506102fa612708565b34801561065357600080fd5b506102fa61271a565b34801561066857600080fd5b5061032d6106773660046153bc565b612822565b34801561068857600080fd5b5061069c610697366004615121565b612879565b604080516001600160a01b039485168152939092166020840152151590820152606001610337565b3480156106d057600080fd5b506102fa6106df366004615104565b6128bc565b3480156106f057600080fd5b5061032d6106ff3660046153e8565b612910565b34801561071057600080fd5b5061032d60095481565b34801561072657600080fd5b5061032d600181565b34801561073b57600080fd5b5061032d60065481565b34801561075157600080fd5b5061032d600a5481565b34801561076757600080fd5b506102fa610776366004615121565b612aef565b34801561078757600080fd5b506000546001600160a01b031661041a565b3480156107a557600080fd5b506107e06107b43660046153e8565b600e60209081526000928352604080842090915290825290208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610337565b6102fa610809366004615121565b612c2a565b34801561081a57600080fd5b5061032d612d7d565b34801561082f57600080fd5b506102fa61083e366004615104565b612e30565b34801561084f57600080fd5b506005546104469060ff1681565b6102fa61086b366004615121565b612ed7565b6102fa61087e366004615121565b613037565b34801561088f57600080fd5b5060035461041a906001600160a01b031681565b3480156108af57600080fd5b506104466108be366004615104565b60186020526000908152604090205460ff1681565b3480156108df57600080fd5b506102fa6108ee366004615418565b613663565b3480156108ff57600080fd5b5061032d61090e3660046153e8565b6136b4565b6102fa61092136600461514e565b61381d565b34801561093257600080fd5b506102fa610941366004615104565b613cd1565b34801561095257600080fd5b5061032d613d47565b34801561096757600080fd5b506102fa610976366004615121565b613f06565b34801561098757600080fd5b506102fa610996366004615121565b61418a565b3480156109a757600080fd5b5061032d61271081565b6109b9614314565b6003546001600160a01b03166109fc576040514790339082156108fc029083906000818181858888f193505050501580156109f8573d6000803e3d6000fd5b5050565b6003546040516370a0823160e01b81526000916001600160a01b0316906370a0823190610a2d90309060040161513a565b602060405180830381865afa158015610a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6e9190615435565b60035460405163a9059cbb60e01b81529192506001600160a01b03169063a9059cbb90610aa1903390859060040161544e565b6020604051808303816000875af1158015610ac0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f89190615467565b565b610aee614314565b6002546001600160a01b03828116911614801590610b1a57506003546001600160a01b03828116911614155b610b835760405162461bcd60e51b815260206004820152602f60248201527f63616e6e6f74207265636f7665722072657761726420746f6b656e206f72207260448201526e32b33632b1ba34b7b7103a37b5b2b760891b60648201526084015b60405180910390fd5b6001600160a01b03811660009081526018602052604090205460ff1615610be55760405162461bcd60e51b81526020600482015260166024820152751d1bdad95b881a5cc81d5cda5b99c81bdb881c1bdbdb60521b6044820152606401610b7a565b6001600160a01b038116610c27576040514790339082156108fc029083906000818181858888f19350505050158015610c22573d6000803e3d6000fd5b505050565b6040516370a0823160e01b81526000906001600160a01b038316906370a0823190610c5690309060040161513a565b602060405180830381865afa158015610c73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c979190615435565b905080156109f85760405163a9059cbb60e01b81526001600160a01b0383169063a9059cbb90610ccd903390859060040161544e565b6020604051808303816000875af1158015610cec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c229190615467565b50565b610d1b614314565b610d23612590565b600681905560405181815233906000805160206156fc833981519152906020015b60405180910390a250565b600b8181548110610d5f57600080fd5b60009182526020909120600a909102018054600182015460028301546003840154600485015460058601546006870154600788015460088901546009909901546001600160a01b039098169950959794969395929491939092919061ffff80821691620100009004168b565b610dd3614314565b80600003610e59576002546040516370a0823160e01b81526000916001600160a01b0316906370a0823190610e0c90309060040161513a565b602060405180830381865afa158015610e29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4d9190615435565b90506109f8338261436e565b610d10338261436e565b610e6b614538565b6000600b8281548110610e8057610e80615484565b90600052602060002090600a020190506000600c8381548110610ea557610ea5615484565b60009182526020918290206040805160e081018252600790930290910180546001600160a01b039081168452600182015416838501526002810180548351818702810187018552818152949592949386019392830182828015610f3157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610f13575b5050505050815260200160038201805480602002602001604051908101604052809291908181526020018280548015610f9357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610f75575b5050505050815260200160048201805480602002602001604051908101604052809291908181526020018280548015610ff557602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610fd7575b505050505081526020016005820180548060200260200160405190810160405280929190818152602001828054801561105757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611039575b50505091835250506006919091015460ff1615156020918201526000858152600e82526040808220338352909252908120805492935091900361109c57505050611422565b8160c001516110ad57505050611422565b6110b5614591565b6110be8461216b565b6000816001015464e8d4a51000856006015484600001546110df91906154b0565b6110e991906154cf565b6110f391906154f1565b905080156111805780611104612d7d565b10156111225760405162461bcd60e51b8152600401610b7a90615508565b80601654611130919061553f565b601655600a546127109061114490826154f1565b61114e90836154b0565b61115891906154cf565b905080601154111561117a578060115461117291906154f1565b601155611180565b60006011555b83546002546001600160a01b039081169116146113765760006111a46002836154cf565b60025460408601515191925082916001600160a01b03909116901561120757604086015180516111d6906001906154f1565b815181106111e6576111e6615484565b6020026020010151905061120486602001518488604001513061465c565b91505b60025460608701515184916001600160a01b031690156112655760608801518051611234906001906154f1565b8151811061124457611244615484565b602002602001015190506112628860200151868a606001513061465c565b91505b88546040516370a0823160e01b81526000916001600160a01b0316906370a082319061129590309060040161513a565b602060405180830381865afa1580156112b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112d69190615435565b90506112ea8960200151858488873061484c565b50508a546040516370a0823160e01b8152600092506001600160a01b03909116906370a082319061131f90309060040161513a565b602060405180830381865afa15801561133c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113609190615435565b905061136c82826154f1565b9750505050505050505b815461138390829061553f565b808355600685015464e8d4a510009161139c91906154b0565b6113a691906154cf565b6001830155600784015464e8d4a51000906113c190836154b0565b6113cb91906154cf565b82600201546113da919061553f565b600283015583546113f89086906001600160a01b0316836001614978565b604051818152859033906000805160206156dc8339815191529060200160405180910390a3505050505b610d1060018055565b611433614314565b61271081106114845760405162461bcd60e51b815260206004820181905260248201527f7365745265776172644665653a20696e76616c69642070657263656e746167656044820152606401610b7a565b600a8190556040518181527f8241a79c714425e571a9f1686404d094a6271d36603bfbff7341608c35cba269906020015b60405180910390a150565b600d81815481106114d057600080fd5b600091825260209091200154905081565b6114e9614538565b6000600b83815481106114fe576114fe615484565b60009182526020808320868452600e8252604080852033865290925292208054600a909202909201925083111561156c5760405162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b6044820152606401610b7a565b600083116115bc5760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e742073686f756c642062652067726561746f72207468616e2030006044820152606401610b7a565b6115c4614591565b4382600401541015611623576115d8612590565b8160010154600f546115ea91906154f1565b600f55600060018301819055600681905560405190815233906000805160206156fc8339815191529060200160405180910390a261162c565b61162c8461216b565b6000816001015464e8d4a510008460060154846000015461164d91906154b0565b61165791906154cf565b61166191906154f1565b905080156116f85780611672612d7d565b10156116905760405162461bcd60e51b8152600401610b7a90615508565b8060165461169e919061553f565b601655600a54612710906116b290826154f1565b6116bc90836154b0565b6116c691906154cf565b90506116d2338261436e565b8060115411156116f257806011546116ea91906154f1565b6011556116f8565b60006011555b6000826002015464e8d4a510008560070154856000015461171991906154b0565b61172391906154cf565b61172d91906154f1565b9050600081118015611741575060055460ff165b156117c9576003546001600160a01b031661179157336108fc61176383614ad8565b6040518115909202916000818181858888f1935050505015801561178b573d6000803e3d6000fd5b506117b1565b6117b13361179e83614ad8565b6003546001600160a01b03169190614b08565b80601460008282546117c391906154f1565b90915550505b84156118905782546117dc9086906154f1565b8355600984015462010000900461ffff1615611861576009840154600090612710906118129062010000900461ffff16886154b0565b61181c91906154cf565b600754865491925061183b916001600160a01b03908116911683614b08565b61185b3361184983896154f1565b87546001600160a01b03169190614b08565b50611877565b8354611877906001600160a01b03163387614b08565b83546118909087906001600160a01b0316876000614978565b6006840154835464e8d4a51000916118a7916154b0565b6118b191906154cf565b60018401556007840154835464e8d4a51000916118cd916154b0565b6118d791906154cf565b6002840155604051858152869033907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689060200160405180910390a3600554610100900460ff161561192b5761192b614b5e565b505050506109f860018055565b611940614314565b6127108461ffff1611156119a45760405162461bcd60e51b815260206004820152602560248201527f7365743a20696e76616c6964206465706f7369742066656520626173697320706044820152646f696e747360d81b6064820152608401610b7a565b6127108361ffff161115611a095760405162461bcd60e51b815260206004820152602660248201527f7365743a20696e76616c69642077697468647261772066656520626173697320604482015265706f696e747360d01b6064820152608401610b7a565b43600b8781548110611a1d57611a1d615484565b90600052602060002090600a0201600401541115611ab65743611a4261191a846154b0565b600b8881548110611a5557611a55615484565b90600052602060002090600a020160030154611a71919061553f565b11611ab65760405162461bcd60e51b815260206004820152601560248201527439b2ba1d1034b73b30b634b210323ab930ba34b7b760591b6044820152606401610b7a565b8015611ac457611ac4612590565b84600b8781548110611ad857611ad8615484565b90600052602060002090600a020160010154600f54611af791906154f1565b611b01919061553f565b600f8190555084600b8781548110611b1b57611b1b615484565b90600052602060002090600a02016001018190555083600b8781548110611b4457611b44615484565b90600052602060002090600a020160090160006101000a81548161ffff021916908361ffff16021790555082600b8781548110611b8357611b83615484565b90600052602060002090600a020160090160026101000a81548161ffff021916908361ffff16021790555081600b8781548110611bc257611bc2615484565b90600052602060002090600a02016002018190555043600b8781548110611beb57611beb615484565b90600052602060002090600a0201600401541015611c7c5780611c1157611c118661216b565b43600b8781548110611c2557611c25615484565b600091825260209091206003600a909202010155611c4561191a836154b0565b611c4f904361553f565b600b8781548110611c6257611c62615484565b90600052602060002090600a020160040181905550611ce0565b611c8861191a836154b0565b600b8781548110611c9b57611c9b615484565b90600052602060002090600a020160030154611cb7919061553f565b600b8781548110611cca57611cca615484565b90600052602060002090600a0201600401819055505b600b8681548110611cf357611cf3615484565b90600052602060002090600a020160000160009054906101000a90046001600160a01b03166001600160a01b03167f4375452615ce7668a3ecc4deee77cea5cd0dd9e4e0f6315123a2f1903e70276d8787858888600b8d81548110611d5a57611d5a615484565b90600052602060002090600a020160030154600b8e81548110611d7f57611d7f615484565b90600052602060002090600a020160040154604051611da49796959493929190615557565b60405180910390a2505050505050565b611dbc614314565b6001600160a01b038516600090815260186020526040902054859060ff1615611e235760405162461bcd60e51b81526020600482015260196024820152781b9bdb911d5c1b1a58d85d19590e88191d5c1b1a58d85d1959603a1b6044820152606401610b7a565b6127108561ffff161115611e875760405162461bcd60e51b815260206004820152602560248201527f6164643a20696e76616c6964206465706f7369742066656520626173697320706044820152646f696e747360d81b6064820152608401610b7a565b6127108461ffff161115611eec5760405162461bcd60e51b815260206004820152602660248201527f6164643a20696e76616c69642077697468647261772066656520626173697320604482015265706f696e747360d01b6064820152608401610b7a565b8115611efa57611efa612590565b60006010544311611f0d57601054611f0f565b435b905087600f54611f1f919061553f565b600f556001600160a01b038716600081815260186020908152604091829020805460ff1916600117905581516101608101835292835282018a9052810185905260608101829052600b9060808101611f7961191a886154b0565b611f83908561553f565b81526020808201859052600060408084018290526060808501839052608080860184905261ffff808f1660a0808901919091528e821660c098890152895460018181018c559a87528787208a51600a9092020180546001600160a01b039092166001600160a01b031990921691909117815596890151878b0155938801516002870155918701516003860155860151600485015590850151600584015592840151600683015560e08401516007830155610100840151600883015561012084015160099092018054610140909501518416620100000263ffffffff199095169290931691909117929092179055600c80548301808255918190528992909161208b91906154f1565b8154811061209b5761209b615484565b6000918252602082206007919091020180546001600160a01b0319166001600160a01b03938416179055600d8054600181810183559183527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50191909155600b54918916917f4375452615ce7668a3ecc4deee77cea5cd0dd9e4e0f6315123a2f1903e70276d9161212b916154f1565b8a878a8a8761213c61191a856154b0565b612146908a61553f565b6040516121599796959493929190615557565b60405180910390a25050505050505050565b6000600b828154811061218057612180615484565b90600052602060002090600a020190508060050154431161219f575050565b80546040516370a0823160e01b81526000916001600160a01b0316906370a08231906121cf90309060040161513a565b602060405180830381865afa1580156121ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122109190615435565b60025483549192506001600160a01b0390811691160361222f57506012545b60035482546001600160a01b0391821691160361224b57506013545b80158061225a57506001820154155b1561226a57504360059091015550565b600061227f8360050154438560040154612822565b90506000600f5484600101546006548461229991906154b0565b6122a391906154b0565b6122ad91906154cf565b9050826122bf8264e8d4a510006154b0565b6122c991906154cf565b8460060160008282546122dc919061553f565b909155505060055460ff16156123b45760006122f66124a2565b90506014548111156123165760145461230f90826154f1565b905061231a565b5060005b600f5461232c8264e8d4a510006154b0565b61233691906154cf565b60046000828254612347919061553f565b90915550506008850154600454859161235f916154f1565b866001015461236e91906154b0565b61237891906154cf565b85600701600082825461238b919061553f565b90915550506004546008860155601480548291906000906123ad90849061553f565b9091555050505b4360058501556017546123c890829061553f565b6017555050505050565b6123da614538565b6000600b82815481106123ef576123ef615484565b60009182526020808320858452600e8252604080852033808752935284208054858255600182018690556002820195909555600a909302018054909450919291612446916001600160a01b03919091169083614b08565b825461245f9085906001600160a01b0316836000614978565b604051818152849033907fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959060200160405180910390a3505050610d1060018055565b60055460009060ff16151581036124b95750600090565b6003546001600160a01b03166124ce57504790565b6003546040516370a0823160e01b81526000916001600160a01b0316906370a08231906124ff90309060040161513a565b602060405180830381865afa15801561251c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125409190615435565b6002546003549192506001600160a01b0390811691160361257d5760115481101561256d57600091505090565b60115461257a90826154f1565b90505b60135461258a90826154f1565b91505090565b600b5460005b818110156109f8576125a78161216b565b806125b18161558b565b915050612596565b6125c1614314565b6000600c88815481106125d6576125d6615484565b60009182526020918290206007919091020160068101805460ff19168515151790556001810180546001600160a01b0319166001600160a01b038b16179055875190925061262c91600284019190890190615065565b5084516126429060038301906020880190615065565b5083516126589060048301906020870190615065565b50825161266e9060058301906020860190615065565b505050505050505050565b6008546001600160a01b031633146126d35760405162461bcd60e51b815260206004820152601c60248201527f736574506572666f726d616e63654665653a20464f5242494444454e000000006044820152606401610b7a565b60098190556040518181527f8b940a95968ad5b511f89b01075446a4fe9f614f2dc5fbb9e9a6b227d6d4fd70906020016114b5565b612710614314565b610ae46000614c54565b612722614314565b60055460ff168061274357506003546002546001600160a01b039081169116145b610ae4576003546001600160a01b0316612790576008546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610d10573d6000803e3d6000fd5b6003546040516370a0823160e01b81526000916001600160a01b0316906370a08231906127c190309060040161513a565b602060405180830381865afa1580156127de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128029190615435565b600854600354919250610d10916001600160a01b03908116911683614b08565b60008184111561283457506000612872565b8183111561285957600161284885846154f1565b61285291906154b0565b9050612872565b600161286585856154f1565b61286f91906154b0565b90505b9392505050565b600c818154811061288957600080fd5b60009182526020909120600790910201805460018201546006909201546001600160a01b03918216935091169060ff1683565b6128c4614314565b600780546001600160a01b0319166001600160a01b03831690811790915560405133907fd44190acf9d04bdb5d3a1aafff7e6dee8b40b93dfb8c5d3f0eea4b9f4539c3f790600090a350565b600080600b848154811061292657612926615484565b60009182526020808320878452600e825260408085206001600160a01b03808a16875293528085206007600a90950290920193840154845491516370a0823160e01b815294965091949193919216906370a082319061298990309060040161513a565b602060405180830381865afa1580156129a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129ca9190615435565b84546003549192506001600160a01b039081169116036129e957506013545b8360050154431180156129fc5750600081115b8015612a0a575060055460ff165b8015612a1857506000600f54115b15612ab7576000612a276124a2565b9050601454811115612a4757601454612a4090826154f1565b9050612a4b565b5060005b600f54600090612a608364e8d4a510006154b0565b612a6a91906154cf565b600454612a77919061553f565b905082866008015482612a8a91906154f1565b8760010154612a9991906154b0565b612aa391906154cf565b8660070154612ab2919061553f565b935050505b6002830154835464e8d4a5100090612ad09085906154b0565b612ada91906154cf565b612ae491906154f1565b979650505050505050565b612af7614538565b60008111612b0457600080fd5b6002546040516370a0823160e01b81526000916001600160a01b0316906370a0823190612b3590309060040161513a565b602060405180830381865afa158015612b52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b769190615435565b600254909150612b91906001600160a01b0316333085614ca4565b6002546040516370a0823160e01b81526000916001600160a01b0316906370a0823190612bc290309060040161513a565b602060405180830381865afa158015612bdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c039190615435565b90508181601154612c14919061553f565b612c1e91906154f1565b60115550506001805550565b612c32614538565b6000600b8281548110612c4757612c47615484565b60009182526020808320858452600e825260408085203386529092529083208054600a90930290910193509103612c7f575050611422565b60055460ff16612c90575050611422565b612c98614591565b612ca18361216b565b6000816002015464e8d4a5100084600701548460000154612cc291906154b0565b612ccc91906154cf565b612cd691906154f1565b90508015612d48576003546001600160a01b0316612d2957336108fc612cfb83614ad8565b6040518115909202916000818181858888f19350505050158015612d23573d6000803e3d6000fd5b50612d36565b612d363361179e83614ad8565b80601454612d4491906154f1565b6014555b6007830154825464e8d4a5100091612d5f916154b0565b612d6991906154cf565b8260020181905550505050610d1060018055565b6003546002546000916001600160a01b039182169116148015612da2575060055460ff165b15612dae575060115490565b6002546040516370a0823160e01b81526000916001600160a01b0316906370a0823190612ddf90309060040161513a565b602060405180830381865afa158015612dfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e209190615435565b90506012548161258a91906154f1565b6008546001600160a01b03163314612e8a5760405162461bcd60e51b815260206004820152601b60248201527f7365744275794261636b57616c6c65743a20464f5242494444454e00000000006044820152606401610b7a565b600880546001600160a01b0319166001600160a01b03831617905560405133907f5dcc871da1b3d2b6073537b97b4e22ac3dc59199f78de4b24c508f65bb1d99da90610d4490849061513a565b612edf614538565b6000600b8281548110612ef457612ef4615484565b60009182526020808320858452600e825260408085203386529092529083208054600a90930290910193509103612f2c575050611422565b612f34614591565b612f3d8361216b565b6000816001015464e8d4a5100084600601548460000154612f5e91906154b0565b612f6891906154cf565b612f7291906154f1565b905080156130095780612f83612d7d565b1015612fa15760405162461bcd60e51b8152600401610b7a90615508565b80601654612faf919061553f565b601655600a5461271090612fc390826154f1565b612fcd90836154b0565b612fd791906154cf565b9050612fe3338261436e565b8060115411156130035780601154612ffb91906154f1565b601155613009565b60006011555b6006830154825464e8d4a5100091613020916154b0565b61302a91906154cf565b6001928301555080555050565b61303f614538565b6000600b828154811061305457613054615484565b90600052602060002090600a020190506000600c838154811061307957613079615484565b60009182526020918290206040805160e081018252600790930290910180546001600160a01b03908116845260018201541683850152600281018054835181870281018701855281815294959294938601939283018282801561310557602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116130e7575b505050505081526020016003820180548060200260200160405190810160405280929190818152602001828054801561316757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311613149575b50505050508152602001600482018054806020026020016040519081016040528092919081815260200182805480156131c957602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116131ab575b505050505081526020016005820180548060200260200160405190810160405280929190818152602001828054801561322b57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161320d575b50505091835250506006919091015460ff1615156020918201526000858152600e82526040808220338352909252908120805492935091900361327057505050611422565b60055460ff1661328257505050611422565b61328a614591565b6132938461216b565b6000816002015464e8d4a51000856007015484600001546132b491906154b0565b6132be91906154cf565b6132c891906154f1565b905060006132d582614ad8565b9050816014546132e591906154f1565b60145584546003546001600160a01b039081169116146135ae576003546001600160a01b03166133cf57600084602001516001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015613353573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061337791906155a4565b9050806001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b1580156133b457600080fd5b505af11580156133c8573d6000803e3d6000fd5b5050505050505b60006133dc6002836154cf565b60035460808701515191925082916001600160a01b03909116901561343f576080870151805161340e906001906154f1565b8151811061341e5761341e615484565b6020026020010151905061343c87602001518489608001513061465c565b91505b60035460a08801515184916001600160a01b0316901561349d5760a0890151805161346c906001906154f1565b8151811061347c5761347c615484565b6020026020010151925061349a8960200151868b60a001513061465c565b91505b89546040516370a0823160e01b81526000916001600160a01b0316906370a08231906134cd90309060040161513a565b602060405180830381865afa1580156134ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061350e9190615435565b90506135228a60200151858488873061484c565b50508b546040516370a0823160e01b8152600092506001600160a01b03909116906370a082319061355790309060040161513a565b602060405180830381865afa158015613574573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135989190615435565b90506135a482826154f1565b9750505050505050505b82546135bb90829061553f565b8355600685015464e8d4a51000906135d390836154b0565b6135dd91906154cf565b83600101546135ec919061553f565b60018401556007850154835464e8d4a5100091613608916154b0565b61361291906154cf565b600284015584546136309087906001600160a01b0316836001614978565b604051818152869033906000805160206156dc8339815191529060200160405180910390a35050505050610d1060018055565b61366b614314565b600580548215156101000261ff00199091161790556040517f6c55f8d24f45456d49b15692f6cd375689cbbc2cc46a33366288f1061229c1d3906114b590831515815260200190565b600080600b84815481106136ca576136ca615484565b60009182526020808320878452600e825260408085206001600160a01b03808a16875293528085206006600a90950290920193840154845491516370a0823160e01b815294965091949193919216906370a082319061372d90309060040161513a565b602060405180830381865afa15801561374a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061376e9190615435565b90508360050154431180156137835750600081115b801561379157506000600f54115b156138045760006137ab8560050154438760040154612822565b90506000600f548660010154600654846137c591906154b0565b6137cf91906154b0565b6137d991906154cf565b9050826137eb8264e8d4a510006154b0565b6137f591906154cf565b6137ff908561553f565b935050505b6001830154835464e8d4a5100090612ad09085906154b0565b613825614538565b6000600b838154811061383a5761383a615484565b60009182526020808320868452600e825260408085203386529092529220600a909102909101915061386a614591565b613872612590565b805415613a06576000816001015464e8d4a510008460060154846000015461389a91906154b0565b6138a491906154cf565b6138ae91906154f1565b9050801561394557806138bf612d7d565b10156138dd5760405162461bcd60e51b8152600401610b7a90615508565b806016546138eb919061553f565b601655600a54612710906138ff90826154f1565b61390990836154b0565b61391391906154cf565b905061391f338261436e565b80601154111561393f578060115461393791906154f1565b601155613945565b60006011555b6000826002015464e8d4a510008560070154856000015461396691906154b0565b61397091906154cf565b61397a91906154f1565b905060008111801561398e575060055460ff165b15613a03576003546001600160a01b03166139de57336108fc6139b083614ad8565b6040518115909202916000818181858888f193505050501580156139d8573d6000803e3d6000fd5b506139eb565b6139eb3361179e83614ad8565b80601460008282546139fd91906154f1565b90915550505b50505b828015613bcd5782546040516370a0823160e01b81526000916001600160a01b0316906370a0823190613a3d90309060040161513a565b602060405180830381865afa158015613a5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a7e9190615435565b8454909150613a98906001600160a01b0316333088614ca4565b83546040516370a0823160e01b81526000916001600160a01b0316906370a0823190613ac890309060040161513a565b602060405180830381865afa158015613ae5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b099190615435565b90506000613b1783836154f1565b600987015490915061ffff1615613ba057600986015460009061271090613b429061ffff16846154b0565b613b4c91906154cf565b6007548854919250613b6b916001600160a01b03908116911683614b08565b613b7581836154f1565b866000016000828254613b88919061553f565b90915550613b98905081866154f1565b945050613bb0565b8454613bad90829061553f565b85555b8554613bc99089906001600160a01b0316836001614978565b5050505b6006830154825464e8d4a5100091613be4916154b0565b613bee91906154cf565b60018301556007830154825464e8d4a5100091613c0a916154b0565b613c1491906154cf565b6002830155604051818152859033906000805160206156dc8339815191529060200160405180910390a343836004015411613c94578260010154600f54613c5b91906154f1565b600f55600060018401819055600681905560405190815233906000805160206156fc8339815191529060200160405180910390a2613cc5565b6000600a54118015613ca65750600084115b80613cb85750600554610100900460ff165b15613cc557613cc5614b5e565b5050506109f860018055565b613cd9614314565b6001600160a01b038116613d3e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b7a565b610d1081614c54565b60008060175490506000601654613d5c612d7d565b613d66919061553f565b600b5490915060005b81811015613ee2576000600b8281548110613d8c57613d8c615484565b600091825260208083206040805161016081018252600a90940290910180546001600160a01b031684526001810154928401929092526002820154908301526003810154606083015260048101546080830152600581015460a0830152600681015460c0830152600781015460e083015260088101546101008301526009015461ffff80821661012084015262010000909104166101408201526010549092509003613e7e57600f5461191a82604001518360200151600654613e4f91906154b0565b613e5991906154b0565b613e6391906154b0565b613e6d91906154cf565b613e77908661553f565b9450613ecf565b60a08101516080820151600091613e959180612822565b9050600f54826020015160065483613ead91906154b0565b613eb791906154b0565b613ec191906154cf565b613ecb908761553f565b9550505b5080613eda8161558b565b915050613d6f565b50828210613ef4576000935050505090565b613efe82846154f1565b935050505090565b613f0e614314565b600060105411613f565760405162461bcd60e51b81526020600482015260136024820152721c1bdbdb081a5cc81b9bdd081cdd185c9d1959606a1b6044820152606401610b7a565b60008111613f975760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a5908185b5bdd5b9d60921b6044820152606401610b7a565b6000805b600b5481101561400b57600b8181548110613fb857613fb8615484565b90600052602060002090600a020160040154821015613ff957600b8181548110613fe457613fe4615484565b90600052602060002090600a02016004015491505b806140038161558b565b915050613f9b565b504381116140575760405162461bcd60e51b81526020600482015260196024820152781c1bdbdb081dd85cc8185b1c9958591e48199a5b9a5cda1959603a1b6044820152606401610b7a565b61405f612590565b6002546040516370a0823160e01b81526000916001600160a01b0316906370a082319061409090309060040161513a565b602060405180830381865afa1580156140ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140d19190615435565b6002549091506140ec906001600160a01b0316333086614ca4565b6002546040516370a0823160e01b81526000916001600160a01b0316906370a082319061411d90309060040161513a565b602060405180830381865afa15801561413a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061415e9190615435565b9050818160115461416f919061553f565b61417991906154f1565b601155614184614b5e565b50505050565b614192614314565b43601054116141d95760405162461bcd60e51b81526020600482015260136024820152726661726d2069732072756e6e696e67206e6f7760681b6044820152606401610b7a565b4381116142345760405162461bcd60e51b8152602060048201526024808201527f73686f756c642062652067726561746572207468616e2063757272656e7420626044820152636c6f636b60e01b6064820152608401610b7a565b601081905560005b600b548110156109f857601054600b828154811061425c5761425c615484565b90600052602060002090600a020160030181905550601054600b828154811061428757614287615484565b90600052602060002090600a02016005018190555061191a600b82815481106142b2576142b2615484565b90600052602060002090600a0201600201546142ce91906154b0565b6010546142db919061553f565b600b82815481106142ee576142ee615484565b600091825260209091206004600a9092020101558061430c8161558b565b91505061423c565b6000546001600160a01b03163314610ae45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b7a565b6002546040516370a0823160e01b81526000916001600160a01b0316906370a082319061439f90309060040161513a565b602060405180830381865afa1580156143bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906143e09190615435565b90506000818311156144685760025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061441e908790869060040161544e565b6020604051808303816000875af115801561443d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144619190615467565b90506144e0565b60025460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061449a908790879060040161544e565b6020604051808303816000875af11580156144b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144dd9190615467565b90505b806141845760405162461bcd60e51b815260206004820152602260248201527f73616665546f6b656e5472616e736665723a207472616e73666572206661696c604482015261195960f21b6064820152608401610b7a565b60026001540361458a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b7a565b6002600155565b6009543410156145da5760405162461bcd60e51b815260206004820152601460248201527373686f756c642070617920736d616c6c2067617360601b6044820152606401610b7a565b6008546009546040516001600160a01b039092169181156108fc0291906000818181858888f19350505050158015614616573d6000803e3d6000fd5b50600954341115610ae45760095433906108fc9061463490346154f1565b6040518115909202916000818181858888f19350505050158015610d10573d6000803e3d6000fd5b600080836001855161466e91906154f1565b8151811061467e5761467e615484565b60200260200101516001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016146b1919061513a565b602060405180830381865afa1580156146ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146f29190615435565b905061472c86868660008151811061470c5761470c615484565b60200260200101516001600160a01b0316614cdc9092919063ffffffff16565b6001600160a01b038616635c11d795866000878761474c4261025861553f565b6040518663ffffffff1660e01b815260040161476c9594939291906155c1565b600060405180830381600087803b15801561478657600080fd5b505af115801561479a573d6000803e3d6000fd5b50505050600084600186516147af91906154f1565b815181106147bf576147bf615484565b60200260200101516001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016147f2919061513a565b602060405180830381865afa15801561480f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906148339190615435565b905061483f82826154f1565b925050505b949350505050565b600080806148646001600160a01b0389168a88614de0565b6148786001600160a01b0388168a87614de0565b6001600160a01b03891663e8e33700898989896000808b61489b4261025861553f565b60405160e08a901b6001600160e01b03191681526001600160a01b039889166004820152968816602488015260448701959095526064860193909352608485019190915260a484015290921660c482015260e4810191909152610104016060604051808303816000875af1158015614917573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061493b9190615632565b919450925090506149576001600160a01b0389168a6000614cdc565b61496c6001600160a01b0388168a6000614cdc565b96509650969350505050565b8015614a1b5781600d858154811061499257614992615484565b90600052602060002001546149a7919061553f565b600d85815481106149ba576149ba615484565b6000918252602090912001556002546001600160a01b03908116908416036149ee57816012546149ea919061553f565b6012555b6003546001600160a01b0390811690841603614a165781601354614a12919061553f565b6013555b614184565b81600d8581548110614a2f57614a2f615484565b9060005260206000200154614a4491906154f1565b600d8581548110614a5757614a57615484565b6000918252602090912001556002546001600160a01b0390811690841603614a9b57816012541015614a895760128290555b81601254614a9791906154f1565b6012555b6003546001600160a01b039081169084160361418457816013541015614ac15760138290555b81601354614acf91906154f1565b60135550505050565b600080614ae36124a2565b9050601454831115614af55760145492505b80831115614b01578092505b5090919050565b610c228363a9059cbb60e01b8484604051602401614b2792919061544e565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614e80565b6000805b600b54811015614bd257600b8181548110614b7f57614b7f615484565b90600052602060002090600a020160040154821015614bc057600b8181548110614bab57614bab615484565b90600052602060002090600a02016004015491505b80614bca8161558b565b915050614b62565b50438111614bdd5750565b6000601654614bea612d7d565b614bf4919061553f565b90506017548111156109f857601754614c0d90826154f1565b90506000614c1b43846154f1565b9050614c2781836154cf565b600681905560405190815233906000805160206156fc8339815191529060200160405180910390a2505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b03808516602483015283166044820152606481018290526141849085906323b872dd60e01b90608401614b27565b801580614d565750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015614d30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614d549190615435565b155b614dc15760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610b7a565b610c228363095ea7b360e01b8484604051602401614b2792919061544e565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015614e31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614e559190615435565b614e5f919061553f565b90506141848463095ea7b360e01b8584604051602401614b2792919061544e565b6000614ed5826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614f529092919063ffffffff16565b805190915015610c225780806020019051810190614ef39190615467565b610c225760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610b7a565b606061286f848460008585600080866001600160a01b03168587604051614f79919061568c565b60006040518083038185875af1925050503d8060008114614fb6576040519150601f19603f3d011682016040523d82523d6000602084013e614fbb565b606091505b509150915061483f878383876060831561503657825160000361502f576001600160a01b0385163b61502f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b7a565b5081614844565b614844838381511561504b5781518083602001fd5b8060405162461bcd60e51b8152600401610b7a91906156a8565b8280548282559060005260206000209081019282156150ba579160200282015b828111156150ba57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190615085565b506150c69291506150ca565b5090565b5b808211156150c657600081556001016150cb565b6001600160a01b0381168114610d1057600080fd5b80356150ff816150df565b919050565b60006020828403121561511657600080fd5b8135612872816150df565b60006020828403121561513357600080fd5b5035919050565b6001600160a01b0391909116815260200190565b6000806040838503121561516157600080fd5b50508035926020909101359150565b803561ffff811681146150ff57600080fd5b8015158114610d1057600080fd5b80356150ff81615182565b60008060008060008060c087890312156151b457600080fd5b86359550602087013594506151cb60408801615170565b93506151d960608801615170565b92506080870135915060a08701356151f081615182565b809150509295509295509295565b60008060008060008060c0878903121561521757600080fd5b863595506020870135615229816150df565b94506151cb60408801615170565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261525e57600080fd5b8135602067ffffffffffffffff8083111561527b5761527b615237565b8260051b604051601f19603f830116810181811084821117156152a0576152a0615237565b6040529384528581018301938381019250878511156152be57600080fd5b83870191505b84821015612ae4576152d5826150f4565b835291830191908301906152c4565b600080600080600080600060e0888a0312156152ff57600080fd5b8735965061530f602089016150f4565b9550604088013567ffffffffffffffff8082111561532c57600080fd5b6153388b838c0161524d565b965060608a013591508082111561534e57600080fd5b61535a8b838c0161524d565b955060808a013591508082111561537057600080fd5b61537c8b838c0161524d565b945060a08a013591508082111561539257600080fd5b5061539f8a828b0161524d565b9250506153ae60c08901615190565b905092959891949750929550565b6000806000606084860312156153d157600080fd5b505081359360208301359350604090920135919050565b600080604083850312156153fb57600080fd5b82359150602083013561540d816150df565b809150509250929050565b60006020828403121561542a57600080fd5b813561287281615182565b60006020828403121561544757600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b60006020828403121561547957600080fd5b815161287281615182565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156154ca576154ca61549a565b500290565b6000826154ec57634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156155035761550361549a565b500390565b6020808252601a908201527f496e73756666696369656e742072657761726420746f6b656e73000000000000604082015260600190565b600082198211156155525761555261549a565b500190565b9687526020870195909552604086019390935261ffff918216606086015216608084015260a083015260c082015260e00190565b60006001820161559d5761559d61549a565b5060010190565b6000602082840312156155b657600080fd5b8151612872816150df565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156156115784516001600160a01b0316835293830193918301916001016155ec565b50506001600160a01b03969096166060850152505050608001529392505050565b60008060006060848603121561564757600080fd5b8351925060208401519150604084015190509250925092565b60005b8381101561567b578181015183820152602001615663565b838111156141845750506000910152565b6000825161569e818460208701615660565b9190910192915050565b60208152600082518060208401526156c7816040850160208701615660565b601f01601f1916919091016040019291505056fe90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15e2492e003bbe8afa53088b406f0c1cb5d9e280370fc72a74cf116ffd343c4053a264697066735822122010c6a836aabfc46062707a2e63d78a95f874108720f56553c9029294d8e818f564736f6c634300080e0033

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  ]
[ 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.