ETH Price: $3,279.27 (+0.75%)
Gas: 6 Gwei

Contract

0xb8D2471E35eE033Db509e0456c8eFc4135f4EE43
 
Transaction Hash
Method
Block
From
To
Unstake203983532024-07-27 14:02:111 hr ago1722088931IN
0xb8D2471E...135f4EE43
0 ETH0.000968823.96195471
Claim Rewards203983482024-07-27 14:01:111 hr ago1722088871IN
0xb8D2471E...135f4EE43
0 ETH0.000480773.60864919
Unstake203982102024-07-27 13:33:352 hrs ago1722087215IN
0xb8D2471E...135f4EE43
0 ETH0.000578033.76231301
Claim Rewards203982082024-07-27 13:33:112 hrs ago1722087191IN
0xb8D2471E...135f4EE43
0 ETH0.000510293.7705019
Claim Rewards203977612024-07-27 12:03:353 hrs ago1722081815IN
0xb8D2471E...135f4EE43
0 ETH0.000362392.41070221
Claim Rewards203972202024-07-27 10:15:235 hrs ago1722075323IN
0xb8D2471E...135f4EE43
0 ETH0.000303582.08334095
Claim Rewards203965092024-07-27 7:52:478 hrs ago1722066767IN
0xb8D2471E...135f4EE43
0 ETH0.000268011.75818875
Stake203956932024-07-27 5:08:1110 hrs ago1722056891IN
0xb8D2471E...135f4EE43
0 ETH0.000281871.17643174
Claim Rewards203956502024-07-27 4:59:3510 hrs ago1722056375IN
0xb8D2471E...135f4EE43
0 ETH0.000127951.0556792
Claim Rewards203956412024-07-27 4:57:4710 hrs ago1722056267IN
0xb8D2471E...135f4EE43
0 ETH0.000169711.40003486
Claim Rewards203956352024-07-27 4:56:3510 hrs ago1722056195IN
0xb8D2471E...135f4EE43
0 ETH0.000168411.38932385
Claim Rewards203956322024-07-27 4:55:5910 hrs ago1722056159IN
0xb8D2471E...135f4EE43
0 ETH0.000180091.48573027
Claim Rewards203956252024-07-27 4:54:3510 hrs ago1722056075IN
0xb8D2471E...135f4EE43
0 ETH0.000175171.41251239
Claim Rewards203956102024-07-27 4:51:3511 hrs ago1722055895IN
0xb8D2471E...135f4EE43
0 ETH0.000184071.51851062
Claim Rewards203956052024-07-27 4:50:3511 hrs ago1722055835IN
0xb8D2471E...135f4EE43
0 ETH0.000192771.31446364
Claim Rewards203956032024-07-27 4:50:1111 hrs ago1722055811IN
0xb8D2471E...135f4EE43
0 ETH0.00015581.28528365
Claim Rewards203955992024-07-27 4:49:2311 hrs ago1722055763IN
0xb8D2471E...135f4EE43
0 ETH0.000149911.23669481
Claim Rewards203955962024-07-27 4:48:4711 hrs ago1722055727IN
0xb8D2471E...135f4EE43
0 ETH0.000154591.24667954
Claim Rewards203952402024-07-27 3:36:3512 hrs ago1722051395IN
0xb8D2471E...135f4EE43
0 ETH0.000146471.18108822
Claim Rewards203947602024-07-27 2:00:1113 hrs ago1722045611IN
0xb8D2471E...135f4EE43
0 ETH0.00038552.84849166
Claim Rewards203942672024-07-27 0:21:2315 hrs ago1722039683IN
0xb8D2471E...135f4EE43
0 ETH0.000139041.08096632
Claim Rewards203940302024-07-26 23:33:3516 hrs ago1722036815IN
0xb8D2471E...135f4EE43
0 ETH0.000174991.41102108
Claim Rewards203936942024-07-26 22:25:3517 hrs ago1722032735IN
0xb8D2471E...135f4EE43
0 ETH0.000496024
Claim Rewards203935142024-07-26 21:49:2318 hrs ago1722030563IN
0xb8D2471E...135f4EE43
0 ETH0.000271551.92443359
Claim Rewards203933652024-07-26 21:19:3518 hrs ago1722028775IN
0xb8D2471E...135f4EE43
0 ETH0.000288342.04343523
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

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

Contract Name:
FlokiStakingPool

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 800 runs

Other Settings:
istanbul EvmVersion, MIT license
File 1 of 9 : FlokiStakingPool.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;

import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol";

import { IMultiplier } from "../interfaces/IMultiplier.sol";
import { IPenaltyFee } from "../interfaces/IPenaltyFee.sol";
import { IStakingPool } from "../interfaces/IStakingPool.sol";

