ETH Price: $1,849.06 (-2.68%)

Contract

0x2Cb69A7F1FbCcd73DB3E426bB4a9e51a2c0b80DF
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim Rewards175602372023-06-26 1:07:11642 days ago1687741631IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0010951312.73916719
Claim Rewards175602262023-06-26 1:04:59642 days ago1687741499IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0011404313.26611394
Claim Rewards175592882023-06-25 21:54:23642 days ago1687730063IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0012427612.05797029
Claim Rewards175592872023-06-25 21:54:11642 days ago1687730051IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0013242412.84852287
Claim Rewards175592542023-06-25 21:47:35642 days ago1687729655IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0012596712.22199933
Claim Rewards175592482023-06-25 21:46:23642 days ago1687729583IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0015430114.97111164
Claim Rewards175592442023-06-25 21:45:35642 days ago1687729535IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0012162211.80041412
Deposit175590462023-06-25 21:05:11642 days ago1687727111IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0010094412.97467398
Deposit175590422023-06-25 21:04:23642 days ago1687727063IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0009102311.69950908
Deposit175590392023-06-25 21:03:47642 days ago1687727027IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0010125113.01419341
Deposit175578222023-06-25 16:56:47642 days ago1687712207IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0017081912.90336507
Claim Rewards175575322023-06-25 15:58:23642 days ago1687708703IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0021075217.96878771
Deposit175571342023-06-25 14:37:11642 days ago1687703831IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0019273612.89342196
Deposit175565422023-06-25 12:37:35642 days ago1687696655IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0016801512.69152078
Claim Rewards175565252023-06-25 12:34:11642 days ago1687696451IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0016127913.52018288
Deposit175565202023-06-25 12:33:11642 days ago1687696391IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0019697813.17725966
Deposit175561062023-06-25 11:10:23643 days ago1687691423IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0022393714.09811685
Deposit175553822023-06-25 8:42:59643 days ago1687682579IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0019353712.18333309
Deposit175551232023-06-25 7:50:59643 days ago1687679459IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0023885115.03590887
Deposit175549562023-06-25 7:17:35643 days ago1687677455IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0025019515.75
Deposit175548632023-06-25 6:58:35643 days ago1687676315IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0020265312.38306814
Deposit175547052023-06-25 6:25:47643 days ago1687674347IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0028620816.72229035
Deposit175545512023-06-25 5:54:11643 days ago1687672451IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0021016412.84103687
Deposit175543342023-06-25 5:10:35643 days ago1687669835IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0010099111.58548179
Deposit175543312023-06-25 5:09:59643 days ago1687669799IN
0x2Cb69A7F...a2c0b80DF
0 ETH0.0009631911.04953681
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 0xf0567207...E719844b7
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
StakingPlatform

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 8 : StakingPlatform.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.10;

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

