ETH Price: $3,355.91 (-0.87%)

Token

Thorstarter Voting Token (vXRUNE)
 

Overview

Max Total Supply

16,680,145.515121412564536603 vXRUNE

Holders

6,660

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Balance
300 vXRUNE

Value
$0.00
0x98923F41e72e760d3C3c0904707112aA4E7e5098
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
Voters

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 12 : Voters.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.6;

/*
This contract allows XRUNE holders and LPs to lock some of their tokens up for
vXRUNE, the Thorstarter DAO's voting token. It's an ERC20 but without the
transfer methods.
It supports snapshoting and delegation of voting power.
*/

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "./interfaces/IVoters.sol";
import "./interfaces/IUniswapV2Pair.sol";
import "./interfaces/IERC677Receiver.sol";

contract Voters is IVoters, IERC677Receiver, AccessControl { 
    using SafeERC20 for IERC20;
    
    struct UserInfo {
        uint lastFeeGrowth;
        uint lockedToken;
        uint lockedSsLpValue;
        uint lockedSsLpAmount;
        uint lockedTcLpValue;
        uint lockedTcLpAmount;
        address delegate;
    }
    struct Snapshots {
        uint[] ids;
        uint[] values;
    }

    event Transfer(address indexed from, address indexed to, uint value);
    event Snapshot(uint id);
    event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);

    string public constant name = "Thorstarter Voting Token";
    string public constant symbol = "vXRUNE";
    uint8 public constant decimals = 18;
    bytes32 public constant ADMIN_ROLE = keccak256("ADMIN");
    bytes32 public constant KEEPER_ROLE = keccak256("KEEPER");
    bytes32 public constant SNAPSHOTTER_ROLE = keccak256("SNAPSHOTTER");
    IERC20 public token;
    IERC20 public sushiLpToken;
    uint public lastFeeGrowth;
    uint public totalSupply;
    mapping(address => UserInfo) private _userInfos;
    uint public currentSnapshotId;
    Snapshots private _totalSupplySnapshots;
    mapping(address => Snapshots) private _balancesSnapshots;
    mapping(address => uint) private _votes;
    mapping(address => Snapshots) private _votesSnapshots;
    mapping(address => bool) public historicalTcLps;
    address[] private _historicalTcLpsList;
    mapping(address => uint) public lastLockBlock;

    constructor(address _owner, address _token, address _sushiLpToken) {
        _setRoleAdmin(KEEPER_ROLE, ADMIN_ROLE);
        _setRoleAdmin(SNAPSHOTTER_ROLE, ADMIN_ROLE);
        _setupRole(ADMIN_ROLE, _owner);
        _setupRole(KEEPER_ROLE, _owner);
        _setupRole(SNAPSHOTTER_ROLE, _owner);
        token = IERC20(_token);
        sushiLpToken = IERC20(_sushiLpToken);
        currentSnapshotId = 1;
    }

    function userInfo(address user) external view returns (uint, uint, uint, uint, uint, uint, address) {
      UserInfo storage userInfo = _userInfos[user];
      return (
        userInfo.lastFeeGrowth,
        userInfo.lockedToken,
        userInfo.lockedSsLpValue,
        userInfo.lockedSsLpAmount,
        userInfo.lockedTcLpValue,
        userInfo.lockedTcLpAmount,
        userInfo.delegate
      );
    }

    function balanceOf(address user) override public view returns (uint) {
        UserInfo storage userInfo = _userInfos[user];
        return _userInfoTotal(userInfo);
    }

    function balanceOfAt(address user, uint snapshotId) override external view returns (uint) {
        (bool snapshotted, uint value) = _valueAt(_balancesSnapshots[user], snapshotId);
        return snapshotted ? value : balanceOf(user);
    }

    function votes(address user) public view returns (uint) {
        return _votes[user];
    }

    function votesAt(address user, uint snapshotId) override external view returns (uint) {
        (bool snapshotted, uint value) = _valueAt(_votesSnapshots[user], snapshotId);
        return snapshotted ? value : votes(user);
    }

    function totalSupplyAt(uint snapshotId) override external view returns (uint) {
        (bool snapshotted, uint value) = _valueAt(_totalSupplySnapshots, snapshotId);
        return snapshotted ? value : totalSupply;
    }

    function approve(address spender, uint amount) external returns (bool) {
        revert("not implemented");
    }

    function transfer(address to, uint amount) external returns (bool) {
        revert("not implemented");
    }

    function transferFrom(address from, address to, uint amount) external returns (bool) {
        revert("not implemented");
    }

    function snapshot() override external onlyRole(SNAPSHOTTER_ROLE) returns (uint) {
        currentSnapshotId += 1;
        emit Snapshot(currentSnapshotId);
        return currentSnapshotId;
    }

    function _valueAt(Snapshots storage snapshots, uint snapshotId) private view returns (bool, uint) {
        if (snapshots.ids.length == 0) {
            return (false, 0);
        }
        uint lower = 0;
        uint upper = snapshots.ids.length;
        while (lower < upper) {
            uint mid = (lower & upper) + (lower ^ upper) / 2;
            if (snapshots.ids[mid] > snapshotId) {
                upper = mid;
            } else {
                lower = mid + 1;
            }
        }

        uint index = lower;
        if (lower > 0 && snapshots.ids[lower - 1] == snapshotId) {
          index = lower -1;
        }

        if (index == snapshots.ids.length) {
            return (false, 0);
        } else {
            return (true, snapshots.values[index]);
        }
    }

    function _updateSnapshot(Snapshots storage snapshots, uint value) private {
        uint currentId = currentSnapshotId;
        uint lastSnapshotId = 0;
        if (snapshots.ids.length > 0) {
            lastSnapshotId = snapshots.ids[snapshots.ids.length - 1];
        }
        if (lastSnapshotId < currentId) {
            snapshots.ids.push(currentId);
            snapshots.values.push(value);
        }
    }

    function delegate(address delegatee) external {
        require(delegatee != address(0), "zero address provided");
        UserInfo storage userInfo = _userInfos[msg.sender];
        address currentDelegate = userInfo.delegate;
        userInfo.delegate = delegatee;

        _updateSnapshot(_votesSnapshots[currentDelegate], votes(currentDelegate));
        _updateSnapshot(_votesSnapshots[delegatee], votes(delegatee));
        uint amount = balanceOf(msg.sender);
        _votes[currentDelegate] -= amount;
        _votes[delegatee] += amount;

        emit DelegateChanged(msg.sender, currentDelegate, delegatee);
    }

    function _lock(address user, uint amount) private {
        require(amount > 0, "!zero");
        UserInfo storage userInfo = _userInfo(user);

        // track last time a user called the lock method to prevent flash loan attacks
        lastLockBlock[user] = block.number;

        _updateSnapshot(_totalSupplySnapshots, totalSupply);
        _updateSnapshot(_balancesSnapshots[user], balanceOf(user));
        _updateSnapshot(_votesSnapshots[userInfo.delegate], votes(userInfo.delegate));

        totalSupply += amount;
        userInfo.lockedToken += amount;
        _votes[userInfo.delegate] += amount;
        emit Transfer(address(0), user, amount);
    }

    function lock(uint amount) external {
        _transferFrom(token, msg.sender, amount);
        _lock(msg.sender, amount);
    }

    function onTokenTransfer(address user, uint amount, bytes calldata _data) external override {
        require(msg.sender == address(token), "onTokenTransfer: not xrune");
        _lock(user, amount);
    }

    function unlock(uint amount) external {
        require(block.number > lastLockBlock[msg.sender], "no lock-unlock in same tx");

        UserInfo storage userInfo = _userInfo(msg.sender);
        require(amount <= userInfo.lockedToken, "locked balance too low");

        _updateSnapshot(_totalSupplySnapshots, totalSupply);
        _updateSnapshot(_balancesSnapshots[msg.sender], balanceOf(msg.sender));
        _updateSnapshot(_votesSnapshots[userInfo.delegate], votes(userInfo.delegate));

        totalSupply -= amount;
        userInfo.lockedToken -= amount;
        _votes[userInfo.delegate] -= amount;
        emit Transfer(msg.sender, address(0), amount);

        if (amount > 0) {
            token.safeTransfer(msg.sender, amount);
        }
    }

    function lockSslp(uint lpAmount) external {
        UserInfo storage userInfo = _userInfo(msg.sender);
        require(lpAmount > 0, "!zero");
        _transferFrom(sushiLpToken, msg.sender, lpAmount);

        _updateSnapshot(_totalSupplySnapshots, totalSupply);
        _updateSnapshot(_balancesSnapshots[msg.sender], balanceOf(msg.sender));
        _updateSnapshot(_votesSnapshots[userInfo.delegate], votes(userInfo.delegate));

        // Subtract current LP value
        uint previousValue = userInfo.lockedSsLpValue;
        totalSupply -= userInfo.lockedSsLpValue;
        _votes[userInfo.delegate] -= userInfo.lockedSsLpValue;

        // Increment LP amount
        userInfo.lockedSsLpAmount += lpAmount;

        // Calculated updated *full* LP amount value and set (not increment)
        // We do it like this and not based on just amount added so that unlock
        // knows that the lockedSsLpValue is based on one rate and not multiple adds
        uint lpTokenSupply = sushiLpToken.totalSupply();
        uint lpTokenReserve = token.balanceOf(address(sushiLpToken));
        require(lpTokenSupply > 0, "lp token supply can not be zero");
        uint amount = (2 * userInfo.lockedSsLpAmount * lpTokenReserve) / lpTokenSupply;
        totalSupply += amount; // Increment as we decremented
        _votes[userInfo.delegate] += amount; // Increment as we decremented
        userInfo.lockedSsLpValue = amount; // Set a we didn't ajust and amount is full value
        if (previousValue < userInfo.lockedSsLpValue) {
            emit Transfer(address(0), msg.sender, userInfo.lockedSsLpValue - previousValue);
        } else if (previousValue > userInfo.lockedSsLpValue) {
            emit Transfer(msg.sender, address(0), previousValue - userInfo.lockedSsLpValue);
        }
    }

    function unlockSslp(uint lpAmount) external {
        UserInfo storage userInfo = _userInfo(msg.sender);
        require(lpAmount > 0, "amount can't be 0");
        require(lpAmount <= userInfo.lockedSsLpAmount, "locked balance too low");

        _updateSnapshot(_totalSupplySnapshots, totalSupply);
        _updateSnapshot(_balancesSnapshots[msg.sender], balanceOf(msg.sender));
        _updateSnapshot(_votesSnapshots[userInfo.delegate], votes(userInfo.delegate));

        // Proportionally decrement lockedSsLpValue & supply & delegated votes
        uint amount = lpAmount * userInfo.lockedSsLpValue / userInfo.lockedSsLpAmount;
        totalSupply -= amount;
        userInfo.lockedSsLpValue -= amount;
        userInfo.lockedSsLpAmount -= lpAmount;
        _votes[userInfo.delegate] -= amount;
        emit Transfer(msg.sender, address(0), amount);

        sushiLpToken.safeTransfer(msg.sender, lpAmount);
    }

    function updateTclp(address[] calldata users, uint[] calldata amounts, uint[] calldata values) external onlyRole(KEEPER_ROLE) {
        require(users.length == amounts.length && users.length == values.length, "length");
        for (uint i = 0; i < users.length; i++) {
            address user = users[i];
            UserInfo storage userInfo = _userInfo(user);
            _updateSnapshot(_totalSupplySnapshots, totalSupply);
            _updateSnapshot(_balancesSnapshots[user], balanceOf(user));
            _updateSnapshot(_votesSnapshots[userInfo.delegate], votes(userInfo.delegate));

            uint previousValue = userInfo.lockedTcLpValue;
            totalSupply = totalSupply - previousValue + values[i];
            _votes[userInfo.delegate] = _votes[userInfo.delegate] - previousValue + values[i];
            userInfo.lockedTcLpValue = values[i];
            userInfo.lockedTcLpAmount = amounts[i];
            if (previousValue < values[i]) {
                emit Transfer(address(0), user, values[i] - previousValue);
            } else if (previousValue > values[i]) {
                emit Transfer(user, address(0), previousValue - values[i]);
            }

            // Add to historicalTcLpsList for keepers to use
            if (!historicalTcLps[user]) {
              historicalTcLps[user] = true;
              _historicalTcLpsList.push(user);
            }
        }
    }

    function historicalTcLpsList(uint page, uint pageSize) external view returns (address[] memory) {
      address[] memory list = new address[](pageSize);
      for (uint i = page * pageSize; i < (page + 1) * pageSize && i < _historicalTcLpsList.length; i++) {
        list[i-(page*pageSize)] = _historicalTcLpsList[i];
      }
      return list;
    }

    function donate(uint amount) override external {
        _transferFrom(token, msg.sender, amount);
        lastFeeGrowth += (amount * 1e12) / totalSupply;
    }

    function _userInfo(address user) private returns (UserInfo storage) {
        require(user != address(0), "zero address provided");
        UserInfo storage userInfo = _userInfos[user];
        if (userInfo.delegate == address(0)) {
            userInfo.delegate = user;
        }
        if (userInfo.lastFeeGrowth == 0 && lastFeeGrowth != 0) {
            userInfo.lastFeeGrowth = lastFeeGrowth;
        } else {
            uint fees = (_userInfoTotal(userInfo) * (lastFeeGrowth - userInfo.lastFeeGrowth)) / 1e12;
            if (fees > 0) {
                _updateSnapshot(_totalSupplySnapshots, totalSupply);
                _updateSnapshot(_balancesSnapshots[user], balanceOf(user));
                _updateSnapshot(_votesSnapshots[userInfo.delegate], votes(userInfo.delegate));

                totalSupply += fees;
                userInfo.lockedToken += fees;
                userInfo.lastFeeGrowth = lastFeeGrowth;
                _votes[userInfo.delegate] += fees;
                emit Transfer(address(0), user, fees);
            }
        }
        return userInfo;
    }

    function _userInfoTotal(UserInfo storage userInfo) private view returns (uint) {
        return userInfo.lockedToken + userInfo.lockedSsLpValue + userInfo.lockedTcLpValue;
    }

    function _transferFrom(IERC20 token, address from, uint amount) private {
        uint balanceBefore = token.balanceOf(address(this));
        token.safeTransferFrom(from, address(this), amount);
        uint balanceAfter = token.balanceOf(address(this));
        require(balanceAfter - balanceBefore == amount, "_transferFrom: balance change does not match amount");
    }
}