contract FlokiStakingPool is ReentrancyGuard, IStakingPool {
    using SafeERC20 for IERC20;

    address public constant BURN_ADDRESS = 0x000000000000000000000000000000000000dEaD;

    IERC20 public immutable stakingToken;
    IERC20 public immutable rewardsToken;
    uint256 public immutable rewardsTokenDecimals;

    IMultiplier public immutable override rewardsMultiplier;
    IPenaltyFee public immutable override penaltyFeeCalculator;

    address public owner;

    // Duration of the rewards (in seconds)
    uint256 public rewardsDuration;
    // Timestamp of when the staking starts
    uint256 public startsAt;
    // Timestamp of when the staking ends
    uint256 public endsAt;
    // Timestamp of the reward updated
    uint256 public lastUpdateTime;
    // Reward per second (total rewards / duration)
    uint256 public rewardRatePerSec;
    // Reward per token stored
    uint256 public rewardPerTokenStored;

    bool public isPaused;

    // Total staked
    uint256 public totalRewards;
    // Raw amount staked by all users
    uint256 public totalStaked;
    // Total staked with each user multiplier applied
    uint256 public totalWeightedStake;
    // User address => array of the staking info
    mapping(address => StakingInfo[]) public userStakingInfo;

    // it has to be evaluated on a user basis

    enum StakeTimeOptions {
        Duration,
        EndTime
    }

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

    event TokenRecovered(address token, uint256 amount);

    constructor(
        address _stakingToken,
        address _rewardToken,
        uint256 _rewardsTokenDecimals,
        address _multiplier,
        address _penaltyFeeCalculator
    ) {
        owner = msg.sender;
        stakingToken = IERC20(_stakingToken);
        rewardsToken = IERC20(_rewardToken);
        rewardsTokenDecimals = _rewardsTokenDecimals;
        rewardsMultiplier = IMultiplier(_multiplier);
        penaltyFeeCalculator = IPenaltyFee(_penaltyFeeCalculator);
    }

    /* ========== VIEWS ========== */

    /**
     * Calculates how much rewards a user has earned up to current block, every time the user stakes/unstakes/withdraw.
     * We update "rewards[_user]" with how much they are entitled to, up to current block.
     * Next time we calculate how much they earned since last update and accumulate on rewards[_user].
     */
    function getUserRewards(address _user, uint256 _stakeNumber) public view returns (uint256) {
        uint256 weightedAmount = rewardsMultiplier.applyMultiplier(
            userStakingInfo[_user][_stakeNumber].stakedAmount,
            userStakingInfo[_user][_stakeNumber].duration
        );
        uint256 rewardsSinceLastUpdate = ((weightedAmount * (rewardPerToken() - userStakingInfo[_user][_stakeNumber].rewardPerTokenPaid)) /
            (10**rewardsTokenDecimals));
        return rewardsSinceLastUpdate + userStakingInfo[_user][_stakeNumber].rewards;
    }

    function lastTimeRewardApplicable() public view returns (uint256) {
        return block.timestamp < endsAt ? block.timestamp : endsAt;
    }

    function rewardPerToken() public view returns (uint256) {
        if (totalStaked == 0) {
            return rewardPerTokenStored;
        }
        uint256 howLongSinceLastTime = lastTimeRewardApplicable() - lastUpdateTime;
        return rewardPerTokenStored + ((rewardRatePerSec * howLongSinceLastTime * (10**rewardsTokenDecimals)) / totalWeightedStake);
    }

    function getUserStakes(address _user) external view returns (StakingInfo[] memory) {
        return userStakingInfo[_user];
    }

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

    function _updateReward(address _user, uint256 _stakeNumber) private {
        rewardPerTokenStored = rewardPerToken();
        lastUpdateTime = lastTimeRewardApplicable();
        if (_user != address(0)) {
            userStakingInfo[_user][_stakeNumber].rewards = getUserRewards(_user, _stakeNumber);
            userStakingInfo[_user][_stakeNumber].rewardPerTokenPaid = rewardPerTokenStored;
        }
    }

    function stake(
        uint256 _amount,
        StakeTimeOptions _stakeTimeOption,
        uint256 _unstakeTime
    ) external nonReentrant inProgress {
        require(_amount > 0, "FlokiStakingPool::stake: amount = 0");
        uint256 _minimumStakeTimestamp = _stakeTimeOption == StakeTimeOptions.Duration ? block.timestamp + _unstakeTime : _unstakeTime;
        require(_minimumStakeTimestamp > startsAt, "FlokiStakingPool::stake: _minimumStakeTimestamp <= startsAt");
        require(_minimumStakeTimestamp > block.timestamp, "FlokiStakingPool::stake: _minimumStakeTimestamp <= block.timestamp");

        uint256 _stakeDuration = _minimumStakeTimestamp - block.timestamp;

        _updateReward(address(0), 0);
        StakingInfo memory _stakingInfo = StakingInfo({
            stakedAmount: _amount,
            minimumStakeTimestamp: _minimumStakeTimestamp,
            duration: _stakeDuration,
            rewardPerTokenPaid: rewardPerTokenStored,
            rewards: 0
        });
        userStakingInfo[msg.sender].push(_stakingInfo);

        uint256 _stakeNumber = userStakingInfo[msg.sender].length - 1;

        uint256 weightedStake = rewardsMultiplier.applyMultiplier(_amount, _stakeDuration);
        totalWeightedStake += weightedStake;
        totalStaked += _amount;

        stakingToken.safeTransferFrom(msg.sender, address(this), _amount);
        emit Staked(msg.sender, _stakeNumber, _amount);
    }

    function unstake(uint256 _amount, uint256 _stakeNumber) external nonReentrant {
        require(_amount > 0, "FlokiStakingPool::unstake: amount = 0");
        require(_amount <= userStakingInfo[msg.sender][_stakeNumber].stakedAmount, "FlokiStakingPool::unstake: not enough balance");

        _updateReward(msg.sender, _stakeNumber);

        uint256 currentWeightedStake = rewardsMultiplier.applyMultiplier(
            userStakingInfo[msg.sender][_stakeNumber].stakedAmount,
            userStakingInfo[msg.sender][_stakeNumber].duration
        );
        totalWeightedStake -= currentWeightedStake;
        totalStaked -= _amount;

        uint256 penaltyFee = 0;
        if (block.timestamp < userStakingInfo[msg.sender][_stakeNumber].minimumStakeTimestamp) {
            penaltyFee = penaltyFeeCalculator.calculate(_amount, userStakingInfo[msg.sender][_stakeNumber].duration, address(this));
            if (penaltyFee > _amount) {
                penaltyFee = _amount;
            }
        }

        userStakingInfo[msg.sender][_stakeNumber].stakedAmount -= _amount;

        if (userStakingInfo[msg.sender][_stakeNumber].stakedAmount == 0) {
            _claimRewards(msg.sender, _stakeNumber);
            // remove the staking info from array
            userStakingInfo[msg.sender][_stakeNumber] = userStakingInfo[msg.sender][userStakingInfo[msg.sender].length - 1];
            userStakingInfo[msg.sender].pop();
        } else {
            // update the weighted stake
            uint256 newWeightedStake = rewardsMultiplier.applyMultiplier(
                userStakingInfo[msg.sender][_stakeNumber].stakedAmount,
                userStakingInfo[msg.sender][_stakeNumber].duration
            );
            totalWeightedStake += newWeightedStake;
        }

        if (penaltyFee > 0) {
            stakingToken.safeTransfer(BURN_ADDRESS, penaltyFee);
            _amount -= penaltyFee;
        }
        stakingToken.safeTransfer(msg.sender, _amount);
        emit Unstaked(msg.sender, _stakeNumber, _amount);
    }

    function _claimRewards(address _user, uint256 _stakeNumber) private {
        uint256 reward = userStakingInfo[_user][_stakeNumber].rewards;

        if (reward > 0) {
            userStakingInfo[_user][_stakeNumber].rewards = 0;
            rewardsToken.safeTransfer(_user, reward);
            emit RewardPaid(_user, _stakeNumber, reward);
        }
    }

    function claimRewards(uint256 _stakeNumber) external nonReentrant {
        _updateReward(msg.sender, _stakeNumber);
        _claimRewards(msg.sender, _stakeNumber);
    }

    /* ========== RESTRICTED FUNCTIONS ========== */

    function initializeStaking(
        uint256 _startsAt,
        uint256 _rewardsDuration,
        uint256 _amount
    ) external nonReentrant onlyOwner {
        require(_startsAt > block.timestamp, "FlokiStakingPool::initializeStaking: _startsAt must be in the future");
        require(_rewardsDuration > 0, "FlokiStakingPool::initializeStaking: _rewardsDuration = 0");
        require(_amount > 0, "FlokiStakingPool::initializeStaking: _amount = 0");
        require(startsAt == 0, "FlokiStakingPool::initializeStaking: staking already started");

        _updateReward(address(0), 0);

        rewardsDuration = _rewardsDuration;
        startsAt = _startsAt;
        endsAt = _startsAt + _rewardsDuration;

        // add the amount to the pool
        uint256 initialAmount = rewardsToken.balanceOf(address(this));
        rewardsToken.safeTransferFrom(msg.sender, address(this), _amount);
        uint256 actualAmount = rewardsToken.balanceOf(address(this)) - initialAmount;
        totalRewards = actualAmount;
        rewardRatePerSec = actualAmount / _rewardsDuration;

        // set the staking to in progress
        isPaused = false;
    }

    function resumeStaking() external onlyOwner {
        require(rewardRatePerSec > 0, "FlokiStakingPool::startStaking: reward rate = 0");
        require(isPaused, "FlokiStakingPool::startStaking: staking already started");
        isPaused = false;
    }

    function pauseStaking() external onlyOwner {
        require(!isPaused, "FlokiStakingPool::pauseStaking: staking already paused");
        isPaused = true;
    }

    // Added to support recovering LP Rewards from other systems such as BAL to be distributed to holders
    function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyOwner {
        require(tokenAddress != address(stakingToken), "Cannot withdraw the staking token");
        require(tokenAddress != address(rewardsToken), "Cannot withdraw the reward token");
        IERC20(tokenAddress).safeTransfer(owner, tokenAmount);
        emit TokenRecovered(tokenAddress, tokenAmount);
    }

    function transferOwnership(address _newOwner) external onlyOwner {
        address currentOwner = owner;
        owner = _newOwner;
        emit OwnershipTransferred(currentOwner, _newOwner);
    }

    /* ========== MODIFIERS ========== */

    modifier inProgress() {
        require(!isPaused, "FlokiStakingPool::initialized: staking is paused");
        require(startsAt <= block.timestamp, "FlokiStakingPool::initialized: staking has not started yet");
        require(endsAt > block.timestamp, "FlokiStakingPool::notFinished: staking has finished");
        _;
    }

    modifier onlyOwner() {
        require(msg.sender == owner, "FlokiStakingPool::onlyOwner: not authorized");
        _;
    }
}

