Contract 0x474e3b996956850b3e2494989d1d919311fdf54d

 

Contract Overview

Balance:
0 BNB

BNB Value:
$0.00

Token:
Txn Hash
Block
From
To
Value [Txn Fee]
0x13de785d9814ad95b7f378e3db46873744db49ad0003e0eca0c233ebd0b97d4884401682021-06-19 19:03:012 hrs 29 mins ago0x78d9b0ea3cfdf1b59fecfa9edbc80662917cae9b IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.000575706
0x8ee593e6207ad12f9f9b41fe8a39dd547fe7de34d9cd3b3b9b795e440cb9eeaf84401632021-06-19 19:02:462 hrs 30 mins ago0x0b061fd32390085a2999d849616c49e364233502 IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.000485634
0x146cff09addfe9a135734d20a564407c7fc8871b8e7060dc63fbc1b5bbdc121e84396762021-06-19 18:38:122 hrs 54 mins ago0x69374fdc1e7764a7147658086463d2845508aa24 IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.000875725
0x7c1dcfedb26a5969d130c14fcd7cf0785483d8ecb01c1f8d81bdbb6243b90bb284396632021-06-19 18:37:332 hrs 55 mins ago0x69374fdc1e7764a7147658086463d2845508aa24 IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.0006945
0x074d0803947204627b48b45f96d5375ad543ebbba67d169b5fdbad471d6b6f0a84396522021-06-19 18:37:002 hrs 55 mins ago0x69374fdc1e7764a7147658086463d2845508aa24 IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.000624
0x1cab9152626acb578ccb74b1f295a46de0cbf3e4283603891ca00ced3a5dd7be84395962021-06-19 18:34:122 hrs 58 mins ago0x353a5541444b1b371f2cea8390e7bc72c1e72e0b IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.00037331
0x93c2a81adfa8ef199e850682656adb0a0d97ce9bcd99336d9638d0caf555f70e84393312021-06-19 18:20:573 hrs 11 mins ago0xbe0ebbbfab8d261be43968e424212a9ddcab8f90 IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.000875785
0xf3572475fd86fa2b2d20d09de210ab64f5c81c5fdcdc923016053a7516ac548884358512021-06-19 15:26:396 hrs 6 mins ago0x24f6701a0184261aa33893806463dfbd5011af2f IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.000800845
0x56ff67997f7de84a9cf8aa2b397458ab95bfaeeca04d672ff4dd0b4174a2a29084280682021-06-19 8:48:5812 hrs 43 mins ago0xcbb2534c6898655d50fdac79d6e4b23b18a25b97 IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.001224335
0xfd40801b2eb72f59d51363eb5b879e23e4111ecaa7453baba5173c6fd28d014d84280332021-06-19 8:47:1312 hrs 45 mins ago0x3138f8a28b9fcf28c55cfef5a129a82240c05636 IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.001224335
0xc261c7124e2ad9b837a87efa636acb24c26a8d389f4d658eba5914dc0a4c7d5f84270402021-06-19 7:57:3113 hrs 35 mins ago0xd68f213fa821d8978071e353c4d0543ce0a38999 IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.000875725
0xbfbbce48ab3bef9f0355dca5340f6b581a574e8a86f7aee98f2da248705a250284193412021-06-19 1:31:0320 hrs 1 min ago0x6169942254ef885052eb06318001b8b6d0e10321 IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.000961014
0x78f20cb48c28441e06fa05a199e4eaa2df4b8c2b21001e630b6eb174f08861f684185572021-06-19 0:51:5120 hrs 40 mins ago0xe821303800053d13007b64025942f391ea9197fa IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.000281155
0xc55801e1c9e4c41099db54b5f4b89f8bd858157937775f4e28fe7fc9134d5b6284181062021-06-19 0:29:1821 hrs 3 mins ago0x1afbb40f28de23b2ece55e6cb364b6b56d040a07 IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.00033125
0x3858a2110da29bfb319e9c7e38e6b72dd2186d8a6f23facbccaa17073298e2c184157702021-06-18 22:30:2723 hrs 2 mins ago0xa44b87485b6e7bfd048819ddd6dbf4f477e3f1ea IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.00110576
0xb63d94325af850036dca03a545a96ad123e85a4e21081003c102f1f7b3ed7bb084155812021-06-18 22:21:0023 hrs 11 mins ago0x25e6c5a2a60c960e5b0708c9c500c89e46399e22 IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.00800785
0x9c5398014377231ad8a7ce6e601ebe2edbf14577ecf79e40d981c5d24647967584135672021-06-18 20:37:351 day 55 mins ago0x78d9b0ea3cfdf1b59fecfa9edbc80662917cae9b IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.001024465
0x160d41412650e74f4bf8f63e099a223a2a94d64b99ca67440249b4193dd7e64484073672021-06-18 15:25:371 day 6 hrs ago0x6c5ac59770ba6a3d46ae8c0236c6bad7cd9f2ff0 IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.000800845
0xdefc2dffcf3e8778b385c48c32c67c3a444c0b17139c2e9103752b6f2a7ddb9484061752021-06-18 14:25:191 day 7 hrs ago0x6c5ac59770ba6a3d46ae8c0236c6bad7cd9f2ff0 IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.000800845
0x00199a3b39d30c66838bfacd36db1414583bf2d07c0ed79e0cefb09e21d0df0b84020512021-06-18 10:57:471 day 10 hrs ago0xa4d40f05e0e16b1f456cba938ccb57349dfb3d9b IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.000318625
0xfd3cc0904b9a8e6e65ad28423a967761358b4248a791013a715180a0e53596ee84018892021-06-18 10:49:411 day 10 hrs ago0x44635833340226119a916ec1ffaa81b7e58507f8 IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.000800905
0xce234b856913553cfe06c926f98482f2e49240f848c87d17c3242b9651a1a8a383998682021-06-18 9:08:171 day 12 hrs ago0xcfb2718567e2fcc705d75f9315c71bb53472fadd IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.000800845
0x2db29e228b2b8df8cc11b9f0f5c633c87bed41ef094ccb46cee7edfc8604e78383991192021-06-18 8:30:081 day 13 hrs ago0x97dfaf239e902071285a72aae5f1812fd49a491f IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.00088076
0xcb2f7c7ca6b8e8d114219963985062720e7d16717f734f6e3d38503576d02b9183990802021-06-18 8:28:111 day 13 hrs ago0x97dfaf239e902071285a72aae5f1812fd49a491f IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.000304245
0x2ff1d0282c455627888082bf77f2fe5f426e1659af6c51745420f376549a1eca83982832021-06-18 7:47:501 day 13 hrs ago0x7f014539225aa025d8d229c33d304d0ba58584c6 IN  0x474e3b996956850b3e2494989d1d919311fdf54d0 BNB0.001025905
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RankedStaking

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 10 : RankedStaking.sol
// SPDX-License-Identifier: Unlicensed