File 2 of 12 : 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 12 : 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'
        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
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 4 of 12 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    function hasRole(bytes32 role, address account) external view returns (bool);

    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    function grantRole(bytes32 role, address account) external;

    function revokeRole(bytes32 role, address account) external;

    function renounceRole(bytes32 role, address account) external;
}

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        emit RoleAdminChanged(role, getRoleAdmin(role), adminRole);
        _roles[role].adminRole = adminRole;
    }

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 5 of 12 : IVoters.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.6;

interface IVoters {
  function snapshot() external returns (uint);
  function totalSupplyAt(uint snapshotId) external view returns (uint);
  function votesAt(address account, uint snapshotId) external view returns (uint);
  function balanceOf(address account) external view returns (uint);
  function balanceOfAt(address account, uint snapshotId) external view returns (uint);
  function donate(uint amount) external;
}

File 6 of 12 : IUniswapV2Pair.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.6;

interface IUniswapV2Pair {
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
}

File 7 of 12 : IERC677Receiver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IERC677Receiver {
  function onTokenTransfer(address _sender, uint _value, bytes calldata _data) external;
}

File 8 of 12 : 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;
        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");

        (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");

        (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");

        (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");

        (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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 9 of 12 : 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) {
        return msg.data;
    }
}

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

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 12 of 12 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_sushiLpToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"fromDelegate","type":"address"},{"indexed":true,"internalType":"address","name":"toDelegate","type":"address"}],"name":"DelegateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Snapshot","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"KEEPER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SNAPSHOTTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"snapshotId","type":"uint256"}],"name":"balanceOfAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentSnapshotId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"donate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"historicalTcLps","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"page","type":"uint256"},{"internalType":"uint256","name":"pageSize","type":"uint256"}],"name":"historicalTcLpsList","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastFeeGrowth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastLockBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"lpAmount","type":"uint256"}],"name":"lockSslp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"onTokenTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"snapshot","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sushiLpToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"snapshotId","type":"uint256"}],"name":"totalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"lpAmount","type":"uint256"}],"name":"unlockSslp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"users","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"updateTclp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"votes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"snapshotId","type":"uint256"}],"name":"votesAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b5060405162002b0938038062002b09833981016040819052620000349162000233565b6200005e60008051602062002ac983398151915260008051602062002ae983398151915262000112565b6200008860008051602062002aa983398151915260008051602062002ae983398151915262000112565b620000a360008051602062002ae98339815191528462000166565b620000be60008051602062002ac98339815191528462000166565b620000d960008051602062002aa98339815191528462000166565b600180546001600160a01b039384166001600160a01b03199182161782556002805493909416921691909117909155600655506200027d565b600082815260208190526040902060010154819060405184907fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff90600090a460009182526020829052604090912060010155565b62000172828262000176565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000172576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001d23390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b80516001600160a01b03811681146200022e57600080fd5b919050565b6000806000606084860312156200024957600080fd5b620002548462000216565b9250620002646020850162000216565b9150620002746040850162000216565b90509250925092565b61281c806200028d6000396000f3fe608060405234801561001057600080fd5b506004361061023c5760003560e01c806375b238fc1161013b578063a15910af116100b8578063d547741f1161007c578063d547741f14610603578063d8bff5a514610616578063dd46706414610629578063f14faf6f1461063c578063fc0c546a1461064f57600080fd5b8063a15910af146105a1578063a217fddf146105c1578063a4c0ed36146105c9578063a9059cbb146102d3578063cb2db437146105dc57600080fd5b80639582b089116100ff5780639582b0891461054557806395d89b4114610558578063970875ce1461057d5780639711715a14610586578063981b24d01461058e57600080fd5b806375b238fc146104cc57806381006272146104f357806383b1c0311461050657806386defc301461050f57806391d148541461053257600080fd5b80632f2ff15d116101c9578063526404ed1161018d578063526404ed146104485780635b8179f7146104685780635c19a95c146104935780636198e339146104a657806370a08231146104b957600080fd5b80632f2ff15d146103ce578063313ce567146103e1578063364bc15a146103fb57806336568abe146104225780634ee2cd7e1461043557600080fd5b806318160ddd1161021057806318160ddd146102e65780631959a002146102ef5780631e878f331461038857806323b872dd1461039d578063248a9ca3146103ab57600080fd5b80622009c21461024157806301ffc9a71461026757806306fdde031461028a578063095ea7b3146102d3575b600080fd5b61025461024f36600461238e565b610662565b6040519081526020015b60405180910390f35b61027a610275366004612540565b6106aa565b604051901515815260200161025e565b6102c66040518060400160405280601881526020017f54686f727374617274657220566f74696e6720546f6b656e000000000000000081525081565b60405161025e9190612683565b61027a6102e136600461238e565b6106e1565b61025460045481565b61034a6102fd366004612337565b6001600160a01b0390811660009081526005602081905260409091208054600182015460028301546003840154600485015495850154600690950154939792969195909490939092911690565b604080519788526020880196909652948601939093526060850191909152608084015260a08301526001600160a01b031660c082015260e00161025e565b61039b61039636600461243f565b610723565b005b61027a6102e1366004612352565b6102546103b93660046124fb565b60009081526020819052604090206001015490565b61039b6103dc366004612514565b610aa6565b6103e9601281565b60405160ff909116815260200161025e565b6102547f71a9859d7dd21b24504a6f306077ffc2d510b4d4b61128e931fe937441ad183681565b61039b610430366004612514565b610ad1565b61025461044336600461238e565b610b4f565b610254610456366004612337565b600e6020526000908152604090205481565b60025461047b906001600160a01b031681565b6040516001600160a01b03909116815260200161025e565b61039b6104a1366004612337565b610b87565b61039b6104b43660046124fb565b610cef565b6102546104c7366004612337565b610e9f565b6102547fdf8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec4281565b61039b6105013660046124fb565b610ec7565b61025460035481565b61027a61051d366004612337565b600c6020526000908152604090205460ff1681565b61027a610540366004612514565b611240565b61039b6105533660046124fb565b611269565b6102c660405180604001604052806006815260200165765852554e4560d01b81525081565b61025460065481565b610254611437565b61025461059c3660046124fb565b6114ba565b6105b46105af366004612583565b6114e5565b60405161025e9190612636565b610254600081565b61039b6105d73660046123b8565b6115e6565b6102547f448f811bab0a96b12a5a67c73e96871dba861330a24a3040e1baeb42bb606d3181565b61039b610611366004612514565b611650565b610254610624366004612337565b611676565b61039b6106373660046124fb565b611691565b61039b61064a3660046124fb565b6116b5565b60015461047b906001600160a01b031681565b6001600160a01b0382166000908152600b60205260408120819081906106889085611701565b915091508161069f5761069a85611676565b6106a1565b805b95945050505050565b60006001600160e01b03198216637965db0b60e01b14806106db57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60405162461bcd60e51b815260206004820152600f60248201526e1b9bdd081a5b5c1b195b595b9d1959608a1b60448201526000906064015b60405180910390fd5b7f71a9859d7dd21b24504a6f306077ffc2d510b4d4b61128e931fe937441ad183661074e8133611816565b858414801561075c57508582145b6107915760405162461bcd60e51b81526020600482015260066024820152650d8cadccee8d60d31b604482015260640161071a565b60005b86811015610a9c5760008888838181106107b0576107b061279a565b90506020020160208101906107c59190612337565b905060006107d28261187a565b90506107e16007600454611a65565b6001600160a01b038216600090815260096020526040902061080b9061080684610e9f565b611a65565b60068101546001600160a01b03166000818152600b602052604090206108349161080690611676565b600481015486868581811061084b5761084b61279a565b9050602002013581600454610860919061270f565b61086a91906126b6565b60045586868581811061087f5761087f61279a565b60068501546001600160a01b03166000908152600a602090815260409091205491029290920135916108b39150839061270f565b6108bd91906126b6565b60068301546001600160a01b03166000908152600a60205260409020558686858181106108ec576108ec61279a565b602002919091013560048401555088888581811061090c5761090c61279a565b602002919091013560058401555086868581811061092c5761092c61279a565b9050602002013581101561098f576001600160a01b03831660006000805160206127c7833981519152838a8a898181106109685761096861279a565b90506020020135610979919061270f565b60405190815260200160405180910390a3610a00565b8686858181106109a1576109a161279a565b90506020020135811115610a005760006001600160a01b0384166000805160206127c78339815191528989888181106109dc576109dc61279a565b90506020020135846109ee919061270f565b60405190815260200160405180910390a35b6001600160a01b0383166000908152600c602052604090205460ff16610a86576001600160a01b0383166000818152600c60205260408120805460ff19166001908117909155600d805491820181559091527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50180546001600160a01b03191690911790555b5050508080610a9490612769565b915050610794565b5050505050505050565b600082815260208190526040902060010154610ac28133611816565b610acc8383611ad7565b505050565b6001600160a01b0381163314610b415760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161071a565b610b4b8282611b5b565b5050565b6001600160a01b038216600090815260096020526040812081908190610b759085611701565b915091508161069f5761069a85610e9f565b6001600160a01b038116610bd55760405162461bcd60e51b81526020600482015260156024820152741e995c9bc81859191c995cdcc81c1c9bdd9a591959605a1b604482015260640161071a565b3360009081526005602090815260408083206006810180546001600160a01b038781166001600160a01b031983161790925516808552600b9093529220610c1f9061080683611676565b6001600160a01b0383166000908152600b60205260409020610c449061080685611676565b6000610c4f33610e9f565b6001600160a01b0383166000908152600a6020526040812080549293508392909190610c7c90849061270f565b90915550506001600160a01b0384166000908152600a602052604081208054839290610ca99084906126b6565b90915550506040516001600160a01b03808616919084169033907f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f90600090a450505050565b336000908152600e60205260409020544311610d4d5760405162461bcd60e51b815260206004820152601960248201527f6e6f206c6f636b2d756e6c6f636b20696e2073616d6520747800000000000000604482015260640161071a565b6000610d583361187a565b90508060010154821115610da75760405162461bcd60e51b81526020600482015260166024820152756c6f636b65642062616c616e636520746f6f206c6f7760501b604482015260640161071a565b610db46007600454611a65565b336000818152600960205260409020610dd09161080690610e9f565b60068101546001600160a01b03166000818152600b60205260409020610df99161080690611676565b8160046000828254610e0b919061270f565b9250508190555081816001016000828254610e26919061270f565b909155505060068101546001600160a01b03166000908152600a602052604081208054849290610e5790849061270f565b909155505060405182815260009033906000805160206127c78339815191529060200160405180910390a38115610b4b57600154610b4b906001600160a01b03163384611bc0565b6001600160a01b0381166000908152600560205260408120610ec081611c23565b9392505050565b6000610ed23361187a565b905060008211610f0c5760405162461bcd60e51b8152602060048201526005602482015264217a65726f60d81b604482015260640161071a565b600254610f23906001600160a01b03163384611c48565b610f306007600454611a65565b336000818152600960205260409020610f4c9161080690610e9f565b60068101546001600160a01b03166000818152600b60205260409020610f759161080690611676565b600281015460048054829190600090610f8f90849061270f565b9091555050600282015460068301546001600160a01b03166000908152600a602052604081208054909190610fc590849061270f565b9250508190555082826003016000828254610fe091906126b6565b9091555050600254604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561102a57600080fd5b505afa15801561103e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611062919061256a565b6001546002546040516370a0823160e01b81526001600160a01b0391821660048201529293506000929116906370a082319060240160206040518083038186803b1580156110af57600080fd5b505afa1580156110c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e7919061256a565b9050600082116111395760405162461bcd60e51b815260206004820152601f60248201527f6c7020746f6b656e20737570706c792063616e206e6f74206265207a65726f00604482015260640161071a565b600082828660030154600261114e91906126f0565b61115891906126f0565b61116291906126ce565b9050806004600082825461117691906126b6565b909155505060068501546001600160a01b03166000908152600a6020526040812080548392906111a79084906126b6565b909155505060028501819055808410156111f657600285015433906000906000805160206127c7833981519152906111e090889061270f565b60405190815260200160405180910390a3611238565b846002015484111561123857600285015460009033906000805160206127c783398151915290611226908861270f565b60405190815260200160405180910390a35b505050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60006112743361187a565b9050600082116112ba5760405162461bcd60e51b81526020600482015260116024820152700616d6f756e742063616e2774206265203607c1b604482015260640161071a565b80600301548211156113075760405162461bcd60e51b81526020600482015260166024820152756c6f636b65642062616c616e636520746f6f206c6f7760501b604482015260640161071a565b6113146007600454611a65565b3360008181526009602052604090206113309161080690610e9f565b60068101546001600160a01b03166000818152600b602052604090206113599161080690611676565b6000816003015482600201548461137091906126f0565b61137a91906126ce565b9050806004600082825461138e919061270f565b92505081905550808260020160008282546113a9919061270f565b92505081905550828260030160008282546113c4919061270f565b909155505060068201546001600160a01b03166000908152600a6020526040812080548392906113f590849061270f565b909155505060405181815260009033906000805160206127c78339815191529060200160405180910390a3600254610acc906001600160a01b03163385611bc0565b60007f448f811bab0a96b12a5a67c73e96871dba861330a24a3040e1baeb42bb606d316114648133611816565b60016006600082825461147791906126b6565b90915550506006546040519081527f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb679060200160405180910390a1505060065490565b60008060006114ca600785611701565b91509150816114db576004546114dd565b805b949350505050565b606060008267ffffffffffffffff811115611502576115026127b0565b60405190808252806020026020018201604052801561152b578160200160208202803683370190505b509050600061153a84866126f0565b90505b836115498660016126b6565b61155391906126f0565b811080156115625750600d5481105b156115de57600d818154811061157a5761157a61279a565b6000918252602090912001546001600160a01b03168261159a86886126f0565b6115a4908461270f565b815181106115b4576115b461279a565b6001600160a01b0390921660209283029190910190910152806115d681612769565b91505061153d565b509392505050565b6001546001600160a01b031633146116405760405162461bcd60e51b815260206004820152601a60248201527f6f6e546f6b656e5472616e736665723a206e6f74207872756e65000000000000604482015260640161071a565b61164a8484611dd0565b50505050565b60008281526020819052604090206001015461166c8133611816565b610acc8383611b5b565b6001600160a01b03166000908152600a602052604090205490565b6001546116a8906001600160a01b03163383611c48565b6116b23382611dd0565b50565b6001546116cc906001600160a01b03163383611c48565b6004546116de8264e8d4a510006126f0565b6116e891906126ce565b600360008282546116f991906126b6565b909155505050565b815460009081906117175750600090508061180f565b83546000905b8082101561178557600061173460028484186126ce565b611740908484166126b6565b9050858760000182815481106117585761175861279a565b906000526020600020015411156117715780915061177f565b61177c8160016126b6565b92505b5061171d565b8180158015906117ba5750858761179d60018661270f565b815481106117ad576117ad61279a565b9060005260206000200154145b156117cd576117ca60018461270f565b90505b86548114156117e5576000809450945050505061180f565b60018760010182815481106117fc576117fc61279a565b9060005260206000200154945094505050505b9250929050565b6118208282611240565b610b4b57611838816001600160a01b03166014611f25565b611843836020611f25565b6040516020016118549291906125c1565b60408051601f198184030181529082905262461bcd60e51b825261071a91600401612683565b60006001600160a01b0382166118ca5760405162461bcd60e51b81526020600482015260156024820152741e995c9bc81859191c995cdcc81c1c9bdd9a591959605a1b604482015260640161071a565b6001600160a01b038083166000908152600560205260409020600681015490911661190d576006810180546001600160a01b0319166001600160a01b0385161790555b805415801561191d575060035415155b1561192c5760035481556106db565b600064e8d4a510008260000154600354611946919061270f565b61194f84611c23565b61195991906126f0565b61196391906126ce565b90508015611a5e576119786007600454611a65565b6001600160a01b038416600090815260096020526040902061199d9061080686610e9f565b60068201546001600160a01b03166000818152600b602052604090206119c69161080690611676565b80600460008282546119d891906126b6565b92505081905550808260010160008282546119f391906126b6565b9091555050600354825560068201546001600160a01b03166000908152600a602052604081208054839290611a299084906126b6565b90915550506040518181526001600160a01b038516906000906000805160206127c78339815191529060200160405180910390a35b5092915050565b600654825460009015611aa05783548490611a829060019061270f565b81548110611a9257611a9261279a565b906000526020600020015490505b8181101561164a57508254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b611ae18282611240565b610b4b576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055611b173390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611b658282611240565b15610b4b576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6040516001600160a01b038316602482015260448101829052610acc90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526120c1565b6000816004015482600201548360010154611c3e91906126b6565b6106db91906126b6565b6040516370a0823160e01b81523060048201526000906001600160a01b038516906370a082319060240160206040518083038186803b158015611c8a57600080fd5b505afa158015611c9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cc2919061256a565b9050611cd96001600160a01b038516843085612193565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a082319060240160206040518083038186803b158015611d1b57600080fd5b505afa158015611d2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d53919061256a565b905082611d60838361270f565b14611dc95760405162461bcd60e51b815260206004820152603360248201527f5f7472616e7366657246726f6d3a2062616c616e6365206368616e676520646f604482015272195cc81b9bdd081b585d18da08185b5bdd5b9d606a1b606482015260840161071a565b5050505050565b60008111611e085760405162461bcd60e51b8152602060048201526005602482015264217a65726f60d81b604482015260640161071a565b6000611e138361187a565b6001600160a01b0384166000908152600e60205260409020439055600454909150611e4090600790611a65565b6001600160a01b0383166000908152600960205260409020611e659061080685610e9f565b60068101546001600160a01b03166000818152600b60205260409020611e8e9161080690611676565b8160046000828254611ea091906126b6565b9250508190555081816001016000828254611ebb91906126b6565b909155505060068101546001600160a01b03166000908152600a602052604081208054849290611eec9084906126b6565b90915550506040518281526001600160a01b038416906000906000805160206127c78339815191529060200160405180910390a3505050565b60606000611f348360026126f0565b611f3f9060026126b6565b67ffffffffffffffff811115611f5757611f576127b0565b6040519080825280601f01601f191660200182016040528015611f81576020820181803683370190505b509050600360fc1b81600081518110611f9c57611f9c61279a565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611fcb57611fcb61279a565b60200101906001600160f81b031916908160001a9053506000611fef8460026126f0565b611ffa9060016126b6565b90505b6001811115612072576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061202e5761202e61279a565b1a60f81b8282815181106120445761204461279a565b60200101906001600160f81b031916908160001a90535060049490941c9361206b81612752565b9050611ffd565b508315610ec05760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161071a565b6000612116826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166121cb9092919063ffffffff16565b805190915015610acc578080602001905181019061213491906124d9565b610acc5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161071a565b6040516001600160a01b038085166024830152831660448201526064810182905261164a9085906323b872dd60e01b90608401611bec565b60606114dd848460008585843b6122245760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161071a565b600080866001600160a01b0316858760405161224091906125a5565b60006040518083038185875af1925050503d806000811461227d576040519150601f19603f3d011682016040523d82523d6000602084013e612282565b606091505b509150915061229282828661229d565b979650505050505050565b606083156122ac575081610ec0565b8251156122bc5782518084602001fd5b8160405162461bcd60e51b815260040161071a9190612683565b80356001600160a01b03811681146122ed57600080fd5b919050565b60008083601f84011261230457600080fd5b50813567ffffffffffffffff81111561231c57600080fd5b6020830191508360208260051b850101111561180f57600080fd5b60006020828403121561234957600080fd5b610ec0826122d6565b60008060006060848603121561236757600080fd5b612370846122d6565b925061237e602085016122d6565b9150604084013590509250925092565b600080604083850312156123a157600080fd5b6123aa836122d6565b946020939093013593505050565b600080600080606085870312156123ce57600080fd5b6123d7856122d6565b935060208501359250604085013567ffffffffffffffff808211156123fb57600080fd5b818701915087601f83011261240f57600080fd5b81358181111561241e57600080fd5b88602082850101111561243057600080fd5b95989497505060200194505050565b6000806000806000806060878903121561245857600080fd5b863567ffffffffffffffff8082111561247057600080fd5b61247c8a838b016122f2565b9098509650602089013591508082111561249557600080fd5b6124a18a838b016122f2565b909650945060408901359150808211156124ba57600080fd5b506124c789828a016122f2565b979a9699509497509295939492505050565b6000602082840312156124eb57600080fd5b81518015158114610ec057600080fd5b60006020828403121561250d57600080fd5b5035919050565b6000806040838503121561252757600080fd5b82359150612537602084016122d6565b90509250929050565b60006020828403121561255257600080fd5b81356001600160e01b031981168114610ec057600080fd5b60006020828403121561257c57600080fd5b5051919050565b6000806040838503121561259657600080fd5b50508035926020909101359150565b600082516125b7818460208701612726565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516125f9816017850160208801612726565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161262a816028840160208801612726565b01602801949350505050565b6020808252825182820181905260009190848201906040850190845b818110156126775783516001600160a01b031683529284019291840191600101612652565b50909695505050505050565b60208152600082518060208401526126a2816040850160208701612726565b601f01601f19169190910160400192915050565b600082198211156126c9576126c9612784565b500190565b6000826126eb57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561270a5761270a612784565b500290565b60008282101561272157612721612784565b500390565b60005b83811015612741578181015183820152602001612729565b8381111561164a5750506000910152565b60008161276157612761612784565b506000190190565b600060001982141561277d5761277d612784565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220fd91c7b821cad47e7c6a345bad34bdbee0ce08bd87187a259fb43ec7820555e064736f6c63430008060033448f811bab0a96b12a5a67c73e96871dba861330a24a3040e1baeb42bb606d3171a9859d7dd21b24504a6f306077ffc2d510b4d4b61128e931fe937441ad1836df8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec4200000000000000000000000069539c1c678dfd26e626f109149b7cebdd5e476800000000000000000000000069fa0fee221ad11012bab0fdb45d444d3d2ce71c00000000000000000000000095cfa1f48fad82232772d3b1415ad4393517f3b5

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061023c5760003560e01c806375b238fc1161013b578063a15910af116100b8578063d547741f1161007c578063d547741f14610603578063d8bff5a514610616578063dd46706414610629578063f14faf6f1461063c578063fc0c546a1461064f57600080fd5b8063a15910af146105a1578063a217fddf146105c1578063a4c0ed36146105c9578063a9059cbb146102d3578063cb2db437146105dc57600080fd5b80639582b089116100ff5780639582b0891461054557806395d89b4114610558578063970875ce1461057d5780639711715a14610586578063981b24d01461058e57600080fd5b806375b238fc146104cc57806381006272146104f357806383b1c0311461050657806386defc301461050f57806391d148541461053257600080fd5b80632f2ff15d116101c9578063526404ed1161018d578063526404ed146104485780635b8179f7146104685780635c19a95c146104935780636198e339146104a657806370a08231146104b957600080fd5b80632f2ff15d146103ce578063313ce567146103e1578063364bc15a146103fb57806336568abe146104225780634ee2cd7e1461043557600080fd5b806318160ddd1161021057806318160ddd146102e65780631959a002146102ef5780631e878f331461038857806323b872dd1461039d578063248a9ca3146103ab57600080fd5b80622009c21461024157806301ffc9a71461026757806306fdde031461028a578063095ea7b3146102d3575b600080fd5b61025461024f36600461238e565b610662565b6040519081526020015b60405180910390f35b61027a610275366004612540565b6106aa565b604051901515815260200161025e565b6102c66040518060400160405280601881526020017f54686f727374617274657220566f74696e6720546f6b656e000000000000000081525081565b60405161025e9190612683565b61027a6102e136600461238e565b6106e1565b61025460045481565b61034a6102fd366004612337565b6001600160a01b0390811660009081526005602081905260409091208054600182015460028301546003840154600485015495850154600690950154939792969195909490939092911690565b604080519788526020880196909652948601939093526060850191909152608084015260a08301526001600160a01b031660c082015260e00161025e565b61039b61039636600461243f565b610723565b005b61027a6102e1366004612352565b6102546103b93660046124fb565b60009081526020819052604090206001015490565b61039b6103dc366004612514565b610aa6565b6103e9601281565b60405160ff909116815260200161025e565b6102547f71a9859d7dd21b24504a6f306077ffc2d510b4d4b61128e931fe937441ad183681565b61039b610430366004612514565b610ad1565b61025461044336600461238e565b610b4f565b610254610456366004612337565b600e6020526000908152604090205481565b60025461047b906001600160a01b031681565b6040516001600160a01b03909116815260200161025e565b61039b6104a1366004612337565b610b87565b61039b6104b43660046124fb565b610cef565b6102546104c7366004612337565b610e9f565b6102547fdf8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec4281565b61039b6105013660046124fb565b610ec7565b61025460035481565b61027a61051d366004612337565b600c6020526000908152604090205460ff1681565b61027a610540366004612514565b611240565b61039b6105533660046124fb565b611269565b6102c660405180604001604052806006815260200165765852554e4560d01b81525081565b61025460065481565b610254611437565b61025461059c3660046124fb565b6114ba565b6105b46105af366004612583565b6114e5565b60405161025e9190612636565b610254600081565b61039b6105d73660046123b8565b6115e6565b6102547f448f811bab0a96b12a5a67c73e96871dba861330a24a3040e1baeb42bb606d3181565b61039b610611366004612514565b611650565b610254610624366004612337565b611676565b61039b6106373660046124fb565b611691565b61039b61064a3660046124fb565b6116b5565b60015461047b906001600160a01b031681565b6001600160a01b0382166000908152600b60205260408120819081906106889085611701565b915091508161069f5761069a85611676565b6106a1565b805b95945050505050565b60006001600160e01b03198216637965db0b60e01b14806106db57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60405162461bcd60e51b815260206004820152600f60248201526e1b9bdd081a5b5c1b195b595b9d1959608a1b60448201526000906064015b60405180910390fd5b7f71a9859d7dd21b24504a6f306077ffc2d510b4d4b61128e931fe937441ad183661074e8133611816565b858414801561075c57508582145b6107915760405162461bcd60e51b81526020600482015260066024820152650d8cadccee8d60d31b604482015260640161071a565b60005b86811015610a9c5760008888838181106107b0576107b061279a565b90506020020160208101906107c59190612337565b905060006107d28261187a565b90506107e16007600454611a65565b6001600160a01b038216600090815260096020526040902061080b9061080684610e9f565b611a65565b60068101546001600160a01b03166000818152600b602052604090206108349161080690611676565b600481015486868581811061084b5761084b61279a565b9050602002013581600454610860919061270f565b61086a91906126b6565b60045586868581811061087f5761087f61279a565b60068501546001600160a01b03166000908152600a602090815260409091205491029290920135916108b39150839061270f565b6108bd91906126b6565b60068301546001600160a01b03166000908152600a60205260409020558686858181106108ec576108ec61279a565b602002919091013560048401555088888581811061090c5761090c61279a565b602002919091013560058401555086868581811061092c5761092c61279a565b9050602002013581101561098f576001600160a01b03831660006000805160206127c7833981519152838a8a898181106109685761096861279a565b90506020020135610979919061270f565b60405190815260200160405180910390a3610a00565b8686858181106109a1576109a161279a565b90506020020135811115610a005760006001600160a01b0384166000805160206127c78339815191528989888181106109dc576109dc61279a565b90506020020135846109ee919061270f565b60405190815260200160405180910390a35b6001600160a01b0383166000908152600c602052604090205460ff16610a86576001600160a01b0383166000818152600c60205260408120805460ff19166001908117909155600d805491820181559091527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50180546001600160a01b03191690911790555b5050508080610a9490612769565b915050610794565b5050505050505050565b600082815260208190526040902060010154610ac28133611816565b610acc8383611ad7565b505050565b6001600160a01b0381163314610b415760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161071a565b610b4b8282611b5b565b5050565b6001600160a01b038216600090815260096020526040812081908190610b759085611701565b915091508161069f5761069a85610e9f565b6001600160a01b038116610bd55760405162461bcd60e51b81526020600482015260156024820152741e995c9bc81859191c995cdcc81c1c9bdd9a591959605a1b604482015260640161071a565b3360009081526005602090815260408083206006810180546001600160a01b038781166001600160a01b031983161790925516808552600b9093529220610c1f9061080683611676565b6001600160a01b0383166000908152600b60205260409020610c449061080685611676565b6000610c4f33610e9f565b6001600160a01b0383166000908152600a6020526040812080549293508392909190610c7c90849061270f565b90915550506001600160a01b0384166000908152600a602052604081208054839290610ca99084906126b6565b90915550506040516001600160a01b03808616919084169033907f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f90600090a450505050565b336000908152600e60205260409020544311610d4d5760405162461bcd60e51b815260206004820152601960248201527f6e6f206c6f636b2d756e6c6f636b20696e2073616d6520747800000000000000604482015260640161071a565b6000610d583361187a565b90508060010154821115610da75760405162461bcd60e51b81526020600482015260166024820152756c6f636b65642062616c616e636520746f6f206c6f7760501b604482015260640161071a565b610db46007600454611a65565b336000818152600960205260409020610dd09161080690610e9f565b60068101546001600160a01b03166000818152600b60205260409020610df99161080690611676565b8160046000828254610e0b919061270f565b9250508190555081816001016000828254610e26919061270f565b909155505060068101546001600160a01b03166000908152600a602052604081208054849290610e5790849061270f565b909155505060405182815260009033906000805160206127c78339815191529060200160405180910390a38115610b4b57600154610b4b906001600160a01b03163384611bc0565b6001600160a01b0381166000908152600560205260408120610ec081611c23565b9392505050565b6000610ed23361187a565b905060008211610f0c5760405162461bcd60e51b8152602060048201526005602482015264217a65726f60d81b604482015260640161071a565b600254610f23906001600160a01b03163384611c48565b610f306007600454611a65565b336000818152600960205260409020610f4c9161080690610e9f565b60068101546001600160a01b03166000818152600b60205260409020610f759161080690611676565b600281015460048054829190600090610f8f90849061270f565b9091555050600282015460068301546001600160a01b03166000908152600a602052604081208054909190610fc590849061270f565b9250508190555082826003016000828254610fe091906126b6565b9091555050600254604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561102a57600080fd5b505afa15801561103e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611062919061256a565b6001546002546040516370a0823160e01b81526001600160a01b0391821660048201529293506000929116906370a082319060240160206040518083038186803b1580156110af57600080fd5b505afa1580156110c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e7919061256a565b9050600082116111395760405162461bcd60e51b815260206004820152601f60248201527f6c7020746f6b656e20737570706c792063616e206e6f74206265207a65726f00604482015260640161071a565b600082828660030154600261114e91906126f0565b61115891906126f0565b61116291906126ce565b9050806004600082825461117691906126b6565b909155505060068501546001600160a01b03166000908152600a6020526040812080548392906111a79084906126b6565b909155505060028501819055808410156111f657600285015433906000906000805160206127c7833981519152906111e090889061270f565b60405190815260200160405180910390a3611238565b846002015484111561123857600285015460009033906000805160206127c783398151915290611226908861270f565b60405190815260200160405180910390a35b505050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60006112743361187a565b9050600082116112ba5760405162461bcd60e51b81526020600482015260116024820152700616d6f756e742063616e2774206265203607c1b604482015260640161071a565b80600301548211156113075760405162461bcd60e51b81526020600482015260166024820152756c6f636b65642062616c616e636520746f6f206c6f7760501b604482015260640161071a565b6113146007600454611a65565b3360008181526009602052604090206113309161080690610e9f565b60068101546001600160a01b03166000818152600b602052604090206113599161080690611676565b6000816003015482600201548461137091906126f0565b61137a91906126ce565b9050806004600082825461138e919061270f565b92505081905550808260020160008282546113a9919061270f565b92505081905550828260030160008282546113c4919061270f565b909155505060068201546001600160a01b03166000908152600a6020526040812080548392906113f590849061270f565b909155505060405181815260009033906000805160206127c78339815191529060200160405180910390a3600254610acc906001600160a01b03163385611bc0565b60007f448f811bab0a96b12a5a67c73e96871dba861330a24a3040e1baeb42bb606d316114648133611816565b60016006600082825461147791906126b6565b90915550506006546040519081527f8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb679060200160405180910390a1505060065490565b60008060006114ca600785611701565b91509150816114db576004546114dd565b805b949350505050565b606060008267ffffffffffffffff811115611502576115026127b0565b60405190808252806020026020018201604052801561152b578160200160208202803683370190505b509050600061153a84866126f0565b90505b836115498660016126b6565b61155391906126f0565b811080156115625750600d5481105b156115de57600d818154811061157a5761157a61279a565b6000918252602090912001546001600160a01b03168261159a86886126f0565b6115a4908461270f565b815181106115b4576115b461279a565b6001600160a01b0390921660209283029190910190910152806115d681612769565b91505061153d565b509392505050565b6001546001600160a01b031633146116405760405162461bcd60e51b815260206004820152601a60248201527f6f6e546f6b656e5472616e736665723a206e6f74207872756e65000000000000604482015260640161071a565b61164a8484611dd0565b50505050565b60008281526020819052604090206001015461166c8133611816565b610acc8383611b5b565b6001600160a01b03166000908152600a602052604090205490565b6001546116a8906001600160a01b03163383611c48565b6116b23382611dd0565b50565b6001546116cc906001600160a01b03163383611c48565b6004546116de8264e8d4a510006126f0565b6116e891906126ce565b600360008282546116f991906126b6565b909155505050565b815460009081906117175750600090508061180f565b83546000905b8082101561178557600061173460028484186126ce565b611740908484166126b6565b9050858760000182815481106117585761175861279a565b906000526020600020015411156117715780915061177f565b61177c8160016126b6565b92505b5061171d565b8180158015906117ba5750858761179d60018661270f565b815481106117ad576117ad61279a565b9060005260206000200154145b156117cd576117ca60018461270f565b90505b86548114156117e5576000809450945050505061180f565b60018760010182815481106117fc576117fc61279a565b9060005260206000200154945094505050505b9250929050565b6118208282611240565b610b4b57611838816001600160a01b03166014611f25565b611843836020611f25565b6040516020016118549291906125c1565b60408051601f198184030181529082905262461bcd60e51b825261071a91600401612683565b60006001600160a01b0382166118ca5760405162461bcd60e51b81526020600482015260156024820152741e995c9bc81859191c995cdcc81c1c9bdd9a591959605a1b604482015260640161071a565b6001600160a01b038083166000908152600560205260409020600681015490911661190d576006810180546001600160a01b0319166001600160a01b0385161790555b805415801561191d575060035415155b1561192c5760035481556106db565b600064e8d4a510008260000154600354611946919061270f565b61194f84611c23565b61195991906126f0565b61196391906126ce565b90508015611a5e576119786007600454611a65565b6001600160a01b038416600090815260096020526040902061199d9061080686610e9f565b60068201546001600160a01b03166000818152600b602052604090206119c69161080690611676565b80600460008282546119d891906126b6565b92505081905550808260010160008282546119f391906126b6565b9091555050600354825560068201546001600160a01b03166000908152600a602052604081208054839290611a299084906126b6565b90915550506040518181526001600160a01b038516906000906000805160206127c78339815191529060200160405180910390a35b5092915050565b600654825460009015611aa05783548490611a829060019061270f565b81548110611a9257611a9261279a565b906000526020600020015490505b8181101561164a57508254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b611ae18282611240565b610b4b576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055611b173390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611b658282611240565b15610b4b576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6040516001600160a01b038316602482015260448101829052610acc90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526120c1565b6000816004015482600201548360010154611c3e91906126b6565b6106db91906126b6565b6040516370a0823160e01b81523060048201526000906001600160a01b038516906370a082319060240160206040518083038186803b158015611c8a57600080fd5b505afa158015611c9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cc2919061256a565b9050611cd96001600160a01b038516843085612193565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a082319060240160206040518083038186803b158015611d1b57600080fd5b505afa158015611d2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d53919061256a565b905082611d60838361270f565b14611dc95760405162461bcd60e51b815260206004820152603360248201527f5f7472616e7366657246726f6d3a2062616c616e6365206368616e676520646f604482015272195cc81b9bdd081b585d18da08185b5bdd5b9d606a1b606482015260840161071a565b5050505050565b60008111611e085760405162461bcd60e51b8152602060048201526005602482015264217a65726f60d81b604482015260640161071a565b6000611e138361187a565b6001600160a01b0384166000908152600e60205260409020439055600454909150611e4090600790611a65565b6001600160a01b0383166000908152600960205260409020611e659061080685610e9f565b60068101546001600160a01b03166000818152600b60205260409020611e8e9161080690611676565b8160046000828254611ea091906126b6565b9250508190555081816001016000828254611ebb91906126b6565b909155505060068101546001600160a01b03166000908152600a602052604081208054849290611eec9084906126b6565b90915550506040518281526001600160a01b038416906000906000805160206127c78339815191529060200160405180910390a3505050565b60606000611f348360026126f0565b611f3f9060026126b6565b67ffffffffffffffff811115611f5757611f576127b0565b6040519080825280601f01601f191660200182016040528015611f81576020820181803683370190505b509050600360fc1b81600081518110611f9c57611f9c61279a565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611fcb57611fcb61279a565b60200101906001600160f81b031916908160001a9053506000611fef8460026126f0565b611ffa9060016126b6565b90505b6001811115612072576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061202e5761202e61279a565b1a60f81b8282815181106120445761204461279a565b60200101906001600160f81b031916908160001a90535060049490941c9361206b81612752565b9050611ffd565b508315610ec05760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161071a565b6000612116826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166121cb9092919063ffffffff16565b805190915015610acc578080602001905181019061213491906124d9565b610acc5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161071a565b6040516001600160a01b038085166024830152831660448201526064810182905261164a9085906323b872dd60e01b90608401611bec565b60606114dd848460008585843b6122245760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161071a565b600080866001600160a01b0316858760405161224091906125a5565b60006040518083038185875af1925050503d806000811461227d576040519150601f19603f3d011682016040523d82523d6000602084013e612282565b606091505b509150915061229282828661229d565b979650505050505050565b606083156122ac575081610ec0565b8251156122bc5782518084602001fd5b8160405162461bcd60e51b815260040161071a9190612683565b80356001600160a01b03811681146122ed57600080fd5b919050565b60008083601f84011261230457600080fd5b50813567ffffffffffffffff81111561231c57600080fd5b6020830191508360208260051b850101111561180f57600080fd5b60006020828403121561234957600080fd5b610ec0826122d6565b60008060006060848603121561236757600080fd5b612370846122d6565b925061237e602085016122d6565b9150604084013590509250925092565b600080604083850312156123a157600080fd5b6123aa836122d6565b946020939093013593505050565b600080600080606085870312156123ce57600080fd5b6123d7856122d6565b935060208501359250604085013567ffffffffffffffff808211156123fb57600080fd5b818701915087601f83011261240f57600080fd5b81358181111561241e57600080fd5b88602082850101111561243057600080fd5b95989497505060200194505050565b6000806000806000806060878903121561245857600080fd5b863567ffffffffffffffff8082111561247057600080fd5b61247c8a838b016122f2565b9098509650602089013591508082111561249557600080fd5b6124a18a838b016122f2565b909650945060408901359150808211156124ba57600080fd5b506124c789828a016122f2565b979a9699509497509295939492505050565b6000602082840312156124eb57600080fd5b81518015158114610ec057600080fd5b60006020828403121561250d57600080fd5b5035919050565b6000806040838503121561252757600080fd5b82359150612537602084016122d6565b90509250929050565b60006020828403121561255257600080fd5b81356001600160e01b031981168114610ec057600080fd5b60006020828403121561257c57600080fd5b5051919050565b6000806040838503121561259657600080fd5b50508035926020909101359150565b600082516125b7818460208701612726565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516125f9816017850160208801612726565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161262a816028840160208801612726565b01602801949350505050565b6020808252825182820181905260009190848201906040850190845b818110156126775783516001600160a01b031683529284019291840191600101612652565b50909695505050505050565b60208152600082518060208401526126a2816040850160208701612726565b601f01601f19169190910160400192915050565b600082198211156126c9576126c9612784565b500190565b6000826126eb57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561270a5761270a612784565b500290565b60008282101561272157612721612784565b500390565b60005b83811015612741578181015183820152602001612729565b8381111561164a5750506000910152565b60008161276157612761612784565b506000190190565b600060001982141561277d5761277d612784565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220fd91c7b821cad47e7c6a345bad34bdbee0ce08bd87187a259fb43ec7820555e064736f6c63430008060033

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

00000000000000000000000069539c1c678dfd26e626f109149b7cebdd5e476800000000000000000000000069fa0fee221ad11012bab0fdb45d444d3d2ce71c00000000000000000000000095cfa1f48fad82232772d3b1415ad4393517f3b5

-----Decoded View---------------
Arg [0] : _owner (address): 0x69539C1c678dFd26E626f109149b7cEBDd5E4768
Arg [1] : _token (address): 0x69fa0feE221AD11012BAb0FdB45d444D3D2Ce71c
Arg [2] : _sushiLpToken (address): 0x95cFa1f48faD82232772d3B1415Ad4393517F3b5

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000069539c1c678dfd26e626f109149b7cebdd5e4768
Arg [1] : 00000000000000000000000069fa0fee221ad11012bab0fdb45d444d3d2ce71c
Arg [2] : 00000000000000000000000095cfa1f48fad82232772d3b1415ad4393517f3b5


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.