File 2 of 9 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 3 of 9 : 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 4 of 9 : 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 5 of 9 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 6 of 9 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 7 of 9 : IMultiplier.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;

interface IMultiplier {
    /**
     * Applies a multiplier on the _amount, based on the _pool and _beneficiary.
     * The multiplier is not necessarily a constant number, it can be a more complex factor.
     */
    function applyMultiplier(uint256 _amount, uint256 _duration) external view returns (uint256);

    function getMultiplier(uint256 _amount, uint256 _duration) external view returns (uint256);

    function getDurationGroup(uint256 _duration) external view returns (uint256);

    function getDurationMultiplier(uint256 _duration) external view returns (uint256);
}

File 8 of 9 : IPenaltyFee.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;

interface IPenaltyFee {
    /**
     * Calculates the penalty fee for the given _amount for a specific _beneficiary.
     */
    function calculate(
        uint256 _amount,
        uint256 _duration,
        address _pool
    ) external view returns (uint256);
}

File 9 of 9 : IStakingPool.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;

import { IMultiplier } from "../interfaces/IMultiplier.sol";
import { IPenaltyFee } from "../interfaces/IPenaltyFee.sol";

interface IStakingPool {
    struct StakingInfo {
        uint256 stakedAmount; // amount of the stake
        uint256 minimumStakeTimestamp; // timestamp of the minimum stake
        uint256 duration; // in seconds
        uint256 rewardPerTokenPaid; // Reward per token paid
        uint256 rewards; // rewards to be claimed
    }