pragma solidity =0.8.4;

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

import "./IReinvestor.sol";
import "./IPremiumDistributor.sol";

library Errors {
  string public constant ZERO_GROW_K_PERIOD = 'ZERO_GROW_K_PERIOD';
  string public constant NOT_DEPOSIT_OWNER = 'NOT_DEPOSIT_OWNER';
  string public constant DEPOSIT_IS_LOCKED = 'DEPOSIT_IS_LOCKED';
  string public constant INSUFFICIENT_DEPOSIT = 'INSUFFICIENT_DEPOSIT';
  string public constant ZERO_TOTAL_RATING = 'ZERO_TOTAL_RATING';
  string public constant ZERO_ADDRESS = 'ZERO_ADDRESS';
  string public constant SMALL_END_K = 'SMALL_END_K';
  string public constant ZERO_DEPOSIT_AMOUNT = 'ZERO_DEPOSIT_AMOUNT';
  string public constant NOT_FOUND = 'NOT_FOUND';
  string public constant WRONG_INDEX = 'WRONG_INDEX';
  string public constant DATA_INCONSISTENCY = 'DATA_INCONSISTENCY';
  string public constant INSUFFICIENT_SWAP = 'INSUFFICIENT_SWAP';
  string public constant REINVESTOR_NOT_SET = 'REINVESTOR_NOT_SET';
  string public constant PREMIUM_DISTRIBUTOR_NOT_SET = 'PREMIUM_DISTRIBUTOR_NOT_SET';
}


/** 
 * @title RankedStaking
 * @notice DOES NOT SUPPORT deflation and inflation tokens.
 * @dev Distribute premium among stakers.
 * @dev The stakers who freeze deposit longer gets higher coefficient.
 */
