ETH Price: $3,188.31 (+2.71%)

Contract

0xDF358f8B725DC34F2b9F3C2f0EB02a01FE0Bd530
 
Transaction Hash
Method
Block
From
To
Withdraw136877822021-11-26 4:56:571086 days ago1637902617IN
0xDF358f8B...1FE0Bd530
0 ETH0.0045060767.09364329
Deposit129131692021-07-28 7:38:201207 days ago1627457900IN
0xDF358f8B...1FE0Bd530
0 ETH0.0032125922
Withdraw129129062021-07-28 6:39:491207 days ago1627454389IN
0xDF358f8B...1FE0Bd530
0 ETH0.0019046725
Withdraw121787762021-04-05 9:06:401321 days ago1617613600IN
0xDF358f8B...1FE0Bd530
0 ETH0.008375385.00000112
Withdraw119910862021-03-07 11:29:261350 days ago1615116566IN
0xDF358f8B...1FE0Bd530
0 ETH0.0029176396
Withdraw119910842021-03-07 11:29:111350 days ago1615116551IN
0xDF358f8B...1FE0Bd530
0 ETH0.011308796
Withdraw117551042021-01-30 4:25:591386 days ago1611980759IN
0xDF358f8B...1FE0Bd530
0 ETH0.0092448979
Withdraw117372322021-01-27 10:17:461389 days ago1611742666IN
0xDF358f8B...1FE0Bd530
0 ETH0.0065540156.00000145
Withdraw117193802021-01-24 16:17:241391 days ago1611505044IN
0xDF358f8B...1FE0Bd530
0 ETH0.01274522108.9
Withdraw116634372021-01-16 2:01:131400 days ago1610762473IN
0xDF358f8B...1FE0Bd530
0 ETH0.0055001247
Withdraw115897382021-01-04 18:51:511411 days ago1609786311IN
0xDF358f8B...1FE0Bd530
0 ETH0.01322371113
Withdraw114908942020-12-20 15:02:331426 days ago1608476553IN
0xDF358f8B...1FE0Bd530
0 ETH0.0046346239.6
Withdraw114908762020-12-20 14:58:091426 days ago1608476289IN
0xDF358f8B...1FE0Bd530
0 ETH0.0037434
Withdraw114381092020-12-12 12:29:321435 days ago1607776172IN
0xDF358f8B...1FE0Bd530
0 ETH0.0023992320.5
Withdraw114265052020-12-10 17:23:141436 days ago1607620994IN
0xDF358f8B...1FE0Bd530
0 ETH0.0048411555
Withdraw114207782020-12-09 20:16:461437 days ago1607545006IN
0xDF358f8B...1FE0Bd530
0 ETH0.0025518625.5
Withdraw114202642020-12-09 18:22:151437 days ago1607538135IN
0xDF358f8B...1FE0Bd530
0 ETH0.0025482622.6
Deposit114053102020-12-07 11:12:131440 days ago1607339533IN
0xDF358f8B...1FE0Bd530
0 ETH0.0051946635
Set Allocation114037742020-12-07 5:27:081440 days ago1607318828IN
0xDF358f8B...1FE0Bd530
0 ETH0.0033742615.4
Set Allocation114037692020-12-07 5:26:061440 days ago1607318766IN
0xDF358f8B...1FE0Bd530
0 ETH0.0043821620
Withdraw114037592020-12-07 5:23:391440 days ago1607318619IN
0xDF358f8B...1FE0Bd530
0 ETH0.0022473219.2
Withdraw114035412020-12-07 4:40:561440 days ago1607316056IN
0xDF358f8B...1FE0Bd530
0 ETH0.00265226
Withdraw114035202020-12-07 4:36:091440 days ago1607315769IN
0xDF358f8B...1FE0Bd530
0 ETH0.00987567101
Deposit114032912020-12-07 3:47:191440 days ago1607312839IN
0xDF358f8B...1FE0Bd530
0 ETH0.0020664116.00000145
Deposit114029472020-12-07 2:34:461440 days ago1607308486IN
0xDF358f8B...1FE0Bd530
0 ETH0.0034133623
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ArchbishopV2

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 10 : ArchbishopV2.sol
pragma solidity 0.6.12;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "./libraries/SafeMath96.sol";
import "./libraries/SafeMath32.sol";