    function rewardsMultiplier() external view returns (IMultiplier);

    function penaltyFeeCalculator() external view returns (IPenaltyFee);

    event Staked(address indexed user, uint256 stakeNumber, uint256 amount);
    event Unstaked(address indexed user, uint256 stakeNumber, uint256 amount);
    event RewardPaid(address indexed user, uint256 stakeNumber, uint256 reward);
}

Settings
{
  "evmVersion": "istanbul",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "none",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 800
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_stakingToken","type":"address"},{"internalType":"address","name":"_rewardToken","type":"address"},{"internalType":"uint256","name":"_rewardsTokenDecimals","type":"uint256"},{"internalType":"address","name":"_multiplier","type":"address"},{"internalType":"address","name":"_penaltyFeeCalculator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"stakeNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"stakeNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenRecovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"stakeNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Unstaked","type":"event"},{"inputs":[],"name":"BURN_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_stakeNumber","type":"uint256"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endsAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_stakeNumber","type":"uint256"}],"name":"getUserRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserStakes","outputs":[{"components":[{"internalType":"uint256","name":"stakedAmount","type":"uint256"},{"internalType":"uint256","name":"minimumStakeTimestamp","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"rewardPerTokenPaid","type":"uint256"},{"internalType":"uint256","name":"rewards","type":"uint256"}],"internalType":"struct IStakingPool.StakingInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startsAt","type":"uint256"},{"internalType":"uint256","name":"_rewardsDuration","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"initializeStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pauseStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"penaltyFeeCalculator","outputs":[{"internalType":"contract IPenaltyFee","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resumeStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRatePerSec","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsMultiplier","outputs":[{"internalType":"contract IMultiplier","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsTokenDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"enum FlokiStakingPool.StakeTimeOptions","name":"_stakeTimeOption","type":"uint8"},{"internalType":"uint256","name":"_unstakeTime","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startsAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalWeightedStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_stakeNumber","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userStakingInfo","outputs":[{"internalType":"uint256","name":"stakedAmount","type":"uint256"},{"internalType":"uint256","name":"minimumStakeTimestamp","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"rewardPerTokenPaid","type":"uint256"},{"internalType":"uint256","name":"rewards","type":"uint256"}],"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80639e2c8a5b11610104578063d1af0c7d116100a2578063f999c50611610071578063f999c50614610422578063f99b7d751461042a578063fccc28131461043d578063fff0c5361461044657600080fd5b8063d1af0c7d146103d6578063df136d65146103fd578063eed9da1f14610406578063f2fde38b1461040f57600080fd5b8063b6d7dc5c116100de578063b6d7dc5c14610395578063bddff592146103bc578063c8f33c91146103c5578063cd3daf9d146103ce57600080fd5b80639e2c8a5b1461035c578063af4686821461036f578063b187bd261461037857600080fd5b8063386a95251161017c578063817b1cd21161014b578063817b1cd21461030d578063842e2981146103165780638980f11f146103365780638da5cb5b1461034957600080fd5b8063386a9525146102cd57806372f702f3146102d65780637475f913146102fd57806380faa57d1461030557600080fd5b80630e15561a116101b85780630e15561a1461024b57806323a59277146102545780632792cdae1461029357806331d94f89146102ba57600080fd5b806304d978f1146101df5780630962ef791461021f5780630a09284a14610234575b600080fd5b6101f26101ed366004612521565b610459565b604080519586526020860194909452928401919091526060830152608082015260a0015b60405180910390f35b61023261022d36600461256a565b6104a7565b005b61023d60045481565b604051908152602001610216565b61023d60095481565b61027b7f0000000000000000000000004761295cb20bbf40952b3239bdc4fcd14021e30d81565b6040516001600160a01b039091168152602001610216565b61023d7f000000000000000000000000000000000000000000000000000000000000000981565b6102326102c83660046125f5565b610520565b61023d60025481565b61027b7f000000000000000000000000cf0c122c6b73ff809c693db761e7baebe62b6a2e81565b610232610992565b61023d610afc565b61023d600a5481565b610329610324366004612507565b610b13565b604051610216919061263c565b610232610344366004612521565b610bba565b60015461027b906001600160a01b031681565b61023261036a3660046125d4565b610d96565b61023d60035481565b6008546103859060ff1681565b6040519015158152602001610216565b61027b7f000000000000000000000000b254cc6c1d178c2de8182cede6113a986bb9072181565b61023d60065481565b61023d60055481565b61023d6115b8565b61027b7f0000000000000000000000004507cef57c46789ef8d1a19ea45f4216bae2b52881565b61023d60075481565b61023d600b5481565b61023261041d366004612507565b611649565b610232611721565b61023261043836600461259a565b611817565b61027b61dead81565b61023d610454366004612521565b611d58565b600c602052816000526040600020818154811061047557600080fd5b600091825260209091206005909102018054600182015460028301546003840154600490940154929550909350919085565b600260005414156104ff5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260005561050e3382611fa2565b610518338261207f565b506001600055565b600260005414156105735760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016104f6565b60026000556001546001600160a01b031633146105e65760405162461bcd60e51b815260206004820152602b60248201527f466c6f6b695374616b696e67506f6f6c3a3a6f6e6c794f776e65723a206e6f7460448201526a08185d5d1a1bdc9a5e995960aa1b60648201526084016104f6565b4283116106695760405162461bcd60e51b8152602060048201526044602482018190527f466c6f6b695374616b696e67506f6f6c3a3a696e697469616c697a655374616b908201527f696e673a205f7374617274734174206d75737420626520696e207468652066756064820152637475726560e01b608482015260a4016104f6565b600082116106df5760405162461bcd60e51b815260206004820152603960248201527f466c6f6b695374616b696e67506f6f6c3a3a696e697469616c697a655374616b60448201527f696e673a205f726577617264734475726174696f6e203d20300000000000000060648201526084016104f6565b600081116107555760405162461bcd60e51b815260206004820152603060248201527f466c6f6b695374616b696e67506f6f6c3a3a696e697469616c697a655374616b60448201527f696e673a205f616d6f756e74203d20300000000000000000000000000000000060648201526084016104f6565b600354156107cb5760405162461bcd60e51b815260206004820152603c60248201527f466c6f6b695374616b696e67506f6f6c3a3a696e697469616c697a655374616b60448201527f696e673a207374616b696e6720616c726561647920737461727465640000000060648201526084016104f6565b6107d6600080611fa2565b600282905560038390556107ea82846126dd565b60049081556040516370a0823160e01b815230918101919091526000907f0000000000000000000000004507cef57c46789ef8d1a19ea45f4216bae2b5286001600160a01b0316906370a082319060240160206040518083038186803b15801561085357600080fd5b505afa158015610867573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088b9190612582565b90506108c26001600160a01b037f0000000000000000000000004507cef57c46789ef8d1a19ea45f4216bae2b5281633308561219e565b6040516370a0823160e01b815230600482015260009082906001600160a01b037f0000000000000000000000004507cef57c46789ef8d1a19ea45f4216bae2b52816906370a082319060240160206040518083038186803b15801561092657600080fd5b505afa15801561093a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095e9190612582565b610968919061281f565b6009819055905061097984826126f5565b60065550506008805460ff191690555050600160005550565b6001546001600160a01b03163314610a005760405162461bcd60e51b815260206004820152602b60248201527f466c6f6b695374616b696e67506f6f6c3a3a6f6e6c794f776e65723a206e6f7460448201526a08185d5d1a1bdc9a5e995960aa1b60648201526084016104f6565b600060065411610a785760405162461bcd60e51b815260206004820152602f60248201527f466c6f6b695374616b696e67506f6f6c3a3a73746172745374616b696e673a2060448201527f7265776172642072617465203d2030000000000000000000000000000000000060648201526084016104f6565b60085460ff16610af05760405162461bcd60e51b815260206004820152603760248201527f466c6f6b695374616b696e67506f6f6c3a3a73746172745374616b696e673a2060448201527f7374616b696e6720616c7265616479207374617274656400000000000000000060648201526084016104f6565b6008805460ff19169055565b60006004544210610b0e575060045490565b504290565b6001600160a01b0381166000908152600c60209081526040808320805482518185028101850190935280835260609492939192909184015b82821015610baf57838290600052602060002090600502016040518060a00160405290816000820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152505081526020019060010190610b4b565b505050509050919050565b6001546001600160a01b03163314610c285760405162461bcd60e51b815260206004820152602b60248201527f466c6f6b695374616b696e67506f6f6c3a3a6f6e6c794f776e65723a206e6f7460448201526a08185d5d1a1bdc9a5e995960aa1b60648201526084016104f6565b7f000000000000000000000000cf0c122c6b73ff809c693db761e7baebe62b6a2e6001600160a01b0316826001600160a01b03161415610cb45760405162461bcd60e51b815260206004820152602160248201527f43616e6e6f7420776974686472617720746865207374616b696e6720746f6b656044820152603760f91b60648201526084016104f6565b7f0000000000000000000000004507cef57c46789ef8d1a19ea45f4216bae2b5286001600160a01b0316826001600160a01b03161415610d365760405162461bcd60e51b815260206004820181905260248201527f43616e6e6f74207769746864726177207468652072657761726420746f6b656e60448201526064016104f6565b600154610d50906001600160a01b0384811691168361223c565b604080516001600160a01b0384168152602081018390527f4590b594be6fdef6bd5e18792a2494ddf2156b618c7bbe48d13a92831208af05910160405180910390a15050565b60026000541415610de95760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016104f6565b600260005581610e615760405162461bcd60e51b815260206004820152602560248201527f466c6f6b695374616b696e67506f6f6c3a3a756e7374616b653a20616d6f756e60448201527f74203d203000000000000000000000000000000000000000000000000000000060648201526084016104f6565b336000908152600c60205260409020805482908110610e9057634e487b7160e01b600052603260045260246000fd5b906000526020600020906005020160000154821115610f175760405162461bcd60e51b815260206004820152602d60248201527f466c6f6b695374616b696e67506f6f6c3a3a756e7374616b653a206e6f74206560448201527f6e6f7567682062616c616e63650000000000000000000000000000000000000060648201526084016104f6565b610f213382611fa2565b336000908152600c6020526040812080546001600160a01b037f000000000000000000000000b254cc6c1d178c2de8182cede6113a986bb90721169163457b08099185908110610f8157634e487b7160e01b600052603260045260246000fd5b60009182526020808320600590920290910154338352600c9091526040909120805486908110610fc157634e487b7160e01b600052603260045260246000fd5b9060005260206000209060050201600201546040518363ffffffff1660e01b8152600401610ff9929190918252602082015260400190565b60206040518083038186803b15801561101157600080fd5b505afa158015611025573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110499190612582565b905080600b600082825461105d919061281f565b9250508190555082600a6000828254611076919061281f565b9091555050336000908152600c602052604081208054849081106110aa57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060050201600101544210156111d957336000908152600c6020526040902080546001600160a01b037f0000000000000000000000004761295cb20bbf40952b3239bdc4fcd14021e30d169163b2c0f3cb918791908790811061112657634e487b7160e01b600052603260045260246000fd5b60009182526020909120600260059092020101546040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526004810192909252602482015230604482015260640160206040518083038186803b15801561119457600080fd5b505afa1580156111a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111cc9190612582565b9050838111156111d95750825b336000908152600c6020526040902080548591908590811061120b57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060050201600001600082825461122b919061281f565b9091555050336000908152600c6020526040902080548490811061125f57634e487b7160e01b600052603260045260246000fd5b906000526020600020906005020160000154600014156113b257611283338461207f565b336000908152600c6020526040902080546112a09060019061281f565b815481106112be57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060050201600c6000336001600160a01b03166001600160a01b03168152602001908152602001600020848154811061131057634e487b7160e01b600052603260045260246000fd5b6000918252602080832084546005909302019182556001808501549083015560028085015490830155600380850154908301556004938401549390910192909255338152600c9091526040902080548061137a57634e487b7160e01b600052603160045260246000fd5b6000828152602081206005600019909301928302018181556001810182905560028101829055600381018290556004015590556114f5565b336000908152600c6020526040812080546001600160a01b037f000000000000000000000000b254cc6c1d178c2de8182cede6113a986bb90721169163457b0809918790811061141257634e487b7160e01b600052603260045260246000fd5b60009182526020808320600590920290910154338352600c909152604090912080548890811061145257634e487b7160e01b600052603260045260246000fd5b9060005260206000209060050201600201546040518363ffffffff1660e01b815260040161148a929190918252602082015260400190565b60206040518083038186803b1580156114a257600080fd5b505afa1580156114b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114da9190612582565b905080600b60008282546114ee91906126dd565b9091555050505b801561153e576115316001600160a01b037f000000000000000000000000cf0c122c6b73ff809c693db761e7baebe62b6a2e1661dead8361223c565b61153b818561281f565b93505b6115726001600160a01b037f000000000000000000000000cf0c122c6b73ff809c693db761e7baebe62b6a2e16338661223c565b604080518481526020810186905233917f7fc4727e062e336010f2c282598ef5f14facb3de68cf8195c2f23e1454b2b74e910160405180910390a2505060016000555050565b6000600a54600014156115cc575060075490565b60006005546115d9610afc565b6115e3919061281f565b600b549091506116147f0000000000000000000000000000000000000000000000000000000000000009600a612758565b826006546116229190612800565b61162c9190612800565b61163691906126f5565b60075461164391906126dd565b91505090565b6001546001600160a01b031633146116b75760405162461bcd60e51b815260206004820152602b60248201527f466c6f6b695374616b696e67506f6f6c3a3a6f6e6c794f776e65723a206e6f7460448201526a08185d5d1a1bdc9a5e995960aa1b60648201526084016104f6565b600180546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001546001600160a01b0316331461178f5760405162461bcd60e51b815260206004820152602b60248201527f466c6f6b695374616b696e67506f6f6c3a3a6f6e6c794f776e65723a206e6f7460448201526a08185d5d1a1bdc9a5e995960aa1b60648201526084016104f6565b60085460ff16156118085760405162461bcd60e51b815260206004820152603660248201527f466c6f6b695374616b696e67506f6f6c3a3a70617573655374616b696e673a2060448201527f7374616b696e6720616c7265616479207061757365640000000000000000000060648201526084016104f6565b6008805460ff19166001179055565b6002600054141561186a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016104f6565b600260005560085460ff16156118e85760405162461bcd60e51b815260206004820152603060248201527f466c6f6b695374616b696e67506f6f6c3a3a696e697469616c697a65643a207360448201527f74616b696e67206973207061757365640000000000000000000000000000000060648201526084016104f6565b4260035411156119605760405162461bcd60e51b815260206004820152603a60248201527f466c6f6b695374616b696e67506f6f6c3a3a696e697469616c697a65643a207360448201527f74616b696e6720686173206e6f7420737461727465642079657400000000000060648201526084016104f6565b42600454116119d75760405162461bcd60e51b815260206004820152603360248201527f466c6f6b695374616b696e67506f6f6c3a3a6e6f7446696e69736865643a207360448201527f74616b696e67206861732066696e69736865640000000000000000000000000060648201526084016104f6565b60008311611a335760405162461bcd60e51b815260206004820152602360248201527f466c6f6b695374616b696e67506f6f6c3a3a7374616b653a20616d6f756e742060448201526203d20360ec1b60648201526084016104f6565b600080836001811115611a5657634e487b7160e01b600052602160045260246000fd5b14611a615781611a6b565b611a6b82426126dd565b90506003548111611ae45760405162461bcd60e51b815260206004820152603b60248201527f466c6f6b695374616b696e67506f6f6c3a3a7374616b653a205f6d696e696d7560448201527f6d5374616b6554696d657374616d70203c3d207374617274734174000000000060648201526084016104f6565b428111611b645760405162461bcd60e51b815260206004820152604260248201527f466c6f6b695374616b696e67506f6f6c3a3a7374616b653a205f6d696e696d7560448201527f6d5374616b6554696d657374616d70203c3d20626c6f636b2e74696d6573746160648201526106d760f41b608482015260a4016104f6565b6000611b70428361281f565b9050611b7d600080611fa2565b6040805160a08101825286815260208082018581528284018581526007546060850190815260006080860181815233808352600c87529782208054600181810183558285529784208951600590920201908155955186880155935160028601559151600385015590516004909301929092559381529254919291611c01919061281f565b60405163457b080960e01b815260048101899052602481018590529091506000906001600160a01b037f000000000000000000000000b254cc6c1d178c2de8182cede6113a986bb90721169063457b08099060440160206040518083038186803b158015611c6e57600080fd5b505afa158015611c82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ca69190612582565b905080600b6000828254611cba91906126dd565b9250508190555087600a6000828254611cd391906126dd565b90915550611d0e90506001600160a01b037f000000000000000000000000cf0c122c6b73ff809c693db761e7baebe62b6a2e1633308b61219e565b60408051838152602081018a905233917f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee90910160405180910390a250506001600055505050505050565b6000807f000000000000000000000000b254cc6c1d178c2de8182cede6113a986bb907216001600160a01b031663457b0809600c6000876001600160a01b03166001600160a01b031681526020019081526020016000208581548110611dce57634e487b7160e01b600052603260045260246000fd5b600091825260208083206005909202909101546001600160a01b0389168352600c9091526040909120805487908110611e1757634e487b7160e01b600052603260045260246000fd5b9060005260206000209060050201600201546040518363ffffffff1660e01b8152600401611e4f929190918252602082015260400190565b60206040518083038186803b158015611e6757600080fd5b505afa158015611e7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9f9190612582565b90506000611ece7f0000000000000000000000000000000000000000000000000000000000000009600a612758565b6001600160a01b0386166000908152600c60205260409020805486908110611f0657634e487b7160e01b600052603260045260246000fd5b906000526020600020906005020160030154611f206115b8565b611f2a919061281f565b611f349084612800565b611f3e91906126f5565b6001600160a01b0386166000908152600c6020526040902080549192509085908110611f7a57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502016004015481611f9791906126dd565b925050505b92915050565b611faa6115b8565b600755611fb5610afc565b6005556001600160a01b0382161561207b57611fd18282611d58565b6001600160a01b0383166000908152600c6020526040902080548390811061200957634e487b7160e01b600052603260045260246000fd5b906000526020600020906005020160040181905550600754600c6000846001600160a01b03166001600160a01b03168152602001908152602001600020828154811061206557634e487b7160e01b600052603260045260246000fd5b9060005260206000209060050201600301819055505b5050565b6001600160a01b0382166000908152600c602052604081208054839081106120b757634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502016004015490506000811115612199576001600160a01b0383166000908152600c6020526040812080548490811061210c57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600460059092020101556121546001600160a01b037f0000000000000000000000004507cef57c46789ef8d1a19ea45f4216bae2b52816848361223c565b60408051838152602081018390526001600160a01b038516917fd6f2c8500df5b44f11e9e48b91ff9f1b9d81bc496d55570c2b1b75bf65243f51910160405180910390a25b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526122369085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915261226c565b50505050565b6040516001600160a01b03831660248201526044810182905261219990849063a9059cbb60e01b906064016121d2565b60006122c1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166123519092919063ffffffff16565b80519091501561219957808060200190518101906122df919061254a565b6121995760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016104f6565b6060612360848460008561236a565b90505b9392505050565b6060824710156123e25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016104f6565b6001600160a01b0385163b6124395760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104f6565b600080866001600160a01b031685876040516124559190612620565b60006040518083038185875af1925050503d8060008114612492576040519150601f19603f3d011682016040523d82523d6000602084013e612497565b606091505b50915091506124a78282866124b2565b979650505050505050565b606083156124c1575081612363565b8251156124d15782518084602001fd5b8160405162461bcd60e51b81526004016104f691906126aa565b80356001600160a01b038116811461250257600080fd5b919050565b600060208284031215612518578081fd5b612363826124eb565b60008060408385031215612533578081fd5b61253c836124eb565b946020939093013593505050565b60006020828403121561255b578081fd5b81518015158114612363578182fd5b60006020828403121561257b578081fd5b5035919050565b600060208284031215612593578081fd5b5051919050565b6000806000606084860312156125ae578081fd5b833592506020840135600281106125c3578182fd5b929592945050506040919091013590565b600080604083850312156125e6578182fd5b50508035926020909101359150565b600080600060608486031215612609578283fd5b505081359360208301359350604090920135919050565b60008251612632818460208701612836565b9190910192915050565b602080825282518282018190526000919060409081850190868401855b8281101561269d5781518051855286810151878601528581015186860152606080820151908601526080908101519085015260a09093019290850190600101612659565b5091979650505050505050565b60208152600082518060208401526126c9816040850160208701612836565b601f01601f19169190910160400192915050565b600082198211156126f0576126f0612862565b500190565b60008261271057634e487b7160e01b81526012600452602481fd5b500490565b600181815b8085111561275057816000190482111561273657612736612862565b8085161561274357918102915b93841c939080029061271a565b509250929050565b6000612363838360008261276e57506001611f9c565b8161277b57506000611f9c565b8160018114612791576002811461279b576127b7565b6001915050611f9c565b60ff8411156127ac576127ac612862565b50506001821b611f9c565b5060208310610133831016604e8410600b84101617156127da575081810a611f9c565b6127e48383612715565b80600019048211156127f8576127f8612862565b029392505050565b600081600019048311821515161561281a5761281a612862565b500290565b60008282101561283157612831612862565b500390565b60005b83811015612851578181015183820152602001612839565b838111156122365750506000910152565b634e487b7160e01b600052601160045260246000fdfea164736f6c6343000804000a

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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