/// @author www.github.com/jscrui
/// @title Staking Platform with fixed APY and lockup
contract StakingPlatform is IStakingPlatform, Ownable {
    using SafeERC20 for IERC20;

    IERC20 public immutable token;

    uint8 public immutable fixedAPY;

    uint public immutable stakingDuration;
    uint public immutable lockupDuration;
    uint public immutable stakingMax;

    uint public startPeriod;
    uint public lockupPeriod;
    uint public endPeriod;

    uint private _totalStaked;
    uint internal _precision = 1E6;

    mapping(address => uint) public staked;
    mapping(address => uint) private _rewardsToClaim;
    mapping(address => uint) public _userStartTime;

    /**
     * @notice constructor contains all the parameters of the staking platform
     * @dev all parameters are immutable
     */
    constructor(
        address _token,
        uint8 _fixedAPY,
        uint _durationInDays,
        uint _lockDurationInDays,
        uint _maxAmountStaked
    ) {
        stakingDuration = _durationInDays * 1 days;
        lockupDuration = _lockDurationInDays * 1 days;
        token = IERC20(_token);
        fixedAPY = _fixedAPY;
        stakingMax = _maxAmountStaked;
    }

    /**
     * @notice function that start the staking
     * @dev set `startPeriod` to the current current `block.timestamp`
     * set `lockupPeriod` which is `block.timestamp` + `lockupDuration`
     * and `endPeriod` which is `startPeriod` + `stakingDuration`
     */
    function startStaking() external override onlyOwner {
        require(startPeriod == 0, "Staking has already started");
        startPeriod = block.timestamp;
        lockupPeriod = block.timestamp + lockupDuration;
        endPeriod = block.timestamp + stakingDuration;
        emit StartStaking(startPeriod, lockupDuration, endPeriod);
    }

    /**
     * @notice function that allows a user to deposit tokens
     * @dev user must first approve the amount to deposit before calling this function,
     * cannot exceed the `maxAmountStaked`
     * @param amount, the amount to be deposited
     * @dev `endPeriod` to equal 0 (Staking didn't started yet),
     * or `endPeriod` more than current `block.timestamp` (staking not finished yet)
     * @dev `totalStaked + amount` must be less than `stakingMax`
     * @dev that the amount deposited should greater than 0
     */
    function deposit(uint amount) external override {
        require(
            endPeriod == 0 || endPeriod > block.timestamp,
            "Staking period ended"
        );
        require(
            _totalStaked + amount <= stakingMax,
            "Amount staked exceeds MaxStake"
        );
        require(amount > 0, "Amount must be greater than 0");

        if (_userStartTime[_msgSender()] == 0) {
            _userStartTime[_msgSender()] = block.timestamp;
        }

        _updateRewards();

        staked[_msgSender()] += amount;
        _totalStaked += amount;
        token.safeTransferFrom(_msgSender(), address(this), amount);
        emit Deposit(_msgSender(), amount);
    }

    /**
     * @notice function that allows a user to withdraw its initial deposit
     * @param amount, amount to withdraw
     * @dev `block.timestamp` must be higher than `lockupPeriod` (lockupPeriod finished)
     * @dev `amount` must be higher than `0`
     * @dev `amount` must be lower or equal to the amount staked
     * withdraw reset all states variable for the `msg.sender` to 0, and claim rewards
     * if rewards to claim
     */
    function withdraw(uint amount) external override {
        require(
            block.timestamp >= lockupPeriod,
            "No withdraw until lockup ends"
        );
        require(amount > 0, "Amount must be greater than 0");
        require(
            amount <= staked[_msgSender()],
            "Amount higher than stakedAmount"
        );

        _updateRewards();
        if (_rewardsToClaim[_msgSender()] > 0) {
            _claimRewards();
        }
        _totalStaked -= amount;
        staked[_msgSender()] -= amount;
        token.safeTransfer(_msgSender(), amount);

        emit Withdraw(_msgSender(), amount);
    }

    /**
     * @notice function that allows a user to withdraw its initial deposit
     * @dev must be called only when `block.timestamp` >= `lockupPeriod`
     * @dev `block.timestamp` higher than `lockupPeriod` (lockupPeriod finished)
     * withdraw reset all states variable for the `msg.sender` to 0, and claim rewards
     * if rewards to claim
     */
    function withdrawAll() external override {
        require(
            block.timestamp >= lockupPeriod,
            "No withdraw until lockup ends"
        );

        _updateRewards();
        if (_rewardsToClaim[_msgSender()] > 0) {
            _claimRewards();
        }

        _userStartTime[_msgSender()] = 0;
        _totalStaked -= staked[_msgSender()];
        uint stakedBalance = staked[_msgSender()];
        staked[_msgSender()] = 0;
        token.safeTransfer(_msgSender(), stakedBalance);

        emit Withdraw(_msgSender(), stakedBalance);
    }

    /**
     * @notice claim all remaining balance on the contract
     * Residual balance is all the remaining tokens that have not been distributed
     * (e.g, in case the number of stakeholders is not sufficient)
     * @dev Can only be called one week after the end of the staking period
     * Cannot claim initial stakeholders deposit
     */
    function withdrawResidualBalance() external onlyOwner {
        require(
            block.timestamp >= endPeriod + (7 * 1 days),
            "Withdraw 1year after endPeriod"
        );

        uint balance = token.balanceOf(address(this));
        uint residualBalance = balance - (_totalStaked);
        require(residualBalance > 0, "No residual Balance to withdraw");
        token.safeTransfer(owner(), residualBalance);
    }

    /**
     * @notice function that returns the amount of total Staked tokens
     * for a specific user
     * @param stakeHolder, address of the user to check
     * @return uint amount of the total deposited Tokens by the caller
     */
    function amountStaked(address stakeHolder)
        external
        view
        override
        returns (uint)
    {
        return staked[stakeHolder];
    }

    /**
     * @notice function that returns the amount of total Staked tokens
     * on the smart contract
     * @return uint amount of the total deposited Tokens
     */
    function totalDeposited() external view override returns (uint) {
        return _totalStaked;
    }

    /**
     * @notice function that returns the amount of pending rewards
     * that can be claimed by the user
     * @param stakeHolder, address of the user to be checked
     * @return uint amount of claimable rewards
     */
    function rewardOf(address stakeHolder)
        external
        view
        override
        returns (uint)
    {
        return _calculateRewards(stakeHolder);
    }

    /**
     * @notice function that claims pending rewards
     * @dev transfer the pending rewards to the `msg.sender`
     */
    function claimRewards() external override {
        _claimRewards();
    }

    /**
     * @notice calculate rewards based on the `fixedAPY`, `_percentageTimeRemaining()`
     * @dev the higher is the precision and the more the time remaining will be precise
     * @param stakeHolder, address of the user to be checked
     * @return uint amount of claimable tokens of the specified address
     */
    function _calculateRewards(address stakeHolder)
        internal
        view
        returns (uint)
    {
        if (startPeriod == 0 || staked[stakeHolder] == 0) {
            return 0;
        }

        return
            (((staked[stakeHolder] * fixedAPY) *
                _percentageTimeRemaining(stakeHolder)) / (_precision * 100)) +
            _rewardsToClaim[stakeHolder];
    }

    /**
     * @notice function that returns the remaining time in seconds of the staking period
     * @dev the higher is the precision and the more the time remaining will be precise
     * @param stakeHolder, address of the user to be checked
     * @return uint percentage of time remaining * precision
     */
    function _percentageTimeRemaining(address stakeHolder)
        internal
        view
        returns (uint)
    {
        bool early = startPeriod > _userStartTime[stakeHolder];
        uint startTime;
        if (endPeriod > block.timestamp) {
            startTime = early ? startPeriod : _userStartTime[stakeHolder];
            uint timeRemaining = stakingDuration -
                (block.timestamp - startTime);
            return
                (_precision * (stakingDuration - timeRemaining)) /
                stakingDuration;
        }
        startTime = early
            ? 0
            : stakingDuration - (endPeriod - _userStartTime[stakeHolder]);
        return (_precision * (stakingDuration - startTime)) / stakingDuration;
    }

    /**
     * @notice internal function that claims pending rewards
     * @dev transfer the pending rewards to the user address
     */
    function _claimRewards() private {
        _updateRewards();

        uint rewardsToClaim = _rewardsToClaim[_msgSender()];
        require(rewardsToClaim > 0, "Nothing to claim");

        _rewardsToClaim[_msgSender()] = 0;
        token.safeTransfer(_msgSender(), rewardsToClaim);
        emit Claim(_msgSender(), rewardsToClaim);
    }

    /**
     * @notice function that update pending rewards
     * and shift them to rewardsToClaim
     * @dev update rewards claimable
     * and check the time spent since deposit for the `msg.sender`
     */
    function _updateRewards() private {
        _rewardsToClaim[_msgSender()] = _calculateRewards(_msgSender());
        _userStartTime[_msgSender()] = (block.timestamp >= endPeriod)
            ? endPeriod
            : block.timestamp;
    }
}

