Contract 0x57f939dd2083a7756efde6720a33de55a421de6d

Txn Hash Method
Block
From
To
Value [Txn Fee]
0xd4d9d08d6d85e1a2533bbd419a505c97c44472fa905ce743cf3be8f1968c7fb5Stake55757822022-11-15 18:12:1773 days 18 hrs ago0x7ea05fd70ccbb7c147a82a49a3bbecf12b7927d3 IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO2.955916760391 4,877.106587235
0x75940860fb1794f66a28fd59c0820cb992193320c609dba33e958ac09ff0e89bStake55736092022-11-15 14:46:1773 days 22 hrs ago0x7ea05fd70ccbb7c147a82a49a3bbecf12b7927d3 IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.2240892817910
0xf4677e11d34b6d4bc457a006df4412f1ae0ae9cb80e4b92ea2f50cd4066a5e02Exit53481662022-10-31 18:35:0388 days 18 hrs ago0x983cd18ed6d501e6e01285f2a06df0767fb7297f IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO2.9635301342320
0x3ca1574a1dd159d9fc8b637155f0adb2be86d513ac9652f0a057aa27c286b107Stake53479912022-10-31 18:18:2988 days 18 hrs ago0x983cd18ed6d501e6e01285f2a06df0767fb7297f IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.1398821570210
0x9701d21f97e0100e61c7ede29c56b1e9bd2de7b0132a462d8dd501c6daaa67f2Stake50099812022-10-09 13:09:18110 days 23 hrs ago0xa15ec956038877897a21b21a68a9349560188947 IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO2.9913799079460
0xf80e5240c71d8f8443406372ae0451a060001e57b938e6ecdf229dc9c323160cStake49492382022-10-05 13:16:07114 days 23 hrs ago0x2a9e4dda7140b509cefcf0c503c5fb87b1981c23 IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.138229617149 4,905.752687414
0xf30ed4005c134a26e67164206aa54f8d2c2c5313dce71c8aff891493b778e888Withdraw48805642022-10-01 1:01:13119 days 11 hrs ago0x94693cab64781863eb5ac40486bccef57ee75f75 IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.076336035910
0x87193b89bd62d4bcbdca1ca5803ec8b35007d560f2d0110853b29731c4d44ee4Withdraw45257242022-09-07 17:30:40142 days 19 hrs ago0xd1f82edd33326446d6ca156d7cec29e472b74f1e IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.087501508015 4,925.218875847
0x90aaf2de91793adca81183d7a61050e6bcd9c3cf1cd77903430ef9acdad64ac0Stake43370562022-08-26 8:46:19155 days 4 hrs ago0x00379e79624b95d73380adf633dcad235afba30b IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.011014054717 4,933.920924442
0xff37631eab23e37b04ba300a8aefc7efbcced8b0d5f4d4c596db95df7c28359aWithdraw42294622022-08-19 7:31:07162 days 5 hrs ago0xac5d139d8e2de4e5d2b9f0985b94b015cafd4a6b IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO2.992357343912 4,938.894004569
0x7a602055a87adb6a89cf82131cd9abd910503f88c7d85795dda6440f8b4c5bdaWithdraw41845122022-08-16 8:44:00165 days 4 hrs ago0x00379e79624b95d73380adf633dcad235afba30b IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.034941340333 4,940.969882022
0x5fbb4f0b57e830349f14a75197f0d6ba2c9be645216955d186e33350b2754122Stake41468912022-08-13 21:30:16167 days 15 hrs ago0xfcc01b6395dc474fa303ce21dc5e31781fb9fae5 IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.0155719299650
0x030eb84d936058e5e6d1985dd39413177361623cb846f6e084061dd4e9c150ceStake41210732022-08-12 4:50:09169 days 8 hrs ago0x620df634d4b354c08046d6aa745dcd7e1a32d8a1 IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.2891085841490
0x9811a2886fc866fce193569e6a0612c241ae32347895a09772ea5cea7939514cStake40702572022-08-08 20:43:44172 days 16 hrs ago0xac5d139d8e2de4e5d2b9f0985b94b015cafd4a6b IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.018676613243 4,946.185201544
0x3270d9f9ad0762a4916e8dfc8011886b856bfd4a55528904ed77f4c9c111ea0bStake39977122022-08-04 2:28:57177 days 10 hrs ago0x00379e79624b95d73380adf633dcad235afba30b IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.293727619538 4,949.490613431
0xb65eba4d41f2de31abc9a714feade70126f5201fa842f466a5037e29e6a0d27fWithdraw39923182022-08-03 17:58:55177 days 18 hrs ago0x5bc0b7e5dcc796ed3726eae727771dafc09e1284 IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.102868948952 4,949.733199154
0x001e93c696ad18576d9a8ca976898dab4b7285f9d73d009f9820081227a0edcdClaim Reward39328432022-07-30 19:54:27181 days 16 hrs ago0x5f6740f264b86cbb0ef3facd28ef65bed8c5fa26 IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO0.6498676752570
0x60c9347eb71848e1d12f026eb6f44cd76ecf1c720fbbee786113e34de5d19e6dClaim Reward38720362022-07-26 19:58:27185 days 16 hrs ago0x4a4f568479ed1584bb0d9c8d1c76792e688ee224 IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO0.284008371732 4,955.218908361
0x4cd2c1c4e3b6af5b97a9ec620ec2af03c7d3f6b32c6e83ae4b655033b4261cffWithdraw38720112022-07-26 19:56:06185 days 16 hrs ago0x4a4f568479ed1584bb0d9c8d1c76792e688ee224 IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.33576494583 4,955.220053166
0xd65b1b29ea804e17d383a4a9aa6662192539ad2b258cf24044b2cafc581799faWithdraw38600572022-07-26 1:04:42186 days 11 hrs ago0x7e447717fd71653702f4754a178a57547b089c15 IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.0432308218270
0x73a8dfcaf497bd4f856309d62c14d7c9cd3a73673b0a4fa89572396e8f465480Withdraw38494692022-07-25 8:22:37187 days 4 hrs ago0xd3f32d2f76e7b9eb2de07456205621a0d4834db1 IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.0643978867540
0xd6f8a65694598ff1063f651739f0e1ac0f7c54a71d2be9e1dd8238422158d786Withdraw38484182022-07-25 6:43:09187 days 6 hrs ago0x55c94cdd9fab62f44cff8a7aad2098589b408457 IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.1059890964660
0x96bc6fe9e786c8b9d91208e8ebd31c9d7e54b2a3d011467f2cf010f9c4848f07Withdraw38244322022-07-23 16:48:08188 days 20 hrs ago0x5e40807a6fa0fef16ab0343b4a9261e031856808 IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.0442395455030
0x8b781114a7f72038f45ce3bfd44764306a80af848a0cbe58e168de34f25f2a2cWithdraw38219432022-07-23 12:51:47188 days 23 hrs ago0xac5d139d8e2de4e5d2b9f0985b94b015cafd4a6b IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.045112023343 4,957.528040087
0x03950fdae618ad7394bde8f315ea3dd6ca978b0ad3ca09e8fb477e5616270c6aStake38077602022-07-22 14:26:46189 days 22 hrs ago0x7e447717fd71653702f4754a178a57547b089c15 IN  0x57f939dd2083a7756efde6720a33de55a421de6d0 CRO3.2361782961240
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
Boardroom

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 9 : Boardroom.sol
// SPDX-License-Identifier: MIT

