CRO Price: $0.09 (-1.86%)

Contract

0x5d003Ee4beAe948CfcB35F29bf4551874B887803

Overview

CRO Balance

Cronos Chain LogoCronos Chain LogoCronos Chain Logo0 CRO

CRO Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Deposit191668842025-04-22 23:19:4616 hrs ago1745363986IN
0x5d003Ee4...74B887803
0 CRO0.749118263,787.5
Withdraw191637802025-04-22 18:27:1020 hrs ago1745346430IN
0x5d003Ee4...74B887803
0 CRO0.441914133,787.5
Deposit191340152025-04-20 19:43:222 days ago1745178202IN
0x5d003Ee4...74B887803
0 CRO0.311646863,787.5
Deposit191200382025-04-19 21:49:383 days ago1745099378IN
0x5d003Ee4...74B887803
0 CRO0.597167553,787.5
Withdraw190743472025-04-16 22:08:016 days ago1744841281IN
0x5d003Ee4...74B887803
0 CRO0.525678483,787.5
Deposit190560622025-04-15 17:24:487 days ago1744737888IN
0x5d003Ee4...74B887803
0 CRO0.73725963,787.5
Withdraw190514072025-04-15 10:06:108 days ago1744711570IN
0x5d003Ee4...74B887803
0 CRO0.35217693,787.5
Withdraw190031232025-04-12 6:30:0811 days ago1744439408IN
0x5d003Ee4...74B887803
0 CRO0.469899973,787.5
Deposit189978532025-04-11 22:14:0911 days ago1744409649IN
0x5d003Ee4...74B887803
0 CRO0.311646863,787.5
Deposit189978352025-04-11 22:12:2611 days ago1744409546IN
0x5d003Ee4...74B887803
0 CRO0.378806813,787.5
Deposit189978312025-04-11 22:12:0311 days ago1744409523IN
0x5d003Ee4...74B887803
0 CRO0.311646863,787.5
Deposit189974822025-04-11 21:39:0911 days ago1744407549IN
0x5d003Ee4...74B887803
0 CRO0.737395953,787.5
Withdraw189967642025-04-11 20:31:2911 days ago1744403489IN
0x5d003Ee4...74B887803
0 CRO0.469854523,787.5
Withdraw189925862025-04-11 13:57:1812 days ago1744379838IN
0x5d003Ee4...74B887803
0 CRO0.47037723,787.5
Deposit189846562025-04-11 1:29:4312 days ago1744334983IN
0x5d003Ee4...74B887803
0 CRO0.378806813,787.5
Deposit189844342025-04-11 1:08:4912 days ago1744333729IN
0x5d003Ee4...74B887803
0 CRO0.597258453,787.5
Withdraw189783002025-04-10 15:31:1112 days ago1744299071IN
0x5d003Ee4...74B887803
0 CRO0.535143453,787.5
Deposit189762752025-04-10 12:20:2613 days ago1744287626IN
0x5d003Ee4...74B887803
0 CRO0.737395953,787.5
Deposit189745512025-04-10 9:38:1313 days ago1744277893IN
0x5d003Ee4...74B887803
0 CRO0.737395953,787.5
Withdraw189679072025-04-09 23:13:4713 days ago1744240427IN
0x5d003Ee4...74B887803
0 CRO0.525814833,787.5
Deposit189678712025-04-09 23:10:2413 days ago1744240224IN
0x5d003Ee4...74B887803
0 CRO0.378852263,787.5
Deposit189675262025-04-09 22:37:5913 days ago1744238279IN
0x5d003Ee4...74B887803
0 CRO0.378806813,787.5
Deposit189675182025-04-09 22:37:1713 days ago1744238237IN
0x5d003Ee4...74B887803
0 CRO0.311646863,787.5
Deposit189638642025-04-09 16:53:4513 days ago1744217625IN
0x5d003Ee4...74B887803
0 CRO0.737395953,787.5
Deposit189625642025-04-09 14:51:4014 days ago1744210300IN
0x5d003Ee4...74B887803
0 CRO0.378806813,787.5
View all transactions

Latest 1 internal transaction

Parent Transaction Hash Block From To
189150812025-04-06 12:23:1117 days ago1743942191  Contract Creation0 CRO
Loading...
Loading

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

Contract Name:
SmartChefInitializable

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
paris EvmVersion
File 1 of 15 : SmartChefInitializable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;
pragma abicoder v2;

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

/**
 * @title SmartChefInitializable
 * @notice A staking contract that allows users to stake tokens and earn rewards over time
 * @dev Implements role-based access control for enhanced security and delegation of admin functions
 */