File 2 of 8 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/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;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    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));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    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");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to
     * 0 before setting it to a non-zero value.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    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");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // 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 cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 3 of 8 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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 8 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling 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 8 : IStakingPlatform.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.10;

/// @author RetreebInc
/// @title Interface Staking Platform with fixed APY and lockup
interface IStakingPlatform {
    /**
     * @notice function that start the staking
     * @dev set `startPeriod` to the current current `block.timestamp`
     * set `lockupPeriod` which is `block.timestamp` + `lockupDuration`
     * and `endPeriod` which is `startPeriod` + `stakingDuration`
     */
    function startStaking() external;

    /**
     * @notice function that allows a user to deposit tokens
     * @dev user must first approve the amount to deposit before calling this function,
     * cannot exceed the `maxAmountStaked`
     * @param amount, the amount to be deposited
     * @dev `endPeriod` to equal 0 (Staking didn't started yet),
     * or `endPeriod` more than current `block.timestamp` (staking not finished yet)
     * @dev `totalStaked + amount` must be less than `stakingMax`
     * @dev that the amount deposited should greater than 0
     */
    function deposit(uint amount) external;

    /**
     * @notice function that allows a user to withdraw its initial deposit
     * @dev must be called only when `block.timestamp` >= `endPeriod`
     * @dev `block.timestamp` higher than `lockupPeriod` (lockupPeriod finished)
     * withdraw reset all states variable for the `msg.sender` to 0, and claim rewards
     * if rewards to claim
     */
    function withdrawAll() external;