// Archbishop will crown the King 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 $KING is sufficiently
// distributed and the community can show to govern itself.
contract ArchbishopV2 is Ownable, ReentrancyGuard {
    using SafeMath for uint256;
    using SafeMath96 for uint96;
    using SafeMath32 for uint32;

    using SafeERC20 for IERC20;

    struct UserInfo {
        uint256 wAmount; // Weighted amount = lptAmount + (stAmount * pool.sTokenWeight)
        uint256 stAmount; // How many S tokens the user has provided
        uint256 lptAmount; // How many LP tokens the user has provided
        uint96 pendingKing; // $KING tokens pending to be given to user
        uint96 rewardDebt; // Reward debt (see explanation below)
        uint32 lastWithdrawBlock; // User last withdraw time

        // We do some fancy math here. Basically, any point in time, the amount of $KINGs
        // entitled to a user but is pending to be distributed is:
        //
        //   pending reward = (user.wAmount * pool.accKingPerShare) - user.rewardDebt
        //
        // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens:
        //   1. The pool's `accKingPerShare` (and `lastRewardBlock`) gets updated
        //   2. User receives the pending reward sent to his/her address
        //   3. User's `wAmount` gets updated
        //   4. User's `rewardDebt` gets updated
    }

    struct PoolInfo {
        IERC20 lpToken; // Address of LP token contract
        uint32 allocPoint; // Allocation points assigned to this pool (for $KINGs distribution)
        uint32 lastRewardBlock; // Last block number that $KINGs distribution occurs
        uint32 sTokenWeight; // "Weight" of LP token in SToken, times 1e8
        IERC20 sToken; // Address of S token contract
        bool kingLock; // if true, withdraw interval, or withdraw fees otherwise, applied on $KING withdrawals
        uint256 accKingPerShare; // Accumulated $KINGs per share, times 1e12 (see above)
    }

    // The $KING token contract
    address public king;

    // The kingServant contract (that receives LP token fees)
    address public kingServant;
    // fees on LP token withdrawals, in percents
    uint8 public lpFeePct = 0;

    // The courtJester address (that receives $KING fees)
    address public courtJester;
    // fees on $KING withdrawals, in percents (charged if `pool.kingLock` is `false`)
    uint8 public kingFeePct = 0;
    // Withdraw interval, in blocks, takes effect if pool.kingLock is `true`
    uint32 public withdrawInterval;

    // $KING token amount distributed every block of LP token farming
    uint96 public kingPerLptFarmingBlock;
    // $KING token amount distributed every block of S token farming
    uint96 public kingPerStFarmingBlock;
    // The sum of allocation points in all pools
    uint32 public totalAllocPoint;

    // The block when yield and trade farming starts
    uint32 public startBlock;
    // Block when LP token farming ends
    uint32 public lptFarmingEndBlock;
    // Block when S token farming ends
    uint32 public stFarmingEndBlock;

    // Info of each pool
    PoolInfo[] public poolInfo;
    // Info of each user that stakes tokens
    mapping(uint256 => mapping(address => UserInfo)) public userInfo;

    event Deposit(
        address indexed user,
        uint256 indexed pid,
        uint256 lptAmount,
        uint256 stAmount
    );
    event Withdraw(
        address indexed user,
        uint256 indexed pid,
        uint256 lptAmount
    );
    event EmergencyWithdraw(
        address indexed user,
        uint256 indexed pid,
        uint256 lptAmount
    );

    constructor(
        address _king,
        address _kingServant,
        address _courtJester,
        uint256 _startBlock,
        uint256 _withdrawInterval
    ) public {
        king = _nonZeroAddr(_king);
        kingServant = _nonZeroAddr(_kingServant);
        courtJester = _nonZeroAddr(_courtJester);
        startBlock = SafeMath32.fromUint(_startBlock);
        withdrawInterval = SafeMath32.fromUint(_withdrawInterval);
    }

    function setFarmingParams(
        uint256 _kingPerLptFarmingBlock,
        uint256 _kingPerStFarmingBlock,
        uint256 _lptFarmingEndBlock,
        uint256 _stFarmingEndBlock
    ) external onlyOwner {
        _setFarmingParams(
            SafeMath96.fromUint(_kingPerLptFarmingBlock),
            SafeMath96.fromUint(_kingPerStFarmingBlock),
            SafeMath32.fromUint(_lptFarmingEndBlock),
            SafeMath32.fromUint(_stFarmingEndBlock)
        );
    }

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

    // Add a new LP pool. Owner only may call.
    function add(
        uint256 allocPoint,
        uint256 sTokenWeight,
        IERC20 lpToken,
        IERC20 sToken,
        bool withUpdate
    ) public onlyOwner {
        require(_isMissingPool(lpToken, sToken), "ArchV2::add:POOL_EXISTS");
        uint32 _allocPoint = SafeMath32.fromUint(allocPoint);

        if (withUpdate) massUpdatePools();

        uint32 curBlock = curBlock();
        totalAllocPoint = totalAllocPoint.add(_allocPoint);
        poolInfo.push(
            PoolInfo({
                lpToken: lpToken,
                sToken: sToken,
                allocPoint: SafeMath32.fromUint(_allocPoint),
                sTokenWeight: SafeMath32.fromUint(sTokenWeight),
                lastRewardBlock: curBlock > startBlock ? curBlock : startBlock,
                accKingPerShare: 0,
                kingLock: true
            })
        );
    }

    // Update the given pool's $KING allocation point. Owner only may call.
    function setAllocation(
        uint256 pid,
        uint256 allocPoint,
        bool withUpdate
    ) public onlyOwner {
        _validatePid(pid);
        if (withUpdate) massUpdatePools();

        uint32 _allocPoint = SafeMath32.fromUint(allocPoint);

        totalAllocPoint = totalAllocPoint.sub(poolInfo[pid].allocPoint).add(
            _allocPoint
        );
        poolInfo[pid].allocPoint = _allocPoint;
    }

    function setSTokenWeight(
        uint256 pid,
        uint256 sTokenWeight,
        bool withUpdate
    ) public onlyOwner {
        _validatePid(pid);
        if (withUpdate) massUpdatePools();

        poolInfo[pid].sTokenWeight = SafeMath32.fromUint(sTokenWeight);
    }

    function setKingLock(
        uint256 pid,
        bool _kingLock,
        bool withUpdate
    ) public onlyOwner {
        _validatePid(pid);
        if (withUpdate) massUpdatePools();

        poolInfo[pid].kingLock = _kingLock;
    }

    // Return reward multipliers for LP and S tokens over the given _from to _to block.
    function getMultiplier(uint256 from, uint256 to)
        public
        view
        returns (uint256 lpt, uint256 st)
    {
        (uint32 _lpt, uint32 _st) = _getMultiplier(
            SafeMath32.fromUint(from),
            SafeMath32.fromUint(to)
        );
        lpt = uint256(_lpt);
        st = uint256(_st);
    }

    function getKingPerBlock(uint256 blockNum) public view returns (uint256) {
        return
            (blockNum > stFarmingEndBlock ? 0 : kingPerStFarmingBlock).add(
                blockNum > lptFarmingEndBlock ? 0 : kingPerLptFarmingBlock
            );
    }

    // View function to see pending $KINGs on frontend.
    function pendingKing(uint256 pid, address _user)
        external
        view
        returns (uint256)
    {
        _validatePid(pid);
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][_user];

        uint256 kingPerShare = pool.accKingPerShare;

        uint32 curBlock = curBlock();
        uint256 lptSupply = pool.lpToken.balanceOf(address(this));

        if (curBlock > pool.lastRewardBlock && lptSupply != 0) {
            (uint32 lptFactor, uint32 stFactor) = _getMultiplier(
                pool.lastRewardBlock,
                curBlock
            );
            uint96 kingReward = _kingReward(
                lptFactor,
                stFactor,
                pool.allocPoint
            );
            if (kingReward != 0) {
                uint256 stSupply = pool.sToken.balanceOf(address(this));
                uint256 wSupply = _weighted(
                    lptSupply,
                    stSupply,
                    pool.sTokenWeight
                );
                kingPerShare = _accShare(kingPerShare, kingReward, wSupply);
            }
        }

        return
            _accPending(
                user.pendingKing,
                user.wAmount,
                user.rewardDebt,
                kingPerShare
            );
    }

    // 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
    function updatePool(uint256 pid) public {
        _validatePid(pid);
        _updatePool(pid);
    }

    // Deposit lptAmount of LP token and stAmount of S token to mine $KING,
    // (it sends to msg.sender $KINGs pending by then)
    function deposit(
        uint256 pid,
        uint256 lptAmount,
        uint256 stAmount
    ) public nonReentrant {
        require(lptAmount != 0, "deposit: zero LP token amount");
        _validatePid(pid);

        _updatePool(pid);

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

        uint256 oldStAmount = user.stAmount;
        uint96 pendingKingAmount = _accPending(
            user.pendingKing,
            user.wAmount,
            user.rewardDebt,
            pool.accKingPerShare
        );
        user.lptAmount = user.lptAmount.add(lptAmount);
        user.stAmount = user.stAmount.add(stAmount);
        user.wAmount = _accWeighted(
            user.wAmount,
            lptAmount,
            stAmount,
            pool.sTokenWeight
        );

        uint32 curBlock = curBlock();
        if (
            _sendKingToken(
                msg.sender,
                pendingKingAmount,
                pool.kingLock,
                curBlock.sub(user.lastWithdrawBlock)
            )
        ) {
            user.lastWithdrawBlock = curBlock;
            user.pendingKing = 0;
            pool.sToken.safeTransfer(address(1), oldStAmount);
        } else {
            user.pendingKing = pendingKingAmount;
        }
        user.rewardDebt = _pending(user.wAmount, 0, pool.accKingPerShare);

        pool.lpToken.safeTransferFrom(msg.sender, address(this), lptAmount);
        if (stAmount != 0)
            pool.sToken.safeTransferFrom(msg.sender, address(this), stAmount);

        emit Deposit(msg.sender, pid, lptAmount, stAmount);
    }

    // Withdraw lptAmount of LP token and all pending $KING tokens
    // (it burns all S tokens)
    function withdraw(uint256 pid, uint256 lptAmount) public nonReentrant {
        _validatePid(pid);
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];

        uint256 preLptAmount = user.wAmount;
        require(preLptAmount >= lptAmount, "withdraw: LP amount not enough");

        user.lptAmount = preLptAmount.sub(lptAmount);
        uint256 stAmount = user.stAmount;

        _updatePool(pid);
        uint96 pendingKingAmount = _accPending(
            user.pendingKing,
            user.wAmount,
            user.rewardDebt,
            pool.accKingPerShare
        );
        user.wAmount = user.lptAmount;
        user.rewardDebt = _pending(user.wAmount, 0, pool.accKingPerShare);
        user.stAmount = 0;
        uint32 curBlock = curBlock();

        if (
            _sendKingToken(
                msg.sender,
                pendingKingAmount,
                pool.kingLock,
                curBlock.sub(user.lastWithdrawBlock)
            )
        ) {
            user.lastWithdrawBlock = curBlock;
            user.pendingKing = 0;
        } else {
            user.pendingKing = pendingKingAmount;
        }

        uint256 sentLptAmount = lptAmount == 0
            ? 0
            : _sendLptAndBurnSt(msg.sender, pool, lptAmount, stAmount);
        emit Withdraw(msg.sender, pid, sentLptAmount);
    }

    // Withdraw without caring about rewards. EMERGENCY ONLY.
    // (it clears all pending $KINGs and burns all S tokens)
    function emergencyWithdraw(uint256 pid) public {
        _validatePid(pid);
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];

        uint256 lptAmount = user.lptAmount;
        user.lptAmount = 0; // serves as "non-reentrant"
        require(lptAmount > 0, "withdraw: zero LP token amount");

        uint32 curBlock = curBlock();
        uint256 stAmount = user.stAmount;
        user.wAmount = 0;
        user.stAmount = 0;
        user.rewardDebt = 0;
        user.pendingKing = 0;
        user.lastWithdrawBlock = curBlock;

        uint256 sentLptAmount = _sendLptAndBurnSt(
            msg.sender,
            pool,
            lptAmount,
            stAmount
        );
        emit EmergencyWithdraw(msg.sender, pid, sentLptAmount);
    }

    function setKingServant(address _kingServant) public onlyOwner {
        kingServant = _nonZeroAddr(_kingServant);
    }

    function setCourtJester(address _courtJester) public onlyOwner {
        courtJester = _nonZeroAddr(_courtJester);
    }

    function setKingFeePct(uint256 newPercent) public onlyOwner {
        kingFeePct = _validPercent(newPercent);
    }

    function setLpFeePct(uint256 newPercent) public onlyOwner {
        lpFeePct = _validPercent(newPercent);
    }

    function setWithdrawInterval(uint256 _blockNum) public onlyOwner {
        withdrawInterval = SafeMath32.fromUint(_blockNum);
    }

    function _updatePool(uint256 pid) internal {
        PoolInfo storage pool = poolInfo[pid];
        uint32 lastUpdateBlock = pool.lastRewardBlock;

        uint32 curBlock = curBlock();
        if (curBlock <= lastUpdateBlock) return;
        pool.lastRewardBlock = curBlock;

        (uint32 lptFactor, uint32 stFactor) = _getMultiplier(
            lastUpdateBlock,
            curBlock
        );
        if (lptFactor == 0 && stFactor == 0) return;

        uint256 lptSupply = pool.lpToken.balanceOf(address(this));
        if (lptSupply == 0) return;

        uint256 stSupply = pool.sToken.balanceOf(address(this));
        uint256 wSupply = _weighted(lptSupply, stSupply, pool.sTokenWeight);

        uint96 kingReward = _kingReward(lptFactor, stFactor, pool.allocPoint);
        pool.accKingPerShare = _accShare(
            pool.accKingPerShare,
            kingReward,
            wSupply
        );
    }

    function _sendKingToken(
        address user,
        uint96 amount,
        bool kingLock,
        uint32 blocksSinceLastWithdraw
    ) internal returns (bool isSent) {
        isSent = true;
        if (amount == 0) return isSent;

        uint256 feeAmount = 0;
        uint256 userAmount = 0;

        if (!kingLock) {
            userAmount = amount;
            if (kingFeePct != 0) {
                feeAmount = uint256(amount).mul(kingFeePct).div(100);
                userAmount = userAmount.sub(feeAmount);

                IERC20(king).safeTransfer(courtJester, feeAmount);
            }
        } else if (blocksSinceLastWithdraw > withdrawInterval) {
            userAmount = amount;
        } else {
            return isSent = false;
        }

        uint256 balance = IERC20(king).balanceOf(address(this));
        IERC20(king).safeTransfer(
            user,
            // if balance lacks some tiny $KING amount due to imprecise rounding
            userAmount > balance ? balance : userAmount
        );
    }

    function _sendLptAndBurnSt(
        address user,
        PoolInfo storage pool,
        uint256 lptAmount,
        uint256 stAmount
    ) internal returns (uint256) {
        uint256 userLptAmount = lptAmount;

        if (curBlock() < stFarmingEndBlock && lpFeePct != 0) {
            uint256 lptFee = lptAmount.mul(lpFeePct).div(100);
            userLptAmount = userLptAmount.sub(lptFee);

            pool.lpToken.safeTransfer(kingServant, lptFee);
        }

        if (userLptAmount != 0) pool.lpToken.safeTransfer(user, userLptAmount);
        if (stAmount != 0) pool.sToken.safeTransfer(address(1), stAmount);

        return userLptAmount;
    }

    function _safeKingTransfer(address _to, uint256 _amount) internal {
        uint256 kingBal = IERC20(king).balanceOf(address(this));
        // if pool lacks some tiny $KING amount due to imprecise rounding
        IERC20(king).safeTransfer(_to, _amount > kingBal ? kingBal : _amount);
    }

    function _setFarmingParams(
        uint96 _kingPerLptFarmingBlock,
        uint96 _kingPerStFarmingBlock,
        uint32 _lptFarmingEndBlock,
        uint32 _stFarmingEndBlock
    ) internal {
        require(
            _lptFarmingEndBlock >= lptFarmingEndBlock,
            "ArchV2::lptFarmingEndBlock"
        );
        require(
            _stFarmingEndBlock >= stFarmingEndBlock,
            "ArchV2::stFarmingEndBlock"
        );

        if (lptFarmingEndBlock != _lptFarmingEndBlock)
            lptFarmingEndBlock = _lptFarmingEndBlock;
        if (stFarmingEndBlock != _stFarmingEndBlock)
            stFarmingEndBlock = _stFarmingEndBlock;

        (uint32 lptFactor, uint32 stFactor) = _getMultiplier(
            curBlock(),
            2**32 - 1
        );
        uint256 minBalance = (
            uint256(_kingPerLptFarmingBlock).mul(uint256(stFactor))
        )
            .add(uint256(_kingPerStFarmingBlock).mul(uint256(lptFactor)));
        require(
            IERC20(king).balanceOf(address(this)) >= minBalance,
            "ArchV2::LOW_$KING_BALANCE"
        );

        kingPerLptFarmingBlock = _kingPerLptFarmingBlock;
        kingPerStFarmingBlock = _kingPerStFarmingBlock;
    }

    // Revert if the LP token has been already added.
    function _isMissingPool(IERC20 lpToken, IERC20 sToken)
        internal
        view
        returns (bool)
    {
        _revertZeroAddress(address(lpToken));
        _revertZeroAddress(address(lpToken));
        for (uint256 i = 0; i < poolInfo.length; i++) {
            if (
                poolInfo[i].lpToken == lpToken || poolInfo[i].sToken == sToken
            ) {
                return false;
            }
        }
        return true;
    }

    function _getMultiplier(uint32 _from, uint32 _to)
        internal
        view
        returns (uint32 lpt, uint32 st)
    {
        uint32 start = _from > startBlock ? _from : startBlock;

        // LP token farming multiplier
        uint32 end = _to > lptFarmingEndBlock ? lptFarmingEndBlock : _to;
        lpt = _from < lptFarmingEndBlock ? end.sub(start) : 0;

        // S token farming multiplier
        end = _to > stFarmingEndBlock ? stFarmingEndBlock : _to;
        st = _from < stFarmingEndBlock ? end.sub(start) : 0;
    }

    function _accPending(
        uint96 prevPending,
        uint256 amount,
        uint96 rewardDebt,
        uint256 accPerShare
    ) internal pure returns (uint96) {
        return
            amount == 0
                ? prevPending
                : prevPending.add(_pending(amount, rewardDebt, accPerShare));
    }

    function _pending(
        uint256 amount,
        uint96 rewardDebt,
        uint256 accPerShare
    ) internal pure returns (uint96) {
        return
            amount == 0
                ? 0
                : SafeMath96.fromUint(
                    amount.mul(accPerShare).div(1e12).sub(uint256(rewardDebt)),
                    "ArchV2::pending:overflow"
                );
    }

    function _kingReward(
        uint32 lptFactor,
        uint32 stFactor,
        uint32 allocPoint
    ) internal view returns (uint96) {
        uint32 _totalAllocPoint = totalAllocPoint;
        uint96 lptReward = _reward(
            lptFactor,
            kingPerLptFarmingBlock,
            allocPoint,
            _totalAllocPoint
        );
        if (stFactor == 0) return lptReward;

        uint96 stReward = _reward(
            stFactor,
            kingPerStFarmingBlock,
            allocPoint,
            _totalAllocPoint
        );
        return lptReward.add(stReward);
    }

    function _reward(
        uint32 factor,
        uint96 rewardPerBlock,
        uint32 allocPoint,
        uint32 _totalAllocPoint
    ) internal pure returns (uint96) {
        return
            SafeMath96.fromUint(
                uint256(factor)
                    .mul(uint256(rewardPerBlock))
                    .mul(uint256(allocPoint))
                    .div(uint256(_totalAllocPoint))
            );
    }

    function _accShare(
        uint256 prevShare,
        uint96 reward,
        uint256 supply
    ) internal pure returns (uint256) {
        return prevShare.add(uint256(reward).mul(1e12).div(supply));
    }

    function _accWeighted(
        uint256 prevAmount,
        uint256 lptAmount,
        uint256 stAmount,
        uint32 sTokenWeight
    ) internal pure returns (uint256) {
        return prevAmount.add(_weighted(lptAmount, stAmount, sTokenWeight));
    }

    function _weighted(
        uint256 lptAmount,
        uint256 stAmount,
        uint32 sTokenWeight
    ) internal pure returns (uint256) {
        if (stAmount == 0 || sTokenWeight == 0) {
            return lptAmount;
        }
        return lptAmount.add(stAmount.mul(sTokenWeight).div(1e8));
    }

    function _nonZeroAddr(address _address) private pure returns (address) {
        _revertZeroAddress(_address);
        return _address;
    }

    function curBlock() private view returns (uint32) {
        return SafeMath32.fromUint(block.number);
    }

    function _validPercent(uint256 percent) private pure returns (uint8) {
        require(percent <= 100, "ArchV2::INVALID_PERCENT");
        return uint8(percent);
    }

    function _revertZeroAddress(address _address) internal pure {
        require(_address != address(0), "ArchV2::ZERO_ADDRESS");
    }

    function _validatePid(uint256 pid) private view returns (uint256) {
        require(pid < poolInfo.length, "ArchV2::INVALID_POOL_ID");
        return pid;
    }
}

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