contract RankedStaking is Ownable, ReentrancyGuard {
    using SafeERC20 for IERC20;
    using EnumerableSet for EnumerableSet.UintSet;

    event DepositPut (
        address indexed user,
        uint40 lockFor,
        uint256 indexed id,
        uint256 amount
    );

    event DepositWithdrawn (
        address indexed user,
        uint256 indexed id,
        uint256 amount,
        uint256 rest
    );

    event SharePremium(
        address indexed user, 
        uint256 amount, 
        uint256 premiumPerRatingPoint, 
        uint256 totalRating
    );

    event PremiumPaid(
        address indexed user,
        uint256 amount
    );

    event ReinvestorSet(address indexed newAddress);

    event PremiumDistributorSet(address indexed newAddress);

    struct Deposit {
        address user;
        uint40 depositAt;
        uint40 lockFor;
        uint256 amount;
    }

    struct UserAccount {
        uint256 claimedAmount;
        uint256 rating;
        uint256 totalDepositAmount;
    }

    address immutable public stakingToken;
    address immutable public premiumToken;
    IReinvestor public reinvestor;
    IPremiumDistributor public premiumDistributor;
    uint256 internal nextDepositId;
    uint256 public totalRating;
    uint256 public premiumPerRatingPoint;
    uint256 public constant PREMIUM_PER_RATING_POINT_BASE = 10 ** 18;
    uint256 public constant RATE_POINT_BASE = 10 ** 18;
    mapping (uint256 => Deposit) public deposits;
    mapping (address => UserAccount) public accounts;
    mapping (address => EnumerableSet.UintSet) internal userDepositIds;

    uint256 public constant K_BASE = 10 ** 18;
    uint256 constant public START_K = K_BASE;
    uint256 immutable public END_K;
    uint40 immutable public START_K_PERIOD;
    uint40 immutable public GROW_K_PERIOD;


    //    K
    //  ^                        K = END_K, after T >= depositAt + START_K_PERIOD + GROW_K_PERIOD
    //  |                --------- 
    //  |               /
    //  |              /
    //  |             /
    //  |            /   K = START_K + (END_K - START_K) * (T - depositAt - START_K_PERIOD) / GROW_K_PERIOD, after T > depositAt + START_K_PERIOD
    //  |           /
    //  |   -------/  
    //  |
    //  |    ^
    //  |    K = START_K, T <= depositAt + START_K_PERIOD
    //  |
    //  |-----------------------------------> Time
    function calculateK(uint256 lockFor) public view returns (uint256) {
        if (lockFor <= START_K_PERIOD) {
            return START_K;
        } else if (lockFor < START_K_PERIOD + GROW_K_PERIOD) {
            return START_K + (END_K - START_K) * (lockFor - START_K_PERIOD) / GROW_K_PERIOD;
        } else {
            return END_K;
        }
    }

    function getUserDepositIds(address user) view external returns (uint256[] memory) {
        uint256[] memory depositIds = new uint256[](userDepositIds[user].length());
        for(uint256 i = 0; i < userDepositIds[user].length(); ++i) {
            depositIds[i] = userDepositIds[user].at(i);
        }
        return depositIds;
    }

    function getUserDepositIdAtIndex(address user, uint256 index) view external returns (uint256) {
        return userDepositIds[user].at(index);
    }

    function getUserDepositsLength(address user) view external returns (uint256) {
        return userDepositIds[user].length();
    }

    /** 
     * @dev Create a RankedStaking.
     * @param _endK the end value of K
     * @param _startKPeriod the period length when K=START_K
     * @param _growKPeriod the period length when K is growing from START_K to END_K
     * @param _premiumToken the address of token to pay premium
     * @param _stakingToken the address of token to stake
     */
    constructor(
        uint256 _endK, 
        uint40 _startKPeriod, 
        uint40 _growKPeriod,
        address _premiumToken,
        address _stakingToken
    ) {
        require(_growKPeriod > 0, Errors.ZERO_GROW_K_PERIOD);
        require(_endK >= START_K, Errors.SMALL_END_K);
        require(_premiumToken != address(0), Errors.ZERO_ADDRESS);
        require(_stakingToken != address(0), Errors.ZERO_ADDRESS);
        END_K = _endK;
        START_K_PERIOD = _startKPeriod;
        GROW_K_PERIOD = _growKPeriod;
        premiumToken = _premiumToken;
        stakingToken = _stakingToken;
    }

    function sharePremium(uint256 amount) external {
        require(totalRating > 0, Errors.ZERO_TOTAL_RATING);
        premiumPerRatingPoint += amount * PREMIUM_PER_RATING_POINT_BASE / totalRating;
        emit SharePremium(msg.sender, amount, premiumPerRatingPoint, totalRating);
        IERC20(premiumToken).safeTransferFrom(msg.sender, address(this), amount);
    }

    function distributePremiumAndClaim() external {
        require(address(premiumDistributor) != address(0), Errors.PREMIUM_DISTRIBUTOR_NOT_SET);
        premiumDistributor.distributePremium();
        claimPremium();
    }

    function claimPremium() public {
        UserAccount storage account = accounts[msg.sender];
        uint256 total = account.rating * premiumPerRatingPoint / PREMIUM_PER_RATING_POINT_BASE;
        uint256 rest = total - account.claimedAmount;
        if (rest > 0) {
            account.claimedAmount = total;
            emit PremiumPaid(msg.sender, rest);
            IERC20(premiumToken).safeTransfer(msg.sender, rest);
        }
    }

    function premiumOf(address user) external view returns (uint256){
        UserAccount memory account = accounts[user];
        uint256 total = account.rating * premiumPerRatingPoint / PREMIUM_PER_RATING_POINT_BASE;
        uint256 rest = total - account.claimedAmount;
        return rest;
    }

    function putDeposit(uint256 amount, uint40 lockFor) external returns(uint256) {
        IERC20(stakingToken).safeTransferFrom(msg.sender, address(this), amount);
        return _deposit(msg.sender, amount, lockFor);
    }

    function _deposit(address beneficiary, uint256 amount, uint40 lockFor) private returns(uint256) {
        require(amount > 0, Errors.ZERO_DEPOSIT_AMOUNT);
        claimPremium();
        uint256 depositId = nextDepositId++;
        deposits[depositId] = Deposit({
            user: beneficiary,
            depositAt: uint40(block.timestamp),
            amount: amount,
            lockFor: lockFor
        });
        uint256 deltaRating = amount * calculateK(lockFor) / K_BASE;
        UserAccount storage account = accounts[beneficiary];
        account.claimedAmount += deltaRating * premiumPerRatingPoint / PREMIUM_PER_RATING_POINT_BASE;
        account.rating += deltaRating;
        account.totalDepositAmount += amount;
        require(userDepositIds[beneficiary].add(depositId), Errors.DATA_INCONSISTENCY);
        totalRating += deltaRating;
        emit DepositPut(beneficiary, lockFor, depositId, amount);
        return depositId;
    }

    function reinvest(uint40 lockFor, uint256 minimalSwapRateScaled) external nonReentrant {
        require(address(reinvestor) != address(0), Errors.REINVESTOR_NOT_SET);
        UserAccount storage account = accounts[msg.sender];
        uint256 total = account.rating * premiumPerRatingPoint / PREMIUM_PER_RATING_POINT_BASE;
        uint256 rest = total - account.claimedAmount;
        if (rest > 0) {
            account.claimedAmount = total;
            emit PremiumPaid(msg.sender, rest);
            IERC20(premiumToken).approve(address(reinvestor), rest);
            uint256 reinvestAmount = reinvestor.reinvest(rest, minimalSwapRateScaled);
            require(reinvestAmount >= rest * minimalSwapRateScaled / RATE_POINT_BASE, Errors.INSUFFICIENT_SWAP);

            IERC20(stakingToken).safeTransferFrom(address(reinvestor), address(this), reinvestAmount);
            _deposit(msg.sender, reinvestAmount, lockFor);
        }
    }

    function withdrawDeposit(uint256 depositId, uint256 amount) external {
        claimPremium();
        Deposit storage deposit = deposits[depositId];
        if (deposit.amount < amount) {
            revert(Errors.INSUFFICIENT_DEPOSIT);
        }
        // deposit.amount >= amount
        require(deposit.user == msg.sender, Errors.NOT_DEPOSIT_OWNER);
        require(block.timestamp >= deposit.depositAt + deposit.lockFor, Errors.DEPOSIT_IS_LOCKED);
        require(userDepositIds[msg.sender].contains(depositId), Errors.DATA_INCONSISTENCY);
        uint256 deltaRating = amount * calculateK(deposit.lockFor) / K_BASE;
        UserAccount storage account = accounts[msg.sender];
        account.totalDepositAmount -= amount;
        account.claimedAmount -= deltaRating * premiumPerRatingPoint / PREMIUM_PER_RATING_POINT_BASE;
        account.rating -= deltaRating;
        totalRating -= deltaRating;
        if (deposit.amount > amount) {
            deposit.amount -= amount;
            emit DepositWithdrawn(msg.sender, depositId, amount, deposit.amount);
        } else {  // deposit.amount == amount, because of require condition (take care!)
            delete deposits[depositId];  // free up storage slot
            require(userDepositIds[msg.sender].remove(depositId), Errors.DATA_INCONSISTENCY);
            emit DepositWithdrawn(msg.sender, depositId, amount, 0);
        }
        IERC20(stakingToken).safeTransfer(msg.sender, amount);
    }

    function setReinvestor(address newAddress) external onlyOwner {
        reinvestor = IReinvestor(newAddress);
        emit ReinvestorSet(newAddress);
    }

    function setPremiumDistributor(address newAddress) external onlyOwner {
        premiumDistributor = IPremiumDistributor(newAddress);
        emit PremiumDistributorSet(newAddress);
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // 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) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor () {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

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

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        require(set._values.length > index, "EnumerableSet: index out of bounds");
        return set._values[index];
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }


    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}