    /**
     * @notice function that allows a user to withdraw its initial deposit
     * @param amount, amount to withdraw
     * @dev `block.timestamp` must be higher than `lockupPeriod` (lockupPeriod finished)
     * @dev `amount` must be higher than `0`
     * @dev `amount` must be lower or equal to the amount staked
     * withdraw reset all states variable for the `msg.sender` to 0, and claim rewards
     * if rewards to claim
     */
    function withdraw(uint amount) external;

    /**
     * @notice function that returns the amount of total Staked tokens
     * for a specific user
     * @param stakeHolder, address of the user to check
     * @return uint amount of the total deposited Tokens by the caller
     */
    function amountStaked(address stakeHolder) external view returns (uint);

    /**
     * @notice function that returns the amount of total Staked tokens
     * on the smart contract
     * @return uint amount of the total deposited Tokens
     */
    function totalDeposited() external view returns (uint);

    /**
     * @notice function that returns the amount of pending rewards
     * that can be claimed by the user
     * @param stakeHolder, address of the user to be checked
     * @return uint amount of claimable rewards
     */
    function rewardOf(address stakeHolder) external view returns (uint);

    /**
     * @notice function that claims pending rewards
     * @dev transfer the pending rewards to the `msg.sender`
     */
    function claimRewards() external;

    /**
     * @dev Emitted when `amount` tokens are deposited into
     * staking platform
     */
    event Deposit(address indexed owner, uint amount);

    /**
     * @dev Emitted when user withdraw deposited `amount`
     */
    event Withdraw(address indexed owner, uint amount);

    /**
     * @dev Emitted when `stakeHolder` claim rewards
     */
    event Claim(address indexed stakeHolder, uint amount);

    /**
     * @dev Emitted when staking has started
     */
    event StartStaking(uint startPeriod, uint lockupPeriod, uint endingPeriod);
}