contract SmartChefInitializable is Ownable, ReentrancyGuard, AccessControl {
    using SafeERC20 for IERC20Metadata;

    // Role definitions
    bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE");

    // Immutable factory address
    address public immutable SMART_CHEF_FACTORY;

    // Staker tracking
    address[] public stakerAddresses;

    // Contract state flags
    bool public userLimit;
    bool public isInitialized;
    bool public useInitialLockPeriod;

    // Reward calculation variables
    uint256 public accTokenPerShare;
    uint256 public bonusEndBlock;
    uint256 public startBlock;
    uint256 public lastRewardBlock;
    uint256 public poolLimitPerUser;
    uint256 public numberBlocksForUserLimit;
    uint256 public rewardPerBlock;
    uint256 public PRECISION_FACTOR;
    uint256 public minStakingPeriod;

    // Token contracts
    IERC20Metadata public rewardToken;
    IERC20Metadata public stakedToken;

    // Total amount of staked tokens
    uint256 public stakedTokenAmount;

    /**
     * @notice Structure to track user staking information
     */
    struct UserInfo {
        uint256 amount;            // Amount of staked tokens
        uint256 rewardDebt;        // Reward debt for reward calculation
        address staker;            // Address of the staker
        uint256 depositTimestamp;  // Timestamp of the latest deposit
    }

    // Mapping of user address to their staking information
    mapping(address => UserInfo) public userInfo;

    // Events
    event Deposit(address indexed user, uint256 amount);
    event EmergencyWithdraw(address indexed user, uint256 amount);
    event NewStartAndEndBlocks(uint256 startBlock, uint256 endBlock);
    event BonusEndBlockExtended(uint256 endBlock);
    event NewRewardPerBlock(uint256 rewardPerBlock);
    event NewPoolLimit(uint256 poolLimitPerUser);
    event RewardsStop(uint256 blockNumber);
    event TokenRecovery(address indexed token, uint256 amount);
    event Withdraw(address indexed user, uint256 amount);
    event MinStakingPeriodUpdated(uint256 newMinStakingPeriod);
    event LockPeriodBehaviorUpdated(bool useInitialLockPeriod);
    event RewardRateUpdated(uint256 oldRate, uint256 newRate);
    event ManagerUpdated(address indexed newManager);

    /**
     * @notice Constructor sets the factory address and initial admin role
     */
    constructor() {
        SMART_CHEF_FACTORY = msg.sender;
        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
    }

    /**
     * @notice Modifier to restrict functions to manager role
     */
    modifier onlyManager() {
        require(hasRole(MANAGER_ROLE, msg.sender), "Caller is not a manager");
        _;
    }

    /**
     * @notice Initializes the staking contract with initial parameters
     * @param _stakedToken Token that users will stake
     * @param _rewardToken Token that users will earn as rewards
     * @param _rewardPerBlock Reward tokens distributed per block
     * @param _startBlock Block number when rewards start
     * @param _bonusEndBlock Block number when rewards end
     * @param _poolLimitPerUser Maximum amount a user can stake (0 if no limit)
     * @param _numberBlocksForUserLimit Duration of user limit in blocks
     * @param _minStakingPeriod Minimum staking period in days
     * @param _useInitialLockPeriod Whether to use initial deposit timestamp for lock
     * @param _admin Address that will have admin role
     * @param _manager Address that will have manager role
     */
    function initialize(
        IERC20Metadata _stakedToken,
        IERC20Metadata _rewardToken,
        uint256 _rewardPerBlock,
        uint256 _startBlock,
        uint256 _bonusEndBlock,
        uint256 _poolLimitPerUser,
        uint256 _numberBlocksForUserLimit,
        uint256 _minStakingPeriod,
        bool _useInitialLockPeriod,
        address _admin,
        address _manager
    ) external {
        require(!isInitialized, "Already initialized");
        require(msg.sender == SMART_CHEF_FACTORY, "Not factory");
        require(_startBlock < _bonusEndBlock, "Invalid block range");
        require(_admin != address(0), "Invalid admin address");
        require(_manager != address(0), "Invalid manager address");

        // Initialize basic parameters
        isInitialized = true;
        stakedToken = _stakedToken;
        rewardToken = _rewardToken;
        rewardPerBlock = _rewardPerBlock;
        startBlock = _startBlock;
        bonusEndBlock = _bonusEndBlock;
        minStakingPeriod = _minStakingPeriod;
        useInitialLockPeriod = _useInitialLockPeriod;

        // Set up pool limits if specified
        if (_poolLimitPerUser > 0) {
            userLimit = true;
            poolLimitPerUser = _poolLimitPerUser;
            numberBlocksForUserLimit = _numberBlocksForUserLimit;
        }

        // Calculate precision factor based on reward token decimals
        uint256 decimalsRewardToken = uint256(rewardToken.decimals());
        require(decimalsRewardToken < 30, "Must be inferior to 30");
        PRECISION_FACTOR = uint256(10 ** (uint256(30) - decimalsRewardToken));

        // Set initial reward block
        lastRewardBlock = startBlock;

        // Set up roles and ownership
        _setupRole(DEFAULT_ADMIN_ROLE, _admin);
        _setupRole(MANAGER_ROLE, _manager);
        transferOwnership(_admin);
    }
    /*
     * @notice Update minimum staking period
     * @dev Only callable by manager
     * @param _minStakingPeriod: new minimum staking period in days (0 to disable)
     */
    function updateMinStakingPeriod(uint256 _minStakingPeriod) external onlyManager {
        minStakingPeriod = _minStakingPeriod;
        emit MinStakingPeriodUpdated(_minStakingPeriod);
    }

    function updateLockPeriodBehavior(bool _useInitialLockPeriod) external onlyManager {
        useInitialLockPeriod = _useInitialLockPeriod;
        emit LockPeriodBehaviorUpdated(_useInitialLockPeriod);
    }
    /*
    * @notice Check if user can withdraw based on minimum staking period and pool end
    * @param _user: user address
    */
    function canWithdraw(address _user) public view returns (bool) {
        if (minStakingPeriod == 0) return true;
        
        UserInfo storage user = userInfo[_user];
        if (user.amount == 0) return true;
        
        // Allow withdrawal if pool has ended, regardless of staking period     
        if (block.number >= bonusEndBlock) return true;
        
        return (block.timestamp >= user.depositTimestamp + (minStakingPeriod * 1 days));
    }

    // Function to get all stakers and their amounts
    function getStakers() external view returns (UserInfo[] memory) {
        UserInfo[] memory stakersInfo = new UserInfo[](stakerAddresses.length);
        
        for (uint256 i = 0; i < stakerAddresses.length; i++) {
            address stakerAddress = stakerAddresses[i];
            stakersInfo[i] = userInfo[stakerAddress];
        }
        
        return stakersInfo;
    }
    /*
     * @notice Deposit staked tokens and collect reward tokens (if any)
     * @param _amount: amount to withdraw (in rewardToken)
     */
    function deposit(uint256 _amount) external nonReentrant {
        UserInfo storage user = userInfo[msg.sender];
        bool isNewStaker = user.amount == 0 && _amount > 0;

        userLimit = hasUserLimit();
        require(!userLimit || ((_amount + user.amount) <= poolLimitPerUser), "Deposit: Amount above limit");

        _updatePool();

        if (user.amount > 0) {
            uint256 pending = (user.amount * accTokenPerShare) / PRECISION_FACTOR - user.rewardDebt;
            if (pending > 0) {
                _withdrawRewardToken(pending);
            }
        }

        if (_amount > 0) {
            user.amount = user.amount + _depositStakedToken(_amount);
            user.staker = msg.sender;
            
            // Update deposit timestamp based on owner-configured behavior
            if (isNewStaker || !useInitialLockPeriod) {
                user.depositTimestamp = block.timestamp;
            }
            
            if (isNewStaker) {
                stakerAddresses.push(msg.sender);
            }
        }

        user.rewardDebt = (user.amount * accTokenPerShare) / PRECISION_FACTOR;

        emit Deposit(msg.sender, _amount);
    }
    /*
     * @notice Withdraw staked tokens and collect reward tokens
     * @param _amount: amount to withdraw (in rewardToken)
     */
    function withdraw(uint256 _amount) external nonReentrant {
        UserInfo storage user = userInfo[msg.sender];
        require(user.amount >= _amount, "Amount to withdraw too high");
        require(canWithdraw(msg.sender), "Minimum staking period not met");

        _updatePool();

        uint256 pending = (user.amount * accTokenPerShare) / PRECISION_FACTOR - user.rewardDebt;

        if (_amount > 0) {
            user.amount = user.amount - _amount;
            _withdrawStakedToken(_amount);
            // Remove staker from array if fully withdrawn      
            if (user.amount == 0) {
                for (uint256 i = 0; i < stakerAddresses.length; i++) {
                    if (stakerAddresses[i] == msg.sender) {
                        stakerAddresses[i] = stakerAddresses[stakerAddresses.length - 1];
                        stakerAddresses.pop();
                        break;
                    }
                }
            }
        }

        if (pending > 0) {
            _withdrawRewardToken(pending);
        }

        user.rewardDebt = (user.amount * accTokenPerShare) / PRECISION_FACTOR;

        emit Withdraw(msg.sender, _amount);
    }
    /*
     * @notice Withdraw staked tokens without caring about rewards rewards
     * @dev Needs to be for emergency.
     */
    function emergencyWithdraw() external nonReentrant {
        UserInfo storage user = userInfo[msg.sender];
        uint256 amountToTransfer = user.amount;
        user.amount = 0;
        user.rewardDebt = 0;

        if (amountToTransfer > 0) {
            _withdrawStakedToken(amountToTransfer);
        }

        emit EmergencyWithdraw(msg.sender, user.amount);
    }
    /*
     * @notice Stop rewards
     * @dev Only callable by owner. Needs to be for emergency.
     */
    function emergencyRewardWithdraw(uint256 _amount) external onlyOwner {
        _withdrawRewardToken(_amount);
    }
    /**
     * @notice Allows the owner to recover tokens sent to the contract by mistake
     * @param _token: token address
     * @dev Callable by owner
     */
    function recoverToken(address _token) external onlyOwner {
        require(_token != address(rewardToken), "Operations: Cannot recover reward token");

        uint256 balance = IERC20Metadata(_token).balanceOf(address(this));
        if (_token == address(stakedToken)) {
            balance = balance - stakedTokenAmount;
        }
        require(balance != 0, "Operations: Cannot recover zero balance");

        IERC20Metadata(_token).safeTransfer(address(msg.sender), balance);

        emit TokenRecovery(_token, balance);
    }
    /*
     * @notice Stop rewards
     * @dev Only callable by owner
     */
    function stopReward() external onlyOwner {
        bonusEndBlock = block.number;
    }
    /*
     * @notice Update pool limit per user
     * @dev Only callable by owner.
     * @param _userLimit: whether the limit remains forced
     * @param _poolLimitPerUser: new pool limit per user
     */
    function updatePoolLimitPerUser(bool _userLimit, uint256 _poolLimitPerUser) external onlyManager {
        require(userLimit, "Must be set");
        if (_userLimit) {
            require(_poolLimitPerUser > poolLimitPerUser, "New limit must be higher");
            poolLimitPerUser = _poolLimitPerUser;
        } else {
            userLimit = _userLimit;
            poolLimitPerUser = 0;
        }
        emit NewPoolLimit(poolLimitPerUser);
    }
    /*
     * @notice Update reward per block
     * @dev Only callable by owner.
     * @param _rewardPerBlock: the reward per block
     */
    function updateRewardPerBlock(uint256 _rewardPerBlock) external onlyManager {
        _updatePool(); // Update with old rate first
        uint256 oldRate = rewardPerBlock;
        rewardPerBlock = _rewardPerBlock;
        emit RewardRateUpdated(oldRate, _rewardPerBlock);
    }
    /**
     * @notice It allows the manager to update start and end blocks
     * @dev This function is only callable by owner.
     * @param _startBlock: the new start block
     * @param _bonusEndBlock: the new end block
     */
    function updateStartAndEndBlocks(uint256 _startBlock, uint256 _bonusEndBlock) external onlyManager {
        require(block.number < startBlock, "Pool has started");
        require(_startBlock < _bonusEndBlock, "New startBlock must be lower than new endBlock");
        require(block.number < _startBlock, "New startBlock must be higher than current block");

        startBlock = _startBlock;
        bonusEndBlock = _bonusEndBlock;

        // Set the lastRewardBlock as the startBlock
        lastRewardBlock = startBlock;

        emit NewStartAndEndBlocks(_startBlock, _bonusEndBlock);
    }
    /**
     * @notice It allows the manager to update the end blocks
     * @dev This function is only callable by manager.
     * @param _newBonusEndBlock: the new end block
     */
    function extendBonusEndBlock(uint256 _newBonusEndBlock) external onlyOwner {
        require(_newBonusEndBlock > bonusEndBlock, "New end block must be later than current end block");
        require(_newBonusEndBlock > block.number, "New end block must be in the future");
        
        _updatePool();
        bonusEndBlock = _newBonusEndBlock;
        
        emit BonusEndBlockExtended(_newBonusEndBlock);
    }
    /*
     * @notice View function to see pending reward on frontend.
     * @param _user: user address
     * @return Pending reward for a given user
     */
    function pendingReward(address _user) external view returns (uint256) {
        UserInfo storage user = userInfo[_user];
        if (block.number > lastRewardBlock && stakedTokenAmount != 0) {
            uint256 multiplier = _getMultiplier(lastRewardBlock, block.number);
            uint256 tokenReward = multiplier * rewardPerBlock;
            uint256 adjustedTokenPerShare = accTokenPerShare + (tokenReward * PRECISION_FACTOR) / stakedTokenAmount;
            return (user.amount * adjustedTokenPerShare) / PRECISION_FACTOR - user.rewardDebt;
        } else {
            return (user.amount * accTokenPerShare) / PRECISION_FACTOR - user.rewardDebt;
        }
    }

    function _depositStakedToken(uint256 _amount) internal returns (uint256 _received) {
        uint256 balanceBefore = stakedToken.balanceOf(address(this));
        stakedToken.safeTransferFrom(address(msg.sender), address(this), _amount);
        _received = stakedToken.balanceOf(address(this)) - balanceBefore;
        stakedTokenAmount = stakedTokenAmount + _received;
    }

    function _withdrawStakedToken(uint256 _amount) internal {
        stakedTokenAmount = stakedTokenAmount - _amount;
        stakedToken.safeTransfer(address(msg.sender), _amount);
    }

    function _withdrawRewardToken(uint256 _amount) internal {
        rewardToken.safeTransfer(address(msg.sender), _amount);
        if (rewardToken == stakedToken) {
            require(stakedToken.balanceOf(address(this)) >= stakedTokenAmount, "rewards empty");
        }
    }
    /*
     * @notice Update reward variables of the given pool to be up-to-date.
     */
    function _updatePool() internal {
        if (block.number <= lastRewardBlock) {
            return;
        }

        if (stakedTokenAmount == 0) {
            lastRewardBlock = block.number;
            return;
        }

        uint256 multiplier = _getMultiplier(lastRewardBlock, block.number);
        uint256 tokenReward = multiplier * rewardPerBlock;
        accTokenPerShare = accTokenPerShare + (tokenReward * PRECISION_FACTOR) / stakedTokenAmount;
        lastRewardBlock = block.number;
    }
    /*
     * @notice Return reward multiplier over the given _from to _to block.
     * @param _from: block to start
     * @param _to: block to finish
     */
    function _getMultiplier(uint256 _from, uint256 _to) internal view returns (uint256) {
        if (_to <= bonusEndBlock) {
            return _to - _from;
        } else if (_from >= bonusEndBlock) {
            return 0;
        } else {
            return bonusEndBlock - _from;
        }
    }
    /*
     * @notice Return user limit is set or zero.
     */
    function hasUserLimit() public view returns (bool) {
        if (!userLimit || (block.number >= (startBlock + numberBlocksForUserLimit))) {
            return false;
        }
        return true;
    }
    /*
     * @notice Allows admin to assing a new manager
     */
    function changeManager(address _oldManager, address _newManager) external onlyOwner {
        require(_newManager != address(0), "New manager cannot be zero address");
        
        revokeRole(MANAGER_ROLE, _oldManager);
        grantRole(MANAGER_ROLE, _newManager);

        emit ManagerUpdated(_newManager);
    }
}