File 7 of 10 : IReinvestor.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.8.4;

interface IReinvestor {

    function reinvest(uint256 amount, uint256 minimalSwapRateScaled) external returns (uint256);

}

File 8 of 10 : IPremiumDistributor.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.8.4;

interface IPremiumDistributor {

    function distributePremium() external;

}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

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

pragma solidity ^0.8.0;

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

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

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

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"_endK","type":"uint256"},{"internalType":"uint40","name":"_startKPeriod","type":"uint40"},{"internalType":"uint40","name":"_growKPeriod","type":"uint40"},{"internalType":"address","name":"_premiumToken","type":"address"},{"internalType":"address","name":"_stakingToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint40","name":"lockFor","type":"uint40"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositPut","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rest","type":"uint256"}],"name":"DepositWithdrawn","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":"newAddress","type":"address"}],"name":"PremiumDistributorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PremiumPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"ReinvestorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"premiumPerRatingPoint","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalRating","type":"uint256"}],"name":"SharePremium","type":"event"},{"inputs":[],"name":"END_K","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GROW_K_PERIOD","outputs":[{"internalType":"uint40","name":"","type":"uint40"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"K_BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PREMIUM_PER_RATING_POINT_BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RATE_POINT_BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"START_K","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"START_K_PERIOD","outputs":[{"internalType":"uint40","name":"","type":"uint40"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"accounts","outputs":[{"internalType":"uint256","name":"claimedAmount","type":"uint256"},{"internalType":"uint256","name":"rating","type":"uint256"},{"internalType":"uint256","name":"totalDepositAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"lockFor","type":"uint256"}],"name":"calculateK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimPremium","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"deposits","outputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint40","name":"depositAt","type":"uint40"},{"internalType":"uint40","name":"lockFor","type":"uint40"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"distributePremiumAndClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getUserDepositIdAtIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserDepositIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserDepositsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"premiumDistributor","outputs":[{"internalType":"contract IPremiumDistributor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"premiumOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"premiumPerRatingPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"premiumToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint40","name":"lockFor","type":"uint40"}],"name":"putDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint40","name":"lockFor","type":"uint40"},{"internalType":"uint256","name":"minimalSwapRateScaled","type":"uint256"}],"name":"reinvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reinvestor","outputs":[{"internalType":"contract IReinvestor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"setPremiumDistributor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"setReinvestor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sharePremium","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRating","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"depositId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101206040523480156200001257600080fd5b5060405162003f0838038062003f08833981810160405281019062000038919062000455565b60006200004a6200040860201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3506001808190555060008364ffffffffff16116040518060400160405280601281526020017f5a45524f5f47524f575f4b5f504552494f4400000000000000000000000000008152509062000174576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200016b919062000518565b60405180910390fd5b50670de0b6b3a76400008510156040518060400160405280600b81526020017f534d414c4c5f454e445f4b00000000000000000000000000000000000000000081525090620001fb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001f2919062000518565b60405180910390fd5b50600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156040518060400160405280600c81526020017f5a45524f5f41444452455353000000000000000000000000000000000000000081525090620002a7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200029e919062000518565b60405180910390fd5b50600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156040518060400160405280600c81526020017f5a45524f5f4144445245535300000000000000000000000000000000000000008152509062000353576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200034a919062000518565b60405180910390fd5b508460c081815250508364ffffffffff1660e08164ffffffffff1660d81b815250508264ffffffffff166101008164ffffffffff1660d81b815250508173ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff1660601b815250508073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b8152505050505050506200063c565b600033905090565b6000815190506200042181620005ee565b92915050565b600081519050620004388162000608565b92915050565b6000815190506200044f8162000622565b92915050565b600080600080600060a086880312156200046e57600080fd5b60006200047e8882890162000427565b955050602062000491888289016200043e565b9450506040620004a4888289016200043e565b9350506060620004b78882890162000410565b9250506080620004ca8882890162000410565b9150509295509295909350565b6000620004e4826200053c565b620004f0818562000547565b935062000502818560208601620005a7565b6200050d81620005dd565b840191505092915050565b60006020820190508181036000830152620005348184620004d7565b905092915050565b600081519050919050565b600082825260208201905092915050565b600062000565826200056c565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600064ffffffffff82169050919050565b60005b83811015620005c7578082015181840152602081019050620005aa565b83811115620005d7576000848401525b50505050565b6000601f19601f8301169050919050565b620005f98162000558565b81146200060557600080fd5b50565b62000613816200058c565b81146200061f57600080fd5b50565b6200062d8162000596565b81146200063957600080fd5b50565b60805160601c60a05160601c60c05160e05160d81c6101005160d81c613820620006e860003960008181610f560152818161121d01526112770152600081816111df0152818161123e0152818161129f0152611682015260008181610a7c015281816112db01526113340152600081816107d401528181610bb301528181610ee0015261165e015260008181610a1901528181610da1015281816111b90152611cba01526138206000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c806372f702f31161010f578063b29b6774116100a2578063c499d0aa11610071578063c499d0aa14610551578063d4e4487d1461056f578063eec8c9871461059f578063f2fde38b146105bd576101e5565b8063b29b6774146104db578063bae04c9a146104f9578063bd64782b14610515578063beda6f5614610533576101e5565b806397281b88116100de57806397281b8814610464578063a36dca9a14610480578063b02c43d01461048a578063b180783d146104bd576101e5565b806372f702f3146103da57806383195635146103f857806386a3e8c0146104285780638da5cb5b14610446576101e5565b80633e60763a11610187578063619d84fa11610156578063619d84fa14610352578063651a6f7e1461037057806368a78fc9146103a0578063715018a6146103d0576101e5565b80633e60763a146102ca57806341fd148d146102e6578063529663db146103165780635e5c06e214610320576101e5565b80631155a527116101c35780631155a5271461024057806326ff9a5e14610270578063329861311461028e5780633b18af59146102ac576101e5565b8063014114a4146101ea578063076cd4c0146102065780630b9a7e4614610224575b600080fd5b61020460048036038101906101ff9190612ceb565b6105d9565b005b61020e610a7a565b60405161021b9190613196565b60405180910390f35b61023e60048036038101906102399190612c21565b610a9e565b005b61025a60048036038101906102559190612bbc565b610bfb565b6040516102679190613196565b60405180910390f35b610278610c56565b6040516102859190613196565b60405180910390f35b610296610c62565b6040516102a39190613196565b60405180910390f35b6102b4610c6e565b6040516102c19190613079565b60405180910390f35b6102e460048036038101906102df9190612b93565b610c94565b005b61030060048036038101906102fb9190612caf565b610d97565b60405161030d9190613196565b60405180910390f35b61031e610df9565b005b61033a60048036038101906103359190612b93565b610f2a565b60405161034993929190613203565b60405180910390f35b61035a610f54565b604051610367919061323a565b60405180910390f35b61038a60048036038101906103859190612b93565b610f78565b6040516103979190613196565b60405180910390f35b6103ba60048036038101906103b59190612b93565b61102d565b6040516103c79190613196565b60405180910390f35b6103d861107d565b005b6103e26111b7565b6040516103ef9190612f7c565b60405180910390f35b610412600480360381019061040d9190612c21565b6111db565b60405161041f9190613196565b60405180910390f35b61043061135b565b60405161043d9190613196565b60405180910390f35b61044e611367565b60405161045b9190612f7c565b60405180910390f35b61047e60048036038101906104799190612b93565b611390565b005b610488611493565b005b6104a4600480360381019061049f9190612c21565b6115ea565b6040516104b49493929190612ff7565b60405180910390f35b6104c561165c565b6040516104d29190612f7c565b60405180910390f35b6104e3611680565b6040516104f0919061323a565b60405180910390f35b610513600480360381019061050e9190612c73565b6116a4565b005b61051d611d05565b60405161052a9190613196565b60405180910390f35b61053b611d0b565b604051610548919061305e565b60405180910390f35b610559611d31565b6040516105669190613196565b60405180910390f35b61058960048036038101906105849190612b93565b611d37565b604051610596919061303c565b60405180910390f35b6105a7611ef4565b6040516105b49190613196565b60405180910390f35b6105d760048036038101906105d29190612b93565b611f00565b005b6002600154141561061f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061690613176565b60405180910390fd5b6002600181905550600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156040518060400160405280601281526020017f5245494e564553544f525f4e4f545f5345540000000000000000000000000000815250906106f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e89190613094565b60405180910390fd5b506000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000670de0b6b3a7640000600654836001015461075291906133ab565b61075c919061337a565b905060008260000154826107709190613405565b90506000811115610a6c578183600001819055503373ffffffffffffffffffffffffffffffffffffffff167fa21795436a9f6a3b412fd6780f01a49907f2181e76e938496b0a41991d99b61c826040516107ca9190613196565b60405180910390a27f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b815260040161084f929190612fce565b602060405180830381600087803b15801561086957600080fd5b505af115801561087d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a19190612bf8565b506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634458bbc083876040518363ffffffff1660e01b81526004016109019291906131da565b602060405180830381600087803b15801561091b57600080fd5b505af115801561092f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109539190612c4a565b9050670de0b6b3a7640000858361096a91906133ab565b610974919061337a565b8110156040518060400160405280601181526020017f494e53554646494349454e545f53574150000000000000000000000000000000815250906109ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e59190613094565b60405180910390fd5b50610a5e600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1630837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166120a9909392919063ffffffff16565b610a69338288612132565b50505b505050600180819055505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000600554116040518060400160405280601181526020017f5a45524f5f544f54414c5f524154494e4700000000000000000000000000000081525090610b1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b129190613094565b60405180910390fd5b50600554670de0b6b3a764000082610b3391906133ab565b610b3d919061337a565b60066000828254610b4e91906132e9565b925050819055503373ffffffffffffffffffffffffffffffffffffffff167f2eac0f8ad7e38ca2ae8362a44c584a6c819a3d3e3ec90daaf4e498285e1d63cb82600654600554604051610ba393929190613203565b60405180910390a2610bf83330837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166120a9909392919063ffffffff16565b50565b6000610c4e82600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206124f690919063ffffffff16565b905092915050565b670de0b6b3a764000081565b670de0b6b3a764000081565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610c9c612510565b73ffffffffffffffffffffffffffffffffffffffff16610cba611367565b73ffffffffffffffffffffffffffffffffffffffff1614610d10576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0790613116565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f8ec6a9a30e461d8fa9ae53ecad87c07e4d8631e75b80bfcd66091bbe07bd967560405160405180910390a250565b6000610de63330857f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166120a9909392919063ffffffff16565b610df1338484612132565b905092915050565b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000670de0b6b3a76400006006548360010154610e5991906133ab565b610e63919061337a565b90506000826000015482610e779190613405565b90506000811115610f25578183600001819055503373ffffffffffffffffffffffffffffffffffffffff167fa21795436a9f6a3b412fd6780f01a49907f2181e76e938496b0a41991d99b61c82604051610ed19190613196565b60405180910390a2610f2433827f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166125189092919063ffffffff16565b5b505050565b60086020528060005260406000206000915090508060000154908060010154908060020154905083565b7f000000000000000000000000000000000000000000000000000000000000000081565b600080600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020604051806060016040529081600082015481526020016001820154815260200160028201548152505090506000670de0b6b3a7640000600654836020015161100291906133ab565b61100c919061337a565b905060008260000151826110209190613405565b9050809350505050919050565b6000611076600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061259e565b9050919050565b611085612510565b73ffffffffffffffffffffffffffffffffffffffff166110a3611367565b73ffffffffffffffffffffffffffffffffffffffff16146110f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f090613116565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b7f000000000000000000000000000000000000000000000000000000000000000081565b60007f000000000000000000000000000000000000000000000000000000000000000064ffffffffff16821161121b57670de0b6b3a76400009050611356565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611267919061333f565b64ffffffffff16821015611332577f000000000000000000000000000000000000000000000000000000000000000064ffffffffff167f000000000000000000000000000000000000000000000000000000000000000064ffffffffff16836112d09190613405565b670de0b6b3a76400007f00000000000000000000000000000000000000000000000000000000000000006113049190613405565b61130e91906133ab565b611318919061337a565b670de0b6b3a764000061132b91906132e9565b9050611356565b7f000000000000000000000000000000000000000000000000000000000000000090505b919050565b670de0b6b3a764000081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611398612510565b73ffffffffffffffffffffffffffffffffffffffff166113b6611367565b73ffffffffffffffffffffffffffffffffffffffff161461140c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140390613116565b60405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f71608e344929f2dff101eb6e92f72cdc3445f0eebddc9d6a3664e3eff46802fb60405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156040518060400160405280601b81526020017f5052454d49554d5f4449535452494255544f525f4e4f545f53455400000000008152509061155d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115549190613094565b60405180910390fd5b50600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cb7bfd476040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156115c857600080fd5b505af11580156115dc573d6000803e3d6000fd5b505050506115e8610df9565b565b60076020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060000160149054906101000a900464ffffffffff16908060000160199054906101000a900464ffffffffff16908060010154905084565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b6116ac610df9565b60006007600084815260200190815260200160002090508181600101541015611741576040518060400160405280601481526020017f494e53554646494349454e545f4445504f5349540000000000000000000000008152506040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117389190613094565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146040518060400160405280601181526020017f4e4f545f4445504f5349545f4f574e45520000000000000000000000000000008152509061180b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118029190613094565b60405180910390fd5b508060000160199054906101000a900464ffffffffff168160000160149054906101000a900464ffffffffff16611842919061333f565b64ffffffffff164210156040518060400160405280601181526020017f4445504f5349545f49535f4c4f434b4544000000000000000000000000000000815250906118c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ba9190613094565b60405180910390fd5b5061191583600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206125b390919063ffffffff16565b6040518060400160405280601281526020017f444154415f494e434f4e53495354454e435900000000000000000000000000008152509061198c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119839190613094565b60405180910390fd5b506000670de0b6b3a76400006119bd8360000160199054906101000a900464ffffffffff1664ffffffffff166111db565b846119c891906133ab565b6119d2919061337a565b90506000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905083816002016000828254611a2b9190613405565b92505081905550670de0b6b3a764000060065483611a4991906133ab565b611a53919061337a565b816000016000828254611a669190613405565b9250508190555081816001016000828254611a819190613405565b925050819055508160056000828254611a9a9190613405565b925050819055508383600101541115611b225783836001016000828254611ac19190613405565b92505081905550843373ffffffffffffffffffffffffffffffffffffffff167f4959c2f9b36bf25a8c0c413e521adc24f9eeaacd05f94c0eee57ace9bf8b4634868660010154604051611b159291906131da565b60405180910390a3611cb3565b60076000868152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556000820160146101000a81549064ffffffffff02191690556000820160196101000a81549064ffffffffff021916905560018201600090555050611be885600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206125cd90919063ffffffff16565b6040518060400160405280601281526020017f444154415f494e434f4e53495354454e4359000000000000000000000000000081525090611c5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c569190613094565b60405180910390fd5b50843373ffffffffffffffffffffffffffffffffffffffff167f4959c2f9b36bf25a8c0c413e521adc24f9eeaacd05f94c0eee57ace9bf8b4634866000604051611caa9291906131b1565b60405180910390a35b611cfe33857f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166125189092919063ffffffff16565b5050505050565b60055481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b60606000611d82600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061259e565b67ffffffffffffffff811115611dc1577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611def5781602001602082028036833780820191505090505b50905060005b611e3c600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061259e565b811015611eea57611e9481600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206124f690919063ffffffff16565b828281518110611ecd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101818152505080611ee39061351f565b9050611df5565b5080915050919050565b670de0b6b3a764000081565b611f08612510565b73ffffffffffffffffffffffffffffffffffffffff16611f26611367565b73ffffffffffffffffffffffffffffffffffffffff1614611f7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7390613116565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611fec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fe3906130d6565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61212c846323b872dd60e01b8585856040516024016120ca93929190612f97565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506125e7565b50505050565b60008083116040518060400160405280601381526020017f5a45524f5f4445504f5349545f414d4f554e5400000000000000000000000000815250906121ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a59190613094565b60405180910390fd5b506121b7610df9565b6000600460008154809291906121cc9061351f565b91905055905060405180608001604052808673ffffffffffffffffffffffffffffffffffffffff1681526020014264ffffffffff1681526020018464ffffffffff168152602001858152506007600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548164ffffffffff021916908364ffffffffff16021790555060408201518160000160196101000a81548164ffffffffff021916908364ffffffffff160217905550606082015181600101559050506000670de0b6b3a76400006122eb8564ffffffffff166111db565b866122f691906133ab565b612300919061337a565b90506000600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050670de0b6b3a76400006006548361235c91906133ab565b612366919061337a565b81600001600082825461237991906132e9565b925050819055508181600101600082825461239491906132e9565b92505081905550858160020160008282546123af91906132e9565b9250508190555061240783600960008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206126ae90919063ffffffff16565b6040518060400160405280601281526020017f444154415f494e434f4e53495354454e435900000000000000000000000000008152509061247e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124759190613094565b60405180910390fd5b50816005600082825461249191906132e9565b92505081905550828773ffffffffffffffffffffffffffffffffffffffff167fd4bbd5f71da0b71ca6023d3c3d7cfcc041393fd67b547e6f26f421973a559d1987896040516124e1929190613255565b60405180910390a38293505050509392505050565b600061250583600001836126c8565b60001c905092915050565b600033905090565b6125998363a9059cbb60e01b8484604051602401612537929190612fce565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506125e7565b505050565b60006125ac82600001612762565b9050919050565b60006125c5836000018360001b612773565b905092915050565b60006125df836000018360001b612796565b905092915050565b6000612649826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166129149092919063ffffffff16565b90506000815111156126a957808060200190518101906126699190612bf8565b6126a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161269f90613156565b60405180910390fd5b5b505050565b60006126c0836000018360001b61292c565b905092915050565b600081836000018054905011612713576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270a906130b6565b60405180910390fd5b82600001828154811061274f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905092915050565b600081600001805490509050919050565b600080836001016000848152602001908152602001600020541415905092915050565b600080836001016000848152602001908152602001600020549050600081146129085760006001826127c89190613405565b90506000600186600001805490506127e09190613405565b90506000866000018281548110612820577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020015490508087600001848154811061286a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001819055508387600101600083815260200190815260200160002081905550866000018054806128cc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061290e565b60009150505b92915050565b6060612923848460008561299c565b90509392505050565b60006129388383612773565b612991578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050612996565b600090505b92915050565b6060824710156129e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129d8906130f6565b60405180910390fd5b6129ea85612ab0565b612a29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a2090613136565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051612a529190612f65565b60006040518083038185875af1925050503d8060008114612a8f576040519150601f19603f3d011682016040523d82523d6000602084013e612a94565b606091505b5091509150612aa4828286612ac3565b92505050949350505050565b600080823b905060008111915050919050565b60608315612ad357829050612b23565b600083511115612ae65782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b1a9190613094565b60405180910390fd5b9392505050565b600081359050612b398161378e565b92915050565b600081519050612b4e816137a5565b92915050565b600081359050612b63816137bc565b92915050565b600081519050612b78816137bc565b92915050565b600081359050612b8d816137d3565b92915050565b600060208284031215612ba557600080fd5b6000612bb384828501612b2a565b91505092915050565b60008060408385031215612bcf57600080fd5b6000612bdd85828601612b2a565b9250506020612bee85828601612b54565b9150509250929050565b600060208284031215612c0a57600080fd5b6000612c1884828501612b3f565b91505092915050565b600060208284031215612c3357600080fd5b6000612c4184828501612b54565b91505092915050565b600060208284031215612c5c57600080fd5b6000612c6a84828501612b69565b91505092915050565b60008060408385031215612c8657600080fd5b6000612c9485828601612b54565b9250506020612ca585828601612b54565b9150509250929050565b60008060408385031215612cc257600080fd5b6000612cd085828601612b54565b9250506020612ce185828601612b7e565b9150509250929050565b60008060408385031215612cfe57600080fd5b6000612d0c85828601612b7e565b9250506020612d1d85828601612b54565b9150509250929050565b6000612d338383612f38565b60208301905092915050565b612d4881613439565b82525050565b6000612d598261328e565b612d6381856132bc565b9350612d6e8361327e565b8060005b83811015612d9f578151612d868882612d27565b9750612d91836132af565b925050600181019050612d72565b5085935050505092915050565b6000612db782613299565b612dc181856132cd565b9350612dd18185602086016134ec565b80840191505092915050565b612de681613492565b82525050565b612df5816134b6565b82525050565b612e04816134da565b82525050565b6000612e15826132a4565b612e1f81856132d8565b9350612e2f8185602086016134ec565b612e38816135c6565b840191505092915050565b6000612e506022836132d8565b9150612e5b826135d7565b604082019050919050565b6000612e736026836132d8565b9150612e7e82613626565b604082019050919050565b6000612e966026836132d8565b9150612ea182613675565b604082019050919050565b6000612eb96020836132d8565b9150612ec4826136c4565b602082019050919050565b6000612edc601d836132d8565b9150612ee7826136ed565b602082019050919050565b6000612eff602a836132d8565b9150612f0a82613716565b604082019050919050565b6000612f22601f836132d8565b9150612f2d82613765565b602082019050919050565b612f4181613477565b82525050565b612f5081613477565b82525050565b612f5f81613481565b82525050565b6000612f718284612dac565b915081905092915050565b6000602082019050612f916000830184612d3f565b92915050565b6000606082019050612fac6000830186612d3f565b612fb96020830185612d3f565b612fc66040830184612f47565b949350505050565b6000604082019050612fe36000830185612d3f565b612ff06020830184612f47565b9392505050565b600060808201905061300c6000830187612d3f565b6130196020830186612f56565b6130266040830185612f56565b6130336060830184612f47565b95945050505050565b600060208201905081810360008301526130568184612d4e565b905092915050565b60006020820190506130736000830184612ddd565b92915050565b600060208201905061308e6000830184612dec565b92915050565b600060208201905081810360008301526130ae8184612e0a565b905092915050565b600060208201905081810360008301526130cf81612e43565b9050919050565b600060208201905081810360008301526130ef81612e66565b9050919050565b6000602082019050818103600083015261310f81612e89565b9050919050565b6000602082019050818103600083015261312f81612eac565b9050919050565b6000602082019050818103600083015261314f81612ecf565b9050919050565b6000602082019050818103600083015261316f81612ef2565b9050919050565b6000602082019050818103600083015261318f81612f15565b9050919050565b60006020820190506131ab6000830184612f47565b92915050565b60006040820190506131c66000830185612f47565b6131d36020830184612dfb565b9392505050565b60006040820190506131ef6000830185612f47565b6131fc6020830184612f47565b9392505050565b60006060820190506132186000830186612f47565b6132256020830185612f47565b6132326040830184612f47565b949350505050565b600060208201905061324f6000830184612f56565b92915050565b600060408201905061326a6000830185612f56565b6132776020830184612f47565b9392505050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b60006132f482613477565b91506132ff83613477565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561333457613333613568565b5b828201905092915050565b600061334a82613481565b915061335583613481565b92508264ffffffffff0382111561336f5761336e613568565b5b828201905092915050565b600061338582613477565b915061339083613477565b9250826133a05761339f613597565b5b828204905092915050565b60006133b682613477565b91506133c183613477565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133fa576133f9613568565b5b828202905092915050565b600061341082613477565b915061341b83613477565b92508282101561342e5761342d613568565b5b828203905092915050565b600061344482613457565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600064ffffffffff82169050919050565b600061349d826134a4565b9050919050565b60006134af82613457565b9050919050565b60006134c1826134c8565b9050919050565b60006134d382613457565b9050919050565b60006134e582613477565b9050919050565b60005b8381101561350a5780820151818401526020810190506134ef565b83811115613519576000848401525b50505050565b600061352a82613477565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561355d5761355c613568565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008201527f6473000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b61379781613439565b81146137a257600080fd5b50565b6137ae8161344b565b81146137b957600080fd5b50565b6137c581613477565b81146137d057600080fd5b50565b6137dc81613481565b81146137e757600080fd5b5056fea2646970667358221220ead55390d09daa1fff9a803310219caf1f3ac8f497dc13fce9329a60a4cde7eb64736f6c6343000804003300000000000000000000000000000000000000000000000029a2241af62c000000000000000000000000000000000000000000000000000000000000001275000000000000000000000000000000000000000000000000000000000000375f00000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c0000000000000000000000004d2e266267f756d54c09afd1d1473c7739eb7020

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

00000000000000000000000000000000000000000000000029a2241af62c000000000000000000000000000000000000000000000000000000000000001275000000000000000000000000000000000000000000000000000000000000375f00000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c0000000000000000000000004d2e266267f756d54c09afd1d1473c7739eb7020

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000029a2241af62c0000
Arg [1] : 0000000000000000000000000000000000000000000000000000000000127500
Arg [2] : 0000000000000000000000000000000000000000000000000000000000375f00
Arg [3] : 000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c
Arg [4] : 0000000000000000000000004d2e266267f756d54c09afd1d1473c7739eb7020


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.