File 6 of 8 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [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://consensys.net/diligence/blog/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.8.0/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 7 of 8 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/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 8 of 8 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint8","name":"_fixedAPY","type":"uint8"},{"internalType":"uint256","name":"_durationInDays","type":"uint256"},{"internalType":"uint256","name":"_lockDurationInDays","type":"uint256"},{"internalType":"uint256","name":"_maxAmountStaked","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"stakeHolder","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","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":"startPeriod","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lockupPeriod","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endingPeriod","type":"uint256"}],"name":"StartStaking","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_userStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stakeHolder","type":"address"}],"name":"amountStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fixedAPY","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockupDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockupPeriod","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":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"stakeHolder","type":"address"}],"name":"rewardOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"staked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingMax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalDeposited","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"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawResidualBalance","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101425760003560e01c8063853828b6116100b8578063ef40a6701161007c578063ef40a67014610309578063f0316bc814610339578063f2fde38b14610357578063fb468ac314610373578063fc0c546a1461037d578063ff50abdc1461039b57610142565b8063853828b6146102775780638da5cb5b1461028157806398807d841461029f578063b6b55f25146102cf578063ee947a7c146102eb57610142565b8063372500ab1161010a578063372500ab146101ff57806348c9eaaf146102095780635faa65ff14610227578063715018a61461024557806371b0cbfa1461024f5780638005a7de1461025957610142565b80631ada70a8146101475780631d62ebd914610165578063238a6d9e146101955780632e1a7d4d146101c557806330bfb9bb146101e1575b600080fd5b61014f6103b9565b60405161015c9190611b63565b60405180910390f35b61017f600480360381019061017a9190611be1565b6103dd565b60405161018c9190611b63565b60405180910390f35b6101af60048036038101906101aa9190611be1565b6103ef565b6040516101bc9190611b63565b60405180910390f35b6101df60048036038101906101da9190611c3a565b610407565b005b6101e9610698565b6040516101f69190611b63565b60405180910390f35b61020761069e565b005b6102116106a8565b60405161021e9190611c83565b60405180910390f35b61022f6106cc565b60405161023c9190611b63565b60405180910390f35b61024d6106d2565b005b6102576106e6565b005b6102616107ff565b60405161026e9190611b63565b60405180910390f35b61027f610823565b005b610289610ab4565b6040516102969190611cad565b60405180910390f35b6102b960048036038101906102b49190611be1565b610add565b6040516102c69190611b63565b60405180910390f35b6102e960048036038101906102e49190611c3a565b610af5565b005b6102f3610dbe565b6040516103009190611b63565b60405180910390f35b610323600480360381019061031e9190611be1565b610dc4565b6040516103309190611b63565b60405180910390f35b610341610e0d565b60405161034e9190611b63565b60405180910390f35b610371600480360381019061036c9190611be1565b610e31565b005b61037b610eb5565b005b610385611059565b6040516103929190611d27565b60405180910390f35b6103a361107d565b6040516103b09190611b63565b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000012750081565b60006103e882611087565b9050919050565b60086020528060005260406000206000915090505481565b60025442101561044c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044390611d9f565b60405180910390fd5b6000811161048f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048690611e0b565b60405180910390fd5b6006600061049b6111d2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610518576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050f90611e77565b60405180910390fd5b6105206111da565b60006007600061052e6111d2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561057857610577611294565b5b806004600082825461058a9190611ec6565b92505081905550806006600061059e6111d2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546105e79190611ec6565b925050819055506106406105f96111d2565b827f0000000000000000000000006f3c0d29e27bd76b45063ec6f4641f07f260ae5a73ffffffffffffffffffffffffffffffffffffffff166114209092919063ffffffff16565b6106486111d2565b73ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243648260405161068d9190611b63565b60405180910390a250565b60015481565b6106a6611294565b565b7f000000000000000000000000000000000000000000000000000000000000004681565b60035481565b6106da6114a6565b6106e46000611524565b565b6106ee6114a6565b600060015414610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a90611f46565b60405180910390fd5b426001819055507f0000000000000000000000000000000000000000000000000000000000127500426107669190611f66565b6002819055507f0000000000000000000000000000000000000000000000000000000000127500426107989190611f66565b6003819055507f0cdba3fb0a2020e0c9dc500b2679007a9c91cfcf35acab0eb46766c1200b42cd6001547f00000000000000000000000000000000000000000000000000000000001275006003546040516107f593929190611fbc565b60405180910390a1565b7f000000000000000000000000000000000000000000000000000000000012750081565b600254421015610868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085f90611d9f565b60405180910390fd5b6108706111da565b60006007600061087e6111d2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156108c8576108c7611294565b5b6000600860006108d66111d2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660006109206111d2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546004600082825461096c9190611ec6565b925050819055506000600660006109816111d2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600660006109cc6111d2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a5c610a156111d2565b827f0000000000000000000000006f3c0d29e27bd76b45063ec6f4641f07f260ae5a73ffffffffffffffffffffffffffffffffffffffff166114209092919063ffffffff16565b610a646111d2565b73ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436482604051610aa99190611b63565b60405180910390a250565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60066020528060005260406000206000915090505481565b60006003541480610b07575042600354115b610b46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3d9061203f565b60405180910390fd5b7f0000000000000000000000000000000000000000033b2e3c9fd0803ce800000081600454610b759190611f66565b1115610bb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bad906120ab565b60405180910390fd5b60008111610bf9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bf090611e0b565b60405180910390fd5b600060086000610c076111d2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610c94574260086000610c556111d2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610c9c6111da565b8060066000610ca96111d2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610cf29190611f66565b925050819055508060046000828254610d0b9190611f66565b92505081905550610d66610d1d6111d2565b30837f0000000000000000000000006f3c0d29e27bd76b45063ec6f4641f07f260ae5a73ffffffffffffffffffffffffffffffffffffffff166115e8909392919063ffffffff16565b610d6e6111d2565b73ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c82604051610db39190611b63565b60405180910390a250565b60025481565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b7f0000000000000000000000000000000000000000033b2e3c9fd0803ce800000081565b610e396114a6565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610ea9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea09061213d565b60405180910390fd5b610eb281611524565b50565b610ebd6114a6565b62093a80600354610ece9190611f66565b421015610f10576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f07906121a9565b60405180910390fd5b60007f0000000000000000000000006f3c0d29e27bd76b45063ec6f4641f07f260ae5a73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610f6b9190611cad565b602060405180830381865afa158015610f88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fac91906121de565b9050600060045482610fbe9190611ec6565b905060008111611003576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffa90612257565b60405180910390fd5b61105561100e610ab4565b827f0000000000000000000000006f3c0d29e27bd76b45063ec6f4641f07f260ae5a73ffffffffffffffffffffffffffffffffffffffff166114209092919063ffffffff16565b5050565b7f0000000000000000000000006f3c0d29e27bd76b45063ec6f4641f07f260ae5a81565b6000600454905090565b60008060015414806110d857506000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b156110e657600090506111cd565b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460646005546111359190612277565b61113e84611671565b7f000000000000000000000000000000000000000000000000000000000000004660ff16600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111ac9190612277565b6111b69190612277565b6111c09190612300565b6111ca9190611f66565b90505b919050565b600033905090565b6111ea6111e56111d2565b611087565b600760006111f66111d2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506003544210156112445742611248565b6003545b600860006112546111d2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550565b61129c6111da565b6000600760006112aa6111d2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000811161132a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113219061237d565b60405180910390fd5b6000600760006113386111d2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113c86113816111d2565b827f0000000000000000000000006f3c0d29e27bd76b45063ec6f4641f07f260ae5a73ffffffffffffffffffffffffffffffffffffffff166114209092919063ffffffff16565b6113d06111d2565b73ffffffffffffffffffffffffffffffffffffffff167f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4826040516114159190611b63565b60405180910390a250565b6114a18363a9059cbb60e01b848460405160240161143f92919061239d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506118b4565b505050565b6114ae6111d2565b73ffffffffffffffffffffffffffffffffffffffff166114cc610ab4565b73ffffffffffffffffffffffffffffffffffffffff1614611522576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151990612412565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b61166b846323b872dd60e01b85858560405160240161160993929190612432565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506118b4565b50505050565b600080600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460015411905060004260035411156117bf578161171057600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611714565b6001545b9050600081426117249190611ec6565b7f000000000000000000000000000000000000000000000000000000000012750061174f9190611ec6565b90507f0000000000000000000000000000000000000000000000000000000000127500817f000000000000000000000000000000000000000000000000000000000012750061179e9190611ec6565b6005546117ab9190612277565b6117b59190612300565b93505050506118af565b8161184157600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546003546118119190611ec6565b7f000000000000000000000000000000000000000000000000000000000012750061183c9190611ec6565b611844565b60005b90507f0000000000000000000000000000000000000000000000000000000000127500817f00000000000000000000000000000000000000000000000000000000001275006118939190611ec6565b6005546118a09190612277565b6118aa9190612300565b925050505b919050565b6000611916826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661197c9092919063ffffffff16565b905060008151148061193857508080602001905181019061193791906124a1565b5b611977576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196e90612540565b60405180910390fd5b505050565b606061198b8484600085611994565b90509392505050565b6060824710156119d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d0906125d2565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611a02919061266c565b60006040518083038185875af1925050503d8060008114611a3f576040519150601f19603f3d011682016040523d82523d6000602084013e611a44565b606091505b5091509150611a5587838387611a61565b92505050949350505050565b60608315611ac457600083511415611abc57611a7c85611ad7565b611abb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab2906126cf565b60405180910390fd5b5b829050611acf565b611ace8383611afa565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600082511115611b0d5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b419190612744565b60405180910390fd5b6000819050919050565b611b5d81611b4a565b82525050565b6000602082019050611b786000830184611b54565b92915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611bae82611b83565b9050919050565b611bbe81611ba3565b8114611bc957600080fd5b50565b600081359050611bdb81611bb5565b92915050565b600060208284031215611bf757611bf6611b7e565b5b6000611c0584828501611bcc565b91505092915050565b611c1781611b4a565b8114611c2257600080fd5b50565b600081359050611c3481611c0e565b92915050565b600060208284031215611c5057611c4f611b7e565b5b6000611c5e84828501611c25565b91505092915050565b600060ff82169050919050565b611c7d81611c67565b82525050565b6000602082019050611c986000830184611c74565b92915050565b611ca781611ba3565b82525050565b6000602082019050611cc26000830184611c9e565b92915050565b6000819050919050565b6000611ced611ce8611ce384611b83565b611cc8565b611b83565b9050919050565b6000611cff82611cd2565b9050919050565b6000611d1182611cf4565b9050919050565b611d2181611d06565b82525050565b6000602082019050611d3c6000830184611d18565b92915050565b600082825260208201905092915050565b7f4e6f20776974686472617720756e74696c206c6f636b757020656e6473000000600082015250565b6000611d89601d83611d42565b9150611d9482611d53565b602082019050919050565b60006020820190508181036000830152611db881611d7c565b9050919050565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b6000611df5601d83611d42565b9150611e0082611dbf565b602082019050919050565b60006020820190508181036000830152611e2481611de8565b9050919050565b7f416d6f756e7420686967686572207468616e207374616b6564416d6f756e7400600082015250565b6000611e61601f83611d42565b9150611e6c82611e2b565b602082019050919050565b60006020820190508181036000830152611e9081611e54565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611ed182611b4a565b9150611edc83611b4a565b925082821015611eef57611eee611e97565b5b828203905092915050565b7f5374616b696e672068617320616c726561647920737461727465640000000000600082015250565b6000611f30601b83611d42565b9150611f3b82611efa565b602082019050919050565b60006020820190508181036000830152611f5f81611f23565b9050919050565b6000611f7182611b4a565b9150611f7c83611b4a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611fb157611fb0611e97565b5b828201905092915050565b6000606082019050611fd16000830186611b54565b611fde6020830185611b54565b611feb6040830184611b54565b949350505050565b7f5374616b696e6720706572696f6420656e646564000000000000000000000000600082015250565b6000612029601483611d42565b915061203482611ff3565b602082019050919050565b600060208201905081810360008301526120588161201c565b9050919050565b7f416d6f756e74207374616b65642065786365656473204d61785374616b650000600082015250565b6000612095601e83611d42565b91506120a08261205f565b602082019050919050565b600060208201905081810360008301526120c481612088565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000612127602683611d42565b9150612132826120cb565b604082019050919050565b600060208201905081810360008301526121568161211a565b9050919050565b7f576974686472617720317965617220616674657220656e64506572696f640000600082015250565b6000612193601e83611d42565b915061219e8261215d565b602082019050919050565b600060208201905081810360008301526121c281612186565b9050919050565b6000815190506121d881611c0e565b92915050565b6000602082840312156121f4576121f3611b7e565b5b6000612202848285016121c9565b91505092915050565b7f4e6f20726573696475616c2042616c616e636520746f20776974686472617700600082015250565b6000612241601f83611d42565b915061224c8261220b565b602082019050919050565b6000602082019050818103600083015261227081612234565b9050919050565b600061228282611b4a565b915061228d83611b4a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156122c6576122c5611e97565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061230b82611b4a565b915061231683611b4a565b925082612326576123256122d1565b5b828204905092915050565b7f4e6f7468696e6720746f20636c61696d00000000000000000000000000000000600082015250565b6000612367601083611d42565b915061237282612331565b602082019050919050565b600060208201905081810360008301526123968161235a565b9050919050565b60006040820190506123b26000830185611c9e565b6123bf6020830184611b54565b9392505050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006123fc602083611d42565b9150612407826123c6565b602082019050919050565b6000602082019050818103600083015261242b816123ef565b9050919050565b60006060820190506124476000830186611c9e565b6124546020830185611c9e565b6124616040830184611b54565b949350505050565b60008115159050919050565b61247e81612469565b811461248957600080fd5b50565b60008151905061249b81612475565b92915050565b6000602082840312156124b7576124b6611b7e565b5b60006124c58482850161248c565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b600061252a602a83611d42565b9150612535826124ce565b604082019050919050565b600060208201905081810360008301526125598161251d565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b60006125bc602683611d42565b91506125c782612560565b604082019050919050565b600060208201905081810360008301526125eb816125af565b9050919050565b600081519050919050565b600081905092915050565b60005b8381101561262657808201518184015260208101905061260b565b83811115612635576000848401525b50505050565b6000612646826125f2565b61265081856125fd565b9350612660818560208601612608565b80840191505092915050565b6000612678828461263b565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b60006126b9601d83611d42565b91506126c482612683565b602082019050919050565b600060208201905081810360008301526126e8816126ac565b9050919050565b600081519050919050565b6000601f19601f8301169050919050565b6000612716826126ef565b6127208185611d42565b9350612730818560208601612608565b612739816126fa565b840191505092915050565b6000602082019050818103600083015261275e818461270b565b90509291505056fea264697066735822122036fdffcb0609690ab8d4fef5d84d9c61ae2afe220a7912c9bcc35c869fabcc1f64736f6c634300080a0033

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.