pragma solidity >0.6.12;

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

import "./interfaces/IBasisAsset.sol";
import "./interfaces/ITreasury.sol";


contract Boardroom is Ownable {
    using SafeERC20 for IERC20;
    using Address for address;
    using SafeMath for uint256;

    mapping(uint256 => mapping(address => bool)) private _status;

    function checkSameOriginReentranted() internal view returns (bool) {
        return _status[block.number][tx.origin];
    }

    function checkSameSenderReentranted() internal view returns (bool) {
        return _status[block.number][msg.sender];
    }

    /* ========== DATA STRUCTURES ========== */

    struct Boardseat {
        uint256 lastSnapshotIndex;
        uint256 rewardEarned;
        uint256 epochTimerStart;
    }

    struct BoardroomSnapshot {
        uint256 time;
        uint256 rewardReceived;
        uint256 rewardPerShare;
    }

    /* ========== STATE VARIABLES ========== */

    IERC20 public _10SHARE;

    uint256 private _totalSupply;
    mapping(address => uint256) private _balances;

    // governance
    mapping(address => bool) public operators;

    // flags
    bool public initialized = false;

    IERC20 public _10MB;
    ITreasury public treasury;

    mapping(address => Boardseat) public directors;
    BoardroomSnapshot[] public boardHistory;

    uint256 public withdrawLockupEpochs;
    uint256 public rewardLockupEpochs;

    address public reserveFund;
    uint256 public withdrawFee;
    uint256 public stakeFee;

    /* ========== EVENTS ========== */

    event Initialized(address indexed executor, uint256 at);
    event Staked(address indexed user, uint256 amount);
    event Withdrawn(address indexed user, uint256 amount);
    event RewardPaid(address indexed user, uint256 reward);
    event RewardAdded(address indexed user, uint256 reward);

    /* ========== Modifiers =============== */

    modifier onlyOneBlock() {
        require(!checkSameOriginReentranted(), "ContractGuard: one block, one function");
        require(!checkSameSenderReentranted(), "ContractGuard: one block, one function");

        _;

        _status[block.number][tx.origin] = true;
        _status[block.number][msg.sender] = true;
    }

    modifier onlyOperator() {
        require(operators[msg.sender], "Caller is not operator");
        _;
    }

    modifier directorExists {
        require(balanceOf(msg.sender) > 0, "Boardroom: The director does not exist");
        _;
    }

    modifier updateReward(address director) {
        if (director != address(0)) {
            Boardseat memory seat = directors[director];
            seat.rewardEarned = earned(director);
            seat.lastSnapshotIndex = latestSnapshotIndex();
            directors[director] = seat;
        }
        _;
    }

    modifier notInitialized {
        require(!initialized, "Boardroom: already initialized");
        _;
    }

    /* ========== GOVERNANCE ========== */

    function initialize(
        IERC20 __10MB,
        IERC20 __10SHARE,
        ITreasury _treasury
    ) public notInitialized {
        operators[msg.sender] = true;

        _10MB = __10MB;
        _10SHARE = __10SHARE;
        treasury = _treasury;

        operators[address(treasury)] = true;

        stakeFee = 2;
        withdrawFee = 0;

        BoardroomSnapshot memory genesisSnapshot = BoardroomSnapshot({time : block.number, rewardReceived : 0, rewardPerShare : 0});
        boardHistory.push(genesisSnapshot);

        withdrawLockupEpochs = 6; // Lock for 6 epochs (48h) before release withdraw
        rewardLockupEpochs = 3; // Lock for 3 epochs (24h) before release claimReward

        initialized = true;
        emit Initialized(msg.sender, block.number);
    }

    function amIOperator() public view returns (bool) {
        if (operators[msg.sender])
            return true;
        return false;
    }

    function setOperator(address operator, bool isOperator) public onlyOwner {
        require(operator != address(0), "operator address cannot be 0 address");
        operators[operator] = isOperator;
    }

    function setLockUp(uint256 _withdrawLockupEpochs, uint256 _rewardLockupEpochs) external onlyOperator {
        require(_withdrawLockupEpochs >= _rewardLockupEpochs && _withdrawLockupEpochs <= 42, "_withdrawLockupEpochs: out of range"); // <= 2 week
        withdrawLockupEpochs = _withdrawLockupEpochs;
        rewardLockupEpochs = _rewardLockupEpochs;
    }

    function setReserveFund(address _reserveFund) external onlyOperator {
        require(_reserveFund != address(0), "reserveFund address cannot be 0 address");
        reserveFund = _reserveFund;
    }

    function setStakeFee(uint256 _stakeFee) external onlyOperator {
        require(_stakeFee <= 5, "Max stake fee is 5%");
        stakeFee = _stakeFee;
    }

    function setWithdrawFee(uint256 _withdrawFee) external onlyOperator {
        require(_withdrawFee <= 20, "Max withdraw fee is 20%");
        withdrawFee = _withdrawFee;
    }

    /* ========== VIEW FUNCTIONS ========== */

    // =========== Snapshot getters

    function totalSupply() public view returns (uint256) {
        return _totalSupply;
    }

    function balanceOf(address account) public view returns (uint256) {
        return _balances[account];
    }

    function latestSnapshotIndex() public view returns (uint256) {
        return boardHistory.length.sub(1);
    }

    function getLatestSnapshot() internal view returns (BoardroomSnapshot memory) {
        return boardHistory[latestSnapshotIndex()];
    }

    function getLastSnapshotIndexOf(address director) public view returns (uint256) {
        return directors[director].lastSnapshotIndex;
    }

    function getLastSnapshotOf(address director) internal view returns (BoardroomSnapshot memory) {
        return boardHistory[getLastSnapshotIndexOf(director)];
    }

    function canWithdraw(address director) external view returns (bool) {
        return directors[director].epochTimerStart.add(withdrawLockupEpochs) <= treasury.epoch();
    }

    function canClaimReward(address director) external view returns (bool) {
        return directors[director].epochTimerStart.add(rewardLockupEpochs) <= treasury.epoch();
    }

    function epoch() external view returns (uint256) {
        return treasury.epoch();
    }

    function nextEpochPoint() external view returns (uint256) {
        return treasury.nextEpochPoint();
    }

    function get10MBPrice() external view returns (uint256) {
        return treasury.get10MBPrice();
    }

    // =========== Director getters

    function rewardPerShare() public view returns (uint256) {
        return getLatestSnapshot().rewardPerShare;
    }

    function earned(address director) public view returns (uint256) {
        uint256 latestRPS = getLatestSnapshot().rewardPerShare;
        uint256 storedRPS = getLastSnapshotOf(director).rewardPerShare;

        return balanceOf(director).mul(latestRPS.sub(storedRPS)).div(1e18).add(directors[director].rewardEarned);
    }

    /* ========== MUTATIVE FUNCTIONS ========== */

    function stake(uint256 amount) public onlyOneBlock updateReward(msg.sender) {
        require(amount > 0, "Boardroom: Cannot stake 0");

        _10SHARE.safeTransferFrom(msg.sender, address(this), amount);
        if (stakeFee > 0) {
            uint256 feeAmount = amount.mul(stakeFee).div(100);
            _10SHARE.safeTransfer(reserveFund, feeAmount);
            amount = amount.sub(feeAmount);
        }
        _totalSupply = _totalSupply.add(amount);
        _balances[msg.sender] = _balances[msg.sender].add(amount);
        directors[msg.sender].epochTimerStart = treasury.epoch(); // reset timer

        emit Staked(msg.sender, amount);

        treasury.treasuryUpdates();
    }

    function withdraw(uint256 amount) public onlyOneBlock directorExists updateReward(msg.sender) {
        require(amount > 0, "Boardroom: Cannot withdraw 0");
        require(directors[msg.sender].epochTimerStart.add(withdrawLockupEpochs) <= treasury.epoch(), "Boardroom: still in withdraw lockup");

        claimReward();
        uint256 directorShare = _balances[msg.sender];
        require(directorShare >= amount, "Boardroom: withdraw request greater than staked amount");
        _totalSupply = _totalSupply.sub(amount);
        _balances[msg.sender] = directorShare.sub(amount);
        if (withdrawFee > 0) {
            uint256 feeAmount = amount.mul(withdrawFee).div(100);
            _10SHARE.safeTransfer(reserveFund, feeAmount);
            amount = amount.sub(feeAmount);
        }
        _10SHARE.safeTransfer(msg.sender, amount);
        
        emit Withdrawn(msg.sender, amount);

        treasury.treasuryUpdates();
    }

    function exit() external {
        withdraw(balanceOf(msg.sender));
    }

    function claimReward() public updateReward(msg.sender) {
        uint256 reward = directors[msg.sender].rewardEarned;
        if (reward > 0) {
            require(directors[msg.sender].epochTimerStart.add(rewardLockupEpochs) <= treasury.epoch(), "Boardroom: still in reward lockup");
            directors[msg.sender].epochTimerStart = treasury.epoch(); // reset timer
            directors[msg.sender].rewardEarned = 0;
            _10MB.safeTransfer(msg.sender, reward);
            emit RewardPaid(msg.sender, reward);
        }
    }

    function allocateSeigniorage(uint256 amount) external onlyOperator {
        //require(!checkSameOriginReentranted(), "ContractGuard: one block, one function");
        require(!checkSameSenderReentranted(), "ContractGuard: one block, one function");
        require(amount > 0, "Boardroom: Cannot allocate 0");
        require(totalSupply() > 0, "Boardroom: Cannot allocate when totalSupply is 0");

        // Create & add new snapshot
        uint256 prevRPS = getLatestSnapshot().rewardPerShare;
        uint256 nextRPS = prevRPS.add(amount.mul(1e18).div(totalSupply()));

        BoardroomSnapshot memory newSnapshot = BoardroomSnapshot({
            time: block.number,
            rewardReceived: amount,
            rewardPerShare: nextRPS
        });

        boardHistory.push(newSnapshot);

        _10MB.safeTransferFrom(msg.sender, address(this), amount);
        emit RewardAdded(msg.sender, amount);

        _status[block.number][tx.origin] = true;
        _status[block.number][msg.sender] = true;
    }

    function governanceRecoverUnsupported(IERC20 _token, uint256 _amount, address _to) external onlyOperator {
        // do not allow to drain core tokens
        require(address(_token) != address(_10MB), "_10MB");
        require(address(_token) != address(_10SHARE), "_10SHARE");
        _token.safeTransfer(_to, _amount);
    }
}