File 2 of 15 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

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

/**
 * @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 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]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @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 virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @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]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(account),
                        " 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 virtual 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.
     *
     * May emit a {RoleGranted} event.
     */
    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.
     *
     * May emit a {RoleRevoked} event.
     */
    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 revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    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.
     *
     * May emit a {RoleGranted} event.
     *
     * [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}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    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 {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 3 of 15 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @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 {AccessControl-_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 Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @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) external;

    /**
     * @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) external;

    /**
     * @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) external;
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

File 7 of 15 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

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

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

File 12 of 15 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

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 13 of 15 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

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);
}

File 14 of 15 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}

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

pragma solidity ^0.8.0;

import "./math/Math.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @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] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"endBlock","type":"uint256"}],"name":"BonusEndBlockExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"useInitialLockPeriod","type":"bool"}],"name":"LockPeriodBehaviorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"ManagerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMinStakingPeriod","type":"uint256"}],"name":"MinStakingPeriodUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"poolLimitPerUser","type":"uint256"}],"name":"NewPoolLimit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rewardPerBlock","type":"uint256"}],"name":"NewRewardPerBlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startBlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endBlock","type":"uint256"}],"name":"NewStartAndEndBlocks","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newRate","type":"uint256"}],"name":"RewardRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"RewardsStop","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":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenRecovery","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRECISION_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SMART_CHEF_FACTORY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accTokenPerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bonusEndBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"canWithdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_oldManager","type":"address"},{"internalType":"address","name":"_newManager","type":"address"}],"name":"changeManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"emergencyRewardWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newBonusEndBlock","type":"uint256"}],"name":"extendBonusEndBlock","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":[],"name":"getStakers","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"},{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint256","name":"depositTimestamp","type":"uint256"}],"internalType":"struct SmartChefInitializable.UserInfo[]","name":"","type":"tuple[]"}],"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":[],"name":"hasUserLimit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20Metadata","name":"_stakedToken","type":"address"},{"internalType":"contract IERC20Metadata","name":"_rewardToken","type":"address"},{"internalType":"uint256","name":"_rewardPerBlock","type":"uint256"},{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256","name":"_bonusEndBlock","type":"uint256"},{"internalType":"uint256","name":"_poolLimitPerUser","type":"uint256"},{"internalType":"uint256","name":"_numberBlocksForUserLimit","type":"uint256"},{"internalType":"uint256","name":"_minStakingPeriod","type":"uint256"},{"internalType":"bool","name":"_useInitialLockPeriod","type":"bool"},{"internalType":"address","name":"_admin","type":"address"},{"internalType":"address","name":"_manager","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastRewardBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minStakingPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numberBlocksForUserLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"pendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLimitPerUser","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"recoverToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","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":"rewardPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20Metadata","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakedToken","outputs":[{"internalType":"contract IERC20Metadata","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakedTokenAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakerAddresses","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stopReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_useInitialLockPeriod","type":"bool"}],"name":"updateLockPeriodBehavior","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minStakingPeriod","type":"uint256"}],"name":"updateMinStakingPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_userLimit","type":"bool"},{"internalType":"uint256","name":"_poolLimitPerUser","type":"uint256"}],"name":"updatePoolLimitPerUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardPerBlock","type":"uint256"}],"name":"updateRewardPerBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256","name":"_bonusEndBlock","type":"uint256"}],"name":"updateStartAndEndBlocks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"useInitialLockPeriod","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"},{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint256","name":"depositTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"userLimit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106103155760003560e01c80638f662915116101a7578063b14cf5e0116100ee578063db2e21bc11610097578063f2fde38b11610071578063f2fde38b14610702578063f40f0f5214610715578063f7c618c11461072857600080fd5b8063db2e21bc146106c0578063dd901647146106c8578063ec87621c146106db57600080fd5b8063cc7a262e116100c8578063cc7a262e14610684578063ccd34cd5146106a4578063d547741f146106ad57600080fd5b8063b14cf5e014610637578063b6b55f251461064a578063bd6171911461065d57600080fd5b8063993e013c11610150578063a0b409051161012a578063a0b4090514610613578063a217fddf14610626578063a9f8d1811461062e57600080fd5b8063993e013c146105e45780639be65a60146105f75780639c367bc21461060a57600080fd5b806391d148541161018157806391d148541461058357806392e8990e146105c95780639513997f146105d157600080fd5b80638f662915146105545780639129cf011461055d5780639165dd8f1461057057600080fd5b8063392e53cd1161026b57806366fe9f8a116102145780638ad1071b116101ee5780638ad1071b146105245780638ae39cac1461052d5780638da5cb5b1461053657600080fd5b806366fe9f8a1461050b578063715018a61461051457806380dc06721461051c57600080fd5b806348cd4cb11161024557806348cd4cb1146104e25780634a7c01ec146104eb578063625acd32146104f857600080fd5b8063392e53cd1461048357806343352d6114610495578063459598a2146104aa57600080fd5b80631aed6553116102cd5780632f2ff15d116102a75780632f2ff15d1461044a5780633279beab1461045d57806336568abe1461047057600080fd5b80631aed65531461040b578063248a9ca3146104145780632e1a7d4d1461043757600080fd5b8063069c34f6116102fe578063069c34f61461035757806319262d301461036e5780631959a0021461038157600080fd5b806301f8a9761461031a57806301ffc9a71461032f575b600080fd5b61032d61032836600461325a565b610748565b005b61034261033d366004613273565b610833565b60405190151581526020015b60405180910390f35b610360600d5481565b60405190815260200161034e565b61034261037c3660046132d7565b6108cc565b6103cf61038f3660046132d7565b60116020526000908152604090208054600182015460028301546003909301549192909173ffffffffffffffffffffffffffffffffffffffff9091169084565b60405161034e9493929190938452602084019290925273ffffffffffffffffffffffffffffffffffffffff166040830152606082015260800190565b61036060065481565b61036061042236600461325a565b60009081526002602052604090206001015490565b61032d61044536600461325a565b610952565b61032d6104583660046132f4565b610c8f565b61032d61046b36600461325a565b610cb9565b61032d61047e3660046132f4565b610cca565b60045461034290610100900460ff1681565b61049d610d7d565b60405161034e9190613324565b6104bd6104b836600461325a565b610eca565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161034e565b61036060075481565b6004546103429060ff1681565b61032d61050636600461325a565b610f01565b61036060095481565b61032d61106d565b61032d611081565b610360600a5481565b610360600b5481565b60005473ffffffffffffffffffffffffffffffffffffffff166104bd565b61036060055481565b61032d61056b3660046133b1565b61108f565b61032d61057e3660046133ce565b61118e565b6103426105913660046132f4565b600091825260026020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b610342611682565b61032d6105df36600461347c565b6116b7565b61032d6105f236600461325a565b61191d565b61032d6106053660046132d7565b6119ea565b61036060105481565b61032d61062136600461349e565b611c69565b610360600081565b61036060085481565b61032d6106453660046134ca565b611e4d565b61032d61065836600461325a565b611f91565b6104bd7f000000000000000000000000f5acb2075e211fa4c4383b9bbf3aa5f0b3681cf181565b600f546104bd9073ffffffffffffffffffffffffffffffffffffffff1681565b610360600c5481565b61032d6106bb3660046132f4565b6121e4565b61032d612209565b6004546103429062010000900460ff1681565b6103607f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b61032d6107103660046132d7565b61227f565b6103606107233660046132d7565b612333565b600e546104bd9073ffffffffffffffffffffffffffffffffffffffff1681565b3360009081527f94996c563abb815835b318c981fa050298066bd55a6db8b3a8c1aff30a38e7ef602052604090205460ff166107e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616c6c6572206973206e6f742061206d616e6167657200000000000000000060448201526064015b60405180910390fd5b6107ed612425565b600b80549082905560408051828152602081018490527fc390a98ace15a7bb6bab611eedfdbb2685043b241a869420043cdfb23ccfee5091015b60405180910390a15050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806108c657507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6000600d546000036108e057506001919050565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260116020526040812080549091036109175750600192915050565b60065443106109295750600192915050565b600d546109399062015180613527565b8160030154610948919061353e565b4210159392505050565b61095a612495565b33600090815260116020526040902080548211156109d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f416d6f756e7420746f20776974686472617720746f6f2068696768000000000060448201526064016107dc565b6109dd336108cc565b610a43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4d696e696d756d207374616b696e6720706572696f64206e6f74206d6574000060448201526064016107dc565b610a4b612425565b60008160010154600c546005548460000154610a679190613527565b610a719190613551565b610a7b919061358c565b90508215610c1b578154610a9090849061358c565b8255610a9b83612508565b8154600003610c1b5760005b600354811015610c19573373ffffffffffffffffffffffffffffffffffffffff1660038281548110610adb57610adb61359f565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1603610c115760038054610b129060019061358c565b81548110610b2257610b2261359f565b6000918252602090912001546003805473ffffffffffffffffffffffffffffffffffffffff9092169183908110610b5b57610b5b61359f565b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003805480610bb457610bb46135ce565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055019055610c19565b600101610aa7565b505b8015610c2a57610c2a8161253d565b600c546005548354610c3c9190613527565b610c469190613551565b600183015560405183815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364906020015b60405180910390a25050610c8c60018055565b50565b600082815260026020526040902060010154610caa81612683565b610cb4838361268d565b505050565b610cc1612781565b610c8c8161253d565b73ffffffffffffffffffffffffffffffffffffffff81163314610d6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084016107dc565b610d798282612802565b5050565b60035460609060009067ffffffffffffffff811115610d9e57610d9e6135fd565b604051908082528060200260200182016040528015610e1057816020015b610dfd60405180608001604052806000815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b815260200190600190039081610dbc5790505b50905060005b600354811015610ec457600060038281548110610e3557610e3561359f565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff90811680845260118352604093849020845160808101865281548152600182015494810194909452600281015490921693830193909352600301546060820152845191925090849084908110610eb057610eb061359f565b602090810291909101015250600101610e16565b50919050565b60038181548110610eda57600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b610f09612781565b6006548111610f9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4e657720656e6420626c6f636b206d757374206265206c61746572207468616e60448201527f2063757272656e7420656e6420626c6f636b000000000000000000000000000060648201526084016107dc565b438111611029576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f4e657720656e6420626c6f636b206d75737420626520696e207468652066757460448201527f757265000000000000000000000000000000000000000000000000000000000060648201526084016107dc565b611031612425565b60068190556040518181527f64d72ab0e38bca42524d27ed08dc7bd9f1cd3cd30faff228de317941ae4291e9906020015b60405180910390a150565b611075612781565b61107f60006128bd565b565b611089612781565b43600655565b3360009081527f94996c563abb815835b318c981fa050298066bd55a6db8b3a8c1aff30a38e7ef602052604090205460ff16611127576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616c6c6572206973206e6f742061206d616e6167657200000000000000000060448201526064016107dc565b6004805482151562010000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff9091161790556040517fdf2b9e58084e8c5ed09e4ae425bbe5060a0ce8c8eac100255c0598dfb9446c5e9061106290831515815260200190565b600454610100900460ff1615611200576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f416c726561647920696e697469616c697a65640000000000000000000000000060448201526064016107dc565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000f5acb2075e211fa4c4383b9bbf3aa5f0b3681cf1161461129f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f4e6f7420666163746f727900000000000000000000000000000000000000000060448201526064016107dc565b868810611308576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f496e76616c696420626c6f636b2072616e67650000000000000000000000000060448201526064016107dc565b73ffffffffffffffffffffffffffffffffffffffff8216611385576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f496e76616c69642061646d696e2061646472657373000000000000000000000060448201526064016107dc565b73ffffffffffffffffffffffffffffffffffffffff8116611402576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f496e76616c6964206d616e61676572206164647265737300000000000000000060448201526064016107dc565b6001600460016101000a81548160ff0219169083151502179055508a600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555089600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555088600b81905550876007819055508660068190555083600d8190555082600460026101000a81548160ff021916908315150217905550600086111561151457600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556009869055600a8590555b600e54604080517f313ce567000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff169163313ce5679160048083019260209291908290030181865afa158015611584573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a8919061362c565b60ff169050601e8110611617576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d75737420626520696e666572696f7220746f2033300000000000000000000060448201526064016107dc565b61162281601e61358c565b61162d90600a613772565b600c55600754600855611641600084612932565b61166b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0883612932565b6116748361227f565b505050505050505050505050565b60045460009060ff1615806116a65750600a546007546116a2919061353e565b4310155b156116b15750600090565b50600190565b3360009081527f94996c563abb815835b318c981fa050298066bd55a6db8b3a8c1aff30a38e7ef602052604090205460ff1661174f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616c6c6572206973206e6f742061206d616e6167657200000000000000000060448201526064016107dc565b60075443106117ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f506f6f6c2068617320737461727465640000000000000000000000000000000060448201526064016107dc565b808210611849576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4e6577207374617274426c6f636b206d757374206265206c6f7765722074686160448201527f6e206e657720656e64426c6f636b00000000000000000000000000000000000060648201526084016107dc565b8143106118d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f4e6577207374617274426c6f636b206d7573742062652068696768657220746860448201527f616e2063757272656e7420626c6f636b0000000000000000000000000000000060648201526084016107dc565b60078290556006819055600882905560408051838152602081018390527f7cd0ab87d19036f3dfadadb232c78aa4879dda3f0c994a9d637532410ee2ce069101610827565b3360009081527f94996c563abb815835b318c981fa050298066bd55a6db8b3a8c1aff30a38e7ef602052604090205460ff166119b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616c6c6572206973206e6f742061206d616e6167657200000000000000000060448201526064016107dc565b600d8190556040518181527f8114637a99d6dbde6e7e5125969a8ecbe5d143eedc597560c9c79a8cb9a6b5d090602001611062565b6119f2612781565b600e5473ffffffffffffffffffffffffffffffffffffffff90811690821603611a9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4f7065726174696f6e733a2043616e6e6f74207265636f76657220726577617260448201527f6420746f6b656e0000000000000000000000000000000000000000000000000060648201526084016107dc565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa158015611b0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b2e919061377e565b600f5490915073ffffffffffffffffffffffffffffffffffffffff90811690831603611b6457601054611b61908261358c565b90505b80600003611bf4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4f7065726174696f6e733a2043616e6e6f74207265636f766572207a65726f2060448201527f62616c616e63650000000000000000000000000000000000000000000000000060648201526084016107dc565b611c1573ffffffffffffffffffffffffffffffffffffffff8316338361293c565b8173ffffffffffffffffffffffffffffffffffffffff167f14f11966a996e0629572e51064726d2057a80fbd34efc066682c06a71dbb6e9882604051611c5d91815260200190565b60405180910390a25050565b3360009081527f94996c563abb815835b318c981fa050298066bd55a6db8b3a8c1aff30a38e7ef602052604090205460ff16611d01576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616c6c6572206973206e6f742061206d616e6167657200000000000000000060448201526064016107dc565b60045460ff16611d6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f4d7573742062652073657400000000000000000000000000000000000000000060448201526064016107dc565b8115611de8576009548111611dde576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4e6577206c696d6974206d75737420626520686967686572000000000000000060448201526064016107dc565b6009819055611e1a565b600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001683151517905560006009555b7f241f67ee5f41b7a5cabf911367329be7215900f602ebfc47f89dce2a6bcd847c60095460405161082791815260200190565b611e55612781565b73ffffffffffffffffffffffffffffffffffffffff8116611ef8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f4e6577206d616e616765722063616e6e6f74206265207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016107dc565b611f227f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08836121e4565b611f4c7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0882610c8f565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f2c1c11af44aa5608f1dca38c00275c30ea091e02417d36e70e9a1538689c433d90600090a25050565b611f99612495565b3360009081526011602052604081208054909190158015611fba5750600083115b9050611fc4611682565b600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515918217905560ff16158061200e5750600954825461200b908561353e565b11155b612074576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4465706f7369743a20416d6f756e742061626f7665206c696d6974000000000060448201526064016107dc565b61207c612425565b8154156120c65760008260010154600c54600554856000015461209f9190613527565b6120a99190613551565b6120b3919061358c565b905080156120c4576120c48161253d565b505b8215612191576120d583612a10565b82546120e1919061353e565b82556002820180547fffffffffffffffffffffffff000000000000000000000000000000000000000016331790558080612124575060045462010000900460ff16155b15612130574260038301555b801561219157600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180547fffffffffffffffffffffffff000000000000000000000000000000000000000016331790555b600c5460055483546121a39190613527565b6121ad9190613551565b600183015560405183815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c90602001610c79565b6000828152600260205260409020600101546121ff81612683565b610cb48383612802565b612211612495565b3360009081526011602052604081208054828255600182019290925590801561223d5761223d81612508565b815460405190815233907f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd96959060200160405180910390a2505061107f60018055565b612287612781565b73ffffffffffffffffffffffffffffffffffffffff811661232a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016107dc565b610c8c816128bd565b73ffffffffffffffffffffffffffffffffffffffff811660009081526011602052604081206008544311801561236a575060105415155b156123f357600061237d60085443612b84565b90506000600b548261238f9190613527565b90506000601054600c54836123a49190613527565b6123ae9190613551565b6005546123bb919061353e565b90508360010154600c548286600001546123d59190613527565b6123df9190613551565b6123e9919061358c565b9695505050505050565b6001810154600c54600554835461240a9190613527565b6124149190613551565b61241e919061358c565b9392505050565b600854431161243057565b6010546000036124405743600855565b600061244e60085443612b84565b90506000600b54826124609190613527565b9050601054600c54826124739190613527565b61247d9190613551565b60055461248a919061353e565b600555505043600855565b600260015403612501576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107dc565b6002600155565b80601054612516919061358c565b601055600f54610c8c9073ffffffffffffffffffffffffffffffffffffffff16338361293c565b600e546125619073ffffffffffffffffffffffffffffffffffffffff16338361293c565b600f54600e5473ffffffffffffffffffffffffffffffffffffffff918216911603610c8c57601054600f546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa1580156125f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061261b919061377e565b1015610c8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f7265776172647320656d7074790000000000000000000000000000000000000060448201526064016107dc565b610c8c8133612bbf565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610d7957600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556127233390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461107f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107dc565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610d7957600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610d79828261268d565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052610cb49084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612c79565b600f546040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600091829173ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015612a83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aa7919061377e565b600f54909150612acf9073ffffffffffffffffffffffffffffffffffffffff16333086612d85565b600f546040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152829173ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015612b3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b61919061377e565b612b6b919061358c565b915081601054612b7b919061353e565b60105550919050565b60006006548211612ba057612b99838361358c565b90506108c6565b6006548310612bb1575060006108c6565b82600654612b99919061358c565b600082815260026020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610d7957612bff81612de9565b612c0a836020612e08565b604051602001612c1b9291906137bb565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a00000000000000000000000000000000000000000000000000000000082526107dc9160040161383c565b6000612cdb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661304b9092919063ffffffff16565b805190915015610cb45780806020019051810190612cf9919061388d565b610cb4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016107dc565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052612de39085907f23b872dd000000000000000000000000000000000000000000000000000000009060840161298e565b50505050565b60606108c673ffffffffffffffffffffffffffffffffffffffff831660145b60606000612e17836002613527565b612e2290600261353e565b67ffffffffffffffff811115612e3a57612e3a6135fd565b6040519080825280601f01601f191660200182016040528015612e64576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612e9b57612e9b61359f565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612efe57612efe61359f565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000612f3a846002613527565b612f4590600161353e565b90505b6001811115612fe2577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612f8657612f8661359f565b1a60f81b828281518110612f9c57612f9c61359f565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93612fdb816138aa565b9050612f48565b50831561241e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016107dc565b606061305a8484600085613062565b949350505050565b6060824710156130f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016107dc565b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161311d91906138df565b60006040518083038185875af1925050503d806000811461315a576040519150601f19603f3d011682016040523d82523d6000602084013e61315f565b606091505b50915091506131708783838761317b565b979650505050505050565b6060831561321157825160000361320a5773ffffffffffffffffffffffffffffffffffffffff85163b61320a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107dc565b508161305a565b61305a83838151156132265781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107dc919061383c565b60006020828403121561326c57600080fd5b5035919050565b60006020828403121561328557600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461241e57600080fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610c8c57600080fd5b6000602082840312156132e957600080fd5b813561241e816132b5565b6000806040838503121561330757600080fd5b823591506020830135613319816132b5565b809150509250929050565b602080825282518282018190526000918401906040840190835b81811015613398578351805184526020810151602085015273ffffffffffffffffffffffffffffffffffffffff6040820151166040850152606081015160608501525060808301925060208401935060018101905061333e565b509095945050505050565b8015158114610c8c57600080fd5b6000602082840312156133c357600080fd5b813561241e816133a3565b60008060008060008060008060008060006101608c8e0312156133f057600080fd5b8b356133fb816132b5565b9a5060208c013561340b816132b5565b995060408c0135985060608c0135975060808c0135965060a08c0135955060c08c0135945060e08c013593506101008c0135613446816133a3565b92506101208c0135613457816132b5565b91506101408c0135613468816132b5565b809150509295989b509295989b9093969950565b6000806040838503121561348f57600080fd5b50508035926020909101359150565b600080604083850312156134b157600080fd5b82356134bc816133a3565b946020939093013593505050565b600080604083850312156134dd57600080fd5b82356134e8816132b5565b91506020830135613319816132b5565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176108c6576108c66134f8565b808201808211156108c6576108c66134f8565b600082613587577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b818103818111156108c6576108c66134f8565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561363e57600080fd5b815160ff8116811461241e57600080fd5b6001815b600184111561368a5780850481111561366e5761366e6134f8565b600184161561367c57908102905b60019390931c928002613653565b935093915050565b6000826136a1575060016108c6565b816136ae575060006108c6565b81600181146136c457600281146136ce576136ea565b60019150506108c6565b60ff8411156136df576136df6134f8565b50506001821b6108c6565b5060208310610133831016604e8410600b841016171561370d575081810a6108c6565b6137387fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848461364f565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561376a5761376a6134f8565b029392505050565b600061241e8383613692565b60006020828403121561379057600080fd5b5051919050565b60005b838110156137b257818101518382015260200161379a565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516137f3816017850160208801613797565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351613830816028840160208801613797565b01602801949350505050565b602081526000825180602084015261385b816040850160208701613797565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60006020828403121561389f57600080fd5b815161241e816133a3565b6000816138b9576138b96134f8565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b600082516138f1818460208701613797565b919091019291505056fea264697066735822122014f99862c51fea0cbe78cab3354c899f64b19c6ac655c3f0c108dc97bf65084364736f6c634300081c0033

Block Transaction Gas Used Reward
view all blocks validated

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

Validator Index Block Amount
View All Withdrawals

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

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