pragma solidity ^0.6.0;

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

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

File 3 of 10 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "../GSN/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.
 */
contract Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(_owner == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

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

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

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

pragma solidity ^0.6.0;

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

File 5 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 6 of 10 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.6.2;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies in extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

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

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return _functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        return _functionCallWithValue(target, data, value, errorMessage);
    }

    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

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

pragma solidity ^0.6.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].
 */
contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

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

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 9 of 10 : SafeMath32.sol
pragma solidity 0.6.12;

library SafeMath32 {

    function add(uint32 a, uint32 b, string memory errorMessage) internal pure returns (uint32) {
        uint32 c = a + b;
        require(c >= a, errorMessage);
        return c;
    }

    function add(uint32 a, uint32 b) internal pure returns (uint32) {
        return add(a, b, "SafeMath32: addition overflow");
    }

    function sub(uint32 a, uint32 b, string memory errorMessage) internal pure returns (uint32) {
        require(b <= a, errorMessage);
        return a - b;
    }

    function sub(uint32 a, uint32 b) internal pure returns (uint32) {
        return sub(a, b, "SafeMath32: subtraction overflow");
    }

    function fromUint(uint n, string memory errorMessage) internal pure returns (uint32) {
        require(n < 2**32, errorMessage);
        return uint32(n);
    }

    function fromUint(uint n) internal pure returns (uint32) {
        return fromUint(n, "SafeMath32: exceeds 32 bits");
    }
}

File 10 of 10 : SafeMath96.sol
pragma solidity 0.6.12;

library SafeMath96 {

    function add(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
        uint96 c = a + b;
        require(c >= a, errorMessage);
        return c;
    }

    function add(uint96 a, uint96 b) internal pure returns (uint96) {
        return add(a, b, "SafeMath96: addition overflow");
    }

    function sub(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
        require(b <= a, errorMessage);
        return a - b;
    }

    function sub(uint96 a, uint96 b) internal pure returns (uint96) {
        return sub(a, b, "SafeMath96: subtraction overflow");
    }

    function fromUint(uint n, string memory errorMessage) internal pure returns (uint96) {
        require(n < 2**96, errorMessage);
        return uint96(n);
    }

    function fromUint(uint n) internal pure returns (uint96) {
        return fromUint(n, "SafeMath96: exceeds 96 bits");
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_king","type":"address"},{"internalType":"address","name":"_kingServant","type":"address"},{"internalType":"address","name":"_courtJester","type":"address"},{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256","name":"_withdrawInterval","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lptAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stAmount","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":"lptAmount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lptAmount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"sTokenWeight","type":"uint256"},{"internalType":"contract IERC20","name":"lpToken","type":"address"},{"internalType":"contract IERC20","name":"sToken","type":"address"},{"internalType":"bool","name":"withUpdate","type":"bool"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"courtJester","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint256","name":"lptAmount","type":"uint256"},{"internalType":"uint256","name":"stAmount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"blockNum","type":"uint256"}],"name":"getKingPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"from","type":"uint256"},{"internalType":"uint256","name":"to","type":"uint256"}],"name":"getMultiplier","outputs":[{"internalType":"uint256","name":"lpt","type":"uint256"},{"internalType":"uint256","name":"st","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"king","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kingFeePct","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kingPerLptFarmingBlock","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kingPerStFarmingBlock","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kingServant","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lpFeePct","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lptFarmingEndBlock","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"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":"pendingKing","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"lpToken","type":"address"},{"internalType":"uint32","name":"allocPoint","type":"uint32"},{"internalType":"uint32","name":"lastRewardBlock","type":"uint32"},{"internalType":"uint32","name":"sTokenWeight","type":"uint32"},{"internalType":"contract IERC20","name":"sToken","type":"address"},{"internalType":"bool","name":"kingLock","type":"bool"},{"internalType":"uint256","name":"accKingPerShare","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"bool","name":"withUpdate","type":"bool"}],"name":"setAllocation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_courtJester","type":"address"}],"name":"setCourtJester","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_kingPerLptFarmingBlock","type":"uint256"},{"internalType":"uint256","name":"_kingPerStFarmingBlock","type":"uint256"},{"internalType":"uint256","name":"_lptFarmingEndBlock","type":"uint256"},{"internalType":"uint256","name":"_stFarmingEndBlock","type":"uint256"}],"name":"setFarmingParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPercent","type":"uint256"}],"name":"setKingFeePct","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"bool","name":"_kingLock","type":"bool"},{"internalType":"bool","name":"withUpdate","type":"bool"}],"name":"setKingLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_kingServant","type":"address"}],"name":"setKingServant","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPercent","type":"uint256"}],"name":"setLpFeePct","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint256","name":"sTokenWeight","type":"uint256"},{"internalType":"bool","name":"withUpdate","type":"bool"}],"name":"setSTokenWeight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_blockNum","type":"uint256"}],"name":"setWithdrawInterval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stFarmingEndBlock","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"wAmount","type":"uint256"},{"internalType":"uint256","name":"stAmount","type":"uint256"},{"internalType":"uint256","name":"lptAmount","type":"uint256"},{"internalType":"uint96","name":"pendingKing","type":"uint96"},{"internalType":"uint96","name":"rewardDebt","type":"uint96"},{"internalType":"uint32","name":"lastWithdrawBlock","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"pid","type":"uint256"},{"internalType":"uint256","name":"lptAmount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawInterval","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"}]

60806040526003805460ff60a01b199081169091556004805490911690553480156200002a57600080fd5b506040516200343f3803806200343f833981810160405260a08110156200005057600080fd5b5080516020820151604083015160608401516080909401519293919290919060006200007b620001c7565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35060018055620000d485620001cb565b600280546001600160a01b0319166001600160a01b0392909216919091179055620000ff84620001cb565b600380546001600160a01b0319166001600160a01b03929092169190911790556200012a83620001cb565b600460006101000a8154816001600160a01b0302191690836001600160a01b031602179055506200016682620001dc60201b62001c321760201c565b6005601c6101000a81548163ffffffff021916908363ffffffff1602179055506200019c81620001dc60201b62001c321760201c565b600460156101000a81548163ffffffff021916908363ffffffff160217905550505050505062000329565b3390565b6000620001d8826200022b565b5090565b600062000225826040518060400160405280601b81526020017f536166654d61746833323a2065786365656473203332206269747300000000008152506200028a60201b60201c565b92915050565b6001600160a01b03811662000287576040805162461bcd60e51b815260206004820152601460248201527f4172636856323a3a5a45524f5f41444452455353000000000000000000000000604482015290519081900360640190fd5b50565b6000816401000000008410620003215760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015620002e5578181015183820152602001620002cb565b50505050905090810190601f168015620003135780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509192915050565b61310680620003396000396000f3fe608060405234801561001057600080fd5b506004361061021b5760003560e01c80636d68d47d1161012557806393f1a40b116100ad578063cc181ca81161007c578063cc181ca814610666578063d5fadf581461066e578063e87da85614610676578063f2fde38b1461067e578063fa5c853f146106a45761021b565b806393f1a40b146105635780639cb8a819146105d15780639ce5361e146105fc578063cb99b8d3146106225761021b565b80637ff0778f116100f45780637ff0778f146104d35780638ca2068c146104f95780638d979e9a146105015780638da5cb5b1461051f5780638dbb1e3a146105275761021b565b80636d68d47d1461045057806370f656b81461047c578063715018a6146104a757806379e8d773146104af5761021b565b806330746fef116101a857806351eb05a61161017757806351eb05a6146103d45780635312ea8e146103f1578063595adaba1461040e578063630b5ba11461042b578063674a99ae146104335761021b565b806330746fef1461034d57806343398c021461037c578063441a3e70146103a957806348cd4cb1146103cc5761021b565b80631526fe27116101ef5780631526fe27146102aa578063162075d81461031857806317caf6f1146103205780631a7540dc1461032857806327450cc9146103305761021b565b8062aeef8a1461022057806302aaaa581461024b578063081e3eda1461026f5780631231d33414610289575b600080fd5b6102496004803603606081101561023657600080fd5b50803590602081013590604001356106c1565b005b6102536109d0565b604080516001600160a01b039092168252519081900360200190f35b6102776109df565b60408051918252519081900360200190f35b6102916109e5565b6040805163ffffffff9092168252519081900360200190f35b6102c7600480360360208110156102c057600080fd5b50356109f1565b604080516001600160a01b03988916815263ffffffff9788166020820152958716868201529390951660608501529416608083015292151560a082015260c081019190915290519081900360e00190f35b610291610a5c565b610291610a6f565b610253610a82565b6102496004803603602081101561034657600080fd5b5035610a91565b6102496004803603608081101561036357600080fd5b5080359060208101359060408101359060600135610b15565b6102496004803603606081101561039257600080fd5b508035906020810135151590604001351515610b9f565b610249600480360360408110156103bf57600080fd5b5080359060200135610c4a565b610291610ee3565b610249600480360360208110156103ea57600080fd5b5035610ef6565b6102496004803603602081101561040757600080fd5b5035610f0c565b6102496004803603602081101561042457600080fd5b5035611034565b6102496110b2565b6102776004803603602081101561044957600080fd5b50356110d5565b6102776004803603604081101561046657600080fd5b50803590602001356001600160a01b031661114e565b6102496004803603606081101561049257600080fd5b50803590602081013590604001351515611390565b6102496114cc565b6104b761156e565b604080516001600160601b039092168252519081900360200190f35b610249600480360360208110156104e957600080fd5b50356001600160a01b0316611584565b610291611608565b61050961161b565b6040805160ff9092168252519081900360200190f35b61025361162b565b61054a6004803603604081101561053d57600080fd5b508035906020013561163a565b6040805192835260208301919091528051918290030190f35b61058f6004803603604081101561057957600080fd5b50803590602001356001600160a01b031661166f565b604080519687526020870195909552858501939093526001600160601b03918216606086015216608084015263ffffffff1660a0830152519081900360c00190f35b610249600480360360608110156105e757600080fd5b508035906020810135906040013515156116c5565b6102496004803603602081101561061257600080fd5b50356001600160a01b031661177f565b610249600480360360a081101561063857600080fd5b508035906020810135906001600160a01b036040820135811691606081013590911690608001351515611803565b610253611a8e565b6104b7611a9d565b610509611aac565b6102496004803603602081101561069457600080fd5b50356001600160a01b0316611abc565b610249600480360360208110156106ba57600080fd5b5035611bb4565b60026001541415610719576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260015581610770576040805162461bcd60e51b815260206004820152601d60248201527f6465706f7369743a207a65726f204c5020746f6b656e20616d6f756e74000000604482015290519081900360640190fd5b61077983611c73565b5061078383611cd0565b60006007848154811061079257fe5b60009182526020808320878452600882526040808520338652909252908320600181015460038083015483549590910290930160028101549096509194909390926107f2926001600160601b038083169392600160601b90041690611ee8565b60028401549091506108049087611f20565b600284015560018301546108189086611f20565b60018401558254845461083c919088908890600160e01b900463ffffffff16611f81565b83556000610848611f98565b905061089333838760010160149054906101000a900460ff1661088e8860030160189054906101000a900463ffffffff168663ffffffff16611fa890919063ffffffff16565b611fea565b156108ed576003840180546001600160601b031963ffffffff808516600160c01b0263ffffffff60c01b1990931692909217169091556001868101546108e8926001600160a01b039091169190869061216416565b61090b565b6003840180546001600160601b0319166001600160601b0384161790555b61091f8460000154600087600201546121bb565b6003850180546001600160601b0392909216600160601b02600160601b600160c01b03199092169190911790558454610963906001600160a01b031633308a612236565b8515610983576001850154610983906001600160a01b0316333089612236565b604080518881526020810188905281518a9233927f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e929081900390910190a3505060018055505050505050565b6004546001600160a01b031681565b60075490565b60065463ffffffff1681565b600781815481106109fe57fe5b60009182526020909120600390910201805460018201546002909201546001600160a01b03808316945063ffffffff600160a01b808504821695600160c01b8604831695600160e01b9004909216939282169260ff91909204169087565b600454600160a81b900463ffffffff1681565b600554600160c01b900463ffffffff1681565b6003546001600160a01b031681565b610a99612290565b6000546001600160a01b03908116911614610ae9576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b610af281611c32565b600460156101000a81548163ffffffff021916908363ffffffff16021790555050565b610b1d612290565b6000546001600160a01b03908116911614610b6d576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b610b99610b7985612294565b610b8285612294565b610b8b85611c32565b610b9485611c32565b6122d5565b50505050565b610ba7612290565b6000546001600160a01b03908116911614610bf7576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b610c0083611c73565b508015610c0f57610c0f6110b2565b8160078481548110610c1d57fe5b906000526020600020906003020160010160146101000a81548160ff021916908315150217905550505050565b60026001541415610ca2576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155610cb082611c73565b50600060078381548110610cc057fe5b60009182526020808320868452600882526040808520338652909252922080546003909202909201925083811015610d3f576040805162461bcd60e51b815260206004820152601e60248201527f77697468647261773a204c5020616d6f756e74206e6f7420656e6f7567680000604482015290519081900360640190fd5b610d498185612570565b60028301556001820154610d5c86611cd0565b600383015483546002860154600092610d8b926001600160601b03808316939192600160601b90041690611ee8565b60028086015480875590870154919250610da7916000906121bb565b6003850180546001600160601b0392909216600160601b02600160601b600160c01b0319909216919091179055600060018501819055610de5611f98565b9050610e2b33838860010160149054906101000a900460ff1661088e8960030160189054906101000a900463ffffffff168663ffffffff16611fa890919063ffffffff16565b15610e5f5760038501805463ffffffff60c01b1916600160c01b63ffffffff841602176001600160601b0319169055610e7d565b6003850180546001600160601b0319166001600160601b0384161790555b60008715610e9657610e9133888a876125b2565b610e99565b60005b6040805182815290519192508a9133917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568919081900360200190a350506001805550505050505050565b600554600160e01b900463ffffffff1681565b610eff81611c73565b50610f0981611cd0565b50565b610f1581611c73565b50600060078281548110610f2557fe5b6000918252602080832085845260088252604080852033865290925290832060028101805494905560039092020192509080610fa8576040805162461bcd60e51b815260206004820152601e60248201527f77697468647261773a207a65726f204c5020746f6b656e20616d6f756e740000604482015290519081900360640190fd5b6000610fb2611f98565b6001840180546000808755918290556003860180546001600160e01b031916600160c01b63ffffffff861602179055919250610ff0338786856125b2565b604080518281529051919250889133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae0595919081900360200190a350505050505050565b61103c612290565b6000546001600160a01b0390811691161461108c576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b6110958161267f565b600360146101000a81548160ff021916908360ff16021790555050565b60075460005b818110156110d1576110c981611cd0565b6001016110b8565b5050565b60065460009061113f9063ffffffff1683116110fc576005546001600160601b03166110ff565b60005b600654600160201b900463ffffffff16841161112d57600554600160601b90046001600160601b0316611130565b60005b6001600160601b0316906126d7565b6001600160601b031692915050565b600061115983611c73565b5060006007848154811061116957fe5b600091825260208083208784526008825260408085206001600160a01b038916865290925290832060039290920201600281015490935090916111aa611f98565b8454604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156111fa57600080fd5b505afa15801561120e573d6000803e3d6000fd5b505050506040513d602081101561122457600080fd5b5051855490915063ffffffff600160c01b909104811690831611801561124957508015155b15611353578454600090819061126c90600160c01b900463ffffffff1685612719565b91509150600061129183838a60000160149054906101000a900463ffffffff16612822565b90506001600160601b0381161561134f576001880154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156112ef57600080fd5b505afa158015611303573d6000803e3d6000fd5b505050506040513d602081101561131957600080fd5b5051895490915060009061133d9087908490600160e01b900463ffffffff166128a7565b905061134a8884836128eb565b975050505b5050505b60038401548454611379916001600160601b038082169291600160601b90041686611ee8565b6001600160601b0316955050505050505b92915050565b611398612290565b6000546001600160a01b039081169116146113e8576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b6113f183611c73565b508015611400576114006110b2565b600061140b83611c32565b9050611469816114556007878154811061142157fe5b6000918252602090912060039091020154600554600160c01b900463ffffffff90811691600160a01b9004811690611fa816565b63ffffffff1661290c90919063ffffffff16565b600560186101000a81548163ffffffff021916908363ffffffff160217905550806007858154811061149757fe5b906000526020600020906003020160000160146101000a81548163ffffffff021916908363ffffffff16021790555050505050565b6114d4612290565b6000546001600160a01b03908116911614611524576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600554600160601b90046001600160601b031681565b61158c612290565b6000546001600160a01b039081169116146115dc576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b6115e58161294e565b600480546001600160a01b0319166001600160a01b039290921691909117905550565b600654600160201b900463ffffffff1681565b600454600160a01b900460ff1681565b6000546001600160a01b031690565b60008060008061165a61164c87611c32565b61165587611c32565b612719565b63ffffffff9182169891169650945050505050565b60086020908152600092835260408084209091529082529020805460018201546002830154600390930154919290916001600160601b0380821691600160601b810490911690600160c01b900463ffffffff1686565b6116cd612290565b6000546001600160a01b0390811691161461171d576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b61172683611c73565b508015611735576117356110b2565b61173e82611c32565b6007848154811061174b57fe5b9060005260206000209060030201600001601c6101000a81548163ffffffff021916908363ffffffff160217905550505050565b611787612290565b6000546001600160a01b039081169116146117d7576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b6117e08161294e565b600380546001600160a01b0319166001600160a01b039290921691909117905550565b61180b612290565b6000546001600160a01b0390811691161461185b576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b6118658383612959565b6118b6576040805162461bcd60e51b815260206004820152601760248201527f4172636856323a3a6164643a504f4f4c5f455849535453000000000000000000604482015290519081900360640190fd5b60006118c186611c32565b905081156118d1576118d16110b2565b60006118db611f98565b6005549091506118fd9063ffffffff600160c01b909104811690849061290c16565b600560186101000a81548163ffffffff021916908363ffffffff16021790555060076040518060e00160405280876001600160a01b031681526020016119488563ffffffff16611c32565b63ffffffff9081168252600554602090920191600160e01b900481169085161161198157600554600160e01b900463ffffffff16611983565b835b63ffffffff16815260200161199789611c32565b63ffffffff90811682526001600160a01b03978816602080840191909152600160408085018290526000606095860181905287548084018955978152839020865160039098020180549387015191870151958701516001600160a01b0319948516988d169890981763ffffffff60a01b1916600160a01b92861683021763ffffffff60c01b1916600160c01b96861696909602959095176001600160e01b0316600160e01b97909416969096029290921783556080840151918301805460a08601519216929099169190911760ff60a01b19169015159093029290921790955560c090940151600290940193909355505050505050565b6002546001600160a01b031681565b6005546001600160601b031681565b600354600160a01b900460ff1681565b611ac4612290565b6000546001600160a01b03908116911614611b14576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b6001600160a01b038116611b595760405162461bcd60e51b81526004018080602001828103825260268152602001806130406026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b611bbc612290565b6000546001600160a01b03908116911614611c0c576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b611c158161267f565b600460146101000a81548160ff021916908360ff16021790555050565b600061138a826040518060400160405280601b81526020017f536166654d61746833323a206578636565647320333220626974730000000000815250612a09565b6007546000908210611ccc576040805162461bcd60e51b815260206004820152601760248201527f4172636856323a3a494e56414c49445f504f4f4c5f4944000000000000000000604482015290519081900360640190fd5b5090565b600060078281548110611cdf57fe5b600091825260208220600390910201805490925063ffffffff600160c01b9091041690611d0a611f98565b90508163ffffffff168163ffffffff1611611d2757505050610f09565b825463ffffffff60c01b1916600160c01b63ffffffff831602178355600080611d508484612719565b915091508163ffffffff166000148015611d6e575063ffffffff8116155b15611d7d575050505050610f09565b8454604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015611dc757600080fd5b505afa158015611ddb573d6000803e3d6000fd5b505050506040513d6020811015611df157600080fd5b5051905080611e0557505050505050610f09565b6001860154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015611e5257600080fd5b505afa158015611e66573d6000803e3d6000fd5b505050506040513d6020811015611e7c57600080fd5b50518754909150600090611ea09084908490600160e01b900463ffffffff166128a7565b90506000611ec386868b60000160149054906101000a900463ffffffff16612822565b9050611ed4896002015482846128eb565b896002018190555050505050505050505050565b60008315611f1357611f0e611efe8585856121bb565b6001600160601b038716906126d7565b611f15565b845b90505b949350505050565b600082820183811015611f7a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6000611f15611f918585856128a7565b8690611f20565b6000611fa343611c32565b905090565b6000611f7a83836040518060400160405280602081526020017f536166654d61746833323a207375627472616374696f6e206f766572666c6f77815250612aa3565b60016001600160601b038416611fff57611f18565b6000808461208457506004546001600160601b03861690600160a01b900460ff161561207f576004546120539060649061204d906001600160601b038a1690600160a01b900460ff16612b0a565b90612b63565b915061205f8183612570565b60045460025491925061207f916001600160a01b03908116911684612164565b6120ba565b60045463ffffffff600160a81b909104811690851611156120af57506001600160601b0385166120ba565b600092505050611f18565b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561210557600080fd5b505afa158015612119573d6000803e3d6000fd5b505050506040513d602081101561212f57600080fd5b50519050612159888284116121445783612146565b825b6002546001600160a01b03169190612164565b505050949350505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526121b6908490612ba5565b505050565b6000831561222c576122276121ec6001600160601b0385166121e664e8d4a5100061204d8988612b0a565b90612570565b6040518060400160405280601881526020017f4172636856323a3a70656e64696e673a6f766572666c6f770000000000000000815250612c56565b611f18565b6000949350505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610b99908590612ba5565b3390565b600061138a826040518060400160405280601b81526020017f536166654d61746839363a206578636565647320393620626974730000000000815250612c56565b60065463ffffffff9081169083161015612336576040805162461bcd60e51b815260206004820152601a60248201527f4172636856323a3a6c70744661726d696e67456e64426c6f636b000000000000604482015290519081900360640190fd5b60065463ffffffff600160201b9091048116908216101561239e576040805162461bcd60e51b815260206004820152601960248201527f4172636856323a3a73744661726d696e67456e64426c6f636b00000000000000604482015290519081900360640190fd5b60065463ffffffff8381169116146123c6576006805463ffffffff191663ffffffff84161790555b60065463ffffffff828116600160201b90920416146123ff576006805467ffffffff000000001916600160201b63ffffffff8416021790555b60008061241761240d611f98565b63ffffffff612719565b9092509050600061245f61243d6001600160601b03881663ffffffff80871690612b0a16565b6124596001600160601b038a1663ffffffff80871690612b0a16565b90611f20565b600254604080516370a0823160e01b8152306004820152905192935083926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156124af57600080fd5b505afa1580156124c3573d6000803e3d6000fd5b505050506040513d60208110156124d957600080fd5b5051101561252e576040805162461bcd60e51b815260206004820152601960248201527f4172636856323a3a4c4f575f244b494e475f42414c414e434500000000000000604482015290519081900360640190fd5b5050600580546001600160601b0319166001600160601b0396871617600160601b600160c01b031916600160601b959096169490940294909417909255505050565b6000611f7a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612cab565b6006546000908390600160201b900463ffffffff166125cf611f98565b63ffffffff161080156125ed5750600354600160a01b900460ff1615155b15612641576003546000906126149060649061204d908890600160a01b900460ff16612b0a565b90506126208282612570565b600354875491935061263f916001600160a01b03908116911683612164565b505b801561265d57845461265d906001600160a01b03168783612164565b8215611f1557600185810154611f15916001600160a01b039091169085612164565b60006064821115611ccc576040805162461bcd60e51b815260206004820152601760248201527f4172636856323a3a494e56414c49445f50455243454e54000000000000000000604482015290519081900360640190fd5b6000611f7a83836040518060400160405280601d81526020017f536166654d61746839363a206164646974696f6e206f766572666c6f77000000815250612cfd565b6005546000908190819063ffffffff600160e01b90910481169086161161274f57600554600160e01b900463ffffffff16612751565b845b60065490915060009063ffffffff90811690861611612770578461277a565b60065463ffffffff165b60065490915063ffffffff908116908716106127975760006127ab565b6127ab63ffffffff808316908490611fa816565b60065490945063ffffffff600160201b9091048116908616116127ce57846127df565b600654600160201b900463ffffffff165b60065490915063ffffffff600160201b909104811690871610612803576000612817565b61281763ffffffff808316908490611fa816565b925050509250929050565b60055460009063ffffffff600160c01b82041690829061284e9087906001600160601b03168685612d67565b905063ffffffff8516612864579150611f7a9050565b6000612887866005600c9054906101000a90046001600160601b03168786612d67565b905061289c6001600160601b038316826126d7565b979650505050505050565b60008215806128ba575063ffffffff8216155b156128c6575082611f7a565b611f186128e46305f5e10061204d8663ffffffff80881690612b0a16565b8590611f20565b6000611f186128e48361204d6001600160601b03871664e8d4a51000612b0a565b6000611f7a83836040518060400160405280601d81526020017f536166654d61746833323a206164646974696f6e206f766572666c6f77000000815250612dad565b6000611ccc82612e0b565b600061296483612e0b565b61296d83612e0b565b60005b6007548110156129ff57836001600160a01b03166007828154811061299157fe5b60009182526020909120600390910201546001600160a01b031614806129e85750826001600160a01b0316600782815481106129c957fe5b60009182526020909120600160039092020101546001600160a01b0316145b156129f757600091505061138a565b600101612970565b5060019392505050565b600081600160201b8410612a9b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612a60578181015183820152602001612a48565b50505050905090810190601f168015612a8d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509192915050565b60008363ffffffff168363ffffffff1611158290612b025760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612a60578181015183820152602001612a48565b505050900390565b600082612b195750600061138a565b82820282848281612b2657fe5b0414611f7a5760405162461bcd60e51b81526004018080602001828103825260218152602001806130666021913960400191505060405180910390fd5b6000611f7a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612e5d565b6060612bfa826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612ec29092919063ffffffff16565b8051909150156121b657808060200190516020811015612c1957600080fd5b50516121b65760405162461bcd60e51b815260040180806020018281038252602a8152602001806130a7602a913960400191505060405180910390fd5b600081600160601b8410612a9b5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612a60578181015183820152602001612a48565b60008184841115612b025760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612a60578181015183820152602001612a48565b6000838301826001600160601b038087169083161015612d5e5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612a60578181015183820152602001612a48565b50949350505050565b6000611f15612da88363ffffffff1661204d8663ffffffff16612da2896001600160601b03168b63ffffffff16612b0a90919063ffffffff16565b90612b0a565b612294565b60008383018263ffffffff8087169083161015612d5e5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612a60578181015183820152602001612a48565b6001600160a01b038116610f09576040805162461bcd60e51b81526020600482015260146024820152734172636856323a3a5a45524f5f4144445245535360601b604482015290519081900360640190fd5b60008183612eac5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612a60578181015183820152602001612a48565b506000838581612eb857fe5b0495945050505050565b6060611f1884846000856060612ed785613039565b612f28576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310612f675780518252601f199092019160209182019101612f48565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612fc9576040519150601f19603f3d011682016040523d82523d6000602084013e612fce565b606091505b50915091508115612fe2579150611f189050565b805115612ff25780518082602001fd5b60405162461bcd60e51b8152602060048201818152865160248401528651879391928392604401919085019080838360008315612a60578181015183820152602001612a48565b3b15159056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220c3072147dfa9699971b5f88080aed472c36db76ca79d1c6f6fee660f6f501e3064736f6c634300060c00330000000000000000000000005a731151d6510eb475cc7a0072200cffc9a3bfe50000000000000000000000004ba020fe3cf5dc821e776d6bd00dd2639ed8831e000000000000000000000000d31e459ac72e2ccad9a35b5b3367cfb4bab0274f0000000000000000000000000000000000000000000000000000000000ac72e00000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061021b5760003560e01c80636d68d47d1161012557806393f1a40b116100ad578063cc181ca81161007c578063cc181ca814610666578063d5fadf581461066e578063e87da85614610676578063f2fde38b1461067e578063fa5c853f146106a45761021b565b806393f1a40b146105635780639cb8a819146105d15780639ce5361e146105fc578063cb99b8d3146106225761021b565b80637ff0778f116100f45780637ff0778f146104d35780638ca2068c146104f95780638d979e9a146105015780638da5cb5b1461051f5780638dbb1e3a146105275761021b565b80636d68d47d1461045057806370f656b81461047c578063715018a6146104a757806379e8d773146104af5761021b565b806330746fef116101a857806351eb05a61161017757806351eb05a6146103d45780635312ea8e146103f1578063595adaba1461040e578063630b5ba11461042b578063674a99ae146104335761021b565b806330746fef1461034d57806343398c021461037c578063441a3e70146103a957806348cd4cb1146103cc5761021b565b80631526fe27116101ef5780631526fe27146102aa578063162075d81461031857806317caf6f1146103205780631a7540dc1461032857806327450cc9146103305761021b565b8062aeef8a1461022057806302aaaa581461024b578063081e3eda1461026f5780631231d33414610289575b600080fd5b6102496004803603606081101561023657600080fd5b50803590602081013590604001356106c1565b005b6102536109d0565b604080516001600160a01b039092168252519081900360200190f35b6102776109df565b60408051918252519081900360200190f35b6102916109e5565b6040805163ffffffff9092168252519081900360200190f35b6102c7600480360360208110156102c057600080fd5b50356109f1565b604080516001600160a01b03988916815263ffffffff9788166020820152958716868201529390951660608501529416608083015292151560a082015260c081019190915290519081900360e00190f35b610291610a5c565b610291610a6f565b610253610a82565b6102496004803603602081101561034657600080fd5b5035610a91565b6102496004803603608081101561036357600080fd5b5080359060208101359060408101359060600135610b15565b6102496004803603606081101561039257600080fd5b508035906020810135151590604001351515610b9f565b610249600480360360408110156103bf57600080fd5b5080359060200135610c4a565b610291610ee3565b610249600480360360208110156103ea57600080fd5b5035610ef6565b6102496004803603602081101561040757600080fd5b5035610f0c565b6102496004803603602081101561042457600080fd5b5035611034565b6102496110b2565b6102776004803603602081101561044957600080fd5b50356110d5565b6102776004803603604081101561046657600080fd5b50803590602001356001600160a01b031661114e565b6102496004803603606081101561049257600080fd5b50803590602081013590604001351515611390565b6102496114cc565b6104b761156e565b604080516001600160601b039092168252519081900360200190f35b610249600480360360208110156104e957600080fd5b50356001600160a01b0316611584565b610291611608565b61050961161b565b6040805160ff9092168252519081900360200190f35b61025361162b565b61054a6004803603604081101561053d57600080fd5b508035906020013561163a565b6040805192835260208301919091528051918290030190f35b61058f6004803603604081101561057957600080fd5b50803590602001356001600160a01b031661166f565b604080519687526020870195909552858501939093526001600160601b03918216606086015216608084015263ffffffff1660a0830152519081900360c00190f35b610249600480360360608110156105e757600080fd5b508035906020810135906040013515156116c5565b6102496004803603602081101561061257600080fd5b50356001600160a01b031661177f565b610249600480360360a081101561063857600080fd5b508035906020810135906001600160a01b036040820135811691606081013590911690608001351515611803565b610253611a8e565b6104b7611a9d565b610509611aac565b6102496004803603602081101561069457600080fd5b50356001600160a01b0316611abc565b610249600480360360208110156106ba57600080fd5b5035611bb4565b60026001541415610719576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260015581610770576040805162461bcd60e51b815260206004820152601d60248201527f6465706f7369743a207a65726f204c5020746f6b656e20616d6f756e74000000604482015290519081900360640190fd5b61077983611c73565b5061078383611cd0565b60006007848154811061079257fe5b60009182526020808320878452600882526040808520338652909252908320600181015460038083015483549590910290930160028101549096509194909390926107f2926001600160601b038083169392600160601b90041690611ee8565b60028401549091506108049087611f20565b600284015560018301546108189086611f20565b60018401558254845461083c919088908890600160e01b900463ffffffff16611f81565b83556000610848611f98565b905061089333838760010160149054906101000a900460ff1661088e8860030160189054906101000a900463ffffffff168663ffffffff16611fa890919063ffffffff16565b611fea565b156108ed576003840180546001600160601b031963ffffffff808516600160c01b0263ffffffff60c01b1990931692909217169091556001868101546108e8926001600160a01b039091169190869061216416565b61090b565b6003840180546001600160601b0319166001600160601b0384161790555b61091f8460000154600087600201546121bb565b6003850180546001600160601b0392909216600160601b02600160601b600160c01b03199092169190911790558454610963906001600160a01b031633308a612236565b8515610983576001850154610983906001600160a01b0316333089612236565b604080518881526020810188905281518a9233927f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e929081900390910190a3505060018055505050505050565b6004546001600160a01b031681565b60075490565b60065463ffffffff1681565b600781815481106109fe57fe5b60009182526020909120600390910201805460018201546002909201546001600160a01b03808316945063ffffffff600160a01b808504821695600160c01b8604831695600160e01b9004909216939282169260ff91909204169087565b600454600160a81b900463ffffffff1681565b600554600160c01b900463ffffffff1681565b6003546001600160a01b031681565b610a99612290565b6000546001600160a01b03908116911614610ae9576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b610af281611c32565b600460156101000a81548163ffffffff021916908363ffffffff16021790555050565b610b1d612290565b6000546001600160a01b03908116911614610b6d576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b610b99610b7985612294565b610b8285612294565b610b8b85611c32565b610b9485611c32565b6122d5565b50505050565b610ba7612290565b6000546001600160a01b03908116911614610bf7576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b610c0083611c73565b508015610c0f57610c0f6110b2565b8160078481548110610c1d57fe5b906000526020600020906003020160010160146101000a81548160ff021916908315150217905550505050565b60026001541415610ca2576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155610cb082611c73565b50600060078381548110610cc057fe5b60009182526020808320868452600882526040808520338652909252922080546003909202909201925083811015610d3f576040805162461bcd60e51b815260206004820152601e60248201527f77697468647261773a204c5020616d6f756e74206e6f7420656e6f7567680000604482015290519081900360640190fd5b610d498185612570565b60028301556001820154610d5c86611cd0565b600383015483546002860154600092610d8b926001600160601b03808316939192600160601b90041690611ee8565b60028086015480875590870154919250610da7916000906121bb565b6003850180546001600160601b0392909216600160601b02600160601b600160c01b0319909216919091179055600060018501819055610de5611f98565b9050610e2b33838860010160149054906101000a900460ff1661088e8960030160189054906101000a900463ffffffff168663ffffffff16611fa890919063ffffffff16565b15610e5f5760038501805463ffffffff60c01b1916600160c01b63ffffffff841602176001600160601b0319169055610e7d565b6003850180546001600160601b0319166001600160601b0384161790555b60008715610e9657610e9133888a876125b2565b610e99565b60005b6040805182815290519192508a9133917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568919081900360200190a350506001805550505050505050565b600554600160e01b900463ffffffff1681565b610eff81611c73565b50610f0981611cd0565b50565b610f1581611c73565b50600060078281548110610f2557fe5b6000918252602080832085845260088252604080852033865290925290832060028101805494905560039092020192509080610fa8576040805162461bcd60e51b815260206004820152601e60248201527f77697468647261773a207a65726f204c5020746f6b656e20616d6f756e740000604482015290519081900360640190fd5b6000610fb2611f98565b6001840180546000808755918290556003860180546001600160e01b031916600160c01b63ffffffff861602179055919250610ff0338786856125b2565b604080518281529051919250889133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae0595919081900360200190a350505050505050565b61103c612290565b6000546001600160a01b0390811691161461108c576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b6110958161267f565b600360146101000a81548160ff021916908360ff16021790555050565b60075460005b818110156110d1576110c981611cd0565b6001016110b8565b5050565b60065460009061113f9063ffffffff1683116110fc576005546001600160601b03166110ff565b60005b600654600160201b900463ffffffff16841161112d57600554600160601b90046001600160601b0316611130565b60005b6001600160601b0316906126d7565b6001600160601b031692915050565b600061115983611c73565b5060006007848154811061116957fe5b600091825260208083208784526008825260408085206001600160a01b038916865290925290832060039290920201600281015490935090916111aa611f98565b8454604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156111fa57600080fd5b505afa15801561120e573d6000803e3d6000fd5b505050506040513d602081101561122457600080fd5b5051855490915063ffffffff600160c01b909104811690831611801561124957508015155b15611353578454600090819061126c90600160c01b900463ffffffff1685612719565b91509150600061129183838a60000160149054906101000a900463ffffffff16612822565b90506001600160601b0381161561134f576001880154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156112ef57600080fd5b505afa158015611303573d6000803e3d6000fd5b505050506040513d602081101561131957600080fd5b5051895490915060009061133d9087908490600160e01b900463ffffffff166128a7565b905061134a8884836128eb565b975050505b5050505b60038401548454611379916001600160601b038082169291600160601b90041686611ee8565b6001600160601b0316955050505050505b92915050565b611398612290565b6000546001600160a01b039081169116146113e8576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b6113f183611c73565b508015611400576114006110b2565b600061140b83611c32565b9050611469816114556007878154811061142157fe5b6000918252602090912060039091020154600554600160c01b900463ffffffff90811691600160a01b9004811690611fa816565b63ffffffff1661290c90919063ffffffff16565b600560186101000a81548163ffffffff021916908363ffffffff160217905550806007858154811061149757fe5b906000526020600020906003020160000160146101000a81548163ffffffff021916908363ffffffff16021790555050505050565b6114d4612290565b6000546001600160a01b03908116911614611524576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600554600160601b90046001600160601b031681565b61158c612290565b6000546001600160a01b039081169116146115dc576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b6115e58161294e565b600480546001600160a01b0319166001600160a01b039290921691909117905550565b600654600160201b900463ffffffff1681565b600454600160a01b900460ff1681565b6000546001600160a01b031690565b60008060008061165a61164c87611c32565b61165587611c32565b612719565b63ffffffff9182169891169650945050505050565b60086020908152600092835260408084209091529082529020805460018201546002830154600390930154919290916001600160601b0380821691600160601b810490911690600160c01b900463ffffffff1686565b6116cd612290565b6000546001600160a01b0390811691161461171d576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b61172683611c73565b508015611735576117356110b2565b61173e82611c32565b6007848154811061174b57fe5b9060005260206000209060030201600001601c6101000a81548163ffffffff021916908363ffffffff160217905550505050565b611787612290565b6000546001600160a01b039081169116146117d7576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b6117e08161294e565b600380546001600160a01b0319166001600160a01b039290921691909117905550565b61180b612290565b6000546001600160a01b0390811691161461185b576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b6118658383612959565b6118b6576040805162461bcd60e51b815260206004820152601760248201527f4172636856323a3a6164643a504f4f4c5f455849535453000000000000000000604482015290519081900360640190fd5b60006118c186611c32565b905081156118d1576118d16110b2565b60006118db611f98565b6005549091506118fd9063ffffffff600160c01b909104811690849061290c16565b600560186101000a81548163ffffffff021916908363ffffffff16021790555060076040518060e00160405280876001600160a01b031681526020016119488563ffffffff16611c32565b63ffffffff9081168252600554602090920191600160e01b900481169085161161198157600554600160e01b900463ffffffff16611983565b835b63ffffffff16815260200161199789611c32565b63ffffffff90811682526001600160a01b03978816602080840191909152600160408085018290526000606095860181905287548084018955978152839020865160039098020180549387015191870151958701516001600160a01b0319948516988d169890981763ffffffff60a01b1916600160a01b92861683021763ffffffff60c01b1916600160c01b96861696909602959095176001600160e01b0316600160e01b97909416969096029290921783556080840151918301805460a08601519216929099169190911760ff60a01b19169015159093029290921790955560c090940151600290940193909355505050505050565b6002546001600160a01b031681565b6005546001600160601b031681565b600354600160a01b900460ff1681565b611ac4612290565b6000546001600160a01b03908116911614611b14576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b6001600160a01b038116611b595760405162461bcd60e51b81526004018080602001828103825260268152602001806130406026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b611bbc612290565b6000546001600160a01b03908116911614611c0c576040805162461bcd60e51b81526020600482018190526024820152600080516020613087833981519152604482015290519081900360640190fd5b611c158161267f565b600460146101000a81548160ff021916908360ff16021790555050565b600061138a826040518060400160405280601b81526020017f536166654d61746833323a206578636565647320333220626974730000000000815250612a09565b6007546000908210611ccc576040805162461bcd60e51b815260206004820152601760248201527f4172636856323a3a494e56414c49445f504f4f4c5f4944000000000000000000604482015290519081900360640190fd5b5090565b600060078281548110611cdf57fe5b600091825260208220600390910201805490925063ffffffff600160c01b9091041690611d0a611f98565b90508163ffffffff168163ffffffff1611611d2757505050610f09565b825463ffffffff60c01b1916600160c01b63ffffffff831602178355600080611d508484612719565b915091508163ffffffff166000148015611d6e575063ffffffff8116155b15611d7d575050505050610f09565b8454604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015611dc757600080fd5b505afa158015611ddb573d6000803e3d6000fd5b505050506040513d6020811015611df157600080fd5b5051905080611e0557505050505050610f09565b6001860154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015611e5257600080fd5b505afa158015611e66573d6000803e3d6000fd5b505050506040513d6020811015611e7c57600080fd5b50518754909150600090611ea09084908490600160e01b900463ffffffff166128a7565b90506000611ec386868b60000160149054906101000a900463ffffffff16612822565b9050611ed4896002015482846128eb565b896002018190555050505050505050505050565b60008315611f1357611f0e611efe8585856121bb565b6001600160601b038716906126d7565b611f15565b845b90505b949350505050565b600082820183811015611f7a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6000611f15611f918585856128a7565b8690611f20565b6000611fa343611c32565b905090565b6000611f7a83836040518060400160405280602081526020017f536166654d61746833323a207375627472616374696f6e206f766572666c6f77815250612aa3565b60016001600160601b038416611fff57611f18565b6000808461208457506004546001600160601b03861690600160a01b900460ff161561207f576004546120539060649061204d906001600160601b038a1690600160a01b900460ff16612b0a565b90612b63565b915061205f8183612570565b60045460025491925061207f916001600160a01b03908116911684612164565b6120ba565b60045463ffffffff600160a81b909104811690851611156120af57506001600160601b0385166120ba565b600092505050611f18565b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561210557600080fd5b505afa158015612119573d6000803e3d6000fd5b505050506040513d602081101561212f57600080fd5b50519050612159888284116121445783612146565b825b6002546001600160a01b03169190612164565b505050949350505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526121b6908490612ba5565b505050565b6000831561222c576122276121ec6001600160601b0385166121e664e8d4a5100061204d8988612b0a565b90612570565b6040518060400160405280601881526020017f4172636856323a3a70656e64696e673a6f766572666c6f770000000000000000815250612c56565b611f18565b6000949350505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610b99908590612ba5565b3390565b600061138a826040518060400160405280601b81526020017f536166654d61746839363a206578636565647320393620626974730000000000815250612c56565b60065463ffffffff9081169083161015612336576040805162461bcd60e51b815260206004820152601a60248201527f4172636856323a3a6c70744661726d696e67456e64426c6f636b000000000000604482015290519081900360640190fd5b60065463ffffffff600160201b9091048116908216101561239e576040805162461bcd60e51b815260206004820152601960248201527f4172636856323a3a73744661726d696e67456e64426c6f636b00000000000000604482015290519081900360640190fd5b60065463ffffffff8381169116146123c6576006805463ffffffff191663ffffffff84161790555b60065463ffffffff828116600160201b90920416146123ff576006805467ffffffff000000001916600160201b63ffffffff8416021790555b60008061241761240d611f98565b63ffffffff612719565b9092509050600061245f61243d6001600160601b03881663ffffffff80871690612b0a16565b6124596001600160601b038a1663ffffffff80871690612b0a16565b90611f20565b600254604080516370a0823160e01b8152306004820152905192935083926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156124af57600080fd5b505afa1580156124c3573d6000803e3d6000fd5b505050506040513d60208110156124d957600080fd5b5051101561252e576040805162461bcd60e51b815260206004820152601960248201527f4172636856323a3a4c4f575f244b494e475f42414c414e434500000000000000604482015290519081900360640190fd5b5050600580546001600160601b0319166001600160601b0396871617600160601b600160c01b031916600160601b959096169490940294909417909255505050565b6000611f7a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612cab565b6006546000908390600160201b900463ffffffff166125cf611f98565b63ffffffff161080156125ed5750600354600160a01b900460ff1615155b15612641576003546000906126149060649061204d908890600160a01b900460ff16612b0a565b90506126208282612570565b600354875491935061263f916001600160a01b03908116911683612164565b505b801561265d57845461265d906001600160a01b03168783612164565b8215611f1557600185810154611f15916001600160a01b039091169085612164565b60006064821115611ccc576040805162461bcd60e51b815260206004820152601760248201527f4172636856323a3a494e56414c49445f50455243454e54000000000000000000604482015290519081900360640190fd5b6000611f7a83836040518060400160405280601d81526020017f536166654d61746839363a206164646974696f6e206f766572666c6f77000000815250612cfd565b6005546000908190819063ffffffff600160e01b90910481169086161161274f57600554600160e01b900463ffffffff16612751565b845b60065490915060009063ffffffff90811690861611612770578461277a565b60065463ffffffff165b60065490915063ffffffff908116908716106127975760006127ab565b6127ab63ffffffff808316908490611fa816565b60065490945063ffffffff600160201b9091048116908616116127ce57846127df565b600654600160201b900463ffffffff165b60065490915063ffffffff600160201b909104811690871610612803576000612817565b61281763ffffffff808316908490611fa816565b925050509250929050565b60055460009063ffffffff600160c01b82041690829061284e9087906001600160601b03168685612d67565b905063ffffffff8516612864579150611f7a9050565b6000612887866005600c9054906101000a90046001600160601b03168786612d67565b905061289c6001600160601b038316826126d7565b979650505050505050565b60008215806128ba575063ffffffff8216155b156128c6575082611f7a565b611f186128e46305f5e10061204d8663ffffffff80881690612b0a16565b8590611f20565b6000611f186128e48361204d6001600160601b03871664e8d4a51000612b0a565b6000611f7a83836040518060400160405280601d81526020017f536166654d61746833323a206164646974696f6e206f766572666c6f77000000815250612dad565b6000611ccc82612e0b565b600061296483612e0b565b61296d83612e0b565b60005b6007548110156129ff57836001600160a01b03166007828154811061299157fe5b60009182526020909120600390910201546001600160a01b031614806129e85750826001600160a01b0316600782815481106129c957fe5b60009182526020909120600160039092020101546001600160a01b0316145b156129f757600091505061138a565b600101612970565b5060019392505050565b600081600160201b8410612a9b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612a60578181015183820152602001612a48565b50505050905090810190601f168015612a8d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509192915050565b60008363ffffffff168363ffffffff1611158290612b025760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612a60578181015183820152602001612a48565b505050900390565b600082612b195750600061138a565b82820282848281612b2657fe5b0414611f7a5760405162461bcd60e51b81526004018080602001828103825260218152602001806130666021913960400191505060405180910390fd5b6000611f7a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612e5d565b6060612bfa826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612ec29092919063ffffffff16565b8051909150156121b657808060200190516020811015612c1957600080fd5b50516121b65760405162461bcd60e51b815260040180806020018281038252602a8152602001806130a7602a913960400191505060405180910390fd5b600081600160601b8410612a9b5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612a60578181015183820152602001612a48565b60008184841115612b025760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612a60578181015183820152602001612a48565b6000838301826001600160601b038087169083161015612d5e5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612a60578181015183820152602001612a48565b50949350505050565b6000611f15612da88363ffffffff1661204d8663ffffffff16612da2896001600160601b03168b63ffffffff16612b0a90919063ffffffff16565b90612b0a565b612294565b60008383018263ffffffff8087169083161015612d5e5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612a60578181015183820152602001612a48565b6001600160a01b038116610f09576040805162461bcd60e51b81526020600482015260146024820152734172636856323a3a5a45524f5f4144445245535360601b604482015290519081900360640190fd5b60008183612eac5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612a60578181015183820152602001612a48565b506000838581612eb857fe5b0495945050505050565b6060611f1884846000856060612ed785613039565b612f28576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310612f675780518252601f199092019160209182019101612f48565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612fc9576040519150601f19603f3d011682016040523d82523d6000602084013e612fce565b606091505b50915091508115612fe2579150611f189050565b805115612ff25780518082602001fd5b60405162461bcd60e51b8152602060048201818152865160248401528651879391928392604401919085019080838360008315612a60578181015183820152602001612a48565b3b15159056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220c3072147dfa9699971b5f88080aed472c36db76ca79d1c6f6fee660f6f501e3064736f6c634300060c0033

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

0000000000000000000000005a731151d6510eb475cc7a0072200cffc9a3bfe50000000000000000000000004ba020fe3cf5dc821e776d6bd00dd2639ed8831e000000000000000000000000d31e459ac72e2ccad9a35b5b3367cfb4bab0274f0000000000000000000000000000000000000000000000000000000000ac72e00000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _king (address): 0x5a731151d6510Eb475cc7a0072200cFfC9a3bFe5
Arg [1] : _kingServant (address): 0x4Ba020Fe3Cf5Dc821E776D6Bd00dd2639eD8831E
Arg [2] : _courtJester (address): 0xD31e459Ac72E2ccAD9A35b5b3367cfB4BaB0274F
Arg [3] : _startBlock (uint256): 11301600
Arg [4] : _withdrawInterval (uint256): 0

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000005a731151d6510eb475cc7a0072200cffc9a3bfe5
Arg [1] : 0000000000000000000000004ba020fe3cf5dc821e776d6bd00dd2639ed8831e
Arg [2] : 000000000000000000000000d31e459ac72e2ccad9a35b5b3367cfb4bab0274f
Arg [3] : 0000000000000000000000000000000000000000000000000000000000ac72e0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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