File 2 of 9 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

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

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

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

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

    /**
     * @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 9 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

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

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

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

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

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

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 4 of 9 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

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 5 of 9 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 6 of 9 : IBasisAsset.sol
pragma solidity >0.6.12;

interface IBasisAsset {
    function mint(address recipient, uint256 amount) external;

    function burn(uint256 amount) external;

    function burnFrom(address from, uint256 amount) external;

    function isOperator() external returns (bool);

    function amIOperator() external view returns (bool);

    function transferOperator(address newOperator_) external;
}

File 7 of 9 : ITreasury.sol
// SPDX-License-Identifier: MIT

pragma solidity >0.6.12;

interface ITreasury {
    function epoch() external view returns (uint256);

    function startTime() external view returns (uint256);

    function nextEpochPoint() external view returns (uint256);

    function get10MBPrice() external view returns (uint256);

    function get10MBUpdatedPrice() external view returns (uint256);

    function buyBonds(uint256 amount, uint256 targetPrice) external;

    function redeemBonds(uint256 amount, uint256 targetPrice) external;

    function treasuryUpdates() external;

    function _update10MBPrice() external;

    function _update10SHAREPrice() external;

    function refreshCollateralRatio() external;

    function allocateSeigniorage() external;

    function hasPool(address _address) external view returns (bool);

    function info()
        external
        view
        returns (
            uint256,
            uint256,
            uint256,
            uint256,
            uint256,
            uint256,
            uint256,
            uint256
        );

    function epochInfo()
        external
        view
        returns (
            uint256,
            uint256,
            uint256,
            uint256
        );
}

File 8 of 9 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // 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 9 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

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

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"executor","type":"address"},{"indexed":false,"internalType":"uint256","name":"at","type":"uint256"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"_10MB","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_10SHARE","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"allocateSeigniorage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"amIOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"boardHistory","outputs":[{"internalType":"uint256","name":"time","type":"uint256"},{"internalType":"uint256","name":"rewardReceived","type":"uint256"},{"internalType":"uint256","name":"rewardPerShare","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"director","type":"address"}],"name":"canClaimReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"director","type":"address"}],"name":"canWithdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"directors","outputs":[{"internalType":"uint256","name":"lastSnapshotIndex","type":"uint256"},{"internalType":"uint256","name":"rewardEarned","type":"uint256"},{"internalType":"uint256","name":"epochTimerStart","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"director","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"get10MBPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"director","type":"address"}],"name":"getLastSnapshotIndexOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"governanceRecoverUnsupported","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"__10MB","type":"address"},{"internalType":"contract IERC20","name":"__10SHARE","type":"address"},{"internalType":"contract ITreasury","name":"_treasury","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestSnapshotIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextEpochPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"operators","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reserveFund","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardLockupEpochs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_withdrawLockupEpochs","type":"uint256"},{"internalType":"uint256","name":"_rewardLockupEpochs","type":"uint256"}],"name":"setLockUp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"isOperator","type":"bool"}],"name":"setOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_reserveFund","type":"address"}],"name":"setReserveFund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_stakeFee","type":"uint256"}],"name":"setStakeFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_withdrawFee","type":"uint256"}],"name":"setWithdrawFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakeFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"contract ITreasury","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawLockupEpochs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60806040526006805460ff1916905534801561001a57600080fd5b5061002433610029565b610079565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b612420806100886000396000f3fe608060405234801561001057600080fd5b506004361061023c5760003560e01c8063715018a61161013b578063c0c53b8b116100b8578063e9fad8ee1161007c578063e9fad8ee146104b2578063f0ec9430146104ba578063f2fde38b14610504578063f498d8a614610517578063fd147b7f1461052a57600080fd5b8063c0c53b8b14610473578063c5967c2614610486578063e2d7bee41461048e578063e5c204d2146104a1578063e941fa78146104a957600080fd5b806397ffe1d7116100ff57806397ffe1d71461041f578063a694fc3a14610432578063b6ac642a14610445578063b7f92b7114610458578063b88a802f1461046b57600080fd5b8063715018a6146103d357806385f851f2146103db5780638da5cb5b146103ee578063900cf0cf146103ff57806391e203691461040757600080fd5b80632e1a7d4d116101c957806354575af41161018d57806354575af414610330578063558a72971461034357806361d027b31461035657806370a0823114610381578063714b4658146103aa57600080fd5b80632e1a7d4d146102f05780632ffaaa091461030557806330e37a91146103185780633f9e3f0414610320578063446a2ec81461032857600080fd5b8063158ef93e11610210578063158ef93e146102b657806318160ddd146102c357806319262d30146102cb5780631e85cd65146102de578063222c9777146102e757600080fd5b80628cc26214610241578063022ba18d14610267578063046335d01461027057806313e7c9d814610293575b600080fd5b61025461024f3660046120dc565b61053d565b6040519081526020015b60405180910390f35b610254600b5481565b61028361027e3660046120dc565b6105ce565b604051901515815260200161025e565b6102836102a13660046120dc565b60056020526000908152604090205460ff1681565b6006546102839060ff1681565b600354610254565b6102836102d93660046120dc565b61067b565b610254600a5481565b610254600e5481565b6103036102fe3660046121cc565b610720565b005b6103036103133660046121fc565b610bdc565b610283610c7f565b610254610ca3565b610254610cb9565b61030361033e366004612196565b610ccc565b6103036103513660046120f8565b610da8565b600754610369906001600160a01b031681565b6040516001600160a01b03909116815260200161025e565b61025461038f3660046120dc565b6001600160a01b031660009081526004602052604090205490565b6102546103b83660046120dc565b6001600160a01b031660009081526008602052604090205490565b610303610e5f565b600254610369906001600160a01b031681565b6000546001600160a01b0316610369565b610254610e95565b6006546103699061010090046001600160a01b031681565b61030361042d3660046121cc565b610f12565b6103036104403660046121cc565b6111ad565b6103036104533660046121cc565b611518565b600c54610369906001600160a01b031681565b61030361159d565b61030361048136600461214c565b611841565b610254611a02565b61030361049c3660046121cc565b611a47565b610254611ac2565b610254600d5481565b610303611b07565b6104e96104c83660046120dc565b60086020526000908152604090208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161025e565b6103036105123660046120dc565b611b20565b6103036105253660046120dc565b611bbb565b6104e96105383660046121cc565b611c72565b600080610548611ca5565b604001519050600061055984611d2d565b6040908101516001600160a01b0386166000908152600860205291909120600101549091506105c6906105c0670de0b6b3a76400006105ba61059b8787611dce565b6001600160a01b038a1660009081526004602052604090205490611de1565b90611ded565b90611df9565b949350505050565b6007546040805163900cf0cf60e01b815290516000926001600160a01b03169163900cf0cf916004808301926020929190829003018186803b15801561061357600080fd5b505afa158015610627573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064b91906121e4565b600b546001600160a01b03841660009081526008602052604090206002015461067391611df9565b111592915050565b6007546040805163900cf0cf60e01b815290516000926001600160a01b03169163900cf0cf916004808301926020929190829003018186803b1580156106c057600080fd5b505afa1580156106d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f891906121e4565b600a546001600160a01b03841660009081526008602052604090206002015461067391611df9565b43600090815260016020908152604080832032845290915290205460ff16156107645760405162461bcd60e51b815260040161075b906122d1565b60405180910390fd5b43600090815260016020908152604080832033845290915290205460ff161561079f5760405162461bcd60e51b815260040161075b906122d1565b336000908152600460205260408120541161080b5760405162461bcd60e51b815260206004820152602660248201527f426f617264726f6f6d3a20546865206469726563746f7220646f6573206e6f7460448201526508195e1a5cdd60d21b606482015260840161075b565b33801561089c576001600160a01b038116600090815260086020908152604091829020825160608101845281548152600182015492810192909252600201549181019190915261085a8261053d565b6020820152610867610ca3565b81526001600160a01b038216600090815260086020908152604091829020835181559083015160018201559101516002909101555b600082116108ec5760405162461bcd60e51b815260206004820152601c60248201527f426f617264726f6f6d3a2043616e6e6f74207769746864726177203000000000604482015260640161075b565b600760009054906101000a90046001600160a01b03166001600160a01b031663900cf0cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561093a57600080fd5b505afa15801561094e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097291906121e4565b600a543360009081526008602052604090206002015461099191611df9565b11156109eb5760405162461bcd60e51b815260206004820152602360248201527f426f617264726f6f6d3a207374696c6c20696e207769746864726177206c6f6360448201526206b75760ec1b606482015260840161075b565b6109f361159d565b3360009081526004602052604090205482811015610a725760405162461bcd60e51b815260206004820152603660248201527f426f617264726f6f6d3a207769746864726177207265717565737420677265616044820152751d195c881d1a185b881cdd185ad95908185b5bdd5b9d60521b606482015260840161075b565b600354610a7f9084611dce565b600355610a8c8184611dce565b33600090815260046020526040902055600d5415610aee576000610ac060646105ba600d5487611de190919063ffffffff16565b600c54600254919250610ae0916001600160a01b03908116911683611e05565b610aea8482611dce565b9350505b600254610b05906001600160a01b03163385611e05565b60405183815233907f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d59060200160405180910390a2600760009054906101000a90046001600160a01b03166001600160a01b031663af44f7246040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b8a57600080fd5b505af1158015610b9e573d6000803e3d6000fd5b5050436000908152600160208181526040808420328552909152808320805460ff199081168417909155338452922080549092161790555050505050565b3360009081526005602052604090205460ff16610c0b5760405162461bcd60e51b815260040161075b906122a1565b808210158015610c1c5750602a8211155b610c745760405162461bcd60e51b815260206004820152602360248201527f5f77697468647261774c6f636b757045706f6368733a206f7574206f662072616044820152626e676560e81b606482015260840161075b565b600a91909155600b55565b3360009081526005602052604081205460ff1615610c9d5750600190565b50600090565b600954600090610cb4906001611dce565b905090565b6000610cc3611ca5565b60400151905090565b3360009081526005602052604090205460ff16610cfb5760405162461bcd60e51b815260040161075b906122a1565b6006546001600160a01b03848116610100909204161415610d465760405162461bcd60e51b81526020600482015260056024820152642f989826a160d91b604482015260640161075b565b6002546001600160a01b0384811691161415610d8f5760405162461bcd60e51b81526020600482015260086024820152675f3130534841524560c01b604482015260640161075b565b610da36001600160a01b0384168284611e05565b505050565b6000546001600160a01b03163314610dd25760405162461bcd60e51b815260040161075b9061226c565b6001600160a01b038216610e345760405162461bcd60e51b8152602060048201526024808201527f6f70657261746f7220616464726573732063616e6e6f742062652030206164646044820152637265737360e01b606482015260840161075b565b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b6000546001600160a01b03163314610e895760405162461bcd60e51b815260040161075b9061226c565b610e936000611e68565b565b6007546040805163900cf0cf60e01b815290516000926001600160a01b03169163900cf0cf916004808301926020929190829003018186803b158015610eda57600080fd5b505afa158015610eee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb491906121e4565b3360009081526005602052604090205460ff16610f415760405162461bcd60e51b815260040161075b906122a1565b43600090815260016020908152604080832033845290915290205460ff1615610f7c5760405162461bcd60e51b815260040161075b906122d1565b60008111610fcc5760405162461bcd60e51b815260206004820152601c60248201527f426f617264726f6f6d3a2043616e6e6f7420616c6c6f63617465203000000000604482015260640161075b565b6000610fd760035490565b1161103d5760405162461bcd60e51b815260206004820152603060248201527f426f617264726f6f6d3a2043616e6e6f7420616c6c6f63617465207768656e2060448201526f0746f74616c537570706c7920697320360841b606482015260840161075b565b6000611047611ca5565b604001519050600061107761107061105e60035490565b6105ba86670de0b6b3a7640000611de1565b8390611df9565b60408051606081018252438152602081018681529181018381526009805460018101825560009190915282517f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af60039092029182015592517f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7b0840155517f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7b1909201919091556006549192509061113d9061010090046001600160a01b0316333087611eb8565b60405184815233907fac24935fd910bc682b5ccb1a07b718cadf8cf2f6d1404c4f3ddc3662dae40e299060200160405180910390a25050436000908152600160208181526040808420328552909152808320805460ff199081168417909155338452922080549092161790555050565b43600090815260016020908152604080832032845290915290205460ff16156111e85760405162461bcd60e51b815260040161075b906122d1565b43600090815260016020908152604080832033845290915290205460ff16156112235760405162461bcd60e51b815260040161075b906122d1565b3380156112b4576001600160a01b03811660009081526008602090815260409182902082516060810184528154815260018201549281019290925260020154918101919091526112728261053d565b602082015261127f610ca3565b81526001600160a01b038216600090815260086020908152604091829020835181559083015160018201559101516002909101555b600082116113045760405162461bcd60e51b815260206004820152601960248201527f426f617264726f6f6d3a2043616e6e6f74207374616b65203000000000000000604482015260640161075b565b60025461131c906001600160a01b0316333085611eb8565b600e541561136e57600061134060646105ba600e5486611de190919063ffffffff16565b600c54600254919250611360916001600160a01b03908116911683611e05565b61136a8382611dce565b9250505b60035461137b9083611df9565b600355336000908152600460205260409020546113989083611df9565b3360009081526004602081815260409283902093909355600754825163900cf0cf60e01b815292516001600160a01b039091169363900cf0cf938084019391929190829003018186803b1580156113ee57600080fd5b505afa158015611402573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061142691906121e4565b33600081815260086020526040908190206002019290925590517f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d9061146f9085815260200190565b60405180910390a2600760009054906101000a90046001600160a01b03166001600160a01b031663af44f7246040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156114c757600080fd5b505af11580156114db573d6000803e3d6000fd5b5050436000908152600160208181526040808420328552909152808320805460ff1990811684179091553384529220805490921617905550505050565b3360009081526005602052604090205460ff166115475760405162461bcd60e51b815260040161075b906122a1565b60148111156115985760405162461bcd60e51b815260206004820152601760248201527f4d61782077697468647261772066656520697320323025000000000000000000604482015260640161075b565b600d55565b33801561162e576001600160a01b03811660009081526008602090815260409182902082516060810184528154815260018201549281019290925260020154918101919091526115ec8261053d565b60208201526115f9610ca3565b81526001600160a01b038216600090815260086020908152604091829020835181559083015160018201559101516002909101555b33600090815260086020526040902060010154801561183d57600760009054906101000a90046001600160a01b03166001600160a01b031663900cf0cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561169557600080fd5b505afa1580156116a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116cd91906121e4565b600b54336000908152600860205260409020600201546116ec91611df9565b11156117445760405162461bcd60e51b815260206004820152602160248201527f426f617264726f6f6d3a207374696c6c20696e20726577617264206c6f636b756044820152600760fc1b606482015260840161075b565b600760009054906101000a90046001600160a01b03166001600160a01b031663900cf0cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561179257600080fd5b505afa1580156117a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ca91906121e4565b3360008181526008602052604081206002810193909355600190920191909155600654611807916101009091046001600160a01b03169083611e05565b60405181815233907fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e04869060200160405180910390a25b5050565b60065460ff16156118945760405162461bcd60e51b815260206004820152601e60248201527f426f617264726f6f6d3a20616c726561647920696e697469616c697a65640000604482015260640161075b565b336000818152600560209081526040808320805460ff199081166001908117909255600680546001600160a01b038b811661010002610100600160a81b0319909216919091178255600280548b83166001600160a01b031991821617825560078054938c1693909116831790559087528487208054841685179055600e55600d8690558351606081018552438082528187018881528287018981526009805480890182559a52835160039a8b027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af81019190915591517f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7b0830155517f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7b190910155600a839055600b979097558154909216909217909155905192835292917f25ff68dd81b34665b5ba7e553ee5511bf6812e12adb4a7e2c0d9e26b3099ce79910160405180910390a250505050565b600754604080516362cb3e1360e11b815290516000926001600160a01b03169163c5967c26916004808301926020929190829003018186803b158015610eda57600080fd5b3360009081526005602052604090205460ff16611a765760405162461bcd60e51b815260040161075b906122a1565b6005811115611abd5760405162461bcd60e51b81526020600482015260136024820152724d6178207374616b652066656520697320352560681b604482015260640161075b565b600e55565b600754604080516372e1026960e11b815290516000926001600160a01b03169163e5c204d2916004808301926020929190829003018186803b158015610eda57600080fd5b33600090815260046020526040902054610e9390610720565b6000546001600160a01b03163314611b4a5760405162461bcd60e51b815260040161075b9061226c565b6001600160a01b038116611baf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161075b565b611bb881611e68565b50565b3360009081526005602052604090205460ff16611bea5760405162461bcd60e51b815260040161075b906122a1565b6001600160a01b038116611c505760405162461bcd60e51b815260206004820152602760248201527f7265736572766546756e6420616464726573732063616e6e6f742062652030206044820152666164647265737360c81b606482015260840161075b565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b60098181548110611c8257600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b611cc960405180606001604052806000815260200160008152602001600081525090565b6009611cd3610ca3565b81548110611cf157634e487b7160e01b600052603260045260246000fd5b90600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050905090565b611d5160405180606001604052806000815260200160008152602001600081525090565b6009611d72836001600160a01b031660009081526008602052604090205490565b81548110611d9057634e487b7160e01b600052603260045260246000fd5b906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820154815250509050919050565b6000611dda828461236e565b9392505050565b6000611dda828461234f565b6000611dda828461232f565b6000611dda8284612317565b6040516001600160a01b038316602482015260448101829052610da390849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611ef6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b0380851660248301528316604482015260648101829052611ef09085906323b872dd60e01b90608401611e31565b50505050565b6000611f4b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611fc89092919063ffffffff16565b805190915015610da35780806020019051810190611f699190612130565b610da35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161075b565b60606105c68484600085856001600160a01b0385163b61202a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161075b565b600080866001600160a01b03168587604051612046919061221d565b60006040518083038185875af1925050503d8060008114612083576040519150601f19603f3d011682016040523d82523d6000602084013e612088565b606091505b50915091506120988282866120a3565b979650505050505050565b606083156120b2575081611dda565b8251156120c25782518084602001fd5b8160405162461bcd60e51b815260040161075b9190612239565b6000602082840312156120ed578081fd5b8135611dda816123c7565b6000806040838503121561210a578081fd5b8235612115816123c7565b91506020830135612125816123dc565b809150509250929050565b600060208284031215612141578081fd5b8151611dda816123dc565b600080600060608486031215612160578081fd5b833561216b816123c7565b9250602084013561217b816123c7565b9150604084013561218b816123c7565b809150509250925092565b6000806000606084860312156121aa578283fd5b83356121b5816123c7565b925060208401359150604084013561218b816123c7565b6000602082840312156121dd578081fd5b5035919050565b6000602082840312156121f5578081fd5b5051919050565b6000806040838503121561220e578182fd5b50508035926020909101359150565b6000825161222f818460208701612385565b9190910192915050565b6020815260008251806020840152612258816040850160208701612385565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526016908201527521b0b63632b91034b9903737ba1037b832b930ba37b960511b604082015260600190565b60208082526026908201527f436f6e747261637447756172643a206f6e6520626c6f636b2c206f6e652066756040820152653731ba34b7b760d11b606082015260800190565b6000821982111561232a5761232a6123b1565b500190565b60008261234a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612369576123696123b1565b500290565b600082821015612380576123806123b1565b500390565b60005b838110156123a0578181015183820152602001612388565b83811115611ef05750506000910152565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114611bb857600080fd5b8015158114611bb857600080fdfea2646970667358221220af85eaa8b6c31dd63e576bf3f698e358aee7676a80ea4f4e55253532dfd8075164736f6c63